/* OpenCallbook — Palette 5 (lavender / brown / sage on dark plum) + light mode.
   DARK:  bg #0c0a10 · text #ece9f1 · primary #bdb1cd · secondary #c19868 · accent #b3c994
   LIGHT: bg #faf7fc · text #1a1620 · primary #6d5c89 · secondary #8a6440 · accent #5e7a3f
   Inter throughout, JetBrains Mono for callsigns. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
    /* ─── DARK (default) — lavender + brown + sage on dark plum ── */
    --bg:           #0c0a10;     /* dark plum near-black */
    --bg-2:         #131019;     /* subtle raised */
    --bg-3:         #1c1827;     /* hover band */
    --surface:      #161320;     /* card surface */
    --surface-2:    #1e1a2c;     /* hovered card */
    --line:         #2a2435;     /* hairline */
    --line-soft:    #3a3245;     /* stronger border */
    --line-strong:  #524863;

    --text:         #ece9f1;     /* warm off-white ink */
    --text-2:       #bcb4c4;
    --text-3:       #8e85a0;
    --text-faint:   #5d556e;

    /* PRIMARY: dusty lavender */
    --primary:      #bdb1cd;
    --primary-deep: #a99cbe;
    --primary-light:#d4cbe0;
    --primary-bg:   rgba(189, 177, 205, 0.14);
    --primary-bg-2: rgba(189, 177, 205, 0.26);
    --primary-bd:   rgba(189, 177, 205, 0.45);

    /* SECONDARY: warm brown — for emphasis, top-tier badges, highlights */
    --secondary:    #c19868;
    --secondary-bg: rgba(193, 152, 104, 0.16);
    --secondary-bd: rgba(193, 152, 104, 0.42);

    /* ACCENT: sage green — alive, growth, positive */
    --accent:       #b3c994;
    --accent-bg:    rgba(179, 201, 148, 0.16);
    --accent-bd:    rgba(179, 201, 148, 0.42);

    /* DANGER: terracotta — earthy warning tone (the 4th color this palette needs) */
    --danger:       #c47a5e;
    --danger-bg:    rgba(196, 122, 94, 0.16);
    --danger-bd:    rgba(196, 122, 94, 0.42);

    /* Aliases — keep older variable names working */
    --coral:        var(--danger);
    --coral-bg:     var(--danger-bg);
    --coral-bd:     var(--danger-bd);
    --buttercup:    var(--secondary);
    --buttercup-bg: var(--secondary-bg);
    --teal:         var(--accent);
    --teal-bg:      var(--accent-bg);
    --berry:        var(--danger);
    --berry-bg:     var(--danger-bg);
    --violet:       var(--primary);
    --violet-bg:    var(--primary-bg);
    --sage:         var(--accent);
    --sage-bg:      var(--accent-bg);

    /* Status / semantic */
    --success:      var(--accent);     /* sage = "active" */
    --success-bg:   var(--accent-bg);
    --success-bd:   var(--accent-bd);

    /* Class pill colors — earthy palette */
    --class-extra:    #c19868;                      /* warm brown — top tier */
    --class-extra-bg: rgba(193, 152, 104, 0.20);
    --class-adv:      #b08aa6;                      /* dusty rose lavender — premium */
    --class-adv-bg:   rgba(176, 138, 166, 0.18);
    --class-gen:      #bdb1cd;                      /* primary lavender */
    --class-gen-bg:   rgba(189, 177, 205, 0.18);
    --class-tech:     #b3c994;                      /* sage */
    --class-tech-bg:  rgba(179, 201, 148, 0.18);
    --class-novice:   #94a3b8;                      /* muted slate */
    --class-novice-bg: rgba(148, 163, 184, 0.14);
    --class-gmrs:     #d9a35a;                      /* warm amber — distinct from brown */
    --class-gmrs-bg:  rgba(217, 163, 90, 0.18);

    /* Type — Inter throughout, JetBrains Mono for callsigns/IDs */
    --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --font-display: "Inter", sans-serif;

    /* Geometry */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.30);
    --shadow:    0 1px 2px rgba(0,0,0,0.30), 0 8px 24px -8px rgba(0,0,0,0.50);
    --shadow-lg: 0 1px 2px rgba(0,0,0,0.30), 0 24px 48px -16px rgba(0,0,0,0.60);
    --tap: 44px;
}

/* ─── LIGHT mode override — same palette, deepened for AA contrast on cream ── */
[data-theme="light"] {
    --bg:           #faf7fc;     /* warm off-white, hint of lavender */
    --bg-2:         #f3eef7;
    --bg-3:         #ebe4f0;
    --surface:      #ffffff;
    --surface-2:    #f8f4fb;
    --line:         #e1d8ec;
    --line-soft:    #c8baD8;
    --line-strong:  #a89cbe;

    --text:         #1a1620;     /* deep plum near-black */
    --text-2:       #44404d;
    --text-3:       #6c6577;
    --text-faint:   #a098ad;

    --primary:      #6d5c89;     /* deeper lavender for light bg */
    --primary-deep: #4f4068;
    --primary-light:#8e7ea6;
    --primary-bg:   rgba(109, 92, 137, 0.10);
    --primary-bg-2: rgba(109, 92, 137, 0.18);
    --primary-bd:   rgba(109, 92, 137, 0.40);

    --secondary:    #8a6440;     /* richer brown for light bg */
    --secondary-bg: rgba(138, 100, 64, 0.12);
    --secondary-bd: rgba(138, 100, 64, 0.42);

    --accent:       #5e7a3f;     /* deeper sage for light bg */
    --accent-bg:    rgba(94, 122, 63, 0.12);
    --accent-bd:    rgba(94, 122, 63, 0.42);

    --danger:       #b56a52;     /* terracotta */
    --danger-bg:    rgba(181, 106, 82, 0.12);
    --danger-bd:    rgba(181, 106, 82, 0.42);

    --success:      var(--accent);
    --success-bg:   var(--accent-bg);
    --success-bd:   var(--accent-bd);

    --class-extra:    #8a6440;
    --class-extra-bg: rgba(138, 100, 64, 0.14);
    --class-adv:      #8d5e7e;
    --class-adv-bg:   rgba(141, 94, 126, 0.14);
    --class-gen:      #6d5c89;
    --class-gen-bg:   rgba(109, 92, 137, 0.12);
    --class-tech:     #5e7a3f;
    --class-tech-bg:  rgba(94, 122, 63, 0.14);
    --class-novice:   #6e6678;
    --class-novice-bg: rgba(110, 102, 120, 0.12);
    --class-gmrs:     #b8843a;
    --class-gmrs-bg:  rgba(184, 132, 58, 0.14);

    --shadow-sm: 0 1px 2px rgba(38, 28, 56, 0.06);
    --shadow:    0 1px 2px rgba(38, 28, 56, 0.06), 0 8px 24px -8px rgba(38, 28, 56, 0.12);
    --shadow-lg: 0 1px 2px rgba(38, 28, 56, 0.06), 0 24px 48px -16px rgba(38, 28, 56, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(ellipse 70% 40% at 100% 0%, rgba(189, 177, 205, 0.10), transparent 60%),
        radial-gradient(ellipse 50% 30% at 0% 50%, rgba(193, 152, 104, 0.06), transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(179, 201, 148, 0.05), transparent 60%);
    background-attachment: fixed;
}
[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 70% 40% at 100% 0%, rgba(109, 92, 137, 0.06), transparent 60%),
        radial-gradient(ellipse 50% 30% at 0% 50%, rgba(138, 100, 64, 0.04), transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(94, 122, 63, 0.04), transparent 60%);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }

select, input, button, textarea { font: inherit; color: inherit; }

/* skip link */
.skip {
    position: absolute;
    left: -9999px; top: 0;
    background: var(--primary);
    color: var(--bg);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; z-index: 100; }

/* ─── header ───────────────────────────────────────────── */
.header {
    background: rgba(12, 10, 16, 0.85);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}
[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.85);
}
.header__row {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    min-height: var(--tap);
    letter-spacing: -0.01em;
}
.brand__icon {
    width: 28px; height: 28px;
    color: var(--primary);
    flex-shrink: 0;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
    color: var(--text-2);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.nav a:hover { color: var(--primary); background: var(--primary-bg); }

@media (max-width: 700px) { .nav .nav__link { display: none; } }

.menu-btn {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    width: var(--tap); height: var(--tap);
    border-radius: var(--radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
@media (max-width: 700px) { .menu-btn { display: inline-flex; } }

/* ─── search-results pager ─────────────────────────────── */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 8px;
    flex-wrap: wrap;
}
.pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    min-height: 40px;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pager__btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--surface-2);
}
.pager__btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pager__page {
    color: var(--text-3);
    font-size: 13px;
    font-family: var(--font-mono);
    padding: 0 12px;
}

/* ─── mobile nav drawer (hamburger menu) ───────────────── */
@media (max-width: 700px) {
    .header__row { position: relative; }
    .nav {
        gap: 4px;
    }
    .nav .nav__link {
        display: none;
    }
    .nav.is-open .nav__link {
        display: flex;
    }
    .nav.is-open {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        padding: 8px;
        gap: 2px;
        z-index: 25;
    }
    .nav.is-open .nav__link {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: var(--radius-sm);
    }
    .nav.is-open .theme-toggle,
    .nav.is-open .menu-btn {
        align-self: flex-end;
    }
}
.menu-btn {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-2);
    width: var(--tap); height: var(--tap);
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.menu-btn:hover {
    color: var(--primary);
    border-color: var(--primary-bd);
}
.menu-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ─── view toggle (Compare page: Absolute / Per 100k) ──── */
.view-toggle {
    display: inline-flex;
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px;
    gap: 2px;
}
.view-toggle__btn {
    padding: 8px 16px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.view-toggle__btn:hover {
    color: var(--text);
    background: var(--bg-3);
}
.view-toggle__btn.is-active {
    background: var(--primary);
    color: var(--bg);
}
.view-toggle__btn.is-active:hover {
    background: var(--primary-deep);
    color: var(--bg);
}

/* ─── theme toggle ─────────────────────────────────────── */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-2);
    width: var(--tap); height: var(--tap);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary-bd);
    background: var(--surface-2);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.theme-toggle svg {
    position: absolute;
    transition: opacity 200ms ease, transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle__sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}
.theme-toggle__moon {
    opacity: 0;
    transform: rotate(40deg) scale(0.5);
}
[data-theme="light"] .theme-toggle__sun {
    opacity: 0;
    transform: rotate(-40deg) scale(0.5);
}
[data-theme="light"] .theme-toggle__moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ─── search-as-home page ──────────────────────────────── */
.search-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 80px;
}

.intro {
    text-align: center;
    padding: 32px 0 16px;
}
.intro h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(36px, 7vw, 60px);
    letter-spacing: -0.015em;
    line-height: 1.05;
    margin-bottom: 12px;
    color: var(--text);
}
.intro h1 em {
    font-style: italic;
    background: linear-gradient(110deg, var(--primary) 0%, var(--secondary) 65%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.intro__sub {
    color: var(--text-3);
    font-size: 15px;
}
.intro__sub strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* ─── search input ──────────────────────────────────────── */
.search {
    margin-top: 28px;
    position: relative;
}
.search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}
.search__input {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--line);
    color: var(--text);
    border-radius: var(--radius);
    padding: 16px 48px 16px 48px;
    font-size: 17px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: var(--shadow-sm);
}
.search__input:focus {
    border-color: var(--primary);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px var(--primary-bg);
}
.search__input::placeholder { color: var(--text-faint); }

.search__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-3);
    border: 0;
    color: var(--text-2);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}
.search__clear:hover { background: var(--coral); color: var(--bg); }
.search__clear:not([data-shown]) { display: none; }

/* ─── filter row ────────────────────────────────────────── */
.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 1.1fr));
    gap: 8px;
    margin-top: 12px;
}
@media (max-width: 1000px) {
    .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters__city { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .filters { grid-template-columns: 1fr 1fr; }
    .filters__city { grid-column: 1 / -1; }
}
.filter { position: relative; }
.filter__label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.filter select,
.filter input {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--line);
    color: var(--text);
    border-radius: var(--radius);
    padding: 12px 36px 12px 14px;
    font-size: 16px;
    height: var(--tap);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}
.filter input { padding-right: 14px; cursor: text; }
.filter select option { background: var(--surface); color: var(--text); }
.filter select:focus, .filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
    background: var(--surface-2);
}
.filter__chevron {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.filter--text .filter__chevron { display: none; }

.filter select.is-set,
.filter input.is-set {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--text);
    font-weight: 600;
}

/* ─── active-filters chips ───────────────────────────── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
    min-height: 20px;
}
.active-filters__label {
    font-size: 13px;
    color: var(--text-3);
    margin-right: 4px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary-bd);
    padding: 5px 4px 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.chip__x {
    background: var(--primary);
    border: 0;
    color: var(--bg);
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    text-decoration: none;
    font-weight: 700;
}
.chip__x:hover { background: var(--coral); color: var(--bg); }
.chip-clear {
    background: transparent;
    color: var(--text-3);
    border: 1px solid var(--line-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    margin-left: auto;
    height: 28px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.chip-clear:hover { color: var(--coral); border-color: var(--coral); }

/* ─── results header + sort ─────────────────────────────── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.results-count {
    font-size: 14px;
    color: var(--text-2);
}
.results-count strong {
    color: var(--coral);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 17px;
}
.results-took {
    color: var(--text-faint);
    font-size: 13px;
    margin-left: 6px;
    font-family: var(--font-mono);
}
.sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sort label {
    font-size: 13px;
    color: var(--text-3);
}
.sort select {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 28px 8px 10px;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2397a4be' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    height: 36px;
}

/* ─── result cards ─────────────────────────────────────── */
.results { margin-top: 8px; }
.result {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s, background 0.1s;
    min-height: 72px;
    box-shadow: var(--shadow-sm);
}
.result:hover, .result:focus-visible {
    border-color: var(--primary);
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    outline: none;
}
.result:active { transform: scale(0.995); }
.result__call {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
    color: var(--primary);
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.result:hover .result__call {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.result__name {
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    font-size: 15px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result__loc {
    font-size: 13px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

@media (max-width: 480px) {
    .result {
        grid-template-columns: auto 1fr;
        gap: 10px;
        padding: 12px;
    }
    .result__meta {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        margin-top: 2px;
    }
}

/* ─── pills (saturated, used confidently) ──────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    background: var(--bg-3);
    color: var(--text-2);
    border: 1px solid var(--line);
}
.pill--active     { color: var(--success);     background: var(--success-bg);    border-color: var(--success-bd); }
.pill--expired    { color: var(--text-3);      background: var(--bg-3); }
.pill--cancelled  { color: var(--text-faint); }
.pill--extra      { color: var(--class-extra);    background: var(--class-extra-bg);  border-color: rgba(129,140,248,0.4); }
.pill--advanced   { color: var(--class-adv);      background: var(--class-adv-bg); }
.pill--general    { color: var(--class-gen);      background: var(--class-gen-bg); }
.pill--technician { color: var(--class-tech);     background: var(--class-tech-bg); }
.pill--novice     { color: var(--class-novice);   background: var(--class-novice-bg); }
.pill--amateur    { color: var(--primary);        background: var(--primary-bg);     border-color: var(--primary-bd); }
.pill--gmrs       { color: var(--class-gmrs);     background: var(--class-gmrs-bg); }
.pill .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }

/* ─── empty state ───────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--surface);
    border: 1px dashed var(--line-soft);
    border-radius: var(--radius);
    margin-top: 16px;
}
.empty svg { color: var(--text-faint); margin-bottom: 12px; }
.empty h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.empty p {
    font-size: 14px;
    color: var(--text-3);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ─── home stats (when no query) ────────────────────────── */
.welcome {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 32px;
}
@media (max-width: 700px) { .welcome { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.04), transparent 60%);
    pointer-events: none;
}
.stat-card__label {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 600;
    position: relative;
}
.stat-card__value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    position: relative;
}
.stat-card--success .stat-card__value { color: var(--success); }
.stat-card--coral .stat-card__value   { color: var(--accent); }
.stat-card--buttercup .stat-card__value { color: var(--secondary); }
.stat-card:nth-child(1) .stat-card__value { color: var(--primary); }
.stat-card:nth-child(2) .stat-card__value { color: var(--success); }
.stat-card:nth-child(3) .stat-card__value { color: var(--secondary); }
.stat-card:nth-child(4) .stat-card__value { color: var(--accent); }
.stat-card__sub {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 4px;
    position: relative;
}

.shortcuts { margin-top: 32px; }
.shortcuts h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 12px;
    letter-spacing: -0.005em;
    color: var(--text);
}
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (max-width: 540px) { .shortcut-grid { grid-template-columns: 1fr; } }
.shortcut {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap);
    transition: border-color 0.1s, box-shadow 0.1s, transform 0.1s, background 0.1s;
    box-shadow: var(--shadow-sm);
}
.shortcut:hover {
    border-color: var(--primary);
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.shortcut__icon {
    width: 36px; height: 36px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.shortcut:nth-child(2) .shortcut__icon { background: var(--secondary-bg); color: var(--secondary); }
.shortcut:nth-child(3) .shortcut__icon { background: var(--accent-bg);    color: var(--accent); }
.shortcut:nth-child(4) .shortcut__icon { background: var(--success-bg);   color: var(--success); }
.shortcut__title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}
.shortcut__desc {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ─── footer ────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--line);
    padding: 24px 16px;
    margin-top: 64px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}
.footer a { color: var(--text-3); margin: 0 8px; }
.footer a:hover { color: var(--primary); }

/* =================================================================
   DETAIL PAGE
   ================================================================= */
.detail-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 80px;
}
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 8px 8px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin: 8px 0 12px;
    min-height: var(--tap);
}
.detail-back:hover { background: var(--surface); color: var(--primary); }

.detail-hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(189, 177, 205, 0.14), transparent 60%),
        radial-gradient(ellipse 40% 40% at 100% 100%, rgba(193, 152, 104, 0.08), transparent 60%);
    pointer-events: none;
}
[data-theme="light"] .detail-hero::before {
    background:
        radial-gradient(ellipse 60% 50% at 0% 0%, rgba(109, 92, 137, 0.07), transparent 60%),
        radial-gradient(ellipse 40% 40% at 100% 100%, rgba(138, 100, 64, 0.05), transparent 60%);
}
.detail-hero > * { position: relative; }

.detail-hero__call {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(36px, 8vw, 56px);
    letter-spacing: 0.01em;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 12px;
    word-break: break-all;
}
.detail-hero__name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 4px;
    line-height: 1.2;
    color: var(--text);
}
.detail-hero__loc {
    color: var(--text-3);
    font-size: 15px;
    margin-bottom: 16px;
}
.detail-hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.detail-hero__pills .pill {
    font-size: 12px;
    padding: 4px 10px;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    min-height: var(--tap);
    box-sizing: border-box;
    transition: border-color 0.1s, color 0.1s, background 0.1s;
}
.action:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }
.action--primary {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    font-weight: 700;
}
.action--primary:hover {
    background: var(--primary-deep);
    color: var(--bg);
    border-color: var(--primary-deep);
}
.action--coral {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.action--gold {
    background: var(--secondary);
    color: var(--bg);
    border-color: var(--secondary);
    font-weight: 700;
}

/* collapsible sections */
.section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.section__head {
    list-style: none;
    cursor: pointer;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--tap);
    user-select: none;
}
.section__head::-webkit-details-marker { display: none; }
.section__head:hover { background: var(--surface-2); }
.section__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.section__title-meta {
    color: var(--text-3);
    font-weight: 400;
    font-size: 13px;
    margin-left: 8px;
}
.section__chev {
    color: var(--text-3);
    transition: transform 0.15s;
}
.section[open] .section__chev { transform: rotate(180deg); }

.section__body {
    padding: 4px 20px 20px;
    border-top: 1px solid var(--line);
}
.kv {
    display: grid;
    grid-template-columns: minmax(110px, 35%) 1fr;
    gap: 10px 16px;
    padding-top: 12px;
    font-size: 14px;
}
.kv dt {
    color: var(--text-3);
    font-weight: 500;
    align-self: center;
}
.kv dd { color: var(--text); align-self: center; word-break: break-word; }
.kv dd.mono { font-family: var(--font-mono); font-size: 13px; color: var(--secondary); }
.kv dd a { font-family: var(--font-mono); font-size: 13px; }

/* cross-service block — bold gradient panel */
.cross {
    background: linear-gradient(135deg, var(--primary-bg-2) 0%, var(--coral-bg) 100%);
    border: 1px solid var(--primary-bd);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.cross::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 60% at 100% 100%, var(--coral-bg), transparent 60%);
    pointer-events: none;
}
.cross > * { position: relative; }
.cross__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.cross__head svg { color: var(--primary); flex-shrink: 0; }
.cross__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}
.cross__lede {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 14px;
    margin-left: 32px;
}
.cross__list { list-style: none; }
.cross__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    text-decoration: none;
    color: inherit;
    min-height: var(--tap);
}
.cross__item:hover { border-color: var(--primary); background: var(--surface-2); }
.cross__call {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
    background: var(--bg);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}
.cross__meta {
    font-size: 13px;
    color: var(--text-3);
}
.cross__pills { display: flex; gap: 4px; }

.detail-footer {
    margin-top: 20px;
    padding: 16px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}
.detail-footer a { margin: 0 6px; color: var(--text-3); }
.detail-footer a:hover { color: var(--primary); }
.detail-footer time { color: var(--secondary); font-weight: 600; }

/* ─── HTMX loading indicator on the search input ──────── */
.htmx-request.search__input {
    background-image: linear-gradient(90deg, transparent, var(--primary-bg-2), transparent);
    background-size: 200% 100%;
    animation: searchPulse 1.2s linear infinite;
}
@keyframes searchPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── results count number gets the gold pop ─────────── */
.results-count strong { color: var(--secondary); }
