/* Stationhouse shell. Plain CSS, no build step.
   This file is structure only: every colour, font, radius and shadow comes
   from a brand stylesheet in css/brands/<slug>.css, scoped to
   :root[data-brand="<slug>"]. Red (--danger) is for errors and alerts only. */

:root {
    /* Fallbacks so the shell stays readable if a brand file fails to load. */
    --bg: #F2F6F9; --surface: #FCFEFF; --sunken: #EAEFF3;
    --ink: #17232F; --ink-2: #4C5661; --ink-3: #5B646F;
    --line: #D9DFE4; --line-strong: #79818A;
    --accent: #056C4A; --accent-hover: #045A3E; --on-accent: #F8FDFA; --accent-ink: #005F40;
    --accent-soft: #DDF5E9; --accent-soft-ink: #004C33;
    --focus: #1762B6; --danger: #B72725; --danger-soft: #FFEDEB; --ok: #236436; --warn: #8D5406;
    --nav-bg: var(--sunken); --nav-ink: var(--ink); --nav-ink-2: var(--ink-2); --nav-line: var(--line);
    --nav-active-bg: var(--accent); --nav-active-ink: var(--on-accent); --nav-hover: #DEE6EC; --nav-focus: var(--focus);
    --font-display: system-ui, sans-serif; --font-body: system-ui, sans-serif; --font-mono: ui-monospace, monospace;
    --display-weight: 700; --display-tracking: -0.015em;
    --h1: 2rem; --h1-lh: 1.1;
    --label-font: var(--font-body); --label-size: .75rem; --label-tracking: .08em; --label-weight: 600; --label-case: uppercase;
    --r-s: 6px; --r-m: 10px; --r-l: 14px; --r-btn: 10px;
    --shadow-1: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .06);
    --shadow-2: 0 1px 2px rgb(16 24 40 / .05), 0 10px 24px -10px rgb(16 24 40 / .22), 0 4px 10px -4px rgb(16 24 40 / .08);
    --shadow-3: 0 2px 4px rgb(16 24 40 / .06), 0 24px 48px -16px rgb(16 24 40 / .28);
    --icon-stroke: 1.75;

    /* Structure: 4px grid, one easing family. */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
    --sidebar-w: 18rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
:root[data-scheme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    color: var(--ink);
    text-wrap: balance;
}
h1 { font-size: var(--h1); line-height: var(--h1-lh); margin: 0 0 var(--s3); }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 var(--s2); }
h3 { font-size: 1rem; line-height: 1.3; margin: 0; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--dur-1) var(--ease-out); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sidebar :focus-visible, .guest__aside :focus-visible { outline-color: var(--nav-focus); }

.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;
}

.skip {
    position: absolute; left: var(--s3); top: -100px; z-index: 50;
    background: var(--surface); color: var(--ink); padding: var(--s3) var(--s4);
    border-radius: var(--r-m); box-shadow: var(--shadow-2); font-weight: 600;
}
.skip:focus { top: var(--s3); }

.muted { color: var(--ink-2); margin: 0; }
.label {
    display: block;
    font-family: var(--label-font);
    font-size: var(--label-size);
    letter-spacing: var(--label-tracking);
    text-transform: var(--label-case);
    font-weight: var(--label-weight);
    color: var(--ink-3);
    line-height: 1.4;
}

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; stroke-width: var(--icon-stroke); fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Brand mark ---------- */
.brand {
    display: inline-flex; align-items: center; gap: var(--s3);
    min-height: 44px;
    font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 1.1875rem; letter-spacing: var(--display-tracking);
    color: inherit; text-decoration: none;
}
.brand__mark {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center;
    border-radius: var(--r-s); background: var(--accent); color: var(--on-accent);
}
.brand__mark svg { width: 20px; height: 20px; }

/* ---------- App shell: stacked on phones, sidebar + content from 1024px ---------- */
.shell { min-height: 100vh; }

.sidebar { background: var(--nav-bg); color: var(--nav-ink); border-bottom: 1px solid var(--nav-line); }
.sidebar__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s4); }
.sidebar__toggle {
    display: inline-flex; align-items: center; gap: var(--s2);
    min-height: 44px; min-width: 44px; padding: 0 var(--s4);
    background: transparent; color: var(--nav-ink);
    border: 1px solid var(--nav-line); border-radius: var(--r-btn);
    font: inherit; font-weight: 600; cursor: pointer;
    transition: background var(--dur-1) var(--ease-out);
}
.sidebar__toggle:hover { background: var(--nav-hover); }
.sidebar__panel { display: none; padding: 0 var(--s4) var(--s5); }
.sidebar__panel.is-open { display: block; }

.sidebar__dept { margin: var(--s2) 0 var(--s5); padding: var(--s3) var(--s4); border-radius: var(--r-m); background: var(--nav-hover); }
.sidebar__dept .label { color: var(--nav-ink-2); }
.sidebar__dept strong { display: block; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-size: 1rem; line-height: 1.3; margin-top: 2px; }

.nav { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: 2px; }
.nav__link {
    display: flex; align-items: center; gap: var(--s3);
    min-height: 44px; padding: 0 var(--s3);
    border-radius: var(--r-m);
    color: var(--nav-ink); text-decoration: none; font-weight: 500; font-size: .9375rem;
    transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.nav__link .icon { color: var(--nav-ink-2); transition: color var(--dur-1) var(--ease-out); }
.nav__link span { flex: 1; }
.nav__link:hover { background: var(--nav-hover); text-decoration: none; }
.nav__link:hover .icon { color: var(--nav-ink); }
.nav__link.is-active { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 600; }
.nav__link.is-active .icon { color: var(--nav-active-ink); }

.sidebar__user { border-top: 1px solid var(--nav-line); padding-top: var(--s4); display: grid; gap: var(--s3); }
.sidebar__user .label { color: var(--nav-ink-2); }
.sidebar__email { display: block; overflow-wrap: anywhere; font-size: .875rem; }
.sidebar__user .btn--quiet { color: var(--nav-ink); border-color: var(--nav-line); }
.sidebar__user .btn--quiet:hover { background: var(--nav-hover); }

.switcher { margin-bottom: var(--s5); }
.switcher select { margin-top: var(--s1); }

.content { padding: var(--s5) var(--s4) var(--s8); max-width: 80rem; }

@media (min-width: 1024px) {
    .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .sidebar { border-bottom: 0; border-right: 1px solid var(--nav-line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
    .sidebar__bar { padding: var(--s5) var(--s5) var(--s3); }
    .sidebar__toggle { display: none; }
    .sidebar__panel { display: block; padding: 0 var(--s4) var(--s5); }
    .content { padding: var(--s7) var(--s7) var(--s8); }
}

/* ---------- Page header ---------- */
.page-head { margin-bottom: var(--s6); max-width: 46rem; }
.page-head .label { margin-bottom: var(--s2); }
.page-head .muted { font-size: 1.0625rem; max-width: 60ch; }

/* ---------- Module cards (dashboard) ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); } }

.card {
    position: relative;
    display: grid; grid-template-columns: auto 1fr; column-gap: var(--s4); row-gap: var(--s1); align-items: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    padding: var(--s5);
    box-shadow: var(--shadow-1);
    transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.card__icon {
    grid-row: span 3;
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: var(--r-m);
    background: var(--accent-soft); color: var(--accent-soft-ink);
}
.card__icon .icon { width: 22px; height: 22px; }
.card__title {
    font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
    font-size: 1.125rem; line-height: 1.3; color: var(--ink); text-decoration: none;
}
.card__title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card__title:focus-visible { outline: none; }
.card:has(.card__title:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.card .muted { font-size: .9375rem; }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--line-strong); }
.card:active { transform: translateY(0); transition-duration: var(--dur-1); }

.tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .01em;
    color: var(--ink-2); background: var(--sunken);
    border-radius: 999px; padding: 2px 10px; font-variant-numeric: tabular-nums;
}

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-soft); color: var(--accent-soft-ink);
    border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 600;
}

/* ---------- Empty state (module pages before their sprint) ---------- */
.empty {
    display: grid; gap: var(--s3); justify-items: start;
    background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-l);
    padding: var(--s6); max-width: 40rem;
}
.empty__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-l); background: var(--accent-soft); color: var(--accent-soft-ink); }

/* ---------- Forms and buttons ---------- */
.form { display: grid; gap: var(--s5); }
.field { display: grid; gap: 6px; }
.field label, .switcher label { font-weight: 600; font-size: .875rem; color: var(--ink); }
.sidebar .switcher label { color: var(--nav-ink-2); }
input[type=email], input[type=password], input[type=text], input[type=search], input[type=number], select {
    width: 100%; min-height: 48px;
    font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--r-m);
    padding: 12px 14px;
    transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
input::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible {
    outline: none; border-color: var(--focus);
    box-shadow: 0 0 0 1px var(--focus), 0 0 0 5px color-mix(in oklab, var(--focus) 22%, transparent);
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.check { display: flex; gap: var(--s3); align-items: center; min-height: 44px; font-size: .9375rem; color: var(--ink-2); cursor: pointer; }

.btn {
    position: relative; /* anchors the .visually-hidden spans inside a button */
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
    min-height: 48px; padding: 0 var(--s5);
    font: inherit; font-weight: 600; letter-spacing: .005em; text-decoration: none; cursor: pointer;
    background: var(--accent); color: var(--on-accent);
    border: 1px solid transparent; border-radius: var(--r-btn);
    box-shadow: var(--shadow-1);
    transition: background var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-2); text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: var(--shadow-1); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn .icon { width: 18px; height: 18px; }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); box-shadow: none; min-height: 44px; }
.btn--quiet:hover { background: var(--sunken); box-shadow: none; }
.btn--block { width: 100%; }

.alert { display: flex; gap: var(--s2); align-items: flex-start; margin: 0; color: var(--danger); font-size: .875rem; font-weight: 500; }
.alert::before { content: "!" / ""; flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: .75rem; font-weight: 700; }
.notice { margin: 0; background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: var(--r-m); padding: var(--s3) var(--s4); font-size: .9375rem; }

/* ---------- Guest pages (sign in, set password): brand panel + form ---------- */
body.guest { min-height: 100vh; }
.guest-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.guest__aside {
    position: relative; overflow: hidden;
    background: var(--nav-bg); color: var(--nav-ink);
    padding: var(--s4) var(--s5) var(--s5);
}
.guest__title {
    font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
    font-size: 1.375rem; line-height: 1.2; margin-top: var(--s4); max-width: 22ch;
}
.guest__points, .guest__foot { display: none; }
.guest__main { display: grid; align-content: start; justify-items: center; padding: var(--s6) var(--s4) var(--s7); }
.guest__card {
    width: 100%; max-width: 28rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
    padding: var(--s6) var(--s5); box-shadow: var(--shadow-2);
}
.guest__card h1 { font-size: 1.75rem; margin-bottom: var(--s1); }
.guest__lede { color: var(--ink-2); margin-bottom: var(--s2); }

@media (min-width: 960px) {
    .guest-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: none; }
    .guest__aside { display: flex; flex-direction: column; padding: var(--s6) var(--s7) var(--s6); }
    .guest__title { font-size: clamp(2rem, 1rem + 2vw, 2.875rem); line-height: 1.08; margin-top: auto; max-width: 16ch; }
    .guest__points {
        display: grid; gap: var(--s4); list-style: none; padding: 0; margin: var(--s6) 0 auto;
        color: var(--nav-ink); font-size: 1rem; max-width: 30rem;
    }
    .guest__points li { display: flex; gap: var(--s3); align-items: center; }
    .guest__points .icon { color: var(--nav-ink-2); }
    .guest__foot { display: block; color: var(--nav-ink-2); font-size: .8125rem; margin-top: var(--s6); }
    .guest__main { align-content: center; padding: var(--s7); }
    .guest__card { padding: var(--s7) var(--s6); }
}

/* ---------- Module list (roster): toolbar, table, side rail ---------- */
.module-grid { display: grid; gap: var(--s6); }
@media (min-width: 1280px) { .module-grid { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; } }

.page-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); max-width: none; }
.page-head--row > div { max-width: 46rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.search { position: relative; flex: 1 1 16rem; max-width: 24rem; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 42px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
    display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4);
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
    font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer;
    transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip__n { font-family: var(--font-mono); font-size: .75rem; font-variant-numeric: tabular-nums; opacity: .85; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }

.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th {
    text-align: left; font-family: var(--label-font); font-size: var(--label-size); letter-spacing: var(--label-tracking);
    text-transform: var(--label-case); font-weight: var(--label-weight); color: var(--ink-3);
    padding: var(--s3) var(--s4); background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1) var(--ease-out); }
.table tbody tr:hover { background: color-mix(in oklab, var(--sunken) 60%, var(--surface)); }
.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .875rem; white-space: nowrap; }

.member { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.member__name { color: var(--ink); font-weight: 600; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.member__name:hover { color: var(--accent-ink); text-decoration: underline; }
.member__meta { display: block; font-size: .8125rem; color: var(--ink-2); }
.avatar {
    width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%;
    background: var(--sunken); color: var(--ink); font-size: .8125rem; font-weight: 600; letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px var(--line);
}

.status { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink); font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--ok); }
.status--leave::before { background: transparent; box-shadow: inset 0 0 0 2px var(--warn); }
.status--probation::before { border-radius: 2px; transform: rotate(45deg) scale(.85); background: var(--accent); }
.status--inactive::before { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-3); }

.row-meta { display: none; }
@media (min-width: 900px) { .col-wide { display: table-cell; } }
@media (max-width: 899px) { .col-wide { display: none; } .row-meta { display: block; } }

.rail { display: grid; gap: var(--s4); }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s5); box-shadow: var(--shadow-1); }
.rail-card h2 { font-size: 1rem; margin-bottom: var(--s3); }
.rail-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rail-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 40px; border-bottom: 1px solid var(--line); font-size: .9375rem; color: var(--ink-2); }
.rail-list li:last-child { border-bottom: 0; }
.rail-list b { color: var(--ink); font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .875rem; }
.rail-card .btn--quiet { margin-top: var(--s4); width: 100%; }
.panel__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--sunken); font-size: .8125rem; color: var(--ink-2); }

/* ---------- Website module and dashboard slots ---------- */
.flash { margin-bottom: var(--s5); max-width: 46rem; }
.panel__body { padding: var(--s5); display: grid; gap: var(--s4); }
.panel__body--rule { border-top: 1px solid var(--line); }
.panel__body h2 { font-size: 1.0625rem; }
.kv { display: grid; gap: 0; margin: 0; }
.kv > div { display: grid; gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-family: var(--label-font); font-size: var(--label-size); letter-spacing: var(--label-tracking); text-transform: var(--label-case); font-weight: var(--label-weight); color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
@media (min-width: 640px) { .kv > div { grid-template-columns: 12rem minmax(0, 1fr); align-items: baseline; } }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
input[type=date] { width: 100%; min-height: 48px; height: 48px; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-m); padding: 12px 14px; }
.slots { display: grid; gap: var(--s5); margin-bottom: var(--s6); }
@media (min-width: 1024px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.slot-list { list-style: none; margin: 0; padding: 0; display: grid; }
.slot-list li { display: grid; gap: 2px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: .9375rem; color: var(--ink-2); }
.slot-list li:last-child { border-bottom: 0; }
.slot-list b { color: var(--ink); font-weight: 600; }
.filters { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; margin-bottom: var(--s4); }
.pager { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--sunken); }

/* ---------- One orchestrated entrance; nothing else moves on its own ---------- */
@media (prefers-reduced-motion: no-preference) {
    .page-head, .cards > li, .module-grid > *, .guest__card {
        animation: rise var(--dur-3) var(--ease-out) backwards;
        animation-delay: calc(var(--i, 0) * 28ms);
    }
}
/* Stagger by position, not inline styles, so a strict style-src CSP keeps it. */
.cards > li:nth-child(2) { --i: 1; } .cards > li:nth-child(3) { --i: 2; } .cards > li:nth-child(4) { --i: 3; }
.cards > li:nth-child(5) { --i: 4; } .cards > li:nth-child(6) { --i: 5; } .cards > li:nth-child(7) { --i: 6; }
.cards > li:nth-child(8) { --i: 7; } .cards > li:nth-child(9) { --i: 8; } .cards > li:nth-child(10) { --i: 9; }
.cards > li:nth-child(11) { --i: 10; } .cards > li:nth-child(n+12) { --i: 11; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}

/* ---------- Phone density: the 9pm check should not be a scroll marathon ---------- */
@media (max-width: 639px) {
    .cards { gap: var(--s3); }
    .card { padding: var(--s4); column-gap: var(--s3); }
    .card__icon { width: 40px; height: 40px; }
    .page-head { margin-bottom: var(--s5); }
}
@media (max-width: 899px) {
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Mail: domains, mailboxes, DNS records ---------- */
.mail-grid { display: grid; gap: var(--s6); margin-top: var(--s5); }
@media (min-width: 1024px) { .mail-grid { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }
.mail-main { display: grid; gap: var(--s5); min-width: 0; }
.mail-domain__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--sunken); }
.mail-domain__head h2 { font-size: 1.0625rem; margin: 0; overflow-wrap: anywhere; }
.mail-domain__actions, .row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.mail-empty, .mail-dns { padding: var(--s4); }
.mail-dns { border-bottom: 1px solid var(--line); }
.mail-dns .table { margin-top: var(--s3); }
.mail-inline { grid-template-columns: 1fr; max-width: 28rem; }
.dns-value { font-family: var(--font-mono); font-size: .8125rem; overflow-wrap: anywhere; word-break: break-all; }
.tag__x { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0 0 0 var(--s2); min-height: 24px; }
.notice + .alert, .alert + .alert, .notice + .notice { margin-top: var(--s3); }
