﻿/* ════════════════════════════════════════════════════════════════════════════
   Terrapoint — Editorial Cartography
   A premium forest intelligence surface. White & blue. Subtle depth.
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    /* Blue system — multiple tones, never one flat blue */
    --ink:        #07153d;   /* deep ink — used for display type, never for fills */
    --ink-soft:   #0f1f54;   /* slightly lifted ink */
    --blue-950:   #0a1f5c;   /* deep brand */
    --blue-900:   #0a3d9e;   /* brand primary */
    --blue-700:   #1565c0;   /* secondary */
    --blue-600:   #1d4ed8;   /* action */
    --blue-500:   #3b82f6;   /* interactive */
    --blue-400:   #60a5fa;   /* highlight */
    --blue-300:   #93c5fd;   /* muted accent */
    --blue-200:   #bfdbfe;   /* hairline tint */
    --blue-100:   #dbeafe;   /* tint */
    --blue-50:    #eff6ff;   /* wash */

    /* Cyan accent for data callouts only — used sparingly */
    --cyan-500:   #06b6d4;

    /* Neutral surface ladder */
    --white:      #ffffff;
    --paper:      #fbfcfe;   /* page bg — never pure white */
    --paper-2:    #f5f8fc;   /* subtle panel */
    --paper-3:    #eef2f8;   /* deeper panel */
    --paper-4:    #e4eaf2;   /* track */
    --hair:       #e3e8f0;   /* hairline */
    --hair-2:     #d4dce7;   /* stronger hairline */
    --ink-2:      #0f172a;   /* primary text */
    --ink-3:      #334155;   /* secondary text */
    --ink-4:      #64748b;   /* tertiary */
    --ink-5:      #94a3b8;   /* muted */
    --ink-6:      #cbd5e1;   /* very muted */

    /* Semantic */
    --success:    #047857;
    --success-bg: #ecfdf5;
    --warn:       #b45309;
    --warn-bg:    #fffbeb;
    --danger:     #b91c1c;
    --danger-bg:  #fef2f2;
    --info:       #1d4ed8;
    --info-bg:    #eff6ff;

    /* Semantic data state — used only when a value is truly a state, not a category */
    --data-state-danger: #b91c1c;
    --data-state-warn:   #b45309;
    --data-state-ok:     #047857;
    --data-state-info:   #1d4ed8;

    /* Map — neutral stand age classes, separate from management recommendations */
    --map-age-young:    #7aa6c2;
    --map-age-middle:   #4f7c9b;
    --map-age-maturing: #756b9e;
    --map-age-reached:  #5b536b;
    --map-age-unknown:  #6b7280;

    /* Promotional callout surface — used for kinnistu turuväärtus box */
    --surface-callout:        #f0f6ff;  /* very light blue, distinct from paper-2 */
    --surface-callout-border: #c7dcfb;
    --surface-callout-label:  #1d4ed8;
    --surface-callout-text:   #07153d;

    /* Spacing — 4pt scale */
    --s-1:  4px;
    --s-2:  8px;
    --s-3:  12px;
    --s-4:  16px;
    --s-5:  20px;
    --s-6:  24px;
    --s-7:  32px;
    --s-8:  40px;
    --s-9:  48px;
    --s-10: 64px;
    --s-11: 80px;
    --s-12: 96px;

    /* Radius */
    --r-xs:  4px;
    --r-sm:  6px;
    --r:     10px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-2xl: 28px;
    --r-full: 9999px;

    /* Shadow — restrained. Lift, not float. */
    --sh-1: 0 1px 0 rgba(15, 23, 42, 0.04);
    --sh-2: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 0 rgba(15, 23, 42, 0.03);
    --sh-3: 0 2px 4px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
    --sh-4: 0 4px 8px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.07);
    --sh-5: 0 8px 16px rgba(15, 23, 42, 0.06), 0 24px 48px rgba(15, 23, 42, 0.09);
    --sh-blue: 0 4px 14px rgba(10, 61, 158, 0.18), 0 1px 3px rgba(10, 61, 158, 0.12);
    --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(15, 23, 42, 0.04);

    /* Type */
    --ff-sans: "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --ff-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --ff-display: "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --ff-estonian: "Geist", "Inter Tight", system-ui, sans-serif; /* Geist covers Estonian diacritics */

    /* Motion */
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 120ms;
    --t-base: 200ms;
    --t-slow: 320ms;

    /* Layout */
    --nav-h: 64px;
    --max-w: min(80vw, 1600px);
    --dashboard-max-w: min(calc(100vw - 48px), 1600px);
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    overscroll-behavior-y: none;
}
body {
    font-family: var(--ff-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-2);
    background: var(--paper);
    /* Subtle topographic feel — radial blue wash that never competes with content */
    background-image:
        radial-gradient(1200px 600px at 50% -10%, rgba(96, 165, 250, 0.06), transparent 70%),
        radial-gradient(900px 500px at 100% 100%, rgba(10, 61, 158, 0.04), transparent 60%);
    background-attachment: fixed;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    min-height: 100vh;
    min-height: 100dvh;
}
button { font: inherit; color: inherit; }
input, textarea { font: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-700); text-decoration: none; }
::selection { background: rgba(29, 78, 216, 0.15); color: var(--ink-2); }

/* Scrollbars — thin, only in the blue family */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb {
    background: var(--paper-4);
    border: 2px solid var(--paper);
    border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--hair-2); }

/* ─── Type scale ──────────────────────────────────────────────────────────── */
.t-mono { font-family: var(--ff-mono); font-feature-settings: "tnum" 1, "cv11" 1, "ss01" 1; }
.t-display { font-family: var(--ff-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.t-eyebrow {
    font-family: var(--ff-sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-4);
}
.t-num {
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "ss01" 1, "cv11" 1;
    letter-spacing: -0.02em;
}

/* ═══ NAV ═══════════════════════════════════════════════════════════════════ */
.hero {
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: 0 var(--s-5);
    height: var(--nav-h);
    background: linear-gradient(135deg, #22c55e 0%, #06b6d4 50%, #3b82f6 100%);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
}

/* Global scroll-margin so anchor jumps and `:target` clear the sticky header */
.metric-card, .source-card, .ai-chat-card, .fact, .section-head, .landing {
    scroll-margin-top: 72px;
}


.nav-left {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: 32px;
}
.nav-center a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-center a:hover {
    color: white;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    text-decoration: none;
    color: white;
    padding: var(--s-1) 0;
}
.brand-mark {
    display: none;
    width: 22px;
    height: 22px;
    color: white;
    flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }


.brand-name {
    font-family: var(--ff-sans);
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.01em;
    color: white;
    font-weight: 400;
}
.brand-name strong {
    font-weight: 700;
    color: #bbf7d0;
}
.brand-tag {
    display: none;
}

.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: white;
    flex-shrink: 0;
    cursor: pointer;
}

.hamburger:hover { background: var(--paper-2); color: var(--ink-2); border-color: var(--hair-2); }
.hamburger:active { transform: scale(0.96); }
.hamburger svg { width: 18px; height: 18px; }


.nav-right {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

/* ═══ SEARCH ════════════════════════════════════════════════════════════════ */
.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 580px;
    min-width: 0;
    height: 42px;
    padding: 0 2px 0 14px;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    box-shadow: var(--sh-1);
    transition: all var(--t-base) var(--ease);
    position: relative;
}
.search-box:hover { border-color: var(--hair-2); box-shadow: var(--sh-2); }
.search-box:focus-within {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12), var(--sh-2);
}

.search-icon {
    color: var(--ink-5);
    flex-shrink: 0;
    display: flex;
    transition: color var(--t-base) var(--ease);
}
.search-icon svg { width: 16px; height: 16px; }
.search-box:focus-within .search-icon { color: var(--blue-600); }

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.search-box input {
    width: 100%;
    min-width: 0;
    padding: 0 var(--s-3);
    font-size: 14px;
    line-height: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink-2);
    height: 100%;
    letter-spacing: -0.005em;
}
.search-box input::placeholder { color: var(--ink-5); }

.search-kbd {
    display: none !important;
}

.search-box button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--blue-900);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.search-box button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
    opacity: 0;
    transition: opacity var(--t-base) var(--ease);
    border-radius: 50%;
}
.search-box button:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(10, 61, 158, 0.25); }
.search-box button:hover::before { opacity: 1; }
.search-box button:active { transform: translateY(0); }
.search-box button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.search-box button svg { position: relative; z-index: 1; width: 14px; height: 14px; }
.search-box button .btn-icon { transition: opacity var(--t-base) var(--ease); }
.search-box button .btn-spinner {
    display: none;
    width: 14px; height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    position: relative;
    z-index: 1;
}
.search-box button.is-loading .btn-icon { display: none; }
.search-box button.is-loading .btn-spinner { display: block; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

.search-box.is-searching {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), var(--sh-2);
    animation: searchBreath 2.4s ease-in-out infinite;
}
@keyframes searchBreath {
    0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), var(--sh-2); }
    50% { box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.10), var(--sh-2); }
}

/* Address dropdown */
.address-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r);
    box-shadow: var(--sh-4);
    z-index: 9999;
    max-height: 320px;
    overflow-y: auto;
    padding: var(--s-1);
}
.address-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background var(--t-fast) var(--ease);
    border: 1px solid transparent;
}
.address-item:hover,
.address-item.is-active { background: var(--paper-2); border-color: var(--hair); }
.address-item + .address-item { margin-top: 1px; }
.addr-loading,
.addr-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--ink-4);
    display: flex;
    align-items: center;
    gap: 8px;
}
.addr-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--hair);
    border-top-color: var(--blue-700);
    border-radius: 50%;
    animation: addr-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes addr-spin { to { transform: rotate(360deg); } }
.addr-main {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    letter-spacing: -0.01em;
}
.addr-sub {
    font-size: 13px;
    color: var(--ink-4);
    margin-top: 2px;
}
.addr-kataster {
    font-size: 12px;
    color: var(--blue-700);
    margin-top: 4px;
    font-family: var(--ff-mono);
    letter-spacing: 0.02em;
}

/* ═══ ERROR BANNER ═════════════════════════════════════════════════════════ */
.error-msg {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    padding: 10px 14px 10px 12px;
    background: var(--white);
    color: var(--danger);
    border: 1px solid #fecaca;
    border-left: 3px solid var(--danger);
    border-radius: var(--r);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--sh-3);
    max-width: 440px;
    width: calc(100% - 24px);
    display: flex;
    align-items: center;
    gap: var(--s-2);
    animation: errorIn 0.25s var(--ease-spring);
}
@keyframes errorIn {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.error-msg::before {
    content: "!";
    width: 18px; height: 18px;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* In-card error state — replaces data area contents on failed search */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-5) 0;
}
.error-state-icon {
    width: 36px; height: 36px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--r);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.error-state-text {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-2);
    line-height: 1.4;
}
.error-state-hint {
    font-size: 12.5px;
    color: var(--ink-4);
    line-height: 1.5;
}

/* Promotional callout — used for kinnistu turuväärtus panel */
.callout-surface {
    background: var(--surface-callout);
    border: 1px solid var(--surface-callout-border);
    border-radius: var(--r);
    padding: var(--s-4) var(--s-5);
    margin: var(--s-3) 0;
    position: relative;
    overflow: hidden;
}
.callout-surface::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--blue-600);
}
.callout-label {
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.005em;
    color: var(--surface-callout-label);
    margin-bottom: var(--s-2);
}
.callout-value {
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--surface-callout-text);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
#kataster-info .callout-value {
    font-size: 1.75rem;
}
.callout-breakdown {
    display: flex;
    gap: var(--s-4);
    margin-top: var(--s-3);
    font-size: 14.5px;
    color: var(--ink-3);
    flex-wrap: wrap;
}
.callout-key {
    color: var(--ink-4);
    margin-right: 4px;
}
.estimate-range {
    display: flex;
    align-items: baseline;
    gap: 7px;
    white-space: nowrap;
    font-family: var(--ff-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--surface-callout-text);
    letter-spacing: -0.035em;
}
.estimate-range span { color: var(--ink-5); font-weight: 400; }
.estimate-midpoint {
    margin-top: 5px;
    color: var(--ink-4);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.confidence-block { margin-top: 14px; }
.confidence-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink-4);
    font-size: 13px;
}
.confidence-heading strong { color: var(--ink-2); font-weight: 600; }
.confidence-track {
    height: 4px;
    margin-top: 6px;
    border-radius: var(--r-full);
    overflow: hidden;
    background: var(--blue-100);
}
.confidence-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue-700);
}
.estimate-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 2px 0 12px;
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
.estimate-breakdown > div { padding: 12px 10px 12px 0; min-width: 0; }
.estimate-breakdown > div + div { padding-left: 12px; border-left: 1px solid var(--hair); }
.estimate-breakdown span,
.estimate-breakdown small { display: block; color: var(--ink-4); font-size: 12.5px; line-height: 1.45; }
.estimate-breakdown strong {
    display: block;
    margin: 3px 0;
    color: var(--ink-2);
    font-family: var(--ff-mono);
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: normal;
}
.evidence-details { margin-top: 12px; border-top: 1px solid var(--hair); }
.evidence-details summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--blue-700);
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}
.evidence-details summary::-webkit-details-marker { display: none; }
.evidence-details summary::after { content: "+"; margin-left: auto; font-size: 17px; font-weight: 400; }
.evidence-details[open] summary::after { content: "−"; }
.evidence-body { padding: 0 0 6px; color: var(--ink-3); font-size: 14px; line-height: 1.6; }
.evidence-body p { margin: 0 0 9px; }
.evidence-body h4,
.health-components h4 { margin: 12px 0 5px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-transform: none; }
.evidence-body ul { margin: 0; padding-left: 17px; }
.evidence-body li { margin: 3px 0; }
.evidence-links { list-style: none; padding-left: 0 !important; }
.evidence-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--blue-700);
    font-size: 13.5px;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.data-quality-alert {
    display: grid;
    gap: 5px;
    margin: 0 0 var(--s-4);
    padding: 12px 14px;
    border-left: 3px solid var(--warn);
    border-radius: var(--r-sm);
    background: var(--warn-bg);
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.5;
}
.data-quality-alert strong { color: var(--warn); font-size: 13.5px; }
.data-quality-alert.critical { border-left-color: var(--danger); background: var(--danger-bg); }
.data-quality-alert.critical strong { color: var(--danger); }

/* Subtle inline links — secondary action with a hairline arrow */
.muted-link {
    font-size: 14.5px;
    color: var(--blue-900);
    text-decoration: none;
    border-bottom: 1px solid var(--blue-300);
    transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.muted-link:hover { color: var(--blue-950); border-bottom-color: var(--blue-700); }

/* Status pill — green for "active"/"present" state */
.pill-success {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #a7f3d0;
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.pill-warn {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid #fde68a;
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.pill-neutral {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: var(--paper-3);
    color: var(--ink-4);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.eudr-scope-warning {
    display: grid;
    gap: 4px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid #f2cf7d;
    border-radius: var(--r-sm);
    background: var(--warn-bg);
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.45;
}
.eudr-scope-warning strong { color: var(--warn); }
.eudr-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--blue-900);
    color: #fff;
    border: none;
    border-radius: var(--r-md, 8px);
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.eudr-export-btn:hover { background: var(--blue-950); }
.eudr-export-btn:active { transform: translateY(1px); }
.eudr-export-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }
.eudr-export-btn svg { flex-shrink: 0; }

/* Collapsible summary line — quiet, but legible on hover */
.muted-summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--ink-4);
    list-style: none;
    padding: 4px 0;
    transition: color var(--t-fast) var(--ease);
}
.muted-summary:hover { color: var(--ink-2); }
.muted-summary::-webkit-details-marker { display: none; }
.muted-summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    font-size: 0.7rem;
    color: var(--ink-5);
    transition: transform var(--t-base) var(--ease);
}
details[open] > .muted-summary::before { transform: rotate(90deg); }

/* Subsidy eligible banner — matches .callout-surface family */
.eligible-banner {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
    border-left: 3px solid var(--success);
    border-radius: var(--r);
    color: var(--success);
    font-size: 0.85rem;
}

/* ═══ SIDEBAR ═══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 21, 61, 0.32);
    backdrop-filter: blur(2px);
    z-index: 1500;
}
.sidebar-overlay.open { display: block; animation: fadeIn 0.2s var(--ease); }

.sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: 320px;
    background: var(--white);
    border-right: 1px solid var(--hair);
    box-shadow: var(--sh-4);
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform var(--t-slow) var(--ease-out);
    display: flex;
    flex-direction: column;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hair);
}
.sidebar-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-2);
    letter-spacing: -0.01em;
}
.sidebar-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    color: var(--ink-4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast) var(--ease);
}
.sidebar-close:hover { background: var(--paper-2); color: var(--ink-2); }
.sidebar-close svg { width: 16px; height: 16px; }

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--s-5);
}
.sidebar-nav {
    display: grid;
    gap: 4px;
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--hair);
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.sidebar-nav a:hover,
.sidebar-nav a:focus-visible {
    background: var(--paper-2);
    color: var(--blue-700);
}
.sidebar-section-title {
    margin-top: var(--s-5);
    color: var(--ink-4);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.sidebar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 20px;
    color: var(--ink-4);
    font-size: 14px;
    gap: 6px;
}
.sidebar-empty svg { color: var(--ink-6); margin-bottom: 4px; }

/* ═══ LOADING ═══════════════════════════════════════════════════════════════ */
.loading {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0; bottom: 0;
    z-index: 1999;
    background: rgba(251, 252, 254, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 32px;
}
.loading::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--paper-4);
    overflow: hidden;
}
.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-600), var(--cyan-500), transparent);
    animation: loadSlide 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes loadSlide {
    0% { left: -30%; }
    100% { left: 100%; }
}

.loading-content {
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--paper-4);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: loadingSpin 0.7s linear infinite;
    margin-bottom: 4px;
}
@keyframes loadingSpin { to { transform: rotate(360deg); } }
.loading-text {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink-4);
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.skeleton {
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-lg);
    position: relative;
    overflow: hidden;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.08), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.6s var(--ease) infinite;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
.skeleton-map { height: 320px; }
.skeleton-card { height: 100px; }
.skeleton-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ═══ HERO LANDING ═════════════════════════════════════════════════════════ */
/* ═══ HERO SCENE — transparent tree barriers, trunk anchored to the screen
   edge, leaning inward (60° → 90°), rising up and away on scroll. ═══ */
.landing {
    position: relative;
    min-height: clamp(640px, 92vh, 920px);
    padding: clamp(40px, 7vh, 84px) 24px clamp(28px, 5vh, 56px);
    text-align: center;
    background:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255,255,255,0.55), transparent 65%),
        linear-gradient(180deg, #eef4fc 0%, #e6eff7 55%, #dce6f0 100%);
    --s: 0;
    color: var(--ink);
}
.landing > .hero-content {
    position: relative;
    z-index: 3;
    max-width: 920px;
    margin: 0 auto;
    transform: translateY(calc(var(--s-content) * -8vh));
    opacity: calc(1 - var(--s-content));
    will-change: transform, opacity;
}
.landing::before { content: none; }

/* 3 trees per side, spaced out vertically along each edge. Each tree's
   trunk is anchored to the screen edge via translateX(±50%). The scroll
   motion is a PURE rotation on the trunk axis (the tree pivots from
   its leaned angle to upright) — no lift, no circular path. A soft
   ground/fog gradient at the bottom of the tree layer hides the flat
   cut at the end of each trunk so we don't see the "end of the trunk". */
.hero-trees {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}
/* Ground/fog: gradient at the bottom of the HERO SECTION (on .landing,
   not on the trees container) so it reliably paints above the trees
   (the trees are inside .hero-trees with their own stacking context;
   the ground is in the .landing context, above .hero-trees, below
   .hero-content). Fully opaque at the very bottom so the rembg cut
   at the end of each trunk is not visible — the cut blends into the
   same color as the hero's bottom background. */
.landing::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22vh;
    background: linear-gradient(to top,
        #dce6f0 0%,
        #dce6f0 40%,
        rgba(220, 230, 240, 0.5) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 2;
}
.hero-tree {
    position: absolute;
    width: auto;
    --tilt: 0deg;
    transform-origin: 50% 100%;
    will-change: opacity;
    opacity: var(--s-op);
}
.hero-tree--left {
    left: 2vw;
    transform: translateX(-50%);
}
.hero-tree--right {
    right: 2vw;
    transform: translateX(50%);
}
/* Push the 4 middle + upper trees further OUTSIDE the frame (trunks
   off-screen) so only their foliage is visible inside the hero. The
   2 bottom trees keep their trunks near the edge (2vw in). */
.hero-tree--left-2,
.hero-tree--left-3 { left: -4vw; }
.hero-tree--right-2,
.hero-tree--right-3 { right: -4vw; }
/* 3 trees per side, spaced out along the edge with a clear gap between
   each pair. Lean is ~55° from vertical (more horizontal — the user
   said the previous 40° was "angled too up"). */
.hero-tree--left-1  { bottom: 0;   height: 60vh; --tilt:  55deg; }
.hero-tree--left-2  { bottom: 36vh; height: 52vh; --tilt:  57deg; }
.hero-tree--left-3  { bottom: 56vh; height: 44vh; --tilt:  53deg; }
.hero-tree--right-1 { bottom: 0;   height: 58vh; --tilt: -55deg; }
.hero-tree--right-2 { bottom: 36vh; height: 50vh; --tilt: -57deg; }
.hero-tree--right-3 { bottom: 56vh; height: 42vh; --tilt: -53deg; }

.hero-tree picture {
    display: block;
    height: 100%;
}
.hero-tree img {
    display: block;
    height: 100%;
    width: auto;
    transform-origin: 50% 100%;
    will-change: transform;
    filter: drop-shadow(0 24px 36px rgba(7, 21, 61, 0.13));
    /* Scroll motion: pure rotation on the trunk axis. From the leaned
       base tilt to 0° (upright). No translateY. */
    transform: rotate(calc(var(--tilt) * (1 - var(--s))));
}
/* Per-tree ground patch: a large, very soft radial gradient at the
   base of every tree that hides the rembg cut at the end of the
   trunk. The element is intentionally much larger than the visible
   solid area and the gradient fades to transparent well before the
   element's edges, so the patch's rectangular shape is never
   visible — it reads as soft fog blending into the hero background.
   The solid color matches the hero's bottom bg (#dce6f0) so the
   trunk base blends in. */
.hero-tree::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 560px;
    height: 160px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse 55% 60% at center 70%,
        #dce6f0 0%,
        #dce6f0 18%,
        rgba(220, 230, 240, 0.45) 45%,
        rgba(220, 230, 240, 0.15) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.landing-eyebrow {
    display: inline-flex;
    transform-origin: 50% 50%;
    align-items: center;
    gap: 5px;
    padding: 4px 11px 4px 9px;
    margin-bottom: 18px;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    box-shadow: var(--sh-1);
    font-size: 13.5px;
    color: var(--ink-3);
    font-weight: 500;
    letter-spacing: -0.005em;
}
.landing-eyebrow .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18); }
    50% { box-shadow: 0 0 0 5px rgba(4, 120, 87, 0.05); }
}

.landing-title {
    font-family: "Bricolage Grotesque", "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.04;
    color: var(--ink);
    letter-spacing: -0.035em;
    margin-bottom: 14px;
    font-weight: 700;
    font-optical-sizing: auto;
}
.landing-title em {
    font-style: italic;
    color: var(--blue-700);
    font-weight: 700;
}
.landing-title .ampersand {
    color: var(--blue-400);
    font-style: italic;
    font-weight: 500;
}

.landing-sub {
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-3);
    max-width: 540px;
    margin: 0 auto 28px;
    letter-spacing: -0.005em;
}

.landing-search {
    max-width: 560px;
    margin: 0 auto 20px;
    position: relative;
}
.landing-search .search-box {
    height: 48px;
    max-width: none;
    padding: 0 4px 0 14px;
    border-radius: var(--r-full);
    box-shadow: var(--sh-1);
}
.landing-search .search-box input {
    font-size: 16px;
    padding: 0 14px;
}
.landing-search .search-box button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.landing-search .search-box button svg { width: 16px; height: 16px; }
.landing-search .search-icon svg { width: 18px; height: 18px; }

.landing-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.landing-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    font-size: 14px;
    color: var(--ink-3);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    font-family: var(--ff-mono);
    letter-spacing: 0.01em;
}
.landing-hint:hover {
    border-color: var(--blue-400);
    color: var(--blue-700);
    background: var(--blue-50);
    transform: translateY(-1px);
}
.landing-hint .kbd {
    font-size: 11px;
    color: var(--ink-5);
    background: var(--paper-2);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--hair);
}

.landing-meta {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.landing-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.landing-meta-num {
    font-family: var(--ff-sans);
    font-size: 28px;
    color: var(--ink);
    font-feature-settings: "tnum" 1;
    letter-spacing: -0.02em;
}
.landing-meta-label {
    font-size: 12px;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ═══ DASHBOARD ════════════════════════════════════════════════════════════ */
.dashboard {
    /* Full-bleed so the section fills the viewport on desktop; the
       "white sides" become the dashboard's own paper-2 background. */
    max-width: 100%;
    margin: 0;
    padding: 24px 0 80px;
    background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 30%, var(--paper) 70%, var(--paper-2) 100%);
    display: flex;
    flex-direction: column;
    align-items: stretch;  /* sunni lapsed 100% laiuseks — `normal` ei venita alati flex kolumnis */
    gap: 24px;
}
.dashboard > * {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}
@media (min-width: 769px) {
    .dashboard > * {
        max-width: var(--dashboard-max-w);
        margin-left: auto;
        margin-right: auto;
        padding-left: 24px;
        padding-right: 24px;
    }
}
/* `hidden` attribute must beat the `display: flex` above so the
   empty placeholder cards don't bleed into the landing/intro view. */
.dashboard[hidden] { display: none; }

/* Section heading */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: 14px;
}
.section-head h2 {
    font-family: var(--ff-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.15;
}
.section-head h2 em { font-style: italic; color: var(--blue-700); font-weight: 700; }
.section-head .section-meta {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink-4);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ═══ QUICK FACTS STRIP (after search) ════════════════════════════════════ */
.facts-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--hair);
    border: 1px solid var(--hair);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--sh-1);
}
.fact {
    background: var(--white);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: background var(--t-base) var(--ease);
}
.fact:hover { background: var(--paper); }
.fact-label {
    font-size: 12.5px;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.fact-label::before {
    content: "";
    width: 4px; height: 4px;
    background: var(--blue-500);
    border-radius: 50%;
}
.fact-value {
    font-family: var(--ff-mono);
    font-size: 24px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "ss01" 1;
}
.fact-value .unit {
    font-size: 13px;
    color: var(--ink-4);
    font-weight: 400;
    margin-left: 3px;
    letter-spacing: 0;
}
.fact-sub {
    font-size: 13px;
    color: var(--ink-4);
    margin-top: 2px;
}
.fact-sub.green { color: var(--success); }
.fact-sub.blue { color: var(--blue-700); }

/* ═══ MAP ═══════════════════════════════════════════════════════════════════ */
.map-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.map-wrapper {
    position: relative;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--sh-3);
}
#map {
    width: 100%;
    height: 560px;
    background: var(--paper-3);
}

/* Unified map workspace */
.map-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
}
.map-workspace {
    width: min(372px, calc(100vw - 24px));
    max-height: calc(100% - 24px);
    overflow: hidden;
    color: var(--ink-2);
}
.map-workspace-button,
.map-view-preset {
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.map-workspace-opener {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--hair);
    border-radius: var(--r);
    padding: 9px 11px;
    box-shadow: var(--sh-2);
    font-size: 13px;
    text-align: left;
    transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.map-workspace-opener:hover { background: var(--white); border-color: var(--hair-2); }
.map-workspace.is-open .map-workspace-opener { display: none; }
.map-workspace-opener-copy { display: grid; gap: 1px; min-width: 0; }
.map-workspace-opener-copy strong,
.map-workspace-panel-header strong { font-size: 14px; letter-spacing: -0.01em; }
.map-workspace-eyebrow,
.map-workspace-section-title {
    color: var(--ink-4);
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.map-workspace-opener-status {
    max-width: 46%;
    color: var(--ink-4);
    font-size: 11.5px;
    line-height: 1.25;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.map-workspace-panel {
    margin-top: 5px;
    max-height: calc(560px - 72px);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--hair);
    border-radius: var(--r);
    box-shadow: var(--sh-3);
}
.map-workspace-panel[hidden] { display: none; }
.map-workspace-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px 9px 12px;
    border-bottom: 1px solid var(--hair);
}
.map-workspace-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--paper-2);
    color: var(--ink-4);
    font-size: 19px;
    line-height: 1;
}
.map-workspace-panel-body { overflow-y: auto; max-height: calc(560px - 126px); padding: 10px 12px 12px; scrollbar-width: thin; }
.map-workspace-status {
    margin: 0 0 9px;
    padding: 7px 9px;
    background: var(--paper-2);
    border-left: 2px solid var(--blue-500);
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.35;
}
.map-view-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.map-view-preset { min-height: 44px;
    padding: 6px 5px;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-sm);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.15;
}
.map-view-preset[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.map-workspace-view-description {
    margin: 8px 1px 0;
    color: var(--ink-4);
    font-size: 11.5px;
    line-height: 1.4;
    text-wrap: pretty;
}
.map-workspace-legend-title { margin-top: 14px; }
.map-workspace-button { min-width: 44px; min-height: 44px; }
.map-workspace button:disabled { cursor: not-allowed; opacity: 0.46; }
.map-workspace-button:focus-visible,
.map-workspace-close:focus-visible,
.map-inline-retry:focus-visible,
.map-view-preset:focus-visible,
.map-legend-row summary:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}
.map-workspace-legend { margin-top: 4px; border-top: 1px solid var(--hair); }
.map-layer-focus-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 3px;
    padding: 8px 8px 8px 10px;
    background: var(--paper-2);
    border: 1px solid var(--hair);
    border-radius: var(--r-sm);
}
.map-layer-focus-status > span { display: grid; min-width: 0; }
.map-layer-focus-status small {
    color: var(--blue-700);
    font-family: var(--ff-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.map-layer-focus-status strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.map-focus-clear {
    min-height: 36px;
    padding: 5px 8px;
    flex: 0 0 auto;
    background: var(--white);
    border: 1px solid var(--hair-2);
    border-radius: var(--r-sm);
    color: var(--blue-700);
    font-size: 10.5px;
    font-weight: 700;
}
.map-workspace-empty { margin: 9px 0 0; color: var(--ink-4); font-size: 12px; line-height: 1.4; }

/* Click-to-find hint pill — top center of map */
.map-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px 6px 11px;
    max-width: calc(100% - 32px);
    background: rgba(15, 23, 42, 0.86);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-full);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    box-shadow: var(--sh-2);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.2;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.map-hint svg { flex-shrink: 0; opacity: 0.85; }
.map-hint span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-hint-close {
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    pointer-events: auto;
    transition: background var(--t-fast) var(--ease);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.map-hint-close:hover { background: rgba(255, 255, 255, 0.22); }
.map-hint.hidden {
    opacity: 0;
    transform: translate(-50%, -8px);
    pointer-events: none;
}

/* ── Map click confirm popup ── */
.map-confirm {
    position: absolute;
    z-index: 1100;
    transform: translate(-50%, calc(-100% - 18px));
    pointer-events: auto;
    filter: drop-shadow(0 8px 24px rgba(7, 21, 61, 0.22));
    animation: map-confirm-in 0.18s ease-out;
}
.map-confirm[hidden] { display: none; }
@keyframes map-confirm-in {
    from { opacity: 0; transform: translate(-50%, calc(-100% - 8px)); }
    to   { opacity: 1; transform: translate(-50%, calc(-100% - 18px)); }
}
.map-confirm::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--white);
    border-right: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
.map-confirm-card {
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: 12px;
    padding: 14px 16px 12px;
    min-width: 240px;
    max-width: 280px;
    text-align: center;
}
.map-confirm-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue-700);
    margin-bottom: 4px;
    font-family: var(--ff-mono);
}
.map-confirm-tunnus {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    font-family: var(--ff-mono);
    margin-bottom: 6px;
    word-break: break-all;
}
.map-confirm-text {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ink-3);
    margin-bottom: 12px;
}
.map-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.map-confirm-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--hair);
    background: var(--white);
    color: var(--ink-3);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--ff-sans);
}
.map-confirm-btn-secondary:hover {
    background: var(--paper-2);
    color: var(--ink);
    border-color: var(--ink-4);
}
.map-confirm-btn-primary {
    background: var(--blue-700);
    color: var(--white);
    border-color: var(--blue-700);
}
.map-confirm-btn-primary:hover {
    background: var(--blue-800);
    border-color: var(--blue-800);
}
.map-confirm-btn-primary:active {
    transform: translateY(1px);
}
@media (max-width: 520px) {
    .map-confirm { max-width: calc(100vw - 32px); }
    .map-confirm-card { min-width: 0; max-width: 100%; }
}
.map-legend-row {
    border-bottom: 1px solid var(--hair);
    transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.map-legend-row:last-child { border-bottom: 0; }
.map-legend-row.is-focused {
    background: color-mix(in srgb, var(--blue-100) 64%, var(--white));
    box-shadow: inset 3px 0 0 var(--blue-600);
}
.map-legend-row summary {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 2px;
    cursor: pointer;
    list-style: none;
}
.map-legend-theme-row summary:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.map-legend-row summary::-webkit-details-marker { display: none; }
.map-legend-symbol {
    grid-column: 1;
    width: 18px;
    height: 14px;
    border-radius: 3px;
    background: var(--legend-color);
    box-shadow: inset 0 0 0 1px rgba(7, 21, 61, 0.12);
}
.map-legend-symbols {
    grid-column: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}
.map-legend-symbols .map-source-symbol + .map-source-symbol { margin-left: -7px; }
.map-legend-symbols .map-source-symbol {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.94);
}
.map-legend-symbol-extra {
    margin-left: 3px;
    color: var(--ink-4);
    font-family: var(--ff-mono);
    font-size: 9px;
    font-weight: 700;
}
.map-legend-copy { grid-column: 2; display: grid; gap: 1px; min-width: 0; }
.map-legend-copy strong { font-size: 12.5px; line-height: 1.3; }
.map-legend-copy small { color: var(--ink-4); font-size: 11.5px; line-height: 1.3; }
.map-legend-focus-badge {
    grid-column: 3;
    color: var(--blue-700);
    font-family: var(--ff-mono);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.map-legend-chevron { grid-column: 4; color: var(--ink-5); font-size: 18px; transition: transform var(--t-fast) var(--ease); }
.map-legend-row[open] .map-legend-chevron { transform: rotate(90deg); }
.map-legend-detail { padding: 1px 2px 11px 60px; }
.map-theme-focus-help {
    margin: 0 0 6px;
    color: var(--blue-700);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.35;
}
.map-legend-interpretation { margin: 0 0 8px; color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
.map-record-list { display: grid; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--hair); list-style: none; }
.map-record { display: grid; gap: 2px; min-width: 0; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.map-record:last-child { border-bottom: 0; }
.map-record-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.map-record-title { min-width: 0; color: var(--ink-2); font-size: 11.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.map-record-status { color: var(--ink-3); font-size: 11px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.map-record-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; color: var(--ink-4); font-size: 10.5px; line-height: 1.4; }
.map-record-meta > * { min-width: 0; overflow-wrap: anywhere; }
.map-source-list { display: grid; gap: 6px; }
.map-source { padding: 8px 9px; background: var(--paper-2); border-left: 2px solid var(--hair-2); font-size: 11px; line-height: 1.4; }
.map-source-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.map-source-heading > div { min-width: 0; }
.map-source-title { color: var(--ink-2); font-weight: 700; }
.map-source-provider { color: var(--ink-4); font-size: 10px; line-height: 1.3; }
.map-source-state { margin-top: 5px; color: var(--ink-2); font-size: 10.5px; font-weight: 700; }
.map-source p { margin: 3px 0; color: var(--ink-3); }
.map-source-match-count,
.map-source-overlap,
.map-source-stands { color: var(--ink-3); }
.map-source-as-of,
.map-source-checked { color: var(--ink-4); }
.map-source-symbol {
    width: 24px;
    height: 14px;
    flex: 0 0 24px;
}
.leaflet-map-theme-dimmed-pane > svg,
.leaflet-map-theme-normal-pane > svg,
.leaflet-map-theme-focused-pane > svg { max-width: none; }
.map-layer-tooltip-wrap.leaflet-tooltip {
    padding: 0 !important;
    overflow: visible;
    background: rgba(255, 255, 255, 0.97) !important;
    border: 1px solid var(--hair-2) !important;
    border-radius: 6px !important;
    box-shadow: var(--sh-2) !important;
    color: var(--ink-2) !important;
    max-width: min(280px, calc(100vw - 32px));
    width: max-content;
    text-shadow: none !important;
    white-space: normal;
    overflow-wrap: anywhere;
}
.map-layer-tooltip-wrap.leaflet-tooltip::before { border-top-color: rgba(255, 255, 255, 0.97) !important; }
.map-layer-tooltip { display: grid; gap: 1px; padding: 6px 8px; }
.map-layer-tooltip strong { font-size: 11px; line-height: 1.25; }
.map-layer-tooltip span { color: var(--ink-4); font-size: 9.5px; line-height: 1.25; }
.map-overview-checks { display: grid; gap: 5px; }
.map-overview-check { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-overview-check > span { display: grid; gap: 1px; min-width: 0; }
.map-overview-check strong { font-size: 11.5px; }
.map-overview-check small { color: var(--ink-4); font-size: 11px; }
.map-inline-retry {
    min-height: 32px;
    padding: 5px 8px;
    flex: 0 0 auto;
    background: var(--white);
    border: 1px solid var(--hair-2);
    border-radius: var(--r-sm);
    color: var(--blue-700);
    font-size: 11px;
    font-weight: 700;
}
.map-legend-detail > .map-inline-retry { margin-top: 7px; }
.map-age-legend { display: grid; gap: 4px; margin: 7px 0 8px; }
.map-age-legend > div { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 11px; }
.map-age-legend span { width: 10px; height: 10px; border-radius: 3px; background: var(--age-color); }

/* ═══ METRIC GRID ═══════════════════════════════════════════════════════════ */
#dashboard { scroll-margin-top: calc(var(--nav-h) + 16px); }
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
@media (max-width: 1180px) {
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
.metric-card {
    grid-column: span 1;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: 10px;
    padding: 28px 28px 24px;
    box-shadow: var(--sh-1);
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    transition: box-shadow var(--t-base) var(--ease);
    overflow: hidden;
    animation: cardIn 0.5s var(--ease-out) backwards;
    color: var(--ink-2);
}
/* Tighter padding on cards that hold the eraldised table — the 7-column
   table needs more horizontal room than the 28px default gives it. The
   table panel itself has padding:0, so reducing the card padding
   directly widens the available space. */
.metric-card:has(.eraldised-table-panel) {
    padding-left: 14px;
    padding-right: 14px;
}

.metric-card:nth-child(1) { animation-delay: 0.02s; }
.metric-card:nth-child(2) { animation-delay: 0.06s; }
.metric-card:nth-child(3) { animation-delay: 0.10s; }
.metric-card:nth-child(4) { animation-delay: 0.14s; }
.metric-card:nth-child(5) { animation-delay: 0.18s; }
.metric-card:nth-child(6) { animation-delay: 0.22s; }
.metric-card:nth-child(7) { animation-delay: 0.26s; }
.metric-card:nth-child(8) { animation-delay: 0.30s; }
.metric-card:nth-child(9) { animation-delay: 0.34s; }

/* Alumise rea kaardid (Kitsendused, Metsateatised, Toetused) ei veni
   grid rea kõrgusele — muidu tekib tühi valge kast, kui sisu on lühike
   (nt Metsateatised 3 reaga). `align-self: start` jätab kaardi loomulikku
   kõrgusesse, ülejäänud rida on grid taust (mitte kaardi valge). */
.metric-card:nth-child(n+7) {
    align-self: start;
}

/* Eemaldatud ::before gradient joon — AI slop dekoratsioon */

.metric-card:hover {
    box-shadow: var(--sh-3);
}
.metric-card:focus-within {
    box-shadow: 0 0 0 2px var(--blue-100), var(--sh-3);
}

/* Highlight card — the value card gets a refined treatment */
.highlight-card {
    background:
        linear-gradient(135deg, #fff 0%, var(--blue-50) 100%);
    position: relative;
    color: var(--ink);
    border-color: var(--blue-200);
    box-shadow: var(--sh-3);
}
.highlight-card::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.2), transparent 70%);
    pointer-events: none;
}
.highlight-card:hover { border-color: var(--blue-300); box-shadow: var(--sh-4); }

/* Card header — ikoonid minimaalsed, ilma värviliste kastideta */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}
.card-icon {
    width: 18px; height: 18px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: none;
    color: var(--ink-4);
    border: none;
    transition: none;
    margin-top: 2px;
}
.card-icon svg { width: 16px; height: 16px; }
.metric-card:hover .card-icon {
    background: none;
    color: var(--ink-4);
    border: none;
    transform: none;
}
.vaartus-icon { color: var(--blue-700); }

.card-head-text { flex: 1; min-width: 0; }
.card-header h3 {
    font-size: var(--tier-1-title);
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.25;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}
.metric-card.highlight-card .card-header h3 { color: var(--ink); }
.section-desc {
    font-size: 14.5px;
    color: var(--ink-4);
    margin: 3px 0 0;
    line-height: 1.5;
    letter-spacing: -0.005em;
    padding-bottom: 14px;
}

@media (max-width: 768px) {
    .metric-card { padding: 18px 18px 16px; }
    .section-desc { font-size: 14px; }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes sectionIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══ INFO ROWS ═════════════════════════════════════════════════════════════ */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    font-size: var(--tier-2-row);
    position: relative;
}
.info-row .label {
    color: var(--ink-4);
    font-weight: 400;
    font-size: var(--tier-2-row);
    letter-spacing: -0.005em;
    min-width: 0;
    flex: 1 1 auto;
}
.metric-card.highlight-card .section-desc {
    transform: none;
}
.metric-card.highlight-card .info-row {
    transform: none;
}

.info-row .value {
    font-family: var(--ff-mono);
    font-weight: 500;
    color: var(--ink-2);
    text-align: right;
    font-size: var(--tier-2-row);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: -0.005em;
    min-width: 0;
    max-width: 58%;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.4;
    text-wrap: pretty;
}
.info-row .value strong { font-weight: 600; }
.info-row .value-with-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.info-row .value-with-detail small {
    color: var(--ink-4);
    font-family: var(--ff-sans);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}
.clearcut-row { align-items: flex-start; }
.clearcut-status { font-weight: 700 !important; }
.clearcut-status-found { color: var(--blue-700) !important; }
.clearcut-status-empty { color: var(--success) !important; }
.clearcut-status-partial { color: var(--warn) !important; }
.clearcut-status-unavailable { color: var(--danger) !important; }
.clearcut-explanation { max-width: 42ch; }

/* ═══ BIG NUMBERS ═══════════════════════════════════════════════════════════ */
.big-number {
    font-family: var(--ff-mono);
    font-size: 40px;
    font-weight: 500;
    color: var(--blue-700);
    line-height: 1.05;
    margin-bottom: 6px;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "ss01" 1, "cv11" 1;
}
.big-number .unit {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-4);
    margin-left: 4px;
    letter-spacing: 0;
}
.big-number.accent { color: var(--blue-700); }

.value-block {
    background:
        linear-gradient(135deg, var(--blue-50) 0%, rgba(219, 234, 254, 0.4) 100%);
    border: 1px solid var(--blue-100);
    border-radius: var(--r);
    padding: 14px 16px 12px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

/* Override inline green styles from JS — the kinnistu turuväärtus box */
#kataster-info [style*="background:linear-gradient(135deg,#f0f7f0"],
#kataster-info [style*="background:linear-gradient(135deg, #f0f7f0"] {
    background: linear-gradient(135deg, var(--blue-50) 0%, rgba(219, 234, 254, 0.5) 100%) !important;
    border: 1px solid var(--blue-100) !important;
    color: var(--ink-2) !important;
}
#kataster-info [style*="background:linear-gradient(135deg,#f0f7f0"] [style*="color:#2e7d32"],
#kataster-info [style*="background:linear-gradient(135deg, #f0f7f0"] [style*="color:#2e7d32"] {
    color: var(--blue-700) !important;
}
#kataster-info [style*="color:#1b5e20"] {
    color: var(--blue-700) !important;
}
#kataster-info [style*="color:var(--text-muted)"] {
    color: var(--ink-4) !important;
}

/* The inline vaartus gradient block in vaartus-info */
#vaartus-info [style*="background:linear-gradient(135deg,#eef4ff"] {
    background: linear-gradient(135deg, var(--blue-50) 0%, rgba(219, 234, 254, 0.5) 100%) !important;
    border: 1px solid var(--blue-100) !important;
}
.value-block-label {
    font-size: 12px;
    color: var(--blue-700);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.value-block-label::before {
    content: "";
    width: 12px; height: 1px;
    background: currentColor;
}
.value-block .sub {
    font-size: 13px;
    color: var(--ink-4);
    margin-top: 4px;
    letter-spacing: -0.005em;
}
.value-block .row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--blue-100);
    font-size: 13.5px;
}
.value-block .row > div { color: var(--ink-3); }
.value-block .row strong {
    font-family: var(--ff-mono);
    color: var(--ink-2);
    font-weight: 500;
    margin-left: 4px;
}

.asset-ledger {
    margin-bottom: 14px;
    container-type: inline-size;
}
.asset-trust-strip {
    --asset-trust-color: var(--ink-4);
    --asset-trust-bg: var(--paper-2);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-left: 3px solid var(--asset-trust-color);
    background: var(--asset-trust-bg);
    border-radius: var(--r-sm);
}
.asset-trust-kõrge,
.asset-trust-hea {
    --asset-trust-color: var(--success);
    --asset-trust-bg: var(--success-bg);
}
.asset-trust-keskmine,
.asset-trust-teadmata {
    --asset-trust-color: var(--warn);
    --asset-trust-bg: var(--warn-bg);
}
.asset-trust-madal {
    --asset-trust-color: var(--danger);
    --asset-trust-bg: var(--danger-bg);
}
.asset-trust-strip > div {
    display: grid;
    gap: 2px;
}
.asset-trust-strip span {
    color: var(--asset-trust-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.asset-trust-strip strong {
    color: var(--ink-2);
    font-size: 14px;
}
.asset-trust-strip p {
    max-width: 26ch;
    margin: 0;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.45;
    text-align: right;
}
.asset-passport {
    border-bottom: 1px solid var(--hair);
}
.asset-passport:first-child {
    border-top: 1px solid var(--hair);
}
.asset-passport summary {
    min-height: 66px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    cursor: pointer;
    list-style: none;
}
.asset-passport summary::-webkit-details-marker { display: none; }
.asset-passport summary:focus-visible,
.asset-ai-btn:focus-visible,
.asset-source-link:focus-visible,
.asset-passport-methods a:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}
.asset-passport-heading {
    min-width: 0;
    display: grid;
    justify-items: start;
    gap: 5px;
}
.asset-passport-label {
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
}
.asset-passport-origin {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
}
.asset-passport-origin-official { background: var(--success-bg); color: var(--success); }
.asset-passport-origin-derived { background: var(--blue-50); color: var(--blue-700); }
.asset-passport-origin-estimate,
.asset-passport-origin-mixed,
.asset-passport-origin-unknown { background: var(--warn-bg); color: var(--warn); }
.asset-passport-value {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--ink-2);
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
}
.asset-passport-value strong {
    font-family: var(--ff-mono);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}
.asset-passport-value small { color: var(--ink-4); font-size: 10.5px; }
.asset-passport-missing { color: var(--ink-4); font-family: var(--ff-sans) !important; font-size: 13px !important; }
.asset-passport-toggle {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--ink-4);
    border-bottom: 1.5px solid var(--ink-4);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}
.asset-passport[open] .asset-passport-toggle { transform: rotate(225deg) translate(-2px, -2px); }
.asset-passport-body {
    padding: 4px 2px 16px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.5;
}
.asset-passport-body dl { display: grid; gap: 8px; margin: 0 0 12px; }
.asset-passport-body dl > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
.asset-passport-body dt { color: var(--ink-4); }
.asset-passport-body dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.asset-source-link,
.asset-passport-methods a {
    color: var(--blue-700);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.asset-passport-note,
.asset-passport-methods {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--paper-2);
    border-radius: var(--r-sm);
}
.asset-passport-warning { background: var(--warn-bg); }
.asset-passport-note strong,
.asset-passport-methods strong { color: var(--ink-2); font-size: 12px; }
.asset-passport-note ul,
.asset-passport-methods ul { margin: 5px 0 0; padding-left: 17px; }
.asset-passport-note li,
.asset-passport-methods li { margin: 3px 0; }
.asset-ai-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid var(--blue-200);
    border-radius: var(--r-sm);
    background: var(--blue-50);
    color: var(--blue-700);
    font: 600 13px/1.3 var(--ff-sans);
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}
.asset-ai-btn:hover { background: var(--blue-100); border-color: var(--blue-300); }

/* ═══ TRAFFIC LIGHTS / PILLS ════════════════════════════════════════════════ */
.traffic-light {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    font-family: var(--ff-sans);
}
.traffic-light .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: pulse-dot 2.4s ease-in-out infinite;
}
.traffic-light.green { background: var(--success-bg); color: var(--success); border-color: #a7f3d0; }
.traffic-light.green .dot { background: var(--success); box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.18); }
.traffic-light.yellow { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.traffic-light.yellow .dot { background: var(--warn); box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.18); }
.traffic-light.red { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.traffic-light.red .dot { background: var(--danger); box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.18); }
.traffic-light.blue { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.traffic-light.blue .dot { background: var(--blue-600); box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18); }

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px currentColor; opacity: 1; }
    50% { opacity: 0.6; }
}

/* ═══ PROGRESS BAR ═════════════════════════════════════════════════════════ */
.progress-bar {
    height: 6px;
    background: var(--paper-3);
    border-radius: var(--r-full);
    overflow: hidden;
    margin: 6px 0 8px;
    position: relative;
}
.progress-bar .fill {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 0.9s var(--ease-out);
    background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
    position: relative;
}
.progress-bar .fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s var(--ease) infinite;
}
.health-score { margin-top: 12px; }
.health-score > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.health-score span { color: var(--ink-4); font-size: 13.5px; }
.health-score strong { color: var(--ink); font-family: var(--ff-mono); font-size: 1.6rem; letter-spacing: -0.04em; }
.health-score p { margin: 2px 0 8px; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; }
.health-components { margin: 12px 0 4px; padding-top: 2px; }
.health-components > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: 13.5px; }
.health-components > div strong { color: var(--danger); font-family: var(--ff-mono); }
.health-components p { margin: 0; color: var(--ink-4); font-size: 13.5px; line-height: 1.5; }
@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══ COMPOSITION TABLE / BARS ═════════════════════════════════════════════ */
.comp-table {
    width: 100%;
    margin-top: 12px;
    font-size: var(--tier-3-table);
    border-collapse: collapse;
    border-top: 1px solid var(--paper-3);
}
.comp-table td {
    padding: 8px 0;
    font-size: var(--tier-3-table);
    border-bottom: 1px solid var(--paper-3);
    font-family: var(--ff-sans);
}
.comp-table tr:last-child td { border-bottom: none; }
.comp-table .bar-cell { width: 45%; padding-left: 12px; }
.comp-bar {
    display: block;
    height: 8px;
    background: linear-gradient(90deg, var(--blue-700), var(--blue-400));
    border-radius: var(--r-full);
    transition: width 0.7s var(--ease-out);
    position: relative;
}

/* ═══ EUDR BUTTON ══════════════════════════════════════════════════════════ */
.eudr-desc { font-size: 14px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.55; letter-spacing: -0.005em; }
.btn-eudr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--ink);
    color: var(--white);
    font-weight: 600;
    font-family: var(--ff-sans);
    font-size: 13px;
    border: none;
    border-radius: var(--r);
    cursor: pointer;
    transition: all var(--t-base) var(--ease);
    width: 100%;
    box-shadow: var(--sh-blue);
    letter-spacing: -0.005em;
    position: relative;
    overflow: hidden;
}
.btn-eudr::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
    opacity: 0;
    transition: opacity var(--t-base) var(--ease);
}
.btn-eudr:hover { transform: translateY(-1px); }
.btn-eudr:hover::before { opacity: 1; }
.btn-eudr:active { transform: translateY(0); }
.btn-eudr svg { position: relative; z-index: 1; width: 14px; height: 14px; }
.btn-eudr span { position: relative; z-index: 1; }

/* ═══ AI CHAT ══════════════════════════════════════════════════════════════ */
.ai-chat-section {
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: 8px;
    box-shadow: var(--sh-1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    grid-column: span 12;
}
.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--white);
    border-bottom: 1px solid var(--hair);
    position: relative;
}
.ai-chat-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, var(--blue-200), var(--blue-400) 50%, var(--blue-200));
    opacity: 0.4;
}
.ai-chat-icon {
    width: 32px; height: 32px;
    background:
        radial-gradient(circle at 30% 30%, var(--blue-400), var(--blue-700));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: var(--sh-2);
    position: relative;
}
.ai-chat-icon::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    border: 1px solid var(--blue-300);
    opacity: 0.4;
    animation: pulse 2.4s ease-in-out infinite;
}
.ai-chat-icon svg { width: 16px; height: 16px; position: relative; z-index: 1; }
.ai-chat-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0;
    letter-spacing: -0.01em;
}
.ai-chat-subtitle {
    font-size: 13px;
    color: var(--ink-4);
    margin: 1px 0 0;
    font-family: var(--ff-mono);
    letter-spacing: 0;
}

.ai-chat-messages {
    padding: 16px 18px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(15, 23, 42, 0.015) 31px 32px),
        var(--white);
}
.ai-analyze-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 18px 8px;
}
.ai-analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 17px;
    background: var(--blue-900);
    color: #fff;
    border: none;
    border-radius: var(--r-md, 8px);
    font-family: var(--ff-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.ai-analyze-btn:hover { background: var(--blue-950); }
.ai-analyze-btn:active { transform: translateY(1px); }
.ai-analyze-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.ai-analyze-cta-hint {
    font-size: 13px;
    color: var(--ink-4);
    text-align: center;
    margin: 0;
    max-width: 320px;
}

.ai-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: msgIn 0.35s var(--ease-spring);
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-message.user-message { flex-direction: row-reverse; }
.ai-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, var(--blue-400), var(--blue-700));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    box-shadow: var(--sh-1);
    position: relative;
}
.ai-avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--white);
}
.user-message .ai-avatar { display: none; }
.ai-bubble {
    background: var(--paper-2);
    border: 1px solid var(--paper-3);
    border-radius: var(--r-md);
    padding: 10px 14px;
    max-width: min(88%, 72ch);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-2);
    letter-spacing: -0.005em;
}
.user-message .ai-bubble {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}
.ai-bubble p { margin: 0 0 6px; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-answer-source {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--blue-700);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}
.ai-bubble strong { font-weight: 600; color: var(--ink-2); }
.user-message .ai-bubble strong { color: var(--white); }
.ai-bubble h2, .ai-bubble h3, .ai-bubble h4 {
    font-size: 14.5px;
    font-weight: 600;
    margin: 8px 0 4px;
    color: var(--blue-700);
    letter-spacing: -0.005em;
}
.ai-bubble h2:first-child, .ai-bubble h3:first-child, .ai-bubble h4:first-child { margin-top: 0; }
.ai-bubble ul, .ai-bubble ol { margin: 6px 0; padding-left: 18px; }
.ai-bubble li { margin-bottom: 3px; }
.ai-bubble code {
    background: var(--paper-3);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    font-family: var(--ff-mono);
}
.ai-bubble pre {
    background: var(--paper-3);
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    overflow-x: auto;
    margin: 6px 0;
    font-family: var(--ff-mono);
}

.ai-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-thinking-icon { color: var(--blue-600); animation: pulse 1.5s ease-in-out infinite; }
.ai-thinking-text {
    font-size: 12.5px;
    color: var(--ink-4);
    font-style: italic;
    letter-spacing: -0.005em;
}
.ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
}
.ai-typing span {
    width: 5px; height: 5px;
    background: var(--blue-500);
    border-radius: 50%;
    animation: typing 1.3s var(--ease) infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
    0%, 60%, 100% { opacity: 0.2; transform: scale(0.7); }
    30% { opacity: 1; transform: scale(1); }
}

.ai-thinking-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
    background: var(--paper-2);
    border: 1px solid var(--paper-3);
    border-left: 2px solid var(--blue-500);
    border-radius: var(--r-sm);
    color: var(--ink-4);
    font-size: 12px;
    font-style: italic;
    max-height: 64px;
    overflow: hidden;
    position: relative;
}
.ai-thinking-block::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 18px;
    background: linear-gradient(to bottom, transparent, var(--paper-2));
    pointer-events: none;
}
.ai-thinking-block .ai-thinking-text {
    color: var(--blue-700);
    font-style: normal;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ai-thinking-block .ai-thinking-text::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--blue-500);
    animation: thinkPulse 1.2s ease-in-out infinite;
}
@keyframes thinkPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}
.ai-thinking-snippet {
    font-size: 12px;
    color: var(--ink-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
    font-family: var(--ff-sans);
}
.ai-answer-block { margin-top: 6px; }

.ai-chat-input-area {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--hair);
    background: var(--white);
}
.ai-chat-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    padding: 4px 4px 4px 14px;
    transition: all var(--t-base) var(--ease);
}
.ai-chat-input-wrap:focus-within {
    background: var(--white);
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.10);
}
.ai-chat-input-wrap input,
.ai-chat-input-wrap textarea {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink-2);
    font-size: 14.5px;
    font-family: var(--ff-sans);
    letter-spacing: -0.005em;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.45;
}
.ai-chat-input-wrap textarea { overflow-y: auto; }
.ai-chat-input-wrap input::placeholder,
.ai-chat-input-wrap textarea::placeholder { color: var(--ink-5); }
.ai-chat-input-wrap button {
    width: 44px; height: 44px;
    background: var(--blue-900);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-base) var(--ease);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.ai-chat-input-wrap button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
    opacity: 0;
    transition: opacity var(--t-base) var(--ease);
}
.ai-chat-input-wrap button:hover { transform: translateY(-1px); }
.ai-chat-input-wrap button:hover::before { opacity: 1; }
.ai-chat-input-wrap button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ai-chat-input-wrap button svg { position: relative; z-index: 1; width: 14px; height: 14px; }

.ai-chat-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.ai-hint {
    padding: 5px 11px;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r-full);
    font-size: 12px;
    font-family: var(--ff-sans);
    color: var(--ink-3);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    letter-spacing: -0.005em;
}
.ai-hint:hover {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
    transform: translateY(-1px);
}
.ai-hint-custom {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
    font-weight: 600;
}
.ai-hint-custom:hover {
    background: var(--blue-700);
    border-color: var(--blue-700);
}
.ai-chat-privacy {
    margin: 10px 2px 0;
    color: var(--ink-5);
    font-size: 11px;
    line-height: 1.45;
}
.ai-welcome { opacity: 0.95; }

.eraldis-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}
.eraldis-strip-label {
    font-size: 11px;
    color: var(--ink-4);
    font-weight: 600;
    margin-right: 2px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.eraldis-pick-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--hair);
    border-radius: var(--r);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.eraldis-pick-btn:hover {
    background: var(--paper-2);
    border-color: var(--hair-2);
    color: var(--blue-700);
}
.eraldis-pick-btn svg {
    transition: transform var(--t-base) var(--ease);
}
.eraldis-pick-btn:hover svg {
    transform: rotate(90deg);
}

/* Eraldis bottom sheet */
.eraldis-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 21, 61, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s var(--ease);
}
.eraldis-sheet-overlay.open { opacity: 1; }
.eraldis-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 48px rgba(7, 21, 61, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s var(--ease-out);
    overflow: hidden;
}
.eraldis-sheet-overlay.open .eraldis-sheet { transform: translateY(0); }
.eraldis-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--hair);
    flex-shrink: 0;
}
.eraldis-sheet-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-2);
    margin: 0;
    letter-spacing: -0.01em;
}
.eraldis-sheet-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--ink-4);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    transition: all var(--t-fast) var(--ease);
}
.eraldis-sheet-close:hover { background: var(--paper-2); color: var(--ink-2); }
.eraldis-sheet-list {
    overflow-y: auto;
    padding: 6px;
    flex: 1;
}
.eraldis-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r);
    text-align: left;
    cursor: pointer;
    font-family: var(--ff-sans);
    color: var(--ink-2);
    transition: all var(--t-fast) var(--ease);
}
.eraldis-sheet-item:hover,
.eraldis-sheet-item:focus {
    background: var(--paper-2);
    border-color: var(--hair);
    outline: none;
}
.eraldis-sheet-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--paper-3);
}
.eraldis-sheet-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.eraldis-sheet-nr {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-700);
    font-family: var(--ff-mono);
    letter-spacing: 0;
}
.eraldis-sheet-meta {
    font-size: 13px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.eraldis-sheet-sub {
    font-size: 12.5px;
    color: var(--ink-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--ff-mono);
    letter-spacing: 0;
}
.eraldis-sheet-arrow {
    font-size: 18px;
    color: var(--ink-5);
    flex-shrink: 0;
    line-height: 1;
}
@media (min-width: 641px) {
    .eraldis-sheet-overlay { align-items: center; padding: 16px; }
    .eraldis-sheet {
        border-radius: var(--r-xl);
        max-height: 70vh;
    }
}

/* ═══ TABLES ════════════════════════════════════════════════════════════════ */
#card-mets details {
    margin-top: 12px;
    padding-top: 12px;
}
#card-mets details > summary {
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--blue-700);
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 4px 0;
    letter-spacing: -0.005em;
}
#card-mets details > summary::-webkit-details-marker { display: none; }
#card-mets details > summary::before {
    content: "";
    display: inline-block;
    width: 10px; height: 10px;
    background: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
    transition: transform var(--t-base) var(--ease);
}
#card-mets details[open] > summary::before { transform: rotate(90deg); }
#card-mets details > summary .pill {
    background: var(--ink);
    color: var(--white);
    padding: 2px 7px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-family: var(--ff-mono);
    font-weight: 500;
}
#card-mets details > summary .total {
    color: var(--success);
    font-family: var(--ff-mono);
    font-weight: 500;
    font-size: 12px;
}
#card-mets details table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 8px;
}
#card-mets details table th,
#card-mets details table td {
    padding: 6px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
}
#card-mets details table th {
    text-align: left;
    color: var(--ink-4);
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.005em;
    font-size: 11px;
}
#card-mets details table td {
    font-family: var(--ff-mono);
    font-weight: 500;
    color: var(--ink-2);
    font-size: 11.5px;
}
#card-mets details table tr:last-child td { border-bottom: none; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--paper-3);
}
th {
    color: var(--ink-4);
    font-weight: 600;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--paper-2);
    font-family: var(--ff-sans);
}
tr:hover td { background: var(--paper); }
td strong { font-weight: 600; color: var(--ink-2); }
td { font-family: var(--ff-mono); color: var(--ink-3); font-size: 12px; }
td a { color: var(--blue-700); font-family: var(--ff-sans); font-weight: 500; }

/* ═══ TOETUSED ══════════════════════════════════════════════════════════════ */
.toetus-list-scroll {
    max-height: 720px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background:
        linear-gradient(var(--white) 30%, rgba(255, 255, 255, 0)) center top,
        linear-gradient(rgba(255, 255, 255, 0), var(--white) 70%) center bottom,
        radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) center top,
        radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) center bottom;
    background-repeat: no-repeat;
    background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
    background-attachment: local, local, scroll, scroll;
}
.toetus-list { display: flex; flex-direction: column; gap: 10px; }
.toetus-card {
    border: 1px solid var(--hair);
    border-radius: var(--r);
    padding: 18px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    overflow: hidden;
}
.toetus-card:hover { box-shadow: var(--sh-2); border-color: var(--hair-2); }
.toetus-likely {
    border-color: #a7f3d0;
    border-left: 3px solid var(--success);
}
.toetus-check {
    border-color: #fde68a;
    border-left: 3px solid var(--warn);
}
.toetus-ineligible {
    background: var(--paper);
    border-left: 3px solid var(--ink-5);
}

.toetus-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
}
.toetus-title {
    color: var(--ink-1);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}
.toetus-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    max-width: none;
}
.toetus-eligibility-badge,
.toetus-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    padding: 4px 9px;
    border-radius: var(--r-full);
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}
.toetus-eligibility-likely { background: var(--success-bg); color: var(--success); }
.toetus-eligibility-check { background: var(--warn-bg); color: var(--warn); }
.toetus-eligibility-ineligible { background: var(--paper-3); color: var(--ink-3); }
.toetus-badge-open { background: var(--success); color: #fff; }
.toetus-badge-year-round { background: var(--blue-700); color: #fff; }
.toetus-badge-upcoming {
    background: var(--warn);
    color: #fff;
}
.toetus-badge-awaiting { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }
.toetus-badge-closed { background: var(--paper-3); color: var(--ink-3); }

.toetus-cat {
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-4);
    line-height: 1.45;
}
.toetus-desc {
    color: var(--ink-3);
    font-size: 14.5px;
    margin: 0;
    line-height: 1.55;
    max-width: 78ch;
}

.toetus-reason {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--paper-2);
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.5;
}
.toetus-likely .toetus-reason {
    background: var(--success-bg);
    color: #065f46;
}
.toetus-check .toetus-reason {
    background: var(--warn-bg);
    color: #92400e;
}
.toetus-reason strong { color: inherit; font-size: 13px; }

.toetus-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
.toetus-facts > div {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 4px;
    min-width: 0;
}
.toetus-facts > div + div { border-top: 1px solid var(--hair); }
.toetus-facts dt {
    margin: 0;
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.toetus-facts dd {
    margin: 0;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: normal;
}

.toetus-eraldised-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.toetus-eraldised-label {
    font-size: 13px;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    line-height: 1.4;
}
.toetus-eraldised-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.toetus-eraldis-row {
    padding: 9px 10px;
    border: 1px solid var(--hair);
    border-radius: var(--r-sm);
    background: var(--paper);
}
.toetus-eraldis-heading {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.toetus-eraldis-reason {
    margin-top: 3px;
    color: var(--ink-4);
    font-size: 13.5px;
    line-height: 1.5;
}
.toetus-more-matches summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.toetus-more-matches[open] summary { margin-bottom: 6px; }
.toetus-eraldised-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    font-size: 13px;
    color: var(--ink-4);
    line-height: 1.4;
}
.toetus-eraldised-ha {
    color: var(--ink-3);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.toetus-eraldised-filter {
    color: var(--ink-4);
}
.toetus-match-note {
    margin: 0;
    padding-left: 10px;
    border-left: 2px solid var(--blue-300);
    color: var(--ink-4);
    font-size: 13.5px;
    line-height: 1.5;
}

.toetus-verification {
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
.toetus-verification summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--ink-3);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.toetus-verification summary:focus-visible,
.toetus-cta:focus-visible,
.toetus-legal-link:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.toetus-verification-list {
    margin: 0 0 12px;
    padding-left: 20px;
    color: var(--ink-3);
    font-size: 14px;
    line-height: 1.55;
}
.toetus-verification-list li + li { margin-top: 3px; }

.toetus-footer {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-direction: column;
    gap: 10px;
}
.toetus-source-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--ink-4);
    font-size: 13px;
    line-height: 1.45;
}
.toetus-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-900);
    border-radius: var(--r-sm);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}
.toetus-cta:hover { background: var(--blue-100); }
.toetus-legal-link {
    align-self: flex-start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 600;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.toetus-disclaimer {
    margin: -4px 0 0;
    color: var(--ink-4);
    font-size: 13px;
    line-height: 1.5;
}

.toetus-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 9px 12px;
    border-left: 3px solid var(--success);
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--r-sm);
    font-size: 14px;
}
.toetus-group-heading > span,
.toetus-details-count {
    min-width: 28px;
    padding: 3px 8px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.toetus-group-heading > span { background: var(--success); color: #fff; }
.toetus-empty {
    margin: 0;
    padding: 14px 16px;
    border-left: 3px solid var(--blue-400);
    background: var(--blue-50);
    color: var(--ink-3);
    border-radius: var(--r-sm);
    font-size: 14px;
    line-height: 1.5;
}

.toetus-details {
    margin-top: 16px;
    border: 1px solid var(--hair);
    border-radius: var(--r);
    background: var(--white);
    overflow: hidden;
}
.toetus-details > .muted-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--paper);
}
.toetus-details > .muted-summary:hover { background: var(--paper-2); }
.toetus-details-label { color: var(--ink-3); }
.toetus-details-count { background: var(--ink-5); color: #fff; }
.toetus-details[open] > .toetus-list-ineligible { padding: 12px; border-top: 1px solid var(--hair); }


#kitsendused-info .kitsendused-scroll { overflow-x: visible; }
#kitsendused-info .kitsendused-table {
    display: block;
    width: 100%;
    border-collapse: collapse;
    font-size: var(--tier-3-table);
}
#kitsendused-info .kitsendused-table thead,
#kitsendused-info .kitsendused-table tbody,
#kitsendused-info .kitsendused-table tr {
    display: block;
}
#kitsendused-info .kitsendused-table tr {
    display: grid;
    grid-template-columns: minmax(90px, 0.9fr) minmax(120px, 1.5fr) 84px;
    align-items: center;
}
#kitsendused-info .kitsendused-table th,
#kitsendused-info .kitsendused-table td {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: var(--table-grid-pad-y, 6px) var(--table-grid-pad-x, 8px);
}
#kitsendused-info .kitsendused-table th {
    font-size: var(--tier-3-table);
    text-align: left;
    border-bottom: 1px solid var(--hair);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    background: var(--paper-2);
    color: var(--ink-4);
}
#kitsendused-info .kitsendused-table th:last-child { text-align: left; }
#kitsendused-info .kitsendused-table tbody tr {
    min-height: var(--table-grid-row-min, 30px);
    border-bottom: 1px solid var(--hair);
}
#kitsendused-info .kitsendused-table td:nth-child(1) { font-size: var(--tier-3-table); font-family: var(--ff-sans); }
#kitsendused-info .kitsendused-table td:nth-child(2) { font-size: var(--tier-3-table); line-height: 1.35; font-family: var(--ff-sans); color: var(--ink-3); }
#kitsendused-info .kitsendused-table td:nth-child(3) { text-align: left; }
#kitsendused-info .kitsendused-table td:nth-child(3) a { font-size: var(--tier-3-table); }
#kitsendused-info .kitsendused-table tr:hover td { background: var(--paper-2); }
/* ═══ INFO DROPDOWNS ═══════════════════════════════════════════════════════ */
.info-dd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 -10px 0 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ink-5);
    transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    vertical-align: middle;
    user-select: none;
}
.info-dd:hover { color: var(--blue-700); }
.info-dd:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -8px; border-radius: 50%; }
.info-dd.open { transform: rotate(180deg); color: var(--blue-700); }
.info-dd svg { width: 10px; height: 10px; }
.info-dd-text {
    display: none;
    flex: 1 0 100%;
    font-size: 14px;
    color: var(--ink-3);
    padding: 12px 14px;
    background: var(--paper-2);
    border-radius: var(--r-sm);
    border-left: 2px solid var(--blue-500);
    line-height: 1.5;
    font-weight: 400;
    position: static;
    width: 100%;
    box-shadow: none;
    margin-top: 6px;
    font-family: var(--ff-sans);
    letter-spacing: 0;
    overflow-wrap: break-word;
    word-break: normal;
}
.info-row:has(.info-dd-text.show) { flex-wrap: wrap; align-items: flex-start; }
.info-dd-text.show { display: block; }
.info-dd-text .dd-field { font-size: 14px; color: var(--ink-3); line-height: 1.55; }
.info-dd-text .dd-value {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--hair);
    font-size: 13.5px;
    color: var(--blue-700);
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: break-word;
    word-break: normal;
}

@media (max-width: 420px) {
    .estimate-range { font-size: 0.95rem; gap: 5px; }
    .estimate-breakdown { grid-template-columns: minmax(0, 1fr); }
    .estimate-breakdown > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
    .risk-row { align-items: flex-start; flex-wrap: wrap; }
    .risk-row .label,
    .risk-row .value { width: 100%; text-align: left; }
}

/* ═══ UTILITIES ════════════════════════════════════════════════════════════ */
.muted { color: var(--ink-4); font-size: 13.5px; font-style: italic; }
.hidden { display: none !important; }

/* ═══ CARD PLACEHOLDER (ühtne kõikidele sektsioonidele kuni otsing) ═══
   Struktuurne "preview" — näitab väljade nimesid, mida pärast otsingut
   täidetakse. Täidab kaardi pinna tihedalt, ei jäta tühja keskele
   tsentreeritud ikooni nagu varem. */
.card-placeholder {
    padding: 14px 0 8px;
    margin-top: 4px;
    color: var(--ink-3);
}
.ph-eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--ink-4);
    margin-bottom: 10px;
}
.ph-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.ph-list li {
    padding: 8px 0;
    font-size: 13.5px;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 36px;
}
.ph-list .ph-label {
    font-weight: 400;
    color: var(--ink-4);
    letter-spacing: -0.005em;
}
.ph-list .ph-slot {
    display: block;
    width: 70px;
    height: 7px;
    border-radius: 3.5px;
    background: linear-gradient(to right, var(--paper-2) 0%, var(--paper-3) 100%);
    flex-shrink: 0;
}

/* ═══ FOOTER ═══════════════════════════════════════════════════════════════ */
footer {
    text-align: center;
    padding: 20px 24px 32px;
    border-top: 1px solid var(--hair);
    margin-top: 24px;
    background: var(--white);
}
.footer-content { max-width: var(--max-w); margin: 0 auto; }
.footer-brand {
    font-family: var(--ff-sans);
    font-size: 16px;
    color: var(--ink-2);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
    font-weight: 400;
}
.footer-sources { color: var(--ink-4); font-size: 13px; font-family: var(--ff-mono); letter-spacing: 0.02em; }

/* ═══ LEAFLET OVERRIDES ═══════════════════════════════════════════════════ */
.leaflet-bar,
.leaflet-bar a,
.leaflet-bar a:hover { background: transparent !important; border: none !important; box-shadow: none !important; }
.leaflet-bar { box-shadow: var(--sh-2) !important; border-radius: var(--r) !important; overflow: hidden; }
.leaflet-control-zoom a {
    background: var(--white) !important;
    color: var(--ink-2) !important;
    border: 1px solid var(--hair) !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 42px !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    margin: 0 !important;
    transition: all var(--t-fast) var(--ease);
}
.leaflet-control-zoom a:first-child { border-radius: var(--r) var(--r) 0 0 !important; border-bottom: 1px solid var(--hair) !important; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 var(--r) var(--r) !important; }
.leaflet-control-zoom a:hover { background: var(--blue-50) !important; color: var(--blue-700) !important; }
/* ═══ ATTRIBUTION: collapse by default ═══
   Esri ja Maa-ameti atribuudid on juriidiliselt nõutavad (Esri ToS +
   CC-BY 4.0). Kuvame nad kokkupanduna — väike "i" ikoon, hover/klõpsuga
   avaneb täistekst. "Leaflet" prefiksi kustutame (pole nõutav). */
.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--r) !important;
    border: 1px solid var(--hair) !important;
    box-shadow: var(--sh-1) !important;
    font-family: var(--ff-sans) !important;
    font-size: 10.5px !important;
    line-height: 1.4 !important;
    color: var(--ink-3) !important;
    padding: 3px 6px !important;
    margin: 0 6px 6px 0 !important;
    max-width: 26px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: max-width 0.18s var(--ease), background 0.15s;
    user-select: none;
}
.leaflet-control-attribution::before {
    content: "i";
    display: inline-block;
    font-style: italic;
    font-weight: 600;
    font-size: 11px;
    color: var(--ink-2);
    font-family: var(--ff-serif);
}
.leaflet-control-attribution a {
    display: none;
    color: var(--ink-2) !important;
    text-decoration: none !important;
}
.leaflet-control-attribution a:hover { text-decoration: underline !important; }
.leaflet-control-attribution:hover,
.leaflet-control-attribution:focus,
.leaflet-control-attribution:focus-within {
    max-width: min(720px, 90vw);
    padding: 6px 10px !important;
    background: rgba(255, 255, 255, 0.97) !important;
    white-space: normal;
    text-overflow: clip;
    cursor: auto;
}
.leaflet-control-attribution:hover::before,
.leaflet-control-attribution:focus::before,
.leaflet-control-attribution:focus-within::before {
    display: none;
}
.leaflet-control-attribution:hover a,
.leaflet-control-attribution:focus a,
.leaflet-control-attribution:focus-within a {
    display: inline;
}
@media (max-width: 640px) {
    .leaflet-control-attribution { font-size: 10px !important; }
    .leaflet-control-zoom { display: none !important; }
}

.leaflet-control-layers {
    border-radius: var(--r) !important;
    box-shadow: var(--sh-2) !important;
    border: 1px solid var(--hair) !important;
    background: var(--white) !important;
    font-family: var(--ff-sans) !important;
    font-size: 12px !important;
}
.leaflet-control-layers-expanded { padding: 10px 12px !important; }
.leaflet-popup-content-wrapper {
    border-radius: var(--r) !important;
    box-shadow: var(--sh-4) !important;
    font-family: var(--ff-sans) !important;
    border: 1px solid var(--hair);
}
.leaflet-popup-content { margin: 12px 14px !important; font-size: 14px !important; line-height: 1.5 !important; }
.leaflet-popup-tip { box-shadow: var(--sh-1) !important; }
.leaflet-tooltip {
    background: var(--ink) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    font-weight: 500;
    font-family: var(--ff-sans) !important;
    box-shadow: var(--sh-2) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.leaflet-tooltip::before { border-top-color: var(--ink) !important; }

.eraldis-label-wrap {
    background: transparent !important;
    border: none !important;
    pointer-events: none;
}
.eraldis-label {
    transform: translate(-50%, -50%);
    min-width: 24px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.84);
    color: var(--white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
}

/* Custom map markers */
.custom-marker { cursor: pointer; }

/* ═══ ERALDISED EXPANDED PANEL ═══ */
.eraldised-panel { padding: 0; overflow-x: auto;
    /* Visible thin scrollbar on overflow so user knows they can scroll
       (macOS hides scrollbars by default which made the value column
       look cut off). */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.25) transparent;
}
.eraldised-panel::-webkit-scrollbar { height: 8px; }
.eraldised-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.25); border-radius: 4px; }
.eraldised-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.4); }
.eraldised-panel > summary.table-panel-summary::-webkit-details-marker { display: none; }
.eraldised-panel > summary.table-panel-summary::marker { content: ""; }
#card-mets .eraldised-panel > summary.table-panel-summary,
.eraldised-panel > summary.table-panel-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink-2);
    cursor: pointer;
    list-style: none;
    letter-spacing: -0.005em;
}
.eraldised-panel > summary.table-panel-summary::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='currentColor' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
    transition: transform var(--t-base) var(--ease);
}
.eraldised-panel[open] > summary.table-panel-summary::before { transform: rotate(90deg); }
.table-panel-count {
    background: var(--blue-700);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    line-height: 1.35;
}
.table-panel > .eraldised-controls {
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--hair);
    background: var(--white);
}
.table-panel-count-line {
    padding: 10px 16px 4px;
    font-size: 0.875rem;
    color: var(--ink-4);
}
.table-panel {
    --table-grid-pad-y: 6px;
    --table-grid-pad-x: 8px;
    --table-grid-row-min: 30px;
}
.eraldised-filters {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px;
    background: var(--paper-2);
}
.eraldised-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.eraldised-filter-label { font-size: 11px; color: var(--ink-4); font-weight: 500; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-chip {
    padding: 3px 10px; border-radius: var(--r-full); font-size: 11px; cursor: pointer;
    border: 1px solid var(--hair); background: white; transition: all 0.15s;
    font-family: var(--ff-sans); user-select: none;
}
.filter-chip:hover { border-color: var(--blue-400); }
.filter-chip.active { background: var(--blue-700); color: white; border-color: var(--blue-700); }
.filter-chip-disabled { opacity: 0.3; pointer-events: none; }
.filter-range { display: flex; align-items: center; gap: 4px; }
.filter-range input {
    width: 60px; padding: 4px 8px; border: 1px solid var(--hair); border-radius: var(--r-sm);
    font-size: 12px; font-family: var(--ff-sans); background: white;
}
.filter-range input:focus { border-color: var(--blue-500); outline: none; }
.filter-range-sep { color: var(--ink-4); font-size: 11px; }
.eraldised-controls {
    display: flex; align-items: center; gap: 8px; padding: 8px 0 10px;
    font-size: 13.5px; color: var(--ink-4);
    flex-wrap: wrap;
}
.eraldised-controls button {
    padding: 5px 12px; border-radius: var(--r-full); border: 1px solid var(--hair);
    background: white; cursor: pointer; font-size: 13px; font-family: var(--ff-sans);
    transition: all 0.15s; min-height: 32px;
}
.eraldised-controls button:hover { border-color: var(--blue-400); }
.eraldised-controls button.active { background: var(--blue-700); color: white; border-color: var(--blue-700); }
.table-grid-header {
    display: grid;
    padding: var(--table-grid-pad-y, 6px) var(--table-grid-pad-x, 6px);
    font-size: var(--tier-3-table); color: var(--ink-4);
    font-weight: 500;
    align-items: center;
    column-gap: 8px;
}
.table-grid-row {
    display: grid;
    padding: var(--table-grid-pad-y, 6px) var(--table-grid-pad-x, 6px);
    font-size: var(--tier-3-table);
    align-items: center; transition: background 0.1s;
    min-height: var(--table-grid-row-min, 30px);
    column-gap: 8px;
}
.eraldised-table-header,
.eraldised-row {
    grid-template-columns: minmax(0, 1fr) minmax(124px, auto);
}
.teatised-table-header,
.teatised-row {
    grid-template-columns: minmax(72px, 1.05fr) 84px minmax(80px, 0.95fr) minmax(80px, 0.95fr) 60px;
}
.kitsendused-table-header,
.kitsendused-row {
    grid-template-columns: minmax(0, 1fr) 84px;
}
.table-grid-header > *,
.table-grid-row > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-grid-row:hover { background: var(--paper-2); }
.table-grid-hscroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.table-grid-scroll {
    max-height: calc(var(--table-grid-row-min, 30px) * 15);
    overflow-y: auto;
    overflow-x: visible;
    overscroll-behavior-y: contain;
    /* CSS-only scroll shadow: fades in/out purely from scroll position. */
    background:
        linear-gradient(var(--white) 30%, rgba(255, 255, 255, 0)) center top,
        linear-gradient(rgba(255, 255, 255, 0), var(--white) 70%) center bottom,
        radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) center top,
        radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) center bottom;
    background-repeat: no-repeat;
    background-size: 100% 24px, 100% 24px, 100% 10px, 100% 10px;
    background-attachment: local, local, scroll, scroll;
}
.eraldised-row .er-number { color: var(--ink-2); font-weight: 650; }
.eraldised-row .er-species { font-weight: 500; }
.eraldised-row .er-stand-summary { min-width: 0; overflow: visible; white-space: normal; }
.er-stand-heading { display: flex; align-items: baseline; gap: 8px; }
.er-stand-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; color: var(--ink-4); font-size: 10px; line-height: 1.35; }
.eraldised-row .er-inventory,
.teatised-type span {
    display: block;
    margin-top: 2px;
    color: var(--ink-4);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.25;
}
.teatised-type { white-space: normal; line-height: 1.25; }
.clearcut-period { max-width: 58%; text-align: right; white-space: normal; }
.eraldised-row .er-value { font-weight: 700; color: var(--ink); font-family: var(--ff-mono); text-align: right; font-size: 0.92em; white-space: nowrap; }
.er-value-range { white-space: nowrap; }
.er-value small,
.map-stand-scenario small { display: block; margin-top: 2px; color: var(--ink-4); font-family: var(--ff-sans); font-size: 10px; font-weight: 500; white-space: nowrap; }
.map-stand-scenario { color: var(--ink); font-family: var(--ff-mono); font-size: 15px; font-weight: 800; line-height: 1.35; }
.teatised-eraldis {
    font-weight: 600;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.teatised-eraldis-nr {
    display: inline-block;
    cursor: help;
}
.teatised-table-header > *:nth-child(n+4),
.teatised-row > *:nth-child(n+4) {
    text-align: right;
}
.kitsendused-table-header > *:last-child,
.kitsendused-row > *:last-child {
    text-align: left;
}
.kitsendused-row strong { font-weight: 600; color: var(--ink-2); }
.kitsendused-desc-toggle {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.kitsendused-desc-toggle:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 3px;
    border-radius: 2px;
}
.kitsendused-row.has-kitsendused-desc {
    position: relative;
    overflow: visible;
}
.kitsendused-row.has-kitsendused-desc:hover,
.kitsendused-row.has-kitsendused-desc:focus,
.kitsendused-row.has-kitsendused-desc:focus-within,
.kitsendused-row.has-kitsendused-desc.show-kitsendused-desc {
    z-index: 40;
}
.kitsendused-desc-mark {
    display: inline-block;
    margin-left: 3px;
    color: var(--blue-700);
    font-weight: 800;
    line-height: 1;
}
.kitsendused-row.has-kitsendused-desc::before,
.kitsendused-row.has-kitsendused-desc::after {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    z-index: 35;
    transition: opacity 0.12s var(--ease) 0.35s, transform 0.12s var(--ease) 0.35s, visibility 0s linear 0.47s;
}
.kitsendused-row.has-kitsendused-desc::before {
    content: "";
    top: calc(100% + 2px);
    left: 22px;
    transform: translateY(-2px);
    border: 5px solid transparent;
    border-bottom-color: var(--ink);
}
.kitsendused-row.has-kitsendused-desc::after {
    content: attr(data-description);
    top: calc(100% + 12px);
    left: 8px;
    transform: translateY(-2px);
    width: max-content;
    max-width: min(360px, calc(100vw - 48px));
    padding: 7px 9px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--white);
    box-shadow: var(--sh-2);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}
.kitsendused-row.has-kitsendused-desc:hover::before,
.kitsendused-row.has-kitsendused-desc:hover::after,
.kitsendused-row.has-kitsendused-desc:focus::before,
.kitsendused-row.has-kitsendused-desc:focus::after,
.kitsendused-row.has-kitsendused-desc:focus-within::before,
.kitsendused-row.has-kitsendused-desc:focus-within::after,
.kitsendused-row.has-kitsendused-desc.show-kitsendused-desc::before,
.kitsendused-row.has-kitsendused-desc.show-kitsendused-desc::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.35s, 0.35s, 0s;
}
.kitsendused-row.has-kitsendused-desc.show-kitsendused-desc::before,
.kitsendused-row.has-kitsendused-desc.show-kitsendused-desc::after {
    transition-delay: 0s;
}
.kitsendused-row .kitsendused-link a { font-size: var(--tier-3-table); }
.eraldised-empty { padding: 24px 16px; text-align: center; color: var(--ink-4); font-size: 11px; }
/* Expanded card when eraldised details is open */
.metric-card:has(.eraldised-expand[open]) {
    grid-column: 1 / -1 !important;
    transition: grid-column 0.3s ease;
}

/* ═══ DROPDOWN FILTER ═══ */
.filter-dropdown { position: relative; }
.filter-dropdown-trigger {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid var(--hair); border-radius: var(--r-sm);
    background: white; cursor: pointer; font-size: 12px; font-family: var(--ff-sans);
    transition: all 0.15s; user-select: none; white-space: nowrap;
}
.filter-dropdown-trigger:hover { border-color: var(--hair-2); }
.filter-dropdown.open .filter-dropdown-trigger { border-color: var(--blue-500); }
.filter-arrow { font-size: 9px; transition: transform 0.2s; color: var(--ink-4); }
.filter-dropdown.open .filter-arrow { transform: rotate(180deg); }
.filter-dropdown-menu {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    background: white; border: 1px solid var(--hair); border-radius: var(--r-sm);
    box-shadow: var(--sh-4); z-index: 100; min-width: 180px; max-width: 280px;
    max-height: 240px; overflow-y: auto; padding: 4px 0;
}
.filter-dropdown.open .filter-dropdown-menu { display: block; }
.filter-dropdown-menu label {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; font-size: 12px; cursor: pointer; transition: background 0.1s;
}
.filter-dropdown-menu label:hover { background: var(--paper-2); }
.filter-dropdown-menu input[type="checkbox"] {
    width: 14px; height: 14px; accent-color: var(--blue-700); cursor: pointer;
}
.filter-dropdown-menu .filter-option-disabled { opacity: 0.3; pointer-events: none; }
.filter-dropdown-menu .filter-count { font-size: 10px; color: var(--ink-4); margin-left: auto; }
.filter-dropdown-selected {
    font-size: 11px; color: var(--ink-4); padding: 2px 6px;
    background: var(--paper-2); border-radius: var(--r-full); margin-left: 2px;
}

/* Metsateatised staatus — värviline badge nagu toetuste puhul */
.teatised-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 1px 10px; border-radius: var(--r-full);
    font-size: var(--tier-3-table); font-weight: 700; line-height: 1.15;
    letter-spacing: 0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.teatised-status::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.teatised-status.status-kehtiv { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.teatised-status.status-registreeritud { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
.teatised-status.status-closed,
.teatised-status.status-kehtetu { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.teatised-status.status-muud { color: #4b5563; background: #f3f4f6; border: 1px solid #e5e7eb; }

/* ═══ RESPONSIVE ════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .facts-strip { grid-template-columns: repeat(2, 1fr); }
    /* Trees: medium on tablets, pushed further outside than desktop. */
    .hero-tree--left-1  { left: 0;    bottom: 0;   height: 44vh; }
    .hero-tree--left-2  { left: -6vw; bottom: 28vh; height: 36vh; }
    .hero-tree--left-3  { left: -6vw; bottom: 50vh; height: 30vh; }
    .hero-tree--right-1 { right: 0;   bottom: 0;   height: 42vh; }
    .hero-tree--right-2 { right: -6vw; bottom: 28vh; height: 34vh; }
    .hero-tree--right-3 { right: -6vw; bottom: 50vh; height: 28vh; }
    .landing::after { height: 18vh; }
    .hero-tree::after { width: 420px; height: 120px; }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
    :root { --nav-h: 56px; }
    .hero { padding: 0 12px; gap: 8px; }
    .brand-name { font-size: 19px; }
    .brand-tag { display: none; }
    .nav-center { display: none; }
    .search-box { max-width: none; }
    .nav-right { gap: 8px; }
    /* Hamburger menüü — ainus viis jõuda Meist/Allikad/Kontakt/Tagasiside lehele */
    .hamburger { display: inline-flex !important; }
    .dashboard { padding: 16px 14px 80px; gap: 18px; }
    #map { height: 420px; }
    .section-head h2 { font-size: 24px; }
    /* Trees: hidden on phone / small tablet — desktop keeps the full forest. */
    .hero-trees { display: none; }
}

@container (max-width: 420px) {
    .asset-trust-strip { display: grid; gap: 6px; }
    .asset-trust-strip p { max-width: none; text-align: left; }
    .asset-passport summary { grid-template-columns: minmax(0, 1fr) 16px; }
    .asset-passport-value { grid-column: 1; grid-row: 2; justify-items: start; text-align: left; }
    .asset-passport-toggle { grid-column: 2; grid-row: 1 / span 2; }
    .asset-passport-body dl > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Phone */
@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .hero { padding: 0 10px; height: 56px; }
    .nav-left { gap: 6px; }
    .nav-center { display: none; }
    .brand-name { font-size: 17px; letter-spacing: -0.015em; }
    .brand-tag { display: none; }
    .search-box {
        flex: 1;
        height: 48px;
        padding: 2px 2px 2px 12px;
        border-radius: var(--r-full);
        min-width: 0;
        max-width: none;
        width: auto;
        margin-left: auto;
    }
    .search-box input { font-size: 15px; padding: 0 8px; min-width: 0; }
    .search-icon { display: none; }
    .hero .search-box button { border-radius: 50%; }
    .hero .search-box button svg { width: 16px; height: 16px; }
    .search-kbd { display: none !important; }

    .dashboard {
        padding: 12px 0 100px;
        gap: 16px;
    }
    .dashboard > * {
        padding-left: 6px;
        padding-right: 6px;
    }

    .landing {
        padding: 36px 16px 28px;
        min-height: 560px;
    }
    .landing::after { height: 8vh; }
    .landing-title { font-size: 38px; line-height: 1.04; }
    .landing-sub { font-size: 15px; line-height: 1.5; margin-bottom: 20px; }
    .landing-search .search-box { height: 52px; padding: 0 4px 0 14px; }
    .landing-search .search-box input { font-size: 16px; padding: 0 10px; }
    .landing-search .search-box button { width: 44px; height: 44px; }
    .landing-search .search-box button svg { width: 16px; height: 16px; }
    .landing-hints { gap: 6px; margin-top: 10px; }
    .landing-hint { min-height: 44px; font-size: 13.5px; padding: 6px 10px; gap: 4px; }
    .landing-hint .kbd { font-size: 10px; padding: 0px 5px; }
    .landing-search .search-icon { display: flex; }
    .landing-search .search-icon svg { width: 18px; height: 18px; }
    .landing-meta { gap: 12px; margin-top: 24px; }
    .landing-meta-num { font-size: 22px; }
    .landing-meta-label { font-size: 11px; letter-spacing: 0.04em; }
    .landing-eyebrow { font-size: 11.5px; padding: 3px 9px 3px 8px; gap: 4px; margin-bottom: 12px; letter-spacing: 0.01em; }
    .landing-eyebrow .dot { width: 5px; height: 5px; box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.18); }

    .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .section-head h2 { font-size: 24px; }
    .section-head .section-meta { font-size: 12px; }

    .facts-strip { grid-template-columns: repeat(2, 1fr); gap: 0; }
    .fact { padding: 14px 14px; }
    .fact-value { font-size: 19px; }
    .fact-label { font-size: 11px; }

    .metric-card { grid-column: span 1 !important; padding: 16px 16px 14px; border-radius: var(--r-sm); }
    .card-icon { width: 30px; height: 30px; border-radius: 7px; }
    .card-icon svg { width: 14px; height: 14px; }

    .card-placeholder { padding: 12px 0 8px; }
    .ph-eyebrow { font-size: 10px; margin-bottom: 8px; }
    .ph-list li { padding: 8px 0; min-height: 32px; font-size: 13px; }
    .ph-list .ph-slot { width: 56px; height: 6px; }
    .table-panel,
    #kitsendused-info {
        --table-grid-pad-y: 5px;
        --table-grid-pad-x: 6px;
        --table-grid-gap: 10px;
    }
    /* Mobile only: wider column gaps so values don't read as overlapping,
       and let the header/rows grow to their full content width so the table
       scrolls sideways (within its own .table-grid-hscroll wrapper) instead
       of clipping the rightmost column or squeezing columns together. */
    .table-grid-header,
    .table-grid-row {
        column-gap: var(--table-grid-gap, 10px);
    }
    .table-grid-header,
    .table-grid-scroll {
        width: max-content;
        min-width: 100%;
    }
    .table-grid-scroll { overflow-x: visible; }

    .eraldised-table-header,
    .eraldised-row {
        grid-template-columns: minmax(0, 1fr) minmax(124px, auto);
    }
    .eraldised-table-header,
    .eraldised-table-panel .table-grid-scroll {
        width: 100%;
        min-width: 0;
    }
    .eraldised-table-panel .table-grid-hscroll { overflow-x: visible; }
    .teatised-table-header,
    .teatised-row {
        grid-template-columns: minmax(64px, 1fr) 44px minmax(70px, 0.95fr) minmax(68px, 0.95fr) 48px;
    }
    .teatised-table-header { display: none; }
    .teatised-panel .table-grid-hscroll { overflow-x: visible; }
    .teatised-panel .table-grid-scroll {
        width: 100%;
        min-width: 0;
        max-height: 520px;
        background: none;
    }
    .teatised-row {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
        padding: 12px 8px;
        border-bottom: 1px solid var(--hair);
        align-items: start;
    }
    .teatised-row > div {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        overflow: visible;
        white-space: normal;
        text-align: left !important;
    }
    .teatised-row > div::before {
        content: attr(data-label);
        color: var(--ink-4);
        font-size: 11px;
        font-weight: 600;
    }
    .teatised-row .teatised-type-value { grid-column: 2; }
    .teatised-row .teatised-type span { margin-top: 0; }
    .teatised-row .teatised-eraldis-prefix { display: none; }
    .kitsendused-table-header,
    .kitsendused-row {
        grid-template-columns: minmax(120px, 1fr) 72px;
    }
    #kitsendused-info .kitsendused-table tr {
        grid-template-columns: minmax(70px, 0.9fr) minmax(104px, 1.45fr) 72px;
    }

    .info-row { padding: 10px 0; }
    .big-number { font-size: 32px; }
    .big-number .unit { font-size: 14px; }
    .value-block { padding: 12px 14px 10px; }
    .value-block-label { font-size: 12px; }
    .value-block .sub { font-size: 13px; }
    .value-block .row { font-size: 13.5px; gap: 12px; flex-wrap: wrap; }
    .callout-label { font-size: 12px; }
    .callout-value { font-size: 1.75rem; }

    #map { height: clamp(380px, 60vh, 560px); }
    .map-hint {
        top: 66px;
        font-size: 12px;
        line-height: 1.1;
        padding: 2px 2px 2px 7px;
        gap: 2.5px;
        max-width: calc(100% - 16px);
        white-space: nowrap;
    }
    .map-hint svg { width: 10px; height: 10px; }
    .map-hint-close { width: 44px; height: 44px; font-size: 17px; }
    .map-controls { top: 8px; left: 8px; max-width: calc(100% - 16px); }
    .map-workspace { width: min(300px, calc(100vw - 16px)); max-height: none; }
    .map-workspace-opener { min-height: 48px; }
    .map-workspace-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        width: auto;
        max-height: 72vh;
        overflow: hidden;
        margin: 0;
        border-radius: 12px;
        box-shadow: 0 -12px 36px rgba(7, 21, 61, 0.2);
    }
    .map-workspace-panel-body { max-height: calc(72vh - 58px); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
    .map-view-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .ai-chat-section { border-radius: 8px; }
    .ai-chat-messages { max-height: 320px; padding: 12px 14px; }
    .ai-chat-header { padding: 12px 14px; }
    .ai-chat-header h2 { font-size: 13px; }
    .ai-chat-subtitle { font-size: 12.5px; }
    .ai-bubble { font-size: 13.5px; padding: 8px 12px; }
    .ai-hint { min-height: 44px; padding: 8px 12px; font-size: 12.5px; }
    .ai-chat-input-area { padding: 10px 12px 12px; }

    .error-msg {
        top: calc(var(--nav-h) + 8px);
    font-size: 14.5px;
        padding: 8px 12px 8px 10px;
    }
    .error-msg::before { width: 16px; height: 16px; font-size: 10px; }

    .loading { top: var(--nav-h); }
    .skeleton-map { height: 240px; }
    .skeleton-card { height: 80px; }

    footer { padding: 16px 16px 24px; }
    .footer-brand { font-size: 14px; }
    .footer-sources { font-size: 10.5px; }

    /* Sidebar becomes full-width sheet on phone */
    .sidebar { width: 100%; max-width: 360px; }
    .sidebar-header { padding: 16px 18px; }

    /* Toetused — mobile sizing tweaks */
    .toetus-list-scroll { max-height: none; overflow-y: visible; }
    .toetus-card { padding: 14px 14px 12px; gap: 9px; }
    .toetus-top { flex-direction: column; gap: 9px; }
    .toetus-badges { justify-content: flex-start; max-width: none; }
    .toetus-title { font-size: 15.5px; line-height: 1.3; }
    .toetus-cat { font-size: 12.5px; }
    .toetus-desc { font-size: 14px; line-height: 1.55; }
    .toetus-reason { font-size: 13.5px; line-height: 1.5; padding: 9px 10px; }
    .toetus-facts { grid-template-columns: 1fr; }
    .toetus-facts > div { padding: 9px 4px; }
    .toetus-facts > div + div { border-left: 0; border-top: 1px solid var(--hair); }
    .toetus-eraldised-list { grid-template-columns: 1fr; }
    .toetus-footer { align-items: stretch; flex-direction: column; }
    .toetus-source-meta { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
    .toetus-cta { min-height: 44px; font-size: 14.5px; }
    .toetus-badge,
    .toetus-eligibility-badge { font-size: 11.5px; padding: 4px 9px; }
    .toetus-details > .muted-summary { font-size: 14px; }
    .toetus-details-count { font-size: 12.5px; padding: 3px 9px; }

    /* Sobivad eraldised — mobile */
    .toetus-eraldised-label { font-size: 13px; }
    .toetus-eraldised-meta { font-size: 12.5px; }

    /* Metsateatised — mobile */
    .teatised-status { padding: 1px 9px; }

    /* ── Touch targets: bump everything that taps to ≥44px on mobile ── */
    .ai-chat-input-wrap input,
    .ai-chat-input-wrap textarea { min-height: 44px; padding: 10px 0; font-size: 15px; }
    .ai-chat-input-wrap button { width: 44px; height: 44px; }
    .search-box button { width: 44px; height: 44px; }
    .map-workspace-button,
    .map-workspace-close,
    .map-view-preset,
    .map-inline-retry { min-height: 44px; }
    .map-workspace-close,
    .map-inline-retry { min-width: 44px; }
}

/* Very small phones */
@media (max-width: 380px) {
    .facts-strip { grid-template-columns: 1fr 1fr; }
    .fact-value { font-size: 17px; }
    .landing-title { font-size: 30px; line-height: 1.05; }
    .landing-sub { font-size: 14px; }
    .landing::after { height: 6vh; }
    .big-number { font-size: 28px; }
    .brand-mark { display: inline-flex; align-items: center; }
    .brand-name { display: none; }
    .search-box { max-width: none; flex: 1; }
    .nav-right { flex: 1; min-width: 0; }
    .map-workspace { width: min(280px, calc(100vw - 16px)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print — minimal */
@media print {
    .hero, .sidebar, .ai-chat-section, .map-controls, footer { display: none; }
    body { background: #fff; }
}

/* ═══ Meist (About) section ═══ */
.about {
    position: relative;
    padding: 80px 0 80px;
    background: var(--paper-3);
    overflow: hidden;
}
.about-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}
@media (max-width: 768px) {
    .about { padding: 56px 0; }
    .about-inner { padding: 0 20px; }
}
.about-photo {
    position: relative;
    margin: 0 0 40px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 36px -12px rgba(7, 21, 61, 0.18);
    background: var(--blue-50);
    aspect-ratio: 16/9;
}
.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}
.about-photo-caption {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--white);
    text-shadow: 0 2px 12px rgba(7, 21, 61, 0.6);
    max-width: calc(100% - 40px);
}
.about-photo-caption-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.95);
    font-family: var(--ff-mono);
}
.about-photo-caption-names {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--white);
}
@media (max-width: 640px) {
    .about-photo-caption { left: 14px; bottom: 12px; }
    .about-photo-caption-title { font-size: 12.5px; }
    .about-photo-caption-names { font-size: 13.5px; }
}
.about-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--blue-200);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px -4px rgba(7, 21, 61, 0.3);
}
.about-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
    display: inline-block;
}
.about-title {
    font-size: clamp(26px, 3.6vw, 36px);
    line-height: 1.12;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    font-weight: 800;
}
.about-title em {
    font-style: italic;
    color: var(--blue-700);
    font-weight: 800;
}
.about-lead {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-3);
    margin: 0 0 28px;
    max-width: 760px;
}
.about-hackathon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 16px;
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    border-radius: 999px;
    color: var(--blue-900);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.about-hackathon-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue-700);
}
.about-hackathon-badge svg { width: 14px; height: 14px; flex-shrink: 0; }
@media (max-width: 640px) {
    .about-hackathon {
        margin-top: 4px;
        padding: 7px 11px;
        font-size: 11.5px;
    }
    .about-hackathon-badge { gap: 6px; }
    .about-hackathon-badge svg { width: 12px; height: 12px; }
}
.about-hackathon-title,
.about-hackathon-sub,
.about-hackathon-text { display: none; }
.about-stats,
.about-stat,
.about-stat-num,
.about-stat-label,
.about-team-heading,
.about-team,
.about-member,
.about-member-avatar,
.about-member-name,
.about-member-role,
.about-member-school,
.about-contact,
.about-contact-row,
.about-contact-icon,
.about-contact-email,
.about-contact-label,
.about-contact-note { display: none; }

/* ═══ Allikad (sources) section ═══ */
.sources {
    background: var(--paper-2);
    padding: 76px 32px 64px;
    border-top: 1px solid var(--hair);
    scroll-margin-top: 72px;
}
.sources-inner {
    max-width: 1180px;
    margin: 0 auto;
}
.sources-head {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
    column-gap: clamp(40px, 8vw, 112px);
    align-items: end;
    margin-bottom: 32px;
}
.sources-eyebrow {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.sources-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--blue-600);
    display: inline-block;
}
.sources-title {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.06;
    color: var(--ink);
    letter-spacing: -0.035em;
    margin: 0;
    font-weight: 800;
    max-width: 680px;
    text-wrap: balance;
}
.sources-sub {
    display: block;
    max-width: 54ch;
    margin: 0 0 3px;
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1.55;
}
.source-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: var(--blue-900);
    color: var(--white);
}
.source-flow-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.source-flow-number {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.source-flow-step strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.3;
}
.source-flow-step div > span {
    display: block;
    max-width: 48ch;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13.5px;
    line-height: 1.45;
}
.source-flow-step-result .source-flow-number {
    background: var(--blue-600);
    border-color: var(--blue-500);
    color: var(--white);
}
.source-flow-arrow {
    width: 48px;
    color: rgba(255, 255, 255, 0.38);
}
.sources-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: 16px;
}
.source-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 28px 30px 26px;
    border-bottom: 1px solid var(--hair);
}
.source-card:nth-child(odd) { border-right: 1px solid var(--hair); }
.source-card:nth-last-child(-n + 2) { border-bottom: 0; }
.source-card-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}
.source-card-number {
    padding-top: 3px;
    color: var(--ink-4);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.source-org {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue-700);
    margin-bottom: 5px;
}
.source-name {
    font-size: 19px;
    font-weight: 750;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.source-desc {
    max-width: 60ch;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
    margin: 0 0 18px;
}
.source-use {
    padding-top: 14px;
    margin-bottom: 18px;
    border-top: 1px solid var(--hair-2);
}
.source-use > span {
    display: block;
    margin-bottom: 4px;
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.source-use p {
    margin: 0;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.5;
}
.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: auto;
}
.source-link {
    align-self: flex-start;
    margin-top: auto;
    background: transparent;
    color: var(--blue-700);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.source-links .source-link { margin-top: 0; }
.source-link:hover { text-decoration: underline; }
.source-link:focus-visible,
.sources-secondary-links a:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 3px;
    border-radius: 2px;
}
.sources-secondary {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 40px;
    align-items: center;
    padding: 26px 30px;
    margin-top: 18px;
    border: 1px solid var(--hair);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
}
.sources-secondary-label {
    display: block;
    margin-bottom: 5px;
    color: var(--blue-700);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.sources-secondary h3 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.25;
}
.sources-secondary p {
    max-width: 54ch;
    margin: 0;
    color: var(--ink-3);
    font-size: 13.5px;
    line-height: 1.5;
}
.sources-secondary-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.sources-secondary-links a {
    padding: 8px 11px;
    border: 1px solid var(--hair);
    border-radius: 999px;
    background: var(--white);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.sources-secondary-links a:hover {
    border-color: var(--blue-300);
    color: var(--blue-700);
}
@media (max-width: 820px) {
    .sources-head { grid-template-columns: 1fr; }
    .sources-sub { margin-top: 18px; }
    .sources-secondary { grid-template-columns: 1fr; gap: 20px; }
    .sources-secondary-links { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .sources { padding: 56px 20px 48px; }
    .sources-title { font-size: clamp(29px, 9vw, 38px); }
    .source-flow { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
    .source-flow-arrow { transform: rotate(90deg); justify-self: start; margin-left: 26px; }
    .sources-grid { grid-template-columns: 1fr; }
    .source-card { padding: 24px 22px; border-right: 0 !important; border-bottom: 1px solid var(--hair) !important; }
    .source-card:last-child { border-bottom: 0 !important; }
    .sources-secondary { padding: 22px; }
}

/* ═══ KONTAKT ══════════════════════════════════════════════════════════ */
.contact {
    background: var(--white);
    padding: 80px 0;
    border-top: 1px solid var(--hair-2);
    text-align: center;
}
.contact-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 32px;
}
@media (max-width: 640px) {
    .contact { padding: 56px 0; }
    .contact-inner { padding: 0 20px; }
}
.contact-title {
    font-size: clamp(20px, 3vw, 30px);
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    font-weight: 800;
}
.contact-title em {
    font-style: italic;
    color: var(--blue-700);
    font-weight: 800;
}
.contact-lead {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-3);
    margin: 0 0 20px;
}
.contact-email {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-700);
    text-decoration: none;
    padding: 9px 18px;
    border: 1px solid var(--blue-200);
    border-radius: 999px;
    background: var(--blue-50);
    transition: all 0.2s ease;
    word-break: break-all;
}
.contact-email:hover {
    color: var(--white);
    background: var(--blue-700);
    border-color: var(--blue-700);
}
.contact-grid,
.contact-card,
.contact-card-primary,
.contact-card-icon,
.contact-card-icon svg,
.contact-card-label,
.contact-card-title,
.contact-card-cta,
.contact-card-cta svg { display: none; }

/* ═══ TAGASISIDE ══════════════════════════════════════════════════════════ */
.feedback {
    background: var(--paper);
    padding: 80px 0;
    border-top: 1px solid var(--hair-2);
    text-align: center;
}
.feedback-inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 32px;
}
@media (max-width: 640px) {
    .feedback { padding: 56px 0; }
    .feedback-inner { padding: 0 20px; }
}
.feedback-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px -4px rgba(7, 21, 61, 0.12);
}
.feedback-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--blue-600);
    display: inline-block;
}
.feedback-title {
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    font-weight: 800;
}
.feedback-title em {
    font-style: italic;
    color: var(--blue-700);
    font-weight: 800;
}
.feedback-lead {
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-3);
    margin: 0 0 32px;
}
.feedback-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.feedback-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    letter-spacing: -0.01em;
}
.feedback-label-optional {
    font-weight: 400;
    color: var(--ink-4);
}
.feedback-input,
.feedback-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-2);
    background: var(--white);
    border: 1px solid var(--hair);
    border-radius: var(--r);
    transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
    outline: none;
    font-family: var(--ff-sans);
}
.feedback-input:focus,
.feedback-textarea:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.feedback-input::placeholder,
.feedback-textarea::placeholder {
    color: var(--ink-5);
}
.feedback-textarea {
    resize: vertical;
    min-height: 100px;
}
.feedback-privacy {
    margin: -4px 0 0;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.5;
}
.feedback-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    background: var(--blue-700);
    border: none;
    border-radius: var(--r);
    cursor: pointer;
    transition: background var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
    align-self: flex-start;
}
.feedback-submit:hover {
    background: var(--blue-900);
}
.feedback-submit:active {
    transform: scale(0.98);
}
.feedback-submit:disabled {
    background: var(--ink-5);
    cursor: not-allowed;
    transform: none;
}
.feedback-submit-loader svg {
    animation: feedback-spin 0.8s linear infinite;
}
@keyframes feedback-spin {
    to { transform: rotate(360deg); }
}
.feedback-status {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}
.feedback-status-ok {
    color: var(--success);
}
.feedback-status-err {
    color: var(--danger);
}
