.hero {
    padding: clamp(20px, 3vw, 36px);
}

.hero h2 {
    font-size: clamp(26px, 4vw, 44px);
    margin: 12px 0;
}

.hero p {
    margin-bottom: 8px;
}

#status {
    margin-top: 12px;
}

#counters {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

#tor-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

#ooni-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
    min-width: 0;
    overflow-wrap: anywhere;
}

.metric-value {
    font-size: clamp(24px, 3vw, 34px);
}

.control {
    background: #07140c;
    color: #00ff41;
    border: 1px solid #268a43;
    border-radius: 0;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    max-width: 100%;
}

button.control {
    cursor: pointer;
}

.control:focus-visible {
    outline: 2px solid #00ff41;
    outline-offset: 3px;
}

.control:disabled {
    opacity: .35;
    cursor: default;
}

#menu-toggle {
    display: none;
}

.map-toolbar, .feed-controls, .pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 14px 0;
}

.map-toolbar label {
    font-size: 12px;
    color: var(--muted);
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(200px, 1fr);
    gap: 12px;
}

.map-viewport {
    background-color: #06120a;
    background-image:
        linear-gradient(#194d2930 1px, transparent 1px),
        linear-gradient(90deg, #194d2930 1px, transparent 1px);
    background-size: 25px 25px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
}

#world-svg, #history-chart {
    display: block;
    width: 100%;
    height: auto;
}

#world-svg path {
    stroke: #327548;
    stroke-width: .5;
    cursor: pointer;
    vector-effect: non-scaling-stroke;
}

#world-svg path:hover,
#world-svg path:focus-visible,
#world-svg path.selected {
    stroke: #e0ffe5;
    stroke-width: 1.8;
    outline: none;
}

.map-details h3 {
    color: var(--green);
    overflow-wrap: anywhere;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 11px;
    color: var(--muted);
    margin: 14px 0;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.map-legend i {
    width: 12px;
    height: 12px;
    border: 1px solid #327548;
}

.legend-none { background: #102019; }
.legend-zero { background: #18382a; }
.legend-low  { background: #176b32; }
.legend-mid  { background: #00a83a; }
.legend-high { background: #00ff41; }

#feed-search {
    flex: 1;
    min-width: 160px;
}

#back-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: none;
    font-size: 20px;
}

#back-top.visible {
    display: block;
}

@media (max-width: 1100px) {
    #counters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #tor-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .map-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #counters, #tor-metrics, #ooni-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #menu-toggle {
        display: block;
        margin-top: 12px;
    }

    #main-nav {
        display: none;
        flex-direction: column;
        gap: 12px;
    }

    #main-nav.open {
        display: flex;
    }

    .feed-controls > * {
        width: 100%;
    }

    .map-toolbar select {
        width: 100%;
    }
}

/* OBS-09D - Historical Intelligence */
#history-chart:empty,
#history-chart.history-empty {
    display: none;
}

#history-status {
    padding: 14px 0;
    margin-bottom: 0;
}

/* OBS-10E - Responsive SVG World Map */

.map-layout {
    min-width: 0;
    width: 100%;
}

.map-viewport {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 180px;
}

#world-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 180px;
    aspect-ratio: 2 / 1;
    flex-shrink: 0;
}

@media (max-width: 700px) {

    #global-map {
        width: 100%;
        min-width: 0;
    }

    .map-layout {
        display: block;
    }

    .map-viewport {
        width: 100%;
        min-height: 180px;
        margin-bottom: 12px;
    }

    #world-svg {
        width: 100%;
        height: 220px;
        min-height: 220px;
        max-width: 100%;
    }

    .map-details {
        width: 100%;
        min-width: 0;
    }

    .map-legend {
        gap: 8px;
        font-size: 10px;
    }

    .map-toolbar {
        width: 100%;
    }

    #map-layer {
        width: 100%;
    }
}



/* OBS-15E: Country profile navigation */

.map-country-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 24px;
    padding: 13px 15px;
    min-height: 48px;
    border: 1px solid #00ff41;
    background: #102b17;
    color: #00ff41;
    text-decoration: none;
    font-family: monospace;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.4;
    box-sizing: border-box;
    transition: background .15s ease;
}

.map-country-profile[hidden] {
    display: none !important;
}

.map-country-profile:hover {
    background: #164b25;
    text-decoration: none;
}

.map-country-profile:focus-visible {
    outline: 2px solid #00ff41;
    outline-offset: 4px;
}

.map-country-profile span:last-child {
    font-size: 1.25rem;
}

@media (max-width: 600px) {
    .map-country-profile {
        margin-top: 18px;
        min-height: 50px;
        font-size: .9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-country-profile {
        transition: none;
    }
}
