/* =============================================================================
   panel.css — the whole visual system for the staff panel.

   REGISTER: this is an OUT-OF-CHARACTER staff tool. It deliberately does not
   borrow the sheriff panel's in-character parchment: a moderator reading a ban
   appeal at 2 a.m. is not in the fiction, and dressing an administrative tool
   as a prop makes it harder to read for no gain. The reference is the in-game
   `grind_jobs` panel -- restrained monochrome, a display serif for headings, a
   plain sans for text, ONE accent used only where something needs attention.

   TWO SELF-HOSTED WEBFONTS, AND NOTHING FROM A THIRD PARTY (decision 16).
   This file said NO WEBFONTS and named Cinzel and Open Sans first anyway, on
   the theory that plenty of machines have them installed. They mostly do not,
   so the panel has been reading in the fallback stack while the in-game
   screens read in Cinzel -- which is the mismatch the decision is about. The
   `@font-face` blocks below are same-origin, served by `routes/assets.js`, and
   `app.js` now carries `font-src 'self'` for them; before that key existed,
   `default-src 'none'` covered `font-src` and any webfont was BLOCKED by the
   CSP rather than merely slow. There is still no `@import` and no
   fonts.googleapis.com: a staff tool that fetches a face from a third party
   hands that origin every staff member's IP and the URL of every page they
   open.

   THE FALLBACK STACK IS UNCHANGED AND STILL LOAD-BEARING. A deploy that did
   not carry the two woff2 files gets a 404 and the system serif/sans, which is
   the register every page below was reviewed in.

   NO INLINE STYLES ANYWHERE, for the same CSP reason: `style-src 'self'` has no
   `'unsafe-inline'`, so a `style=` attribute silently does nothing. Everything
   visual is here.

   PHONE FIRST. Staff open this on a phone. Every layout below starts in one
   column and widens at 40rem; nothing depends on hover; tap targets are at
   least 44px tall; the only interactive controls are links and two buttons.
   **THE 44px FLOOR SURVIVES THE FONT SWAP BY CONSTRUCTION**: every tap target
   below is `min-height: 2.75rem`, a rem measure that does not move with a
   face's metrics, so a narrower or taller font can only make a target bigger.
   The headings are the part that does move -- see the metric note on `h1, h2,
   h3`.
   ============================================================================= */

/* --- the two faces ---------------------------------------------------------
   Both are the variable LATIN subsets, so one file covers the whole 400-700
   range each and there is no second request for a bold. They are the same two
   files `grind_business/html/assets/fonts/` ships to the in-game panel, which
   is the entire point of the decision: one register across the game screens
   and the staff screens. Cinzel is OFL, Open Sans is Apache-2.0.

   **THE URL IS ABSOLUTE, AND THAT IS NOT STYLE.** This file is served at
   `/css/panel.css`, so a relative `fonts/cinzel-var.woff2` would resolve to
   `/css/fonts/cinzel-var.woff2` -- a 404, silently, in the fallback face.

   `font-display: swap`, deliberately. The alternative renders headings as
   nothing for up to three seconds, and staff open this on a phone with one bar
   of signal while a server is on fire. The fallback is in the same register,
   so the swap changes the face and not the layout. */
@font-face {
    font-family: 'Cinzel';
    src: url('/fonts/cinzel-var.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Open Sans';
    src: url('/fonts/opensans-var.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;

    /* Monochrome ramp. Named by role, not by colour, so dark mode is a
       redefinition rather than a second stylesheet. */
    --ink: #14110f;
    --ink-soft: #4a423c;
    --ink-faint: #756a62;
    --paper: #f7f5f2;
    --paper-raised: #ffffff;
    /* The sidebar and table heads: one step BELOW the page, so the frame
       recedes and the content is the brightest thing on screen. */
    --paper-sunk: #efebe5;
    --rule: #ddd6cd;
    --rule-strong: #b9aea1;

    /* THE ONE ACCENT. Brass, not blood: it marks the primary action and the
       focus ring, and it is never used for decoration. Two accents would mean
       neither of them means anything. A link is an action, so it wears it. */
    --accent: #8a5a12;
    --accent-ink: #ffffff;
    --link: var(--accent);

    /* State tints, deliberately desaturated -- they must read as "note this",
       not as an alert dashboard. */
    --tone-blocked: #8c2f2f;
    --tone-waiting: #6b5a2a;
    --tone-broken: #6b4a1f;
    /* Money IN, an owned shop, a delivered grant. As desaturated as the other
       three: it says "fine", it does not celebrate. */
    --tone-ok: #3d6a3f;

    --font-display: 'Cinzel', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia,
        'Times New Roman', serif;
    --font-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
        Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

    --space: 1rem;
    --radius: 3px;
    /* A centred page with no sidebar (sign-in, the public forms). */
    --wrap: 54rem;
    /* The sidebar, and the widest a signed-in page's content grows beside
       it. Tables of money need the room; prose pages cap themselves. */
    --nav-w: 15rem;
    --content: 72rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #ece7e1;
        --ink-soft: #b6aca3;
        --ink-faint: #8b817a;
        --paper: #131211;
        --paper-raised: #1c1a18;
        --paper-sunk: #0e0d0c;
        --rule: #332f2b;
        --rule-strong: #4c463f;
        --accent: #d2a054;
        --accent-ink: #14110f;
        --tone-blocked: #d98b8b;
        --tone-waiting: #cbb375;
        --tone-broken: #d2a054;
        --tone-ok: #8fc08c;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    /* Long ban reasons and player-authored report text arrive with no spaces in
       them more often than you would think. */
    overflow-wrap: break-word;
}

/* Links had no rule at all and drew in the browser's own blue. */
a {
    color: var(--link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    text-decoration-thickness: 2px;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--space);
}

/* --- skip link ----------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.5rem 1rem;
    z-index: 10;
}

.skip-link:focus {
    left: 0;
}

/* --- header / footer -----------------------------------------------------
   ONE ROW from 40rem: [Menu] wordmark ... search · sign out. On a phone the
   search drops to its own full-width row, because a search input squeezed
   beside a sign-out button is an input nobody can type a license into. */
.site-head {
    border-bottom: 1px solid var(--rule);
    background: var(--paper-raised);
}

.site-head__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    min-height: 3.5rem;
    padding: 0.5rem var(--space);
}

.site-head__search {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
}

.site-head__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

/* A page that fills neither block leaves no gap in the row. */
.site-head__search:not(:has(*)),
.site-head__actions:not(:has(*)) {
    display: none;
}

@media (min-width: 40rem) {
    .site-head__inner {
        flex-wrap: nowrap;
        padding: 0.5rem 1.5rem;
    }

    .site-head__search {
        order: 0;
        flex: 0 1 30rem;
        margin-left: auto;
    }

    .site-head__search:has(*) + .site-head__actions {
        margin-left: 0;
    }
}

/* The phone menu button. It ships `hidden` and /js/panel.js reveals it, so a
   browser without script never shows a button that does nothing; the rule
   below keeps `hidden` winning over `display`. */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0 0.8rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.nav-toggle[hidden] {
    display: none;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 1rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.nav-toggle__bars {
    position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-open .nav-toggle {
    border-color: var(--accent);
}

/* The sidebar is always drawn from 60rem up, so the button has no job there. */
@media (min-width: 60rem) {
    .nav-toggle {
        display: none;
    }
}

/* --- the shell: sidebar + page ---------------------------------------------
   A signed-in page is a sidebar column and a content column from 60rem up.
   The sidebar's colour is painted by the SHELL, not the nav, so the column
   runs the full height of a long page while the nav itself stays sticky. A
   page with no nav (sign-in, the public forms) keeps the old centred column. */
.shell__main {
    display: block;
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 2rem var(--space) 3rem;
}

.has-nav .shell__main {
    max-width: var(--content);
}

.site-nav {
    background: var(--paper-sunk);
    border-bottom: 1px solid var(--rule);
    padding: 0.75rem var(--space) 1rem;
}

.site-nav__heading {
    margin: 0 0 0.2rem;
    padding: 0 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav__link {
    display: flex;
    align-items: center;
    /* 44px minimum tap target (the file header's own rule). */
    min-height: 2.75rem;
    padding: 0 0.75rem;
    border-left: 3px solid transparent;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--ink-soft);
    font-size: 0.93rem;
    text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.site-nav__link.is-current {
    color: var(--ink);
    background: var(--paper-raised);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Under 60rem: without script the groups are drawn open as a compact grid
   above the page; with script they fold behind the Menu button. */
@media (max-width: 59.99rem) {
    .site-nav {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
        gap: 0.75rem 1rem;
    }

    .js .site-nav {
        display: none;
    }

    .js .nav-open .site-nav {
        display: grid;
    }
}

@media (min-width: 60rem) {
    .has-nav .shell {
        display: grid;
        grid-template-columns: var(--nav-w) minmax(0, 1fr);
        align-items: start;
        min-height: calc(100vh - 3.5rem);
        background: linear-gradient(to right,
            var(--paper-sunk) calc(var(--nav-w) - 1px),
            var(--rule) calc(var(--nav-w) - 1px),
            var(--rule) var(--nav-w),
            transparent var(--nav-w));
    }

    .site-nav {
        position: sticky;
        top: 0;
        max-height: 100vh;
        overflow-y: auto;
        background: none;
        border-bottom: 0;
        padding: 1.25rem 0.75rem 2rem 0;
    }

    .site-nav__group + .site-nav__group {
        margin-top: 1.1rem;
    }

    .has-nav .shell__main {
        padding: 2rem 2.5rem 3rem;
    }
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wordmark__county {
    font-weight: 700;
}

.wordmark__rule {
    display: inline-block;
    width: 1.5rem;
    height: 1px;
    background: var(--rule-strong);
}

.wordmark__panel {
    color: var(--ink-faint);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
}

.site-foot {
    padding: 1.25rem 0 2rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint);
    font-size: 0.8rem;
}

.site-foot__inner {
    padding: 0 var(--space);
}

.site-foot p {
    margin: 0;
}

@media (min-width: 40rem) {
    .site-foot__inner {
        padding: 0 1.5rem;
    }
}

/* A narrow phone keeps the wordmark to its first two words, a little
   smaller, so Menu, the wordmark and Sign out still share one row. */
@media (max-width: 26rem) {
    .wordmark__rule,
    .wordmark__panel {
        display: none;
    }

    .site-head__inner {
        gap: 0.5rem 0.6rem;
    }

    .wordmark {
        font-size: 0.95rem;
        letter-spacing: 0.06em;
    }

    .nav-toggle {
        padding: 0 0.65rem;
    }

    .site-head__actions .button--quiet {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
}

/* --- typography ---------------------------------------------------------- */

/* **THE METRICS MOVED WITH THE FACE (decision 16).** `line-height: 1.2` was
   set against Georgia and Palatino, whose caps sit low in the em. Cinzel is a
   titling face: its capitals are taller, its "lowercase" are small capitals, so
   a heading now fills most of its line box instead of two thirds of it. At 1.2
   an `h2`'s caps very nearly touch the rule underneath (`padding-bottom` is
   0.35rem and the border is 1px), and two-line headings -- a long shop label on
   a phone -- close up. 1.25 is the smallest value that keeps both clear, and it
   is deliberately not larger: these headings sit above dense tables and the
   space between a heading and its section is doing work.

   `letter-spacing` is NOT increased to match. Cinzel is narrower than the
   fallbacks, so the tracking that read as restrained in Georgia reads as
   restrained here too; widening it as well would turn every `h2` into a
   wordmark. `font-weight: 700` is a real master in the variable file, so
   nothing below is synthetically bolded. */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: 1.6rem;
}

h2 {
    font-size: 1.15rem;
    margin-top: 2rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--rule);
}

h3 {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 1.5rem;
}

p {
    margin: 0 0 1rem;
}

.lede {
    color: var(--ink-soft);
}

.fineprint {
    font-size: 0.82rem;
    color: var(--ink-faint);
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
    padding: 0.1em 0.35em;
    border-radius: var(--radius);
}

/* --- cards --------------------------------------------------------------- */
main {
    padding-top: 2rem;
}

.card {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card--narrow {
    max-width: 34rem;
    margin: 0 auto;
}

/* --- buttons ------------------------------------------------------------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 44px minimum tap target: this is used one-handed, on a phone. */
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    border-color: var(--ink-soft);
}

.button--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    width: 100%;
}

.button--quiet {
    border-color: transparent;
    color: var(--ink-faint);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.button--quiet:hover {
    color: var(--ink);
    border-color: var(--rule);
}

:where(a, button, input, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
}

@media (min-width: 40rem) {
    .button--primary {
        width: auto;
    }
}

/* --- notices ------------------------------------------------------------- */
.notice {
    border: 1px solid var(--rule-strong);
    border-left-width: 3px;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.notice--blocked {
    border-left-color: var(--tone-blocked);
}

.notice--waiting {
    border-left-color: var(--tone-waiting);
}

.notice--broken {
    border-left-color: var(--tone-broken);
}

.notice__title {
    margin: 0;
    font-weight: 600;
}

.notice__body {
    margin: 0.35rem 0 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.warn-chip {
    color: var(--tone-broken);
    letter-spacing: 0.06em;
}

/* --- status pages -------------------------------------------------------- */
.page-status h1 {
    margin-bottom: 0.75rem;
}

.tone-blocked h1 {
    color: var(--tone-blocked);
}

.tone-waiting h1 {
    color: var(--tone-waiting);
}

.tone-broken h1 {
    color: var(--tone-broken);
}

.todo {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    color: var(--ink-soft);
}

.todo li {
    margin-bottom: 0.5rem;
}

.who {
    font-size: 0.9rem;
    color: var(--ink-faint);
}

/* --- identity ------------------------------------------------------------ */
.identity {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid var(--rule-strong);
    flex: none;
    background: var(--paper-raised);
}

.avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
}

.identity__text {
    flex: 1 1 16rem;
    min-width: 0;
}

.identity__meta {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.ranks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rank {
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 0.35rem 0.6rem;
    line-height: 1.3;
}

.rank__label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rank__source {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-faint);
}

/* The owner floor is the break-glass path, and the person on it should be able
   to SEE that they are on it rather than holding the role. */
.rank--owner {
    border-color: var(--accent);
}

.rank--none {
    color: var(--ink-faint);
    border-style: dashed;
}

/* --- permissions --------------------------------------------------------- */
.panel-section {
    margin-top: 2rem;
}

.perm-group {
    margin-bottom: 1.25rem;
}

.perm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.perm {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
}

.perm__key {
    background: none;
    padding: 0;
    color: var(--ink);
    font-size: 0.85rem;
    flex: 1 1 14rem;
}

.perm__scope {
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.perm--unbuilt .perm__key,
.perm--unbuilt .perm__scope {
    color: var(--ink-faint);
}

.chip {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    color: var(--ink-faint);
    white-space: nowrap;
}

.chip--priv {
    border-color: var(--accent);
    color: var(--accent);
}

.chip--live {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- inventory ----------------------------------------------------------- */
.inventory {
    list-style: none;
    margin: 0;
    padding: 0;
}

.inventory__item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
}

.inventory__name {
    font-weight: 600;
}

.inventory__note {
    grid-column: 1 / -1;
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.inventory__item--planned .inventory__name {
    color: var(--ink-soft);
    font-weight: 400;
}

/* --- global header search ------------------------------------------------
   PHONE FIRST, and this is the control that proves it: on a phone the search
   gets its own full-width row under the wordmark, because a search input
   squeezed beside a sign-out button is an input nobody can type a license
   into. At 40rem it joins the header row.

   NO JAVASCRIPT. It is a GET form: submitting navigates, the back button
   works, and the results page is a URL a staff member can paste into Discord
   -- which is exactly why the model blanks the term for a license or a
   Discord id before it ever reaches the `value` attribute. */
.site-search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    margin: 0;
}

.site-search__label {
    position: absolute;
    left: -9999px;
}

.site-search__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    /* 16px or iOS Safari zooms the whole page on focus, and the staff member
       is then reading a header at 150% with one hand. */
    font-size: 1rem;
}

.site-search__input::placeholder {
    color: var(--ink-faint);
}

a.wordmark {
    color: inherit;
    text-decoration: none;
}

/* --- search results ------------------------------------------------------ */
.result-list,
.rows,
.char-list,
.ident-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result,
.char,
.row {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
}

.result__head,
.char__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}

.result__name,
.char__name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--ink);
}

/* A result with no citizenid cannot be opened -- there is no card address for
   it. It is shown rather than hidden, because a staff member searching a
   license that is plainly in the database must not be told "no results". */
.result__name--dead {
    color: var(--ink-faint);
}

.result__meta,
.char__meta,
.row__meta {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.result__chars {
    margin: 0.35rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.result__char::after {
    content: '';
}

/* --- the player card ----------------------------------------------------- */
.facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem 1rem;
    margin: 0 0 1rem;
}

.facts dt {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 0.75rem;
}

.facts dd {
    margin: 0;
}

.ident {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9rem;
}

.ident__kind {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    flex: 0 0 5rem;
}

.ident__value {
    flex: 1 1 14rem;
    min-width: 0;
}

.ident__meta {
    color: var(--ink-faint);
    font-size: 0.8rem;
}

.money {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
    padding: 0;
    font-size: 0.85rem;
}

.money__label {
    color: var(--ink-faint);
}

.money__amount {
    font-family: var(--font-mono);
}

.row__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: baseline;
    margin: 0;
}

.row__title {
    flex: 1 1 14rem;
    min-width: 0;
}

/* The per-section total, beside its heading. It is always the length of the
   list under it -- there is no second COUNT(*) anywhere on this page. */
.count {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0;
    color: var(--ink-faint);
}

.chip--state {
    border-color: var(--tone-waiting);
    color: var(--tone-waiting);
}

/* --- moderation actions --------------------------------------------------
   PHONE FIRST, AND DELIBERATELY CLOSED BY DEFAULT. Every action is a native
   `<details>`: no script, no ARIA plumbing, no hover, and a ban form that is
   not sitting open under somebody's thumb. The summary is a 44px tap target
   like every other control here.

   THE BUTTON IS NEVER DISABLED. §6: when the game server is offline the row
   sits pending and the UI says so in words underneath -- "a disabled button
   the staff member cannot reason about is worse than an honest delay". There
   is deliberately no `.button[disabled]` rule in this file for these forms. */
.actions--section {
    display: block;
    margin-top: 1rem;
}

.action {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--paper-raised);
}

.action__summary {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.action[open] .action__summary {
    border-bottom: 1px solid var(--rule);
}

.action__form {
    padding: 0.85rem;
    margin: 0;
}

.field {
    display: block;
    border: 0;
    padding: 0;
    margin: 0 0 0.85rem;
}

.field__label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.field__input {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    /* 16px, or iOS Safari zooms the page on focus and the staff member is
       typing a ban reason at 150% with one hand. */
    font-size: 1rem;
    resize: vertical;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    font-size: 0.95rem;
}

.fineprint--bridge {
    border-left: 3px solid var(--tone-waiting);
    padding-left: 0.6rem;
    margin-top: 0.75rem;
}

/* The done banner. Same shape as the other notices; the accent rather than a
   warning tone, because it reports something that worked. */
.notice--done {
    border-left-color: var(--accent);
}

@media (min-width: 40rem) {
    .facts {
        grid-template-columns: 9rem 1fr;
    }

    .facts dt {
        margin-top: 0;
        padding-top: 0.15rem;
    }
}


/* -----------------------------------------------------------------------------
   §9's HOME QUEUES.

   PHONE FIRST, like everything above: one column, widening to a grid at 40rem.
   The whole tile is one link -- a 44px-plus tap target with the number, the
   label and the unit inside it -- because a staff member reading this on a
   phone at 2 a.m. should not have to hit a word.

   THE NUMBER IS THE ONLY LARGE THING ON THE PAGE. That is the entire visual
   argument for this section: it is a worklist, it is read in a hurry, and the
   count is what decides whether to tap.
   ----------------------------------------------------------------------------- */
.queues {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 40rem) {
    .queues {
        grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    }
}

.queue {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0.9rem 1rem 0.8rem;
}

.queue__link {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    align-items: baseline;
    text-decoration: none;
    color: inherit;
    /* The tap target is the link, and it fills the tile. */
    min-height: 2.75rem;
}

.queue__link:hover .queue__label,
.queue__link:focus-visible .queue__label {
    text-decoration: underline;
}

.queue__count {
    grid-row: 1 / 3;
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.queue__label {
    font-weight: 600;
    color: var(--ink);
}

.queue__unit {
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.queue__note {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* AN EMPTY QUEUE IS STILL SHOWN -- see views/home-queues.js: "nothing is
   waiting" and "you cannot see this" must not be the same blank space. It is
   quietened, not hidden, so the eye goes to the tiles with work in them. */
.queue--empty {
    border-style: dashed;
}

.queue--empty .queue__count,
.queue--empty .queue__label {
    color: var(--ink-faint);
    font-weight: 400;
}

/* A COUNT THAT THREW. The tile stays, and says so: the list behind it still
   opens, and one broken summary must not read as an empty queue. */
.queue--failed {
    border-color: var(--tone-broken);
}

.queue--failed .queue__count {
    color: var(--tone-broken);
}

/* The permission table, demoted to a disclosure. `<summary>` is display:
   list-item, so the h2 inside it has to be inline or the marker sits on its
   own line above the heading. */
.perm-details > summary {
    cursor: pointer;
}

.perm-details > summary > h2 {
    display: inline;
}

.perm-details[open] > summary {
    margin-bottom: 1rem;
}

/* The empty queues, collapsed to one line. See home.njk: they are named and
   linked rather than dropped, because "none waiting" and "no access" must not
   render as the same blank space. */
.all-clear {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--ink-faint);
}

.all-clear__lead {
    font-weight: 600;
}

.all-clear__link {
    color: var(--ink-soft);
}

/* =============================================================================
   THE OPS BOARD — the home dashboard, and the wall.

   READ FROM ACROSS A ROOM. Two figures at 4rem, the rest at 2rem, each with a
   word under it. Everything here is sized so the owner can tell from an office
   doorway whether anything is wrong; `.board--bad` puts a rule down the side in
   the blocked tint so the answer arrives before any number is read.

   The tones are the three already defined at the top of this file. No new
   colours: an ops board that invented a fourth red would be the second red on
   the site meaning something slightly different.
   ============================================================================= */
.board {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: var(--space);
}

.board--warn { border-left-color: var(--tone-waiting); }
.board--bad { border-left-color: var(--tone-blocked); }

.board__headline,
.board__metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.board__headline {
    margin-bottom: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stat__value {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.05;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.stat--big .stat__value { font-size: 4rem; }

.stat__unit {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ink-faint);
}

.stat__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
}

.stat__note {
    font-size: 0.78rem;
    color: var(--ink-faint);
}

/* The tone lands on the NUMBER, not the tile. A tinted card at this size is a
   wall of colour; a coloured figure is a reading. */
.stat.tone-warn .stat__value { color: var(--tone-waiting); }
.stat.tone-bad .stat__value { color: var(--tone-blocked); }

/* Per-resource heartbeats: one row each, so a single dead bridge shows rather
   than being averaged away by the two that are fine. */
.beats {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.beat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.beat__name { font-family: var(--font-mono); color: var(--ink-soft); }
.beat__age { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.beat.tone-warn { border-color: var(--tone-waiting); }
.beat.tone-warn .beat__age { color: var(--tone-waiting); }
.beat.tone-bad { border-color: var(--tone-blocked); }
.beat.tone-bad .beat__age { color: var(--tone-blocked); font-weight: 600; }

.board__warnings,
.board__notes {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
}

.board__warning {
    border-left: 3px solid var(--tone-blocked);
    padding: 0.35rem 0 0.35rem 0.7rem;
    margin-bottom: 0.4rem;
    color: var(--ink);
}

/* Notes are information somebody wrote on purpose. They are shown and they do
   NOT set the board's tone -- see views/home-ops.js. */
.board__notes {
    font-size: 0.82rem;
    color: var(--ink-faint);
}

.board__foot {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* -----------------------------------------------------------------------------
   WALL MODE. Same page, same numbers, further away.
   ----------------------------------------------------------------------------- */
.page-wall .site-nav,
.page-wall .nav-toggle,
.page-wall .site-head__search,
.page-wall .site-foot { display: none; }

/* No sidebar column on the wall: the board takes the whole screen. */
.page-wall .shell { display: block; background: none; min-height: 0; }
.page-wall .shell__main { max-width: none; }

.page-wall .board { border-width: 1px 1px 1px 6px; }

@media (min-width: 60rem) {
    .page-wall .stat--big .stat__value { font-size: 6rem; }
    .page-wall .stat__value { font-size: 3rem; }
    .page-wall .stat__label { font-size: 1.05rem; }
}

/* =============================================================================
   THE MISSING PRIMITIVES, AND THE BUSINESS PAGES (owner, 2026-09-28).

   `.table` is named by twenty-two templates and HAD NO RULE AT ALL, so every
   table in the panel drew in the browser default: no padding, no rules, no
   header treatment -- most of what "looks sloppy" meant. The same was true
   of `.detail-list`, `.stack`, `.pager`, `.thread`, `.button--danger` and six
   of the chip and notice tones the models emit. Each class below is one a
   template already names; nothing here renames anything.
   ============================================================================= */

/* --- tables ---------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--rule);
}

.table thead th {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: var(--paper-sunk);
    border-bottom-color: var(--rule-strong);
    color: var(--ink-faint);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table .nowrap {
    white-space: nowrap;
}

.muted {
    color: var(--ink-faint);
}

/* A framed table. On a phone it scrolls sideways INSIDE the frame rather than
   pushing the page wider than the screen. */
.table-wrap {
    overflow-x: auto;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin: 0 0 1rem;
}

.table-wrap > .table {
    margin: 0;
}

.table-wrap > .table tbody tr:last-child > * {
    border-bottom: 0;
}

/* A long table in a fixed-height box with a header that stays put: the
   ledger's hundred rows no longer make the page a hundred rows long. The
   header's rule is an inset shadow because a collapsed border does not
   travel with a sticky cell. */
.table-scroll {
    max-height: 30rem;
    overflow: auto;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 0;
    box-shadow: inset 0 -1px 0 var(--rule-strong);
}

/* The tables no template wraps yet: on a phone they scroll sideways on their
   own rather than widening the page. */
@media (max-width: 40rem) {
    .table:not(.table-wrap > .table) {
        display: block;
        overflow-x: auto;
    }
}

/* Money, signed from the shop's point of view. */
.amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.amount--in {
    color: var(--tone-ok);
}

.amount--out {
    color: var(--tone-blocked);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--ink-faint);
}

/* --- definition lists, forms, buttons ------------------------------------ */
.detail-list {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
    gap: 0.45rem 1.25rem;
    margin: 0;
}

.detail-list dt {
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.detail-list dd {
    margin: 0;
}

.stack {
    display: grid;
    gap: 0.85rem;
    max-width: 34rem;
    margin: 0;
}

.stack > .field {
    margin: 0;
}

.stack > .button,
.stack > .inline-form {
    justify-self: start;
}

.field--check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
}

.field--check .field__label {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
}

.field--check input {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
    accent-color: var(--accent);
}

.field__note {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.button--danger {
    border-color: var(--tone-blocked);
    color: var(--tone-blocked);
    font-weight: 600;
}

.button--danger:hover {
    background: var(--tone-blocked);
    border-color: var(--tone-blocked);
    color: var(--paper-raised);
}

.panel-section--danger {
    border-left: 3px solid var(--tone-blocked);
    padding-left: 1rem;
}

/* --- chip and notice tones ----------------------------------------------
   The vocabulary the models already emit (`tone`): new is neutral, open and
   waiting want attention, confirmed and ok are fine, closed is done with,
   error and blocked are wrong. */
.chip {
    display: inline-block;
    line-height: 1.5;
    vertical-align: middle;
}

.chip--open,
.chip--waiting,
.chip--warn {
    border-color: var(--tone-waiting);
    color: var(--tone-waiting);
}

.chip--confirmed,
.chip--ok,
.chip--add {
    border-color: var(--tone-ok);
    color: var(--tone-ok);
}

.chip--closed {
    border-style: dashed;
    color: var(--ink-faint);
}

.chip--error,
.chip--blocked,
.chip--bad,
.chip--remove {
    border-color: var(--tone-blocked);
    color: var(--tone-blocked);
}

.chip--broken {
    border-color: var(--tone-broken);
    color: var(--tone-broken);
}

.notice--error,
.notice--bad {
    border-left-color: var(--tone-blocked);
}

.notice--ok {
    border-left-color: var(--tone-ok);
}

/* --- pager and threads ----------------------------------------------------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.thread {
    list-style: none;
    margin: 0;
    padding: 0;
}

.thread__item {
    margin-bottom: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.thread__item--internal {
    border-left: 3px solid var(--tone-waiting);
    background: color-mix(in srgb, var(--tone-waiting) 6%, var(--paper-raised));
}

.thread__meta {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: var(--ink-faint);
}

/* Player- and staff-written text keeps its line breaks. */
.thread__body,
.row__body,
.ticket__body {
    margin: 0;
    white-space: pre-wrap;
}

.money__item {
    display: inline-flex;
    gap: 0.35rem;
}

/* --- page head -------------------------------------------------------------- */
.page-head {
    margin: 0 0 1.5rem;
}

.page-head h1 {
    margin-bottom: 0.4rem;
}

.crumbs {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: var(--ink-faint);
}

.crumbs a {
    color: var(--ink-soft);
}

.page-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: center;
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

/* --- stat tiles: the numbers a page is about, before any table ------------- */
.tiles {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0;
}

.tile {
    min-width: 0;
    padding: 0.8rem 1rem;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.tile__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.tile__value {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tile__note {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.tile--warn {
    border-left: 3px solid var(--tone-waiting);
}

.tile--bad {
    border-left: 3px solid var(--tone-blocked);
}

a.tile {
    color: inherit;
    text-decoration: none;
}

a.tile:hover {
    border-color: var(--rule-strong);
}

a.tile.is-current {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* --- panels: a titled card whose body is flush (a table) or padded -------- */
.panel {
    min-width: 0;
    margin: 0 0 1.25rem;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.panel__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--rule);
}

.panel__title {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 1.05rem;
}

.panel__hint {
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.panel__body {
    padding: 1rem;
}

.panel__body > :last-child {
    margin-bottom: 0;
}

.panel > .table-wrap,
.panel > .table-scroll {
    margin: 0;
    border: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

.panel__foot {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--rule);
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* THE LEDGER ON A PHONE. Five columns do not fit 390px, and a ledger you
   have to scroll sideways to read the amount of is not a ledger. Each row
   becomes two lines -- kind and amount, then player and balance -- with the
   time under them; the header goes, and the balance says what it is. */
@media (max-width: 40rem) {
    .table--ledger,
    .table--ledger tbody {
        display: block;
    }

    .table--ledger thead {
        display: none;
    }

    .table--ledger tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "kind amount"
            "player balance"
            "when when";
        gap: 0.1rem 0.75rem;
        padding: 0.6rem 0.9rem;
        border-bottom: 1px solid var(--rule);
    }

    .table--ledger td {
        padding: 0;
        border: 0;
    }

    .table--ledger td:nth-child(1) { grid-area: when; font-size: 0.8rem; color: var(--ink-faint); }
    .table--ledger td:nth-child(2) { grid-area: kind; font-weight: 600; }
    .table--ledger td:nth-child(3) { grid-area: player; font-size: 0.88rem; }
    .table--ledger td:nth-child(4) { grid-area: amount; }
    .table--ledger td:nth-child(5) { grid-area: balance; font-size: 0.8rem; color: var(--ink-faint); }

    .table--ledger td[data-label]::before {
        content: attr(data-label) " ";
    }
}

.panel__empty {
    margin: 0;
    padding: 1rem;
    color: var(--ink-faint);
}

/* Two panels side by side on a wide screen, stacked on a phone. */
.cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    margin: 0 0 1.25rem;
    align-items: start;
}

.cols > .panel {
    margin: 0;
}

@media (min-width: 64rem) {
    .cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.section-title {
    margin: 2rem 0 0.75rem;
}

/* --- the ownership timeline ------------------------------------------------ */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--rule);
}

.timeline__item:last-child {
    border-bottom: 0;
}

.timeline__dot {
    width: 0.6rem;
    height: 0.6rem;
    margin-top: 0.5rem;
    border-radius: 50%;
    background: var(--rule-strong);
}

.timeline__item--in .timeline__dot {
    background: var(--tone-ok);
}

.timeline__item--out .timeline__dot {
    background: var(--tone-blocked);
}

.timeline__title {
    margin: 0;
    font-weight: 600;
}

.timeline__meta {
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
    color: var(--ink-faint);
}

/* --- disclosures: what a page keeps one click away ----------------------------
   A native <details>: no script, and closed until somebody wants it. */
.disclosure {
    margin: 0 0 1.25rem;
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.disclosure > summary,
.action__summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.75rem;
    cursor: pointer;
    list-style: none;
}

.disclosure > summary {
    padding: 0.35rem 1rem;
    font-weight: 600;
}

.disclosure > summary::-webkit-details-marker,
.action__summary::-webkit-details-marker {
    display: none;
}

/* The chevron: a rotated corner, no icon font, no image. */
.disclosure > summary::before,
.action__summary::before {
    content: '';
    flex: none;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--ink-faint);
    border-bottom: 2px solid var(--ink-faint);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}

.disclosure[open] > summary::before,
.action[open] > .action__summary::before {
    transform: rotate(45deg);
}

.disclosure[open] > summary {
    border-bottom: 1px solid var(--rule);
}

.disclosure__hint {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--ink-faint);
}

.disclosure__body {
    padding: 0.25rem 1rem 1rem;
}

.disclosure__body .row:last-child {
    border-bottom: 0;
}

/* The full activity feed inside a disclosure: compact, and it scrolls. */
.feed {
    max-height: 32rem;
    overflow-y: auto;
}

.feed .row {
    padding: 0.55rem 0;
}

.feed .row__head {
    font-size: 0.9rem;
}

/* --- the manage forms: a grid of closed <details> ---------------------------- */
.action-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
    margin: 0 0 1.25rem;
}

@media (min-width: 48rem) {
    .action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.action-grid > .action {
    margin: 0;
}

.action__hint {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--ink-faint);
}

.action--danger {
    border-color: color-mix(in srgb, var(--tone-blocked) 45%, var(--rule));
}

.action--danger > .action__summary {
    color: var(--tone-blocked);
}

.action__form .fineprint:last-of-type {
    margin-bottom: 0.85rem;
}

/* --- the Ownership form's player picker (2026-10-12) ------------------------
   business-detail.njk + /js/owner-picker.js. A combobox whose list sits IN THE
   FLOW under the box rather than floating over the form, so on a phone it
   pushes the fee field down instead of covering it, and nothing can be clipped
   by the <details> it lives in. Every state is a class or `hidden`: the CSP is
   style-src 'self', so the script sets no style. */
.owner-picker__list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    max-height: 19rem;
    overflow-y: auto;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper-raised);
}

/* `hidden` must win over each part's own `display` (a class beats the UA's
   [hidden] rule otherwise). */
.owner-picker [hidden] {
    display: none;
}

.owner-picker__option {
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    cursor: pointer;
}

.owner-picker__option:last-child {
    border-bottom: 0;
}

.owner-picker__option:hover,
.owner-picker__option.is-active {
    background: var(--paper-sunk);
}

/* The keyboard's place in the list, said with more than a tint. */
.owner-picker__option.is-active {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Greyed and refused: the player has not linked Discord. */
.owner-picker__option.is-disabled {
    cursor: not-allowed;
    color: var(--ink-faint);
}

.owner-picker__option.is-disabled:hover:not(.is-active) {
    background: transparent;
}

.owner-picker__line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.6rem;
}

.owner-picker__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.owner-picker__option.is-disabled .owner-picker__name {
    font-weight: 400;
}

.owner-picker__cid {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-faint);
}

.owner-picker__chip {
    margin-left: auto;
}

.owner-picker__reason {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

.owner-picker__chosen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.6rem;
    min-height: 2.75rem;
    padding: 0.3rem 0.3rem 0.3rem 0.75rem;
    border: 1px solid var(--rule-strong);
    border-left: 3px solid var(--tone-ok);
    border-radius: var(--radius);
    background: var(--paper-sunk);
}

.owner-picker__chosen-label {
    flex-basis: 100%;
    font-size: 0.75rem;
    color: var(--ink-faint);
}

.owner-picker__change {
    margin-left: auto;
}

.owner-picker__status {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Empty, it takes no room -- but it stays rendered: a live region that is
   display:none when its text arrives is one a screen reader may not read. */
.owner-picker__status:empty {
    margin: 0;
}

/* Said to a screen reader, not shown: "New owner: ..." repeats the chosen box
   that is already on screen. */
.owner-picker__status.is-quiet {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- filters above a list ---------------------------------------------------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin: 0 0 1rem;
}

.toolbar .field {
    margin: 0;
    min-width: 10rem;
}

/* A tile that is a link (the register's counts filter the list). The <li>
   stretches it to the row's height so a row of tiles lines up. */
.tiles > li:not(.tile) {
    display: flex;
    min-width: 0;
}

.tiles > li:not(.tile) > .tile {
    flex: 1 1 auto;
    display: block;
}

.tiles--compact {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.tiles--compact .tile__value {
    font-size: 1.45rem;
}

/* A row's name as a link, with its id under it. */
.cell-link {
    font-weight: 600;
    color: var(--ink);
}

.cell-sub {
    display: block;
    margin-top: 0.1rem;
}

/* THE ITEMS PAGE (views/items.njk): an item, its flags, and two short lists
   per row - where it comes from and what it is used for. Each line leads with
   its kind ("Farming", "Crafting") in small caps so a long column scans by
   kind; a recipe that is switched off stays visible, faded. */
.items-count {
    margin: 0.5rem 0;
}

.items-table td {
    vertical-align: top;
}

.item-name {
    font-weight: 600;
    color: var(--ink);
}

.item-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.item-list li + li {
    margin-top: 0.35rem;
}

.item-list .cell-sub {
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.item-kind {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.item-list .is-off {
    opacity: 0.6;
}

/* A TABLE THAT STACKS ON A PHONE: each row a small card, each cell labelled
   by its own `data-label`, the first cell (the row's name) across the top.
   Wider than 40rem it is an ordinary table. */
@media (max-width: 40rem) {
    .table--stack,
    .table--stack tbody {
        display: block;
    }

    .table--stack thead {
        display: none;
    }

    .table--stack tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 1rem;
        padding: 0.8rem 0.9rem;
        border-bottom: 1px solid var(--rule);
    }

    .table-wrap .table--stack tr:last-child {
        border-bottom: 0;
    }

    .table--stack td {
        min-width: 0;
        padding: 0;
        border: 0;
    }

    .table--stack td:first-child {
        grid-column: 1 / -1;
    }

    .table--stack td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--ink-faint);
    }

    .table--stack td.num {
        text-align: left;
    }

    .tiles--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .tiles--compact .tile {
        padding: 0.55rem 0.7rem;
    }

    .tiles--compact .tile__label {
        font-size: 0.62rem;
        letter-spacing: 0.06em;
    }

    .tiles--compact .tile__value {
        font-size: 1.2rem;
    }
}

/* THE TEST LIST (views/tests.njk). A test reads top to bottom the way it is
   run: title and chips, numbered steps, the "Should happen" box, the current
   result, then the four buttons - two by two on a phone, one row wider up.
   The progress bars are native <progress> elements: no inline width (the CSP
   has no 'unsafe-inline' for style), and a screen reader already knows them. */
.progress {
    display: block;
    width: 100%;
    height: 0.6rem;
    margin: 0 0 0.5rem;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--paper-sunk);
    color: var(--tone-ok);
    overflow: hidden;
}

.progress::-webkit-progress-bar {
    background: var(--paper-sunk);
    border-radius: 999px;
}

.progress::-webkit-progress-value {
    background: var(--tone-ok);
    border-radius: 999px;
}

.progress::-moz-progress-bar {
    background: var(--tone-ok);
    border-radius: 999px;
}

.progress--small {
    max-width: 12rem;
    height: 0.35rem;
    margin: 0.35rem 0 0;
}

.jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    align-items: baseline;
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.jump-links__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.test-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.test {
    padding: 1rem 0;
    border-top: 1px solid var(--rule);
    scroll-margin-top: 1rem;
}

.test:first-child {
    border-top: 0;
    padding-top: 0.25rem;
}

.test:last-child {
    padding-bottom: 0;
}

.test__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    justify-content: space-between;
}

.test__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
}

.test__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
}

.test__steps {
    margin: 0.6rem 0;
    padding-left: 1.4rem;
}

.test__steps li + li {
    margin-top: 0.25rem;
}

.test__expect {
    margin: 0 0 0.6rem;
    padding: 0.55rem 0.8rem;
    border-left: 3px solid var(--tone-ok);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.test__expect p {
    margin: 0 0 0.25rem;
}

.test__expect p:last-child {
    margin-bottom: 0;
}

.test__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.test__status {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.test__note {
    margin: 0 0 0.6rem;
    padding: 0.45rem 0.8rem;
    border-left: 3px solid var(--rule-strong);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.test__note p {
    margin: 0 0 0.25rem;
}

.test__note p:last-child {
    margin-bottom: 0;
}

.test__note--bad {
    border-left-color: var(--tone-blocked);
}

.test__note--warn {
    border-left-color: var(--tone-waiting);
}

.test__form {
    margin: 0.6rem 0 0;
}

.test__form .field {
    margin-bottom: 0.5rem;
}

.test__buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.button--pass { color: var(--tone-ok); }
.button--fail { color: var(--tone-blocked); }
.button--blocked { color: var(--tone-waiting); }

.button.is-current {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
    font-weight: 600;
}

.test__history {
    margin: 0.6rem 0 0;
}

.test__history .timeline__item {
    padding: 0.5rem 1rem;
}

.test__manage {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-faint);
}

/* The leadership tools under an edit form, not jammed against its button. */
.stack + .action-grid {
    margin-top: 1.5rem;
}

@media (min-width: 40rem) {
    .test__buttons {
        display: flex;
        flex-wrap: wrap;
    }
}

/* Per-section progress on a phone: the name across the top, the four counts
   on one line under it - a dozen sections must not be a page of scrolling. */
@media (max-width: 40rem) {
    .table--progress tr {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.3rem 0.75rem;
        padding: 0.6rem 0.9rem;
    }
}
