/* ============================================================
   Claude Code Placemat — refined
   ----------------------------------------------------------
   Same dashboard shape, tighter typography, tuned color tiers,
   sharper hierarchy. Press Start 2P shows up only as a small
   wordmark accent — body stays Geist.
   ============================================================ */

/* Fonts loaded via system stack + local install — no external CDN dependency */

/* ---------- TOKENS ---------- */
:root {
    /* surfaces */
    --bg-page: #0a0a0a;
    --bg-card: #141414;
    --bg-card-2: #1a1a1a;        /* nested surface, modal */
    --bg-code: #1f1f1f;
    --header-bg: rgba(10, 10, 10, 0.88);

    /* lines */
    --border:        #262626;
    --border-strong: #3a3a3a;
    --border-soft:   #1f1f1f;

    /* text tiers */
    --fg-main:  #ededed;
    --fg-muted: #9a9a9a;
    --fg-dim:   #6e6e6e;

    /* brand */
    --accent-1: #d97757;
    --accent-1-2: #e8a586;
    --accent-2:  #879d86;
    --accent-2-2: #a9bba8;

    /* state tints */
    --new-bg:         rgba(135, 157, 134, 0.14);
    --new-border:     rgba(135, 157, 134, 0.55);
    --new-bar:        #879d86;
    --unverified-bg:  rgba(245, 158, 11, 0.12);
    --unverified-border: rgba(245, 158, 11, 0.45);
    --unverified-bar: #f59e0b;

    /* interaction */
    --row-hover:    rgba(255, 255, 255, 0.025);
    --success-flash: rgba(217, 119, 87, 0.32);

    /* type */
    --font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --font-pixel: "Press Start 2P", ui-monospace, monospace;

    /* radii */
    --r-xs: 3px;
    --r-sm: 4px;
    --r-md: 6px;

    /* motion */
    --dur: 0.18s;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="light"] {
    --bg-page: #f5f4ef;
    --bg-card: #ffffff;
    --bg-card-2: #fbfaf6;
    --bg-code: #f1efe9;
    --header-bg: rgba(245, 244, 239, 0.9);

    --border:        #e3e0d6;
    --border-strong: #c8c4b6;
    --border-soft:   #ece9e0;

    --fg-main:  #1a1a1a;
    --fg-muted: #5a5a55;
    --fg-dim:   #8a8a82;

    --accent-1: #c2410c;
    --accent-1-2: #9c3309;
    --accent-2:  #0f766e;
    --accent-2-2: #115e59;

    --new-bg:         rgba(15, 118, 110, 0.08);
    --new-border:     rgba(15, 118, 110, 0.35);
    --new-bar:        #0f766e;
    --unverified-bg:  rgba(180, 116, 0, 0.10);
    --unverified-border: rgba(180, 116, 0, 0.4);
    --unverified-bar: #b47400;

    --row-hover:    rgba(0, 0, 0, 0.025);
    --success-flash: rgba(194, 65, 12, 0.22);
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--fg-main);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
body {
    /* --header-h / --nav-h are measured at runtime so the two fixed bars always clear each other */
    padding: calc(var(--header-h, 52px) + var(--nav-h, 32px) + 12px) 18px 24px;
}

/* ---------- HEADER ---------- */
.global-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: var(--header-bg);
    backdrop-filter: saturate(120%) blur(10px);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 18px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.minion-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.header-title h1 {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.015em;
    color: var(--fg-main);
    white-space: nowrap;
}
.header-title h1 .wm-pixel {
    font-family: var(--font-pixel);
    font-size: 9px;
    letter-spacing: 0;
    color: var(--accent-1);
    transform: translateY(-1px);
}

.header-tagline {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-dim);
    border-left: 1px solid var(--border-strong);
    padding-left: 12px;
    white-space: nowrap;
}
@media (max-width: 1000px) { .header-tagline { display: none; } }

.global-controls {
    display: flex; gap: 8px;
    align-items: center;
}

.release-tag {
    display: inline-flex; align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
    background: var(--bg-code);
    border: 1px solid var(--border);
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.release-tag::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(217,119,87,0.18);
}

.header-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 11.5px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.header-link:hover { color: var(--fg-main); border-color: var(--accent-2); }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg-main);
    padding: 4px 9px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 12px;
    transition: border-color var(--dur) var(--ease);
}
.theme-toggle:hover { border-color: var(--accent-1); }

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
#dashboardSearch {
    width: 220px;
    padding: 6px 38px 6px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-code);
    color: var(--fg-main);
    font-family: var(--font-sans);
    font-size: 12px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#dashboardSearch::placeholder { color: var(--fg-dim); }
#dashboardSearch:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(135,157,134,0.12);
}
.search-wrap .kbd {
    position: absolute;
    right: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-dim);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xs);
    padding: 1px 5px;
    pointer-events: none;
}
.search-count {
    position: absolute;
    right: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-2-2);
    background: var(--bg-card);
    border: 1px solid var(--accent-2);
    border-radius: var(--r-xs);
    padding: 1px 5px;
    pointer-events: none;
    display: none;
}
.search-wrap.has-term .kbd { display: none; }
.search-wrap.has-term .search-count { display: inline-block; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 1001;
    background: var(--accent-1);
    color: #0a0a0a;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ---------- SECTION NAV ---------- */
.section-nav {
    position: fixed;
    top: var(--header-h, 52px); left: 0; width: 100%;
    z-index: 999;
    background: var(--header-bg);
    backdrop-filter: saturate(120%) blur(10px);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.section-nav-inner {
    max-width: 1900px;
    margin: 0 auto;
    padding: 6px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.section-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
}
.section-chips::-webkit-scrollbar { display: none; }
.section-chips a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    text-decoration: none;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.section-chips a .chip-count { color: var(--fg-dim); font-size: 10px; }
.section-chips a:hover { color: var(--fg-main); border-color: var(--border-strong); }
.section-chips a.is-active { color: var(--accent-1); border-color: var(--accent-1); }
.section-chips a.is-active .chip-count { color: var(--accent-1-2); }
.section-tools { display: flex; gap: 6px; flex-shrink: 0; }
.section-tools button {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 4px 9px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.section-tools button:hover { color: var(--fg-main); border-color: var(--accent-2); }
.section-tools button[aria-pressed="true"] { color: var(--accent-2-2); border-color: var(--accent-2); }
.card-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 10px;
    color: var(--fg-dim);
    letter-spacing: 0;
}

/* compact density */
body.density-compact { font-size: 12.5px; }
body.density-compact td { padding: 2px 5px 2px; }
body.density-compact td:first-child { width: 38%; }
body.density-compact .desc { font-size: 11px; line-height: 1.3; }
body.density-compact code { font-size: 10.5px; }
body.density-compact .card { padding: 10px 12px 8px; }
body.density-compact .dashboard-grid {
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ---------- DASHBOARD GRID ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
    gap: 14px;
    max-width: 1900px;
    margin: 0 auto;
    align-items: start;
}
/* grid items default to min-width:auto, which lets a wide row push the page sideways */
.dashboard-grid > * { min-width: 0; }

/* ---------- CARDS ---------- */
.card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px 12px 22px;
    transition: border-color var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card { scroll-margin-top: calc(var(--header-h, 52px) + var(--nav-h, 32px) + 8px); }
.card.full-width { grid-column: 1 / -1; }
.card.legend-strip { padding: 8px 16px; }
.legend-strip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.scope-note { flex: 1 1 320px; margin: 0; font-size: 11px; line-height: 1.45; color: var(--fg-muted); }
.scope-note strong { color: var(--fg-main); }

.card h2 {
    margin: 0 0 12px 0;
    padding: 0 0 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--fg-main);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h2::before {
    content: "";
    width: 8px; height: 8px;
    background: var(--accent-1);
    border-radius: 1.5px;
    flex-shrink: 0;
}

/* ---------- GROUPS ---------- */
.search-group { margin-bottom: 12px; }
.search-group:last-child { margin-bottom: 0; }

.search-group h3 {
    color: var(--accent-2);
    font-family: var(--font-mono);
    font-size: 10px;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.search-group h3::before {
    content: "▸";
    color: var(--accent-1);
    font-size: 9px;
    transform: translateY(-1px);
}
.search-group + .search-group h3 {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* collapsible groups */
details.search-group > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px 0;
}
details.search-group > summary::-webkit-details-marker { display: none; }
details.search-group > summary h3 { margin: 0; }
details.search-group > summary h3::before { transition: transform var(--dur) var(--ease); }
details.search-group[open] > summary h3::before { transform: rotate(90deg); }
details.search-group:not([open]) > summary { margin-bottom: 0; }
details.search-group:not([open]) > summary h3 { color: var(--fg-muted); }
details.search-group > summary:hover h3 { color: var(--accent-2-2); }
details.search-group > summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: var(--r-xs); }
details.search-group + details.search-group > summary h3 {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.group-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-dim);
}

/* ---------- TABLES ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
td {
    padding: 4px 6px 3px;
    border-bottom: 1px dotted var(--border);
    vertical-align: middle;
}
td:first-child {
    width: 44%;
    padding-left: 0;
}
tr:last-child td { border-bottom: none; }
tr { transition: background-color var(--dur) var(--ease); }
tr:hover { background-color: var(--row-hover); }

.desc {
    color: var(--fg-muted);
    font-size: 11.5px;
    line-height: 1.35;
}

/* permalinks + roving focus */
.search-item { scroll-margin-top: calc(var(--header-h, 52px) + var(--nav-h, 32px) + 8px); }
.search-item td:first-child { position: relative; }
.row-link {
    position: absolute;
    left: -14px;
    top: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-dim);
    text-decoration: none;
    opacity: 0;
    transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease);
}
.search-item:hover .row-link,
.search-item:focus-within .row-link,
.row-link:focus-visible { opacity: 1; }
.row-link:hover { color: var(--accent-1); }
.row-link.copied { color: var(--accent-2-2); }
.search-item:target { background: var(--new-bg); box-shadow: inset 2px 0 0 0 var(--accent-2); }
.search-item:focus { outline: none; background: var(--row-hover); box-shadow: inset 2px 0 0 0 var(--accent-1); }

mark.hit {
    background: rgba(217, 119, 87, 0.28);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}
:root[data-theme="light"] mark.hit { background: rgba(194, 65, 12, 0.22); }

/* ---------- CODE CHIPS ---------- */
code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    color: var(--fg-main);
    padding: 1px 5px 2px;
    border-radius: var(--r-xs);
    font-size: 11px;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
}
code:hover { border-color: var(--accent-1); }
code:focus-visible {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(135,157,134,0.25);
}
code.copied {
    animation: copyFlash 0.3s ease-out;
    border-color: var(--accent-1);
}
@keyframes copyFlash {
    0%   { background: var(--success-flash); }
    100% { background: var(--bg-code); }
}

/* state variants — left-bar marker for legibility */
code.new {
    background: var(--new-bg);
    border-color: var(--new-border);
    box-shadow: inset 2px 0 0 0 var(--new-bar);
    padding-left: 7px;
}
code.unverified {
    background: var(--unverified-bg);
    border-color: var(--unverified-border);
    box-shadow: inset 2px 0 0 0 var(--unverified-bar);
    padding-left: 7px;
}

/* inline code inside .desc — quieter */
.desc code {
    font-size: 10.5px;
    padding: 0 4px 1px;
}

/* ---------- TWO-TIER ENTRIES ---------- */
.desc .summary { display: inline; }
.notes-btn {
    display: inline-block;
    vertical-align: 1px;
    margin-left: 4px;
    background: none;
    border: 1px solid var(--border-strong);
    color: var(--accent-2-2);
    font-family: var(--font-mono);
    font-size: 9.5px;
    padding: 0 5px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.5;
}
.notes-btn:hover,
.notes-btn[aria-expanded="true"] {
    border-color: var(--accent-2);
    color: var(--fg-main);
    background: var(--new-bg);
}
.notes {
    list-style: none;
    margin: 5px 0 2px;
    padding: 0 0 0 10px;
    border-left: 1px solid var(--border-strong);
}
.notes li {
    position: relative;
    padding: 2px 0 2px 10px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--fg-muted);
}
.notes li::before {
    content: "▸";
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--accent-2);
    font-size: 9px;
}
.notes-all {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.notes-all:hover,
.notes-all[aria-pressed="true"] { color: var(--accent-2-2); border-color: var(--accent-2); }

/* ---------- LEGEND + BUILDER (full-width strip) ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    font-size: 11px;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch {
    display: inline-block;
    width: 26px; height: 12px;
    border-radius: var(--r-xs);
}
.swatch-new       { background: var(--new-bg); border: 1px solid var(--new-border); box-shadow: inset 2px 0 0 0 var(--new-bar); }
.swatch-unverified{ background: var(--unverified-bg); border: 1px solid var(--unverified-border); box-shadow: inset 2px 0 0 0 var(--unverified-bar); }
.swatch-default   { background: var(--bg-code); border: 1px solid var(--border); }


/* ---------- SR-ONLY / NO-RESULTS ---------- */
.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;
}
.no-results {
    display: none;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 12px;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.no-results.is-visible { display: block; }

/* ---------- FOOTER ---------- */
.global-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 18px 12px 6px;
    margin-top: 6px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--border);
}
.global-footer a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
}
.global-footer a:hover { color: var(--accent-2-2); text-decoration: underline; }

/* ---------- WHAT'S NEW MODAL ---------- */
.whats-new-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: modalFadeIn 0.22s var(--ease);
}
.whats-new-overlay.hidden { display: none; }
.whats-new-modal {
    background: var(--bg-card-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    max-width: 580px;
    width: 92%;
    max-height: 70vh;
    overflow-y: auto;
    padding: 22px 24px 20px;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.45),
        0 0 0 1px rgba(217,119,87,0.06);
}
.whats-new-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.whats-new-header h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex; align-items: center; gap: 8px;
}
.whats-new-header h2::before {
    content: "";
    width: 8px; height: 8px;
    background: var(--accent-1);
    border-radius: 1.5px;
}
.whats-new-header .version-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-muted);
    font-weight: 400;
}
.whats-new-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    width: 26px; height: 26px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    margin-left: auto;
}
.whats-new-close:hover { color: var(--fg-main); border-color: var(--accent-1); }
.whats-new-list { list-style: none; padding: 0; margin: 0; }
.whats-new-list li {
    padding: 8px 0;
    border-bottom: 1px dotted var(--border);
    font-size: 12.5px;
    color: var(--fg-main);
    line-height: 1.45;
}
.whats-new-list li:last-child { border-bottom: none; }
.whats-new-list .tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--r-xs);
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 32px;
    text-align: center;
    vertical-align: 1px;
}
.whats-new-list .tag-add    { background: rgba(135,157,134,0.16); color: var(--accent-2-2);  border: 1px solid var(--accent-2); }
.whats-new-list .tag-change { background: rgba(245,158,11,0.10);  color: #fbbf24;        border: 1px solid #f59e0b; }
.whats-new-list .tag-remove { background: rgba(239,68,68,0.10);   color: #f87171;        border: 1px solid #ef4444; }
.whats-new-list .tag-fix    { background: rgba(96,165,250,0.10);  color: #60a5fa;        border: 1px solid #3b82f6; }

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

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .global-header { padding: 0 14px; }
    #dashboardSearch { width: 160px; }
    .release-tag { display: none; }
}
@media (max-width: 700px) {
    body { padding: calc(var(--header-h, 96px) + var(--nav-h, 32px) + 12px) 12px 24px; }
    .section-tools { display: none; }
    .global-header {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px;
        gap: 8px;
    }
    .global-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .whats-new-modal { width: 95%; max-height: 80vh; }
}

/* ---------- SINCE YOUR LAST VISIT ---------- */
.since-strip { padding: 8px 16px; border-color: var(--accent-2); background: var(--new-bg); }
.since-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12.5px;
}
.since-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 3px var(--new-bg);
    flex-shrink: 0;
}
.since-text { flex: 1 1 220px; min-width: 0; }
.since-text b { color: var(--fg-main); }
.since-text code { cursor: default; }
.since-actions { margin-left: auto; display: flex; gap: 6px; }
.since-actions button,
.since-drawer-foot button {
    background: var(--accent-2);
    color: #0a0a0a;
    border: 1px solid var(--accent-2);
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
}
.since-actions button.quiet {
    background: none;
    color: var(--fg-muted);
    border-color: var(--border-strong);
}
.since-actions button.quiet:hover { color: var(--fg-main); border-color: var(--accent-2); }

.since-drawer {
    position: fixed;
    top: var(--header-h, 52px); right: 0; bottom: 0;
    width: min(440px, 100vw);
    background: var(--bg-card-2);
    border-left: 1px solid var(--border-strong);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    animation: drawerIn 0.2s var(--ease);
}
.since-drawer[hidden] { display: none; }
@keyframes drawerIn {
    from { transform: translateX(24px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.since-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}
.since-drawer-head h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.since-drawer-tools { display: flex; align-items: center; gap: 10px; }
.since-drawer-body { overflow-y: auto; padding: 8px 16px; flex: 1; }
.since-release { margin: 10px 0 14px; }
.since-release h3 {
    margin: 0 0 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.since-release h3 span { color: var(--fg-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.since-release ul { list-style: none; margin: 0; padding: 0; }
.since-release li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dotted var(--border);
    font-size: 12px;
    line-height: 1.4;
    color: var(--fg-main);
    cursor: pointer;
}
.since-release li:hover { background: var(--row-hover); }
.since-release li.unlinked { color: var(--fg-muted); cursor: default; }
.since-release li .tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 0;
    border-radius: var(--r-xs);
    text-align: center;
    align-self: start;
    text-transform: uppercase;
}
.since-release li .tag-add    { background: rgba(135, 157, 134, 0.16); color: var(--accent-2-2); border: 1px solid var(--accent-2); }
.since-release li .tag-change { background: rgba(245, 158, 11, 0.10);  color: #fbbf24;       border: 1px solid #f59e0b; }
.since-release li .tag-remove { background: rgba(239, 68, 68, 0.10);   color: #f87171;       border: 1px solid #ef4444; }
.since-release li .tag-fix    { background: rgba(96, 165, 250, 0.10);  color: #60a5fa;       border: 1px solid #3b82f6; }
.since-drawer-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-dim);
    display: flex;
    gap: 12px;
    align-items: center;
}
.since-drawer-foot a { color: var(--accent-2); text-decoration: none; }
.since-drawer-foot a:hover { text-decoration: underline; }
.search-item.flash { animation: rowFlash 1.6s ease-out; }
@keyframes rowFlash {
    0%, 40% { background: var(--success-flash); }
    100%    { background: transparent; }
}


/* ---------- PRINT ---------- */
.print-head { display: none; }
.print-btn { cursor: pointer; background: none; font-family: var(--font-sans); }

@page { size: A4 landscape; margin: 7mm 8mm; }

@media print {
    .global-header, .section-nav, .legend-strip, .since-strip, .since-drawer,
    .no-results, .notes, .notes-btn, .row-link, .skip-link { display: none !important; }

    html, body { padding: 0; background: #fff; color: #111; font-size: 8pt; line-height: 1.25; }

    .print-head {
        display: flex;
        column-span: all;
        justify-content: space-between;
        gap: 6mm;
        font-family: var(--font-mono);
        font-size: 7pt;
        color: #333;
        border-bottom: 1.5px solid #111;
        padding-bottom: 1mm;
        margin-bottom: 3mm;
    }
    .print-head-title { font-family: var(--font-sans); font-weight: 700; font-size: 9pt; color: #111; }
    .print-head-title b { font-family: var(--font-pixel); font-size: 6pt; color: #c2410c; font-weight: 400; margin-left: 4px; }

    .dashboard-grid { display: block; column-count: 4; column-gap: 5mm; column-fill: auto; max-width: none; }

    .card {
        display: block;
        margin: 0 0 3mm;
        padding: 0;
        border: none;
        border-radius: 0;
        background: none;
        break-inside: auto;
    }
    .card h2 {
        font-size: 8.5pt;
        color: #111;
        border-bottom: 1.5px solid #111;
        padding-bottom: 1.5px;
        margin: 0 0 2mm;
        break-after: avoid;
    }
    .card h2::before { background: #c2410c; }
    .card-count { display: none; }

    .search-group { margin-bottom: 2mm; break-inside: auto; }
    details.search-group > summary { margin-bottom: 1mm; }
    details.search-group:not([open]) > table { display: table; }   /* folded groups still print */
    .search-group h3 { font-size: 6.5pt; color: #0f766e; margin: 0 0 1mm; break-after: avoid; }
    .search-group h3::before { color: #c2410c; }
    details.search-group + details.search-group > summary h3 { border-top: 1px dashed #bbb; padding-top: 1mm; margin-top: 1mm; }
    .group-count { color: #666; }

    table { font-size: 7.5pt; }
    tr { break-inside: avoid; }
    td { padding: 0.6mm 1mm 0.4mm 0; border-bottom: 0.4pt dotted #999; vertical-align: top; }
    td:first-child { width: 40%; }
    .desc { font-size: 7pt; color: #333; line-height: 1.25; }

    code {
        font-size: 6.8pt;
        background: #f1efe9;
        color: #111;
        border: 0.4pt solid #ddd;
        padding: 0 2px;
        cursor: default;
    }
    .desc code { font-size: 6.5pt; }
    code.new { background: #dfe8de; border-color: #0f766e; box-shadow: inset 2px 0 0 0 #0f766e; }
    code.new::after { content: " ■"; color: #0f766e; font-size: 5pt; }
    code.unverified { background: #f7edd6; border-color: #b47400; box-shadow: inset 2px 0 0 0 #b47400; }
    code.unverified::after { content: " □"; color: #b47400; font-size: 5pt; }
    mark.hit { background: none; }

    .global-footer { border: none; padding: 2mm 0 0; font-size: 6pt; color: #666; text-align: left; }
    .global-footer a { color: #666; }
    .global-footer br { display: none; }

    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
