/* ==========================================================================
   Design system – HALO: a light precision cockpit.
   Values come from HALO's #halo-flightdeck (--h-*) and are ported to the app's
   own tokens. --accent is the white-label hook (Branding:AccentColor); every
   accent tint below is derived from it.
   ========================================================================== */

@font-face { font-family: "DM Sans"; font-weight: 400 500; font-display: swap; src: url("fonts/dm-sans.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 400 500; font-display: swap; src: url("fonts/dm-sans-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-weight: 400 500; font-display: swap; src: url("fonts/space-grotesk.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-weight: 400 500; font-display: swap; src: url("fonts/space-grotesk-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    color-scheme: light;

    /* Surfaces: app ground, raised panels, cards */
    --panel: #f1f2f6;          /* HALO .hf-surface */
    --panel-2: #eef0f5;        /* footer strip, recessed bars */
    --face: #ffffff;
    --face-2: #fafbfe;         /* top bar gradient end, inputs */
    --recess: #e9ebf0;         /* segmented control track */

    /* Lines – HALO --h-line and neighbours */
    --plate: #dddfe8;
    --plate-2: #e5e6ef;
    --plate-3: #cfd2dc;

    /* Ink – HALO --h-ink and --h-muted, plus steps between */
    --ink: #22242e;
    --ink-2: #4c4e5c;
    --ink-3: #6c6f7c;          /* HALO --h-muted #727582, darkened a step for 4.5:1 on the ground */
    --ink-4: #8b8e9b;          /* scale labels and placeholders only */

    /* Signal – --accent is the white-label hook (HALO --h-accent) */
    --accent: #7961e8;
    --accent-soft: color-mix(in oklab, var(--accent) 10%, white);   /* HALO --h-soft */
    --accent-dim: color-mix(in oklab, var(--accent) 16%, transparent);
    --accent-line: color-mix(in oklab, var(--accent) 45%, white);
    --accent-light: color-mix(in oklab, var(--accent) 45%, white);  /* dial gradient start */
    --accent-mid: color-mix(in oklab, var(--accent) 70%, white);    /* dial gradient end, early rank bars */
    --accent-text: color-mix(in oklab, var(--accent) 72%, black);   /* accent used as text */

    --good: #39816b;           /* HALO --h-good */
    --good-soft: #eaf3ee;
    --good-text: #37745c;
    --caution: #a8680c;
    --caution-soft: #fbf1e1;
    --warning: #c2413a;
    --warning-soft: #fbeceb;

    --action: #35313e;         /* dark primary button (HALO .hf-focus-button) */
    --action-border: #46404f;

    /* Type */
    --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "DM Sans", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --text-2xs: 0.625rem;   /* 10px – mono labels */
    --text-xs: 0.6875rem;   /* 11px */
    --text-sm: 0.8125rem;   /* 13px – HALO base */
    --text-md: 0.875rem;    /* 14px – forms and body copy */
    --text-lg: 1rem;
    --text-xl: 1.3125rem;   /* 21px – focus heading */
    --text-2xl: 1.9375rem;  /* 31px – secondary numbers */
    --text-3xl: 2.125rem;   /* 34px – page heading */
    --tracking-mono: 0.1em;

    /* Space */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-7: 28px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    /* Shape */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 9px;
    --radius-md: 13px;
    --radius-lg: 20px;
    --radius-xl: 22px;

    /* Depth – HALO --h-shadow drives the deck's drop */
    --deck-depth: 28px;
    --shadow-deck: 0 var(--deck-depth) 45px -30px color-mix(in oklab, var(--accent) 22%, #686084), 0 1px 0 1px #ffffffb3, inset 0 1px 0 1px #fff;
    --shadow-card: 0 12px 45px #252c4b08;
    --shadow-raise: 0 1px 4px #3c3b5617, inset 0 0 0 1px #fff;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--accent-line);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--panel);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--text-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.2; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--ink); text-decoration-color: var(--plate-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
/* Headings receive programmatic focus on navigation (FocusOnNavigate); no ring for that. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { box-shadow: none; outline: none; }

* { scrollbar-width: thin; scrollbar-color: var(--plate-3) transparent; }

.icon { flex: none; display: block; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Type roles ---------- */

.label-mono {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-mono);
    text-transform: uppercase;
    color: var(--ink-3);
}
.label-mono .sep { color: var(--ink-4); padding: 0 5px; }

.number { font-family: var(--font-display); font-weight: 400; font-variant-numeric: tabular-nums; }
.muted, .faint { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------- Page scaffolding ---------- */

.page { width: 100%; max-width: 1320px; padding: 31px 30px var(--s-12); }
.page-narrow { max-width: 780px; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
    margin-bottom: 26px;
}
.page-head h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    line-height: 1.15;
    letter-spacing: -0.047em;
    margin-top: 9px;
    overflow-wrap: anywhere;
}
.page-head h1::after { content: "."; color: var(--accent); }
.page-head .label-mono { display: block; }
.page-head .lede { margin-top: var(--s-2); color: var(--ink-3); max-width: 62ch; }
.page-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; flex-shrink: 0; }

/* Data status under the title: fetched, on its way, failed or paused (Ui/DataStatusLine). */
.data-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 13px; font-size: var(--text-sm); color: var(--ink-3); }
.data-status .pip { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
.data-status-bar { width: 104px; height: 4px; flex: none; }
.data-status-meta { min-width: 0; }

.section { margin-top: var(--s-8); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.section-head h2 { font-size: var(--text-sm); font-weight: 500; letter-spacing: -0.015em; }
.section-head > span { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--ink-3); }

/* ---------- Containers ---------- */

/* The deck: HALO's instrument panel with two precision rivets. */
.deck {
    position: relative;
    background: linear-gradient(145deg, #fcfdff, #fff 50%, #f9faff);
    border: 1px solid #dfe1ea;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-deck);
}
.deck::before, .deck::after {
    content: ""; position: absolute; top: 16px; width: 5px; height: 5px;
    border: 1px solid #d4d8e3; border-radius: 50%; background: #f0f2f7;
    box-shadow: inset 0 1px 2px #31394a0a;
}
.deck::before { left: 16px; }
.deck::after { right: 16px; }

/* A plain white card for forms and secondary panels. */
.housing { background: var(--face); border: 1px solid var(--plate); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.housing-pad { padding: var(--s-6); }

/* ---------- Buttons ---------- */

.btn {
    --btn-fg: var(--ink);
    --btn-bg: var(--face);
    --btn-border: var(--plate);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: 500 var(--text-sm)/1 var(--font-ui);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px #3c3b4f0a;
    transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn:hover { --btn-border: var(--plate-3); --btn-bg: var(--face-2); }
.btn:active { transform: translateY(1px); }

/* Primary: HALO's dark focus button. */
.btn-primary { --btn-fg: #fff; --btn-bg: var(--action); --btn-border: var(--action-border); box-shadow: 0 3px 5px #322a4320, inset 0 1px 0 #ffffff14; }
.btn-primary:hover { --btn-bg: #29262f; --btn-border: var(--action-border); }
.btn-primary .icon { color: #c9bee1; }

.btn-danger { --btn-fg: var(--warning); --btn-border: color-mix(in oklab, var(--warning) 40%, white); }
.btn-danger:hover { --btn-bg: var(--warning-soft); --btn-border: var(--warning); }

.btn-quiet { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--ink-3); box-shadow: none; padding: 0 var(--s-2); }
.btn-quiet:hover { --btn-bg: var(--recess); --btn-border: transparent; --btn-fg: var(--ink); }

.btn-sm { min-height: 30px; padding: 0 10px; font-size: var(--text-xs); }
.btn-block { width: 100%; }
.btn-split { justify-content: space-between; }

.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; box-shadow: none; --btn-fg: var(--ink-4); --btn-bg: var(--panel-2); --btn-border: var(--plate-2); }
.btn[data-busy="true"] { cursor: progress; }

/* ---------- Segmented control (HALO .hf-period) ---------- */

.segmented {
    display: inline-flex; gap: 4px; padding: 4px;
    border: 1px solid #dedfe7; border-radius: var(--radius);
    background: var(--recess);
    box-shadow: inset 0 1px 3px #45435b06, 0 1px 0 #fff;
}
.segmented label, .segmented button {
    position: relative; display: grid; place-items: center;
    min-width: 59px; padding: 6px 11px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: #6f7180; font: 400 var(--text-xs)/1.4 var(--font-ui);
    white-space: nowrap; cursor: pointer; transition: background-color 160ms, color 160ms, box-shadow 160ms;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked), .segmented button[aria-pressed="true"] { background: #fff; color: #30313d; box-shadow: var(--shadow-raise); }
.segmented label:has(input:focus-visible) { box-shadow: var(--focus-ring); }

/* ---------- Forms ---------- */

.form { display: grid; gap: var(--s-5); }
.form-row { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions, .button-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.button-row form { margin: 0; }

.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: var(--text-xs); color: var(--ink-3); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }

.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    background: var(--face);
    border: 1px solid var(--plate);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font: inherit;
    font-size: var(--text-md);
    box-shadow: inset 0 1px 2px #45435b08;
    transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
    caret-color: var(--accent);
}
.field select {
    appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23727582' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.field input::placeholder { color: var(--ink-4); }
.field input:hover, .field select:hover { border-color: var(--plate-3); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-dim); }
.field input:disabled { color: var(--ink-3); background: var(--panel-2); }
.field input.invalid, .field select.invalid { border-color: color-mix(in oklab, var(--warning) 55%, white); }
.validation-message, .field-error { color: var(--warning); font-size: var(--text-xs); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink-2); font-size: var(--text-sm); }
.check input {
    appearance: none; width: 16px; height: 16px; margin: 0; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--plate-3); border-radius: 4px; background: var(--face);
    transition: background-color 160ms, border-color 160ms;
}
.check input::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border: solid #fff; border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg) scale(0); transition: transform 160ms var(--ease-out); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }

/* ---------- Notices ---------- */

.notice {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--plate); border-radius: var(--radius);
    background: var(--face-2); color: var(--ink-2); font-size: var(--text-sm);
}
.notice .icon { margin-top: 2px; }
.notice-error { border-color: color-mix(in oklab, var(--warning) 30%, white); background: var(--warning-soft); color: #7f2a25; }
.notice-error .icon { color: var(--warning); }
.notice-ok { border-color: color-mix(in oklab, var(--good) 30%, white); background: var(--good-soft); color: var(--good-text); }
.notice-ok .icon { color: var(--good); }
.notice-caution { border-color: color-mix(in oklab, var(--caution) 30%, white); background: var(--caution-soft); color: #6d4408; }
.notice-caution .icon { color: var(--caution); }

/* ---------- Status pip (HALO .hf-online) ---------- */

.pip { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; }
.pip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); box-shadow: 0 0 0 3px var(--panel-2); flex: none; }
.pip[data-state="ok"]::before { background: #69a28c; box-shadow: 0 0 0 3px #edf5f0; }
.pip[data-state="caution"]::before { background: #d08a1e; box-shadow: 0 0 0 3px var(--caution-soft); }
.pip[data-state="warning"]::before { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.pip[data-state="accent"]::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pip-pulse 1.6s var(--ease-out) infinite; }
@keyframes pip-pulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
a.pip { text-decoration: none; }
a.pip:hover { color: var(--ink); }

/* ---------- Chips, tags, positions ---------- */

.chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: var(--radius-xs); font-size: var(--text-2xs); font-weight: 500; }
.chip .icon { width: 12px; height: 12px; }
.chip-good { background: var(--good-soft); color: var(--good-text); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); border: 1px solid color-mix(in oklab, var(--accent) 16%, white); }

.tag {
    display: inline-flex; align-items: center; padding: 5px 6px;
    border: 1px solid #dcdfe7; border-radius: var(--radius-xs);
    font: 400 var(--text-2xs)/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: #5f6473;
}

.position {
    display: inline-block; min-width: 27px; padding: 4px 7px; text-align: center;
    font: 400 var(--text-xs) var(--font-mono);
    border: 1px solid #dcdce7; background: #fafafe; border-radius: 5px;
}

/* ---------- Status chip and vital scale (Core Web Vitals, shared by list and detail card) ---------- */

.status-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px;
    border-radius: 999px; font: 500 12.5px/1 var(--font-ui); white-space: nowrap;
    background: var(--panel); color: var(--ink-3);
}
.status-chip svg { width: 15px; height: 15px; flex: none; }
.status-chip[data-tone="good"] { background: var(--good-soft); color: var(--good-text); }
.status-chip[data-tone="caution"] { background: var(--caution-soft); color: var(--caution); }
.status-chip[data-tone="bad"] { background: var(--warning-soft); color: var(--warning); }
.status-chip.is-small { font-size: 12px; padding: 3px 9px 3px 5px; gap: 5px; }
.status-chip.is-small svg { width: 14px; height: 14px; }

.vital-scale { position: relative; display: grid; grid-template-columns: 50% 25% 25%; height: 8px; }
.vital-scale span:nth-child(1) { background: #cfe5da; border-radius: 4px 0 0 4px; }
.vital-scale span:nth-child(2) { background: #f3dfbd; }
.vital-scale span:nth-child(3) { background: #f1cfcc; border-radius: 0 4px 4px 0; }
.vital-scale-marker {
    position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
    background: var(--ink); border: 3px solid var(--face); box-shadow: 0 0 0 1px var(--ink);
    transform: translate(-50%, -50%);
}

/* ---------- Tables (HALO .hf-table) ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { font-size: var(--text-2xs); font-weight: 400; color: var(--ink-3); text-align: left; padding: 0 12px 10px 0; border-bottom: 1px solid var(--plate); white-space: nowrap; }
.table td { padding: 13px 12px 13px 0; border-bottom: 1px solid #e1e2ea; vertical-align: middle; color: var(--ink-2); }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num + td:not(.num), .table .num + th:not(.num) { padding-left: 20px; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.table .row-link:hover { color: var(--accent-text); }
.table .sub { display: block; color: var(--ink-3); font-size: var(--text-xs); margin-top: 2px; }
.table .cell-strong { color: var(--ink); font-weight: 500; }
.table .row-actions { white-space: nowrap; }

/* ---------- Copy field ---------- */

.copy-field { display: flex; align-items: stretch; border: 1px solid var(--plate); border-radius: var(--radius-sm); background: var(--face-2); overflow: hidden; }
.copy-field code { flex: 1; min-width: 0; padding: 10px 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; }
.copy-field button {
    border: 0; border-left: 1px solid var(--plate); background: var(--face); color: var(--ink-2);
    padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    font: 500 var(--text-xs) var(--font-ui); transition: color 160ms, background-color 160ms;
}
.copy-field button:hover { color: var(--accent-text); background: var(--accent-soft); }
.copy-field button[data-copied="true"] { color: var(--good-text); }

/* ---------- Definition grid ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-5) var(--s-8); margin: 0; }
.facts dt { font: 400 var(--text-2xs) var(--font-mono); letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 4px 0 0; color: var(--ink); }

/* ---------- Empty state ---------- */

.empty { display: grid; justify-items: start; gap: var(--s-3); padding: var(--s-8); }
.empty h2 { font-family: var(--font-display); font-size: var(--text-xl); letter-spacing: -0.03em; }
.empty p { color: var(--ink-3); max-width: 56ch; }

/* ---------- Motion and input safety ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
@media (pointer: coarse) {
    .segmented label, .segmented button { min-height: 38px; }
    .btn { min-height: 44px; }
}

/* ---------- Blazor chrome ---------- */

#blazor-error-ui {
    display: none; position: fixed; inset: auto 16px 16px auto; z-index: 1000;
    max-width: 420px; padding: 12px 14px;
    background: #292733; color: #fff; border-radius: 7px; font-size: var(--text-sm);
    box-shadow: 0 8px 20px #20193320;
}
#blazor-error-ui .dismiss { cursor: pointer; margin-left: var(--s-3); }
#blazor-error-ui a { color: #fff; }

@media (max-width: 540px) { .hide-sm { display: none; } }
