/* ==========================================================================
   Action Interactive Map - Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Variables)
   -------------------------------------------------------------------------- */
:root {
    /* Brand Colors */
    --action-blue-dark: #00148a;
    --action-blue-medium: #1e3a8a;
    --action-blue-light: #dbeafe;
    --action-blue-stripe: #60a5fa;
    --action-blue-hover: #3b82f6;
    --action-orange: #f97316;
    --action-orange-light: #fdba74;
    --action-white: #ffffff;

    /* Mobile stats color (can be toggled via admin panel) */
    --mobile-stats-color: var(--action-orange);
    --action-grey-light: #f1f5f9;
    --action-grey: #94a3b8;
    --action-grey-dark: #475569;

    /* Typography - sized to match Action Update page */
    --font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.875rem;
    --font-size-sm: 1rem;
    --font-size-base: 1.167rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.500rem;
    --font-size-2xl: 1.875rem;
    --font-size-3xl: 2.5rem;
    --font-size-4xl: 2.875rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Layout */
    --panel-width: 55%;
    --map-width: 45%;
    --timeline-height: 80px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Map Position (edit these values from admin mode) */
    --map-translate-x: -265px;
    --map-translate-y: -180px;
    --map-scale: 1.25;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.5;
    color: var(--action-blue-dark);
    background-color: transparent;
    height: 100vh;
    width: 100%;
    max-height: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Loading Spinner
   -------------------------------------------------------------------------- */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity var(--transition-normal);
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.page-header {
    padding: 0 0 var(--spacing-lg) 0;
    background: transparent;
}

.page-title {
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--action-blue-dark);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
    letter-spacing: 0;
}

.page-subtitle {
    font-family: 'Ubuntu', sans-serif;
    font-size: 28px;
    font-weight: 300;
    color: rgb(83, 87, 90);
    line-height: 39.2px;
    margin-bottom: var(--spacing-sm);
}

.page-body {
    font-family: 'Ubuntu', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: rgb(83, 87, 90);
    line-height: 22.4px;
}

.page-body + .page-body {
    margin-top: var(--spacing-md);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--action-blue-light);
    border-top-color: var(--action-blue-medium);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Main Container
   -------------------------------------------------------------------------- */
.map-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Info Panel
   -------------------------------------------------------------------------- */
.info-panel {
    width: var(--panel-width);
    height: 100%;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    position: relative;
}

.panel-header {
    margin-bottom: var(--spacing-lg);
}

.panel-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--action-blue-dark);
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

.panel-description {
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
    line-height: 1.6;
}

.panel-content {
    flex: 1;
}

/* Totals Summary */
.totals-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm) var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 320px;
}

.total-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.total-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--action-blue-dark);
    line-height: 1.2;
}

.total-label {
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
    font-weight: 400;
}

/* Country Hint - sits inside totals-summary card */
.country-hint {
    grid-column: 1 / -1;
    padding: var(--spacing-sm) 0 0 0;
    margin-top: var(--spacing-sm);
    text-align: left;
}

.country-hint p {
    color: var(--action-grey);
    font-size: var(--font-size-sm);
    font-style: italic;
    margin: 0;
}

/* Country Info */
.country-info {
    position: relative;
    display: table;
    border-collapse: separate;
    border-spacing: 0 var(--spacing-sm);
    padding: var(--spacing-md);
    padding-top: var(--spacing-lg);
    background: rgb(255, 255, 255);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    /* Force full opacity and no filters on container and all children */
    opacity: 1 !important;
    filter: none !important;
}

/* Ensure all children also have full opacity */
.country-info * {
    opacity: 1 !important;
    filter: none !important;
}

.country-info[hidden] {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Country Info Close Button */
.country-info-close {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--action-grey);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.country-info-close:hover {
    color: var(--action-blue-dark);
    background: rgba(0, 0, 0, 0.05);
}

.info-row {
    display: table-row;
}

.info-label {
    display: table-cell;
    width: 120px;
    font-size: var(--font-size-base);
    color: #00148A !important;
    font-weight: 400;
    text-align: right;
    padding-right: var(--spacing-md);
    vertical-align: baseline;
    white-space: nowrap;
    opacity: 1 !important;
}

.info-value {
    display: table-cell;
    font-size: var(--font-size-base);
    font-weight: 700;
    color: #00148A !important;
    vertical-align: baseline;
    opacity: 1 !important;
}

/* Force dark color on all country info text - no transitions/animations */
/* DEBUG: Using red to verify styles are applied - change back to #00148A after testing */
.country-info .info-label,
.country-info .info-value,
.country-info .distribution-centres,
.country-info .dc-name,
.country-info #country-name,
.country-info #stores-count,
.country-info #employees-count,
.country-info #distribution-centres {
    color: #00148A !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #00148A !important;
    animation: none !important;
    transition: none !important;
    /* Fix for font smoothing making text appear lighter */
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: geometricPrecision !important;
}

.distribution-centres {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: #00148A !important;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Lock Indicator */
.lock-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--action-grey-light);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    color: var(--action-grey-dark);
}

.lock-indicator[hidden] {
    display: none;
}

.lock-icon::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--action-orange);
    border-radius: var(--radius-sm);
}

/* Map Legend - now inside totals-summary card */
.map-legend {
    display: none;
}

.panel-legend {
    grid-column: 1 / -1;
    padding: var(--spacing-xs) 0 0 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.legend-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.legend-text {
    font-size: var(--font-size-xs);
    color: var(--action-blue-dark);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Map Area
   -------------------------------------------------------------------------- */
.map-area {
    width: var(--map-width);
    height: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
    background: transparent;
    margin-left: -140px; /* Pull map closer to panel - tighter gap */
}

.map-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Country Name Tooltip */
.country-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--action-blue-dark);
    color: var(--action-white);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-md);
    transform: translate(10px, 10px);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.country-tooltip.visible {
    opacity: 1;
}

.country-tooltip[hidden] {
    display: none;
}

#map-svg-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

#map-svg-container svg {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: left top;
    width: auto;
    height: 115%;
    /* Default position - edit CSS variables in :root to change */
    transform: translate(var(--map-translate-x), var(--map-translate-y)) scale(var(--map-scale));
}

/* Country Styles - SVG groups with built-in stripe patterns */

/* Country borders - white stroke for visibility */
.cls-2, .cls-3, .cls-4 {
    stroke: var(--action-white) !important;
    stroke-width: 1.2px !important;
}

/* Hide the locations layer - we use its coordinates but don't display it */
#locations {
    display: none;
}

/* Invisible hit areas for country hover detection - uses actual country shape */
.country-hit-area {
    pointer-events: all;
    fill: transparent !important;
    stroke: none !important;
}

/* By default, country stripes are hidden (inactive countries) */
/* Use svg g selector to only target SVG country groups, not HTML elements */
svg g[id^="country-"] {
    opacity: 0.3;
    cursor: default;
    transition: opacity var(--transition-fast);
    pointer-events: all;
}

/* Active countries show their stripes */
svg g[id^="country-"].active {
    opacity: 1;
    cursor: pointer;
}

/* Hover state - slightly brighter/more prominent */
svg g[id^="country-"].active:hover,
svg g[id^="country-"].hovered {
    opacity: 1;
    filter: brightness(1.1);
}

/* Selected country - orange glow effect */
svg g[id^="country-"].selected {
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.6)) brightness(1.05);
}

/* Inactive country hover - subtle feedback to show it's clickable */
svg g[id^="country-"].inactive-hover {
    opacity: 0.5;
    cursor: pointer;
    filter: brightness(1.15);
}

/* DC Pin markers inside SVG */
.dc-pin {
    fill: var(--action-blue-dark);
    stroke: var(--action-white);
    stroke-width: 1.5;
    transition: fill var(--transition-fast);
}

.dc-pin-cross {
    stroke: var(--action-white);
    stroke-width: 0.67;
    stroke-linecap: round;
    transition: stroke var(--transition-fast);
}

/* Pin hover state - just change color, no scale to avoid jitter */
.dc-pin-group:hover .dc-pin,
.dc-pin-group.hovered .dc-pin {
    fill: var(--action-orange);
}

.dc-pin-group:hover .dc-pin-cross,
.dc-pin-group.hovered .dc-pin-cross {
    stroke: var(--action-white);
}

/* SVG Pin Markers container */
#dc-pins {
    pointer-events: none;
}

/* Allow pointer events on individual pins */
.dc-pin-group {
    pointer-events: all;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.timeline-container {
    width: 90%;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-xl) 65px;
    background: var(--action-white);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    position: relative;
    overflow: visible;
}

.timeline-info {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    padding-left: calc(var(--panel-width) - var(--spacing-lg));
}

.timeline-label {
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
}

.timeline-year {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--action-blue-dark);
    line-height: 1;
}

.timeline-date {
    font-size: var(--font-size-xs);
    color: var(--action-grey);
    margin-left: var(--spacing-md);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

/* Play Button */
.timeline-play-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--action-orange);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.timeline-play-btn:hover {
    background: var(--action-orange-light);
    transform: scale(1.05);
}

.timeline-play-btn:focus {
    outline: 2px solid var(--action-blue-medium);
    outline-offset: 2px;
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent var(--action-white);
    margin-left: 3px;
}

.timeline-play-btn.playing .play-icon {
    border: none;
    width: 12px;
    height: 14px;
    background: linear-gradient(
        to right,
        var(--action-white) 0%,
        var(--action-white) 35%,
        transparent 35%,
        transparent 65%,
        var(--action-white) 65%,
        var(--action-white) 100%
    );
    margin-left: 0;
}

/* Timeline Slider */
.timeline-slider-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    position: relative;
}

.timeline-track {
    position: relative;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

.timeline-track::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--action-grey-light);
    border-radius: var(--radius-full);
    transform: translateY(-50%);
}

.timeline-track:focus {
    outline: 2px solid var(--action-blue-medium);
    outline-offset: 2px;
}

.timeline-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: var(--action-blue-light);
    border-radius: var(--radius-full);
    pointer-events: none;
    transform: translateY(-50%);
    transition: width 0.2s ease-out;
}

.timeline-track.dragging .timeline-progress {
    transition: none;
}

.timeline-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background: var(--action-orange);
    border: 3px solid var(--action-white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: var(--shadow-md);
    transition: left 0.2s ease-out, transform var(--transition-fast);
    z-index: 2;
}

.timeline-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.timeline-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
    transition: transform var(--transition-fast);
}

/* Timeline Labels */
.timeline-labels {
    position: relative;
    height: 24px;
    padding: 0;
}

.timeline-label-year {
    position: absolute;
    font-size: var(--font-size-xs);
    color: var(--action-grey);
    cursor: pointer;
    transition: color var(--transition-fast), font-size var(--transition-fast);
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.timeline-label-year:hover {
    color: var(--action-blue-medium);
}

.timeline-label-year.active {
    color: var(--action-blue-dark);
    font-weight: 500;
    font-size: var(--font-size-base);
}

/* Timeline tick marks on track - extend from center downward only */
.timeline-tick {
    position: absolute;
    top: 50%;
    width: 3px;
    height: 10px;
    background: var(--action-grey);
    border-radius: 0 0 1px 1px;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

/* Timeline Highlight Callout */
.timeline-highlight-callout {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--action-blue-dark);
    color: var(--action-white);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    line-height: 1.3;
    width: 240px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    opacity: 0.9;
    transition: opacity var(--transition-fast), left var(--transition-fast);
}

.timeline-highlight-callout[hidden] {
    display: none;
}

.timeline-highlight-callout .callout-text {
    display: block;
}

.timeline-highlight-callout .callout-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent var(--action-blue-dark) transparent;
}

/* --------------------------------------------------------------------------
   Admin Panel
   -------------------------------------------------------------------------- */
.admin-panel {
    position: fixed;
    bottom: var(--timeline-height);
    right: var(--spacing-md);
    width: 280px;
    background: var(--action-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.admin-panel[hidden] {
    display: none;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--action-blue-dark);
    color: var(--action-white);
    cursor: move;
    user-select: none;
}

.admin-header::before {
    content: "::";
    margin-right: var(--spacing-sm);
    opacity: 0.5;
    letter-spacing: 2px;
}

.admin-header h2 {
    font-size: var(--font-size-base);
    font-weight: 500;
}

.admin-close {
    background: none;
    border: none;
    color: var(--action-white);
    font-size: var(--font-size-xl);
    cursor: pointer;
    line-height: 1;
}

.admin-content {
    padding: var(--spacing-md);
}

.admin-hint {
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
    margin-bottom: var(--spacing-md);
}

.admin-coords {
    display: flex;
    gap: var(--spacing-lg);
    font-family: monospace;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.admin-export {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--action-blue-medium);
    color: var(--action-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast);
}

.admin-export:hover {
    background: var(--action-blue-dark);
}

/* Admin Section Headers */
.admin-section {
    margin-bottom: var(--spacing-md);
}

.admin-section h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--action-blue-dark);
    margin-bottom: var(--spacing-xs);
}

.admin-divider {
    border: none;
    border-top: 1px solid var(--action-grey-light);
    margin: var(--spacing-md) 0;
}

/* Admin Position Controls */
.admin-position-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.admin-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.admin-zoom-unit {
    font-family: monospace;
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
}

.admin-input {
    width: 70px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--action-grey);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: var(--font-size-sm);
    text-align: center;
}

.admin-input:focus {
    outline: none;
    border-color: var(--action-blue-medium);
}

.admin-input-sm {
    width: 60px;
}

.admin-pan-inputs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--action-grey-dark);
}

.admin-pan-inputs label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.admin-position-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

/* Admin Buttons */
.admin-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--action-grey);
    background: var(--action-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--action-blue-dark);
    transition: all var(--transition-fast);
}

.admin-btn:hover {
    background: var(--action-grey-light);
    border-color: var(--action-blue-medium);
}

.admin-btn-primary {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--action-blue-medium);
    color: var(--action-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.admin-btn-primary:hover {
    background: var(--action-blue-dark);
}

.admin-btn-secondary {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--action-white);
    color: var(--action-blue-medium);
    border: 1px solid var(--action-blue-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.admin-btn-secondary:hover {
    background: var(--action-blue-light);
}

.admin-output {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--action-grey-light);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 11px;
    color: var(--action-blue-dark);
    word-break: break-all;
    min-height: 1.5em;
}

.admin-color-toggle {
    display: flex;
    gap: var(--spacing-md);
}

.admin-radio {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
}

.admin-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.admin-radio-label {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

/* Admin Draggable Map */
#map-svg-container.admin-draggable {
    cursor: grab;
}

#map-svg-container.admin-draggable.dragging {
    cursor: grabbing;
}

#map-svg-container.admin-draggable svg {
    transition: none;
}

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */

/* Tablet - only trigger below 768px to keep iPads on desktop layout */
/* Note: Tablet-specific styles merged into mobile below */

/* Mobile List View - hidden by default, shown on mobile */
.mobile-list-view {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --timeline-height: 80px;
    }

    /* Prevent horizontal scroll on mobile */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Hide desktop info panel on mobile - use bottom sheet instead */
    .info-panel {
        display: none;
    }

    /* Mobile header - hidden, using mobile-page-header inside mobile-list-view instead */
    .mobile-header {
        display: none;
    }

    /* Map area gets more space on mobile */
    .map-area {
        width: 100%;
        flex: 1;
        min-height: 50vh;
        overflow: hidden;
    }

    .map-container {
        flex-direction: column;
    }

    /* Mobile map positioning - scale down and center for portrait */
    #map-svg-container svg {
        --map-translate-x: -265px;
        --map-translate-y: -180px;
        --map-scale: 1.25;
        transform: translate(var(--map-translate-x), var(--map-translate-y)) scale(var(--map-scale));
    }

    /* Fixed timeline at bottom on mobile */
    .timeline-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70px;
        padding: var(--spacing-xs) var(--spacing-sm);
        background: var(--action-white);
        z-index: 50; /* Below bottom sheet */
        border-top: 1px solid var(--action-grey-light);
    }

    /* Hide timeline highlight callouts on mobile - they get clipped */
    .timeline-highlight-callout {
        display: none !important;
    }

    /* Adjust body to account for fixed timeline */
    body {
        padding-bottom: 70px;
    }

    .map-container {
        height: calc(100vh - 70px); /* Subtract mobile header space handled by flex */
    }

    .timeline-info {
        gap: var(--spacing-xs);
    }

    .timeline-label {
        font-size: var(--font-size-xs);
    }

    .timeline-year {
        font-size: var(--font-size-xl);
    }

    .timeline-date {
        display: none;
    }

    /* Larger play button for touch - 48px minimum */
    .timeline-play-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .play-icon {
        border-width: 8px 0 8px 14px;
    }

    .timeline-play-btn.playing .play-icon {
        width: 14px;
        height: 16px;
    }

    /* Larger timeline handle for touch */
    .timeline-handle {
        width: 28px;
        height: 28px;
    }

    /* On mobile, only show first and last year labels */
    .timeline-labels {
        font-size: var(--font-size-xs);
    }

    .timeline-labels .timeline-label-year {
        display: none; /* Hide all by default */
    }

    .timeline-labels .timeline-label-year:first-child,
    .timeline-labels .timeline-label-year:last-child {
        display: block; /* Show only first and last */
    }

    /* Hide tick marks on mobile - too cluttered */
    .timeline-tick {
        display: none;
    }

    /* Hide bottom sheet on mobile - using list view instead */
    .bottom-sheet {
        display: none !important;
    }

    /* Hide map area on mobile - using list view instead */
    .map-area {
        display: none !important;
    }

    /* Hide desktop timeline on mobile - using mobile year selector */
    .timeline-container {
        display: none !important;
    }

    /* Body no longer needs padding for fixed timeline */
    body {
        padding-bottom: 0;
    }

    .map-container {
        height: auto;
        min-height: 0;
        flex: 0 0 auto;
    }

    /* Mobile List View */
    .mobile-list-view {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 0 var(--spacing-md);
        overflow: hidden;
    }

    /* Mobile Page Header */
    .mobile-page-header {
        padding: var(--spacing-md) 0;
        flex-shrink: 0;
    }

    .mobile-page-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--action-blue-dark);
        line-height: 1.3;
        margin-bottom: var(--spacing-sm);
    }

    .mobile-page-body {
        font-size: 0.875rem;
        font-weight: 400;
        color: rgb(83, 87, 90);
        line-height: 1.4;
    }

    .mobile-page-body + .mobile-page-body {
        margin-top: var(--spacing-sm);
    }

    /* Mobile Totals Summary */
    .mobile-totals-summary {
        display: flex;
        justify-content: space-around;
        padding: var(--spacing-sm) 0;
        margin-bottom: var(--spacing-md);
        border-top: 1px solid var(--action-grey-light);
        border-bottom: 1px solid var(--action-grey-light);
        flex-shrink: 0;
    }

    .mobile-total-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mobile-total-value {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--mobile-stats-color);
    }

    .mobile-total-label {
        font-size: 0.75rem;
        color: var(--action-grey-dark);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Mobile Stats Section - dynamic header + totals */
    .mobile-stats-section {
        flex-shrink: 0;
    }

    .mobile-stats-header {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--action-blue-dark);
        margin-bottom: var(--spacing-xs);
        transition: color 0.3s ease;
    }

    /* When a country is selected, hide the redundant header (country name shown in stats) */
    .mobile-stats-section.has-selection .mobile-stats-header {
        display: none;
    }

    /* Mobile DC Info - shown when country selected */
    .mobile-dc-info {
        padding: var(--spacing-sm) 0;
        flex-shrink: 0;
    }

    .mobile-dc-info[hidden] {
        display: none;
    }

    .mobile-dc-header {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--action-blue-dark);
        margin-bottom: var(--spacing-xs);
    }

    .mobile-dc-header .dc-pin-icon {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .mobile-dc-list {
        font-size: 0.85rem;
        color: var(--action-grey-dark);
        line-height: 1.5;
    }

    .mobile-dc-list span {
        display: block;
    }

    /* Mobile Year Selector - swipeable year with arrows (unused but kept for reference) */
    .mobile-year-selector {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-md);
        padding: var(--spacing-md) 0;
        border-bottom: 1px solid var(--action-grey-light);
        margin-bottom: var(--spacing-md);
        flex-shrink: 0;
    }

    .year-nav-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--action-grey-light);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        transition: background var(--transition-fast), transform var(--transition-fast);
    }

    .year-nav-btn:hover,
    .year-nav-btn:active {
        background: var(--action-blue-light);
        transform: scale(1.05);
    }

    .year-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }

    .year-nav-icon {
        font-size: 1rem;
        color: var(--action-blue-dark);
        line-height: 1;
    }

    .year-display {
        font-size: 2.5rem;
        font-weight: 700;
        color: var(--action-blue-dark);
        min-width: 100px;
        text-align: center;
        transition: transform 0.2s ease;
    }

    .year-display.animate-left {
        animation: slideLeft 0.2s ease;
    }

    .year-display.animate-right {
        animation: slideRight 0.2s ease;
    }

    @keyframes slideLeft {
        0% { transform: translateX(20px); opacity: 0; }
        100% { transform: translateX(0); opacity: 1; }
    }

    @keyframes slideRight {
        0% { transform: translateX(-20px); opacity: 0; }
        100% { transform: translateX(0); opacity: 1; }
    }

    .mobile-play-btn {
        width: 44px;
        height: 44px;
        border: none;
        background: var(--action-orange);
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background var(--transition-fast), transform var(--transition-fast);
        margin-left: var(--spacing-sm);
    }

    .mobile-play-btn:hover,
    .mobile-play-btn:active {
        background: var(--action-orange-light);
        transform: scale(1.05);
    }

    .mobile-play-btn .play-icon {
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 8px 0 8px 14px;
        border-color: transparent transparent transparent var(--action-white);
        margin-left: 3px;
    }

    .mobile-play-btn.playing .play-icon {
        border: none;
        width: 12px;
        height: 14px;
        background: linear-gradient(
            to right,
            var(--action-white) 0%,
            var(--action-white) 35%,
            transparent 35%,
            transparent 65%,
            var(--action-white) 65%,
            var(--action-white) 100%
        );
        margin-left: 0;
    }

    /* Mobile Map Container */
    .mobile-map-container {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 150px;
        background: transparent;
        overflow: visible;
        flex-shrink: 0;
        margin-bottom: var(--spacing-md);
        margin-left: calc(-1 * var(--spacing-md));
        margin-right: calc(-1 * var(--spacing-md));
        width: calc(100% + 2 * var(--spacing-md));
        padding-bottom: var(--spacing-md);
        border-bottom: 1px solid var(--action-grey-light);
    }

    .mobile-map-wrapper {
        width: 100%;
        position: relative;
        /* Use aspect-ratio to ensure proper height calculation */
        /* SVG viewBox is 300 x 188.2, so aspect ratio is ~1.594 */
        aspect-ratio: 300 / 188.2;
    }

    .mobile-map-wrapper svg,
    .mobile-map-wrapper object {
        display: block;
        width: 100%;
        height: 100%;
        /* Ensure SVG fills the aspect-ratio container */
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Mobile Map Legend - positioned bottom-right */
    .mobile-map-legend {
        position: absolute;
        bottom: 8px;
        right: 8px;
        left: auto;
        padding: 4px 8px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-sm);
    }

    .mobile-map-legend .legend-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .mobile-map-legend .legend-icon {
        width: 12px;
        height: 12px;
    }

    .mobile-map-legend .legend-text {
        font-size: 0.7rem;
        color: var(--action-blue-dark);
    }

    /* Hide DC pins that are embedded in the SVG */
    .mobile-map-wrapper svg g#Locations {
        display: none;
    }

    /* Country visual states on mobile map - target country groups by their IDs */
    .mobile-map-wrapper svg g[id$="_1993"],
    .mobile-map-wrapper svg g[id$="_2005"],
    .mobile-map-wrapper svg g[id$="_2009"],
    .mobile-map-wrapper svg g[id$="_2012"],
    .mobile-map-wrapper svg g[id$="_2015"],
    .mobile-map-wrapper svg g[id$="_2017"],
    .mobile-map-wrapper svg g[id$="_2020"],
    .mobile-map-wrapper svg g[id$="_2021"],
    .mobile-map-wrapper svg g[id$="_2022"],
    .mobile-map-wrapper svg g[id$="_2023"],
    .mobile-map-wrapper svg g[id$="_2024"],
    .mobile-map-wrapper svg g[id$="_2025"] {
        transition: opacity 0.3s ease;
        cursor: pointer;
        opacity: 1;
        pointer-events: all;
    }

    /* When any country is selected, fade the others */
    .mobile-map-wrapper.has-selection svg g[id$="_1993"],
    .mobile-map-wrapper.has-selection svg g[id$="_2005"],
    .mobile-map-wrapper.has-selection svg g[id$="_2009"],
    .mobile-map-wrapper.has-selection svg g[id$="_2012"],
    .mobile-map-wrapper.has-selection svg g[id$="_2015"],
    .mobile-map-wrapper.has-selection svg g[id$="_2017"],
    .mobile-map-wrapper.has-selection svg g[id$="_2020"],
    .mobile-map-wrapper.has-selection svg g[id$="_2021"],
    .mobile-map-wrapper.has-selection svg g[id$="_2022"],
    .mobile-map-wrapper.has-selection svg g[id$="_2023"],
    .mobile-map-wrapper.has-selection svg g[id$="_2024"],
    .mobile-map-wrapper.has-selection svg g[id$="_2025"] {
        opacity: 0.5;
    }

    /* Selected country stays full opacity - stripes preserved */
    .mobile-map-wrapper svg g.mobile-selected {
        opacity: 1 !important;
    }

    /* Map instruction label */
    .mobile-map-label {
        position: absolute;
        top: 8px;
        left: 8px;
        font-size: 0.75rem;
        color: var(--action-grey-dark);
        background: rgba(255, 255, 255, 0.9);
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        pointer-events: none;
    }

    /* Country callout - appears on selected country */
    .mobile-country-callout {
        position: absolute;
        background: var(--action-blue-dark);
        color: var(--action-white);
        padding: 6px 12px;
        border-radius: var(--radius-md);
        font-size: 0.85rem;
        font-weight: 500;
        white-space: nowrap;
        pointer-events: none;
        z-index: 20;
        box-shadow: var(--shadow-md);
        transform: translate(-50%, -100%);
        margin-top: -8px;
    }

    .mobile-country-callout::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid var(--action-blue-dark);
    }

    .mobile-country-callout[hidden] {
        display: none;
    }

    /* Connecting line for edge countries */
    .callout-line {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 19;
        overflow: visible;
    }

    .callout-line[hidden] {
        display: none;
    }

    /* Hide the default arrow when line is shown */
    .mobile-country-callout.has-line::after {
        display: none;
    }

    /* Country List */
    .country-list {
        flex: 1;
        overflow-y: auto;
        padding-bottom: var(--spacing-lg);
    }

    .country-list-item {
        display: flex;
        align-items: flex-start;
        padding: var(--spacing-md);
        background: var(--action-white);
        border-radius: var(--radius-md);
        margin-bottom: var(--spacing-sm);
        box-shadow: var(--shadow-sm);
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease, box-shadow var(--transition-fast);
    }

    .country-list-item:active {
        box-shadow: var(--shadow-md);
    }

    /* Selected country card in list (bidirectional selection) */
    .country-list-item.selected {
        border: 2px solid var(--action-orange);
        box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2), var(--shadow-md);
        background: rgba(249, 115, 22, 0.05);
    }

    /* Smooth scroll target indicator - pulse animation */
    .country-list-item.scroll-target {
        animation: highlightPulse 0.6s ease-out;
    }

    @keyframes highlightPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.02); }
        100% { transform: scale(1); }
    }

    /* First store badge - "New!" indicator */
    .country-list-item .first-store-badge {
        display: inline-block;
        font-size: var(--font-size-xs);
        color: var(--action-white);
        background: var(--action-orange);
        padding: 2px 6px;
        border-radius: var(--radius-sm);
        margin-left: var(--spacing-sm);
        font-weight: 500;
    }

    /* DC names in country card */
    .country-list-item .dc-names {
        font-size: var(--font-size-xs);
        color: var(--action-grey-dark);
    }

    /* Animation for countries appearing */
    .country-list-item.entering {
        animation: countryEnter 0.4s ease forwards;
    }

    @keyframes countryEnter {
        0% {
            opacity: 0;
            transform: translateY(-10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Animation for countries disappearing */
    .country-list-item.leaving {
        animation: countryLeave 0.3s ease forwards;
    }

    @keyframes countryLeave {
        0% {
            opacity: 1;
            transform: translateY(0);
        }
        100% {
            opacity: 0;
            transform: translateY(10px);
        }
    }

    .country-list-item .country-flag {
        width: 40px;
        height: 28px;
        border-radius: var(--radius-sm);
        background: var(--action-blue-light);
        margin-right: var(--spacing-md);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }

    .country-list-item .country-details {
        flex: 1;
        min-width: 0;
    }

    .country-list-item .country-name {
        font-size: var(--font-size-base);
        font-weight: 700;
        color: var(--action-blue-dark);
        margin-bottom: 4px;
    }

    .country-list-item .country-stats {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
        color: var(--action-grey-dark);
    }

    .country-list-item .country-stat {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .country-list-item .country-stat strong {
        color: var(--action-blue-dark);
        font-weight: 600;
    }

    .country-list-item .country-first-year {
        font-size: var(--font-size-xs);
        color: var(--action-grey);
        margin-top: 4px;
    }

    /* Distribution centres indicator */
    .country-list-item .dc-indicator {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: var(--font-size-xs);
        color: var(--action-blue-dark);
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--action-grey-light);
    }

    .country-list-item .dc-pin-mini {
        width: 12px;
        height: 12px;
    }

    /* Empty state when no countries in year */
    .country-list-empty {
        text-align: center;
        padding: var(--spacing-2xl) var(--spacing-md);
        color: var(--action-grey);
    }

    .country-list-empty-icon {
        font-size: 3rem;
        margin-bottom: var(--spacing-md);
        opacity: 0.5;
    }

    .country-list-empty-text {
        font-size: var(--font-size-base);
    }

    .admin-panel {
        right: var(--spacing-sm);
        width: calc(100% - var(--spacing-md));
        max-width: 280px;
    }
}

/* --------------------------------------------------------------------------
   Bottom Sheet (Mobile Only)
   -------------------------------------------------------------------------- */
.bottom-sheet {
    display: none;
}

@media (max-width: 768px) {
    .bottom-sheet {
        display: block;
        position: fixed;
        bottom: 70px; /* Above fixed timeline */
        left: 0;
        right: 0;
        background: var(--action-white);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 60; /* Above timeline (z-index 50) */
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: calc(100vh - 170px); /* Leave space for header + timeline */
        overflow: hidden;
    }

    /* Bottom sheet states */
    .bottom-sheet.peek {
        transform: translateY(calc(100% - 80px));
    }

    .bottom-sheet.expanded {
        transform: translateY(0);
    }

    /* Drag handle */
    .bottom-sheet-handle {
        display: flex;
        justify-content: center;
        padding: 12px 0 8px;
        cursor: grab;
        touch-action: none;
    }

    .bottom-sheet-handle::before {
        content: "";
        width: 40px;
        height: 4px;
        background: var(--action-grey);
        border-radius: 2px;
    }

    .bottom-sheet-handle:active {
        cursor: grabbing;
    }

    /* Bottom sheet header - shown in peek state */
    .bottom-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 var(--spacing-md) var(--spacing-sm);
    }

    .bottom-sheet-title {
        font-size: var(--font-size-lg);
        font-weight: 700;
        color: var(--action-blue-dark);
    }

    .bottom-sheet-subtitle {
        font-size: var(--font-size-sm);
        color: var(--action-grey);
    }

    .bottom-sheet-close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: var(--action-grey);
        cursor: pointer;
        border-radius: var(--radius-md);
        transition: color var(--transition-fast), background var(--transition-fast);
    }

    .bottom-sheet-close:hover,
    .bottom-sheet-close:active {
        color: var(--action-blue-dark);
        background: rgba(0, 0, 0, 0.05);
    }

    /* Bottom sheet content - shown when expanded */
    .bottom-sheet-content {
        padding: 0 var(--spacing-md) var(--spacing-lg);
        overflow-y: auto;
        overflow-x: hidden;
        max-height: calc(50vh - 80px);
    }

    /* Country info inside bottom sheet - use flexbox instead of table for better mobile layout */
    .bottom-sheet .country-info-mobile {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .bottom-sheet .info-row {
        display: flex;
        align-items: baseline;
        gap: var(--spacing-sm);
    }

    .bottom-sheet .info-label {
        font-size: var(--font-size-sm);
        color: var(--action-blue-dark);
        font-weight: 400;
        flex-shrink: 0;
        min-width: 100px;
    }

    .bottom-sheet .info-value {
        font-size: var(--font-size-sm);
        font-weight: 700;
        color: var(--action-blue-dark);
        word-break: break-word;
    }

    /* Hint shown when no country selected */
    .bottom-sheet-hint {
        text-align: center;
        padding: var(--spacing-md);
        color: var(--action-grey);
        font-size: var(--font-size-sm);
    }
}

/* --------------------------------------------------------------------------
   Mobile Header (shown only on mobile)
   -------------------------------------------------------------------------- */
.mobile-header {
    display: none;
}

/* --------------------------------------------------------------------------
   Landscape Mobile - Use max-height to detect mobile landscape
   (Phones in landscape are typically < 500px tall but can be > 768px wide)
   -------------------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
    /* Override body max-height for landscape */
    body {
        max-height: 100vh;
        padding-bottom: 0;
    }

    /* Force mobile layout in landscape */
    .info-panel {
        display: none !important;
    }

    .mobile-header {
        display: none !important; /* Hide header in landscape to maximize list space */
    }

    /* Hide map - use list view instead */
    .map-area {
        display: none !important;
    }

    /* Hide desktop timeline - use mobile year selector */
    .timeline-container {
        display: none !important;
    }

    /* Hide bottom sheet */
    .bottom-sheet {
        display: none !important;
    }

    .map-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 0;
        flex: 0 0 auto;
    }

    /* Show mobile list view in landscape */
    .mobile-list-view {
        display: flex !important;
        flex-direction: row; /* Side-by-side in landscape */
        height: 100vh;
        padding: var(--spacing-sm);
    }

    /* Year selector on the left in landscape */
    .mobile-year-selector {
        flex-direction: column;
        width: 120px;
        border-bottom: none;
        border-right: 1px solid var(--action-grey-light);
        margin-bottom: 0;
        margin-right: var(--spacing-md);
        padding: var(--spacing-sm);
        justify-content: flex-start;
        gap: var(--spacing-sm);
    }

    .year-display {
        font-size: 2rem;
        min-width: auto;
    }

    /* Country list takes remaining space */
    .country-list {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        align-content: start;
        overflow-y: auto;
    }

    .country-list-item {
        margin-bottom: 0;
        padding: var(--spacing-sm);
    }

    .country-list-item .country-flag {
        width: 32px;
        height: 22px;
        margin-right: var(--spacing-sm);
    }

    .country-list-item .country-name {
        font-size: var(--font-size-sm);
    }

    .country-list-item .country-stats {
        font-size: var(--font-size-xs);
    }
}

/* --------------------------------------------------------------------------
   Playback Toast (Mobile)
   -------------------------------------------------------------------------- */
.playback-toast {
    display: none;
}

@media (max-width: 768px) {
    .playback-toast {
        display: flex;
        position: fixed;
        top: 70px; /* Below mobile header */
        left: 50%;
        transform: translateX(-50%) translateY(-20px);
        padding: var(--spacing-sm) var(--spacing-md);
        background: var(--action-blue-dark);
        color: var(--action-white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        z-index: 100;
        align-items: center;
        gap: var(--spacing-md);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .playback-toast.visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }

    .playback-toast[hidden] {
        display: none;
    }

    .toast-year {
        font-size: var(--font-size-xl);
        font-weight: 700;
        min-width: 50px;
        text-align: center;
    }

    .toast-totals {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }

    .toast-totals strong {
        font-weight: 700;
    }
}

/* --------------------------------------------------------------------------
   Tap Feedback Animation
   -------------------------------------------------------------------------- */
@keyframes tapPulse {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
    100% {
        filter: brightness(1);
    }
}

svg g[id^="country-"].tap-feedback {
    animation: tapPulse 0.3s ease-out;
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .timeline-container,
    .admin-panel,
    .loading {
        display: none;
    }

    .map-container {
        display: block;
    }

    .info-panel,
    .map-area {
        width: 100%;
    }
}
