/* Hallmark · genre: playful · macrostructure: Ecosystem Index · nav: N7 brutal slab · footer: Ft8 marquee
 * route: custom (tuned) · vibe: "icy chrome, dial-up optimism, CRT glow, kitsch"
 * paper: oklch(22% 0.040 258) · accent: oklch(70% 0.155 215)
 * display: Chakra Petch · body: IBM Plex Sans · outlier: Silkscreen (wordmark + pixel chips only)
 * axes: dark / geometric-sans / cool (cyan 215°) · enrichment: CSS chrome + archival GIF layer
 * studied: no · context: inferred · pre-emit critique: P5 H4 E4 S5 R4 V5
 */

@import url("../tokens.css");

/* ===================================================================== base */

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

html, body {
    /* clip, not hidden — hidden would kill position: sticky on the nav */
    overflow-x: clip;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--lh-body);
    color: var(--color-ink-inverse);
    /* The desktop: the wallpaper, unmodified. No scrim, no tint — what is on
       screen is the file. Light body type sitting directly on the field is on
       its own here; the panels carry their own backgrounds and are unaffected. */
    background-color: var(--color-paper);
    background-image: url("../assets/background.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

img { max-width: 100%; }

a { color: var(--color-accent); text-underline-offset: 2px; }
a:hover { color: var(--color-ink-inverse); }

:focus-visible {
    /* Instant — never transitioned. Keyboard users get the ring on frame one. */
    outline: var(--rule-slab) solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--color-focus-contrast);
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: var(--z-overlay);
    background: var(--color-accent-2); color: var(--color-ink-inverse);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-display); font-weight: 700;
}
.skip-link:focus { left: var(--space-xs); top: var(--space-xs); }

.container {
    width: 100%; max-width: var(--max-width);
    margin-inline: auto; padding-inline: var(--page-gutter);
}

.muted { color: var(--color-muted); }
.flush { margin: 0; }
.push-end { margin: 0 0 0 auto; }
.block { display: block; }
.nowrap { white-space: nowrap; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-style: normal;
    line-height: var(--lh-tight);
    overflow-wrap: anywhere;
    min-width: 0;
    margin: 0;
}

/* ============================================================ chrome parts */

/* The one bevel recipe every raised surface uses: specular top edge, body,
   shadowed bottom lip. Y2K chrome is hard-edged — not a blurred glass card. */
.is-chrome {
    background:
        linear-gradient(
            180deg,
            var(--color-chrome-hi) 0%,
            var(--color-chrome-mid) 46%,
            var(--color-chrome-lo) 52%,
            var(--color-chrome-mid) 100%
        );
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-md);
    box-shadow:
        inset 0 1px 0 var(--color-chrome-hi),
        inset 0 -1px 0 var(--color-chrome-lo),
        0 2px 0 var(--color-chrome-edge);
}

/* ================================================================ nav (N7) */

.site-header {
    position: sticky; top: 0; z-index: var(--z-sticky-nav);
    border-bottom: var(--rule-slab) solid var(--color-accent);
    background: var(--dark-glass);
    backdrop-filter: blur(6px);
    padding-block: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.site-header .container {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
}

.site-title {
    font-family: var(--font-outlier);          /* outlier slot 1 of 2 — the wordmark */
    font-size: var(--text-lg);
    letter-spacing: 0.02em;
    color: var(--color-ink-inverse);
    text-shadow:
        0 0 1px var(--color-accent),
        0 0 12px var(--color-accent-deep);      /* phosphor glow, not a gradient */
}
.site-title a { color: inherit; text-decoration: none; }

.site-intro {
    flex: 1 1 14rem;
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-muted-inverse);
}

.nav-links {
    display: flex; align-items: center; gap: var(--space-xs);
    list-style: none; margin: 0 0 0 auto; padding: 0;
}
.nav-links a, .nav-links .button {
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;                        /* clickable text never wraps */
}

/* ============================================================== main + rails */

main { padding-bottom: var(--space-2xl); }
section + section { margin-top: var(--space-2xl); }

/* Each discovery surface is a rail with a titled chrome header — the portal
   idiom: a window title bar over its contents. No fake OS buttons. */
.rail {
    /* the nav is sticky, so an anchored rail must stop below it */
    scroll-margin-top: 7.5rem;
    background: var(--panel-glass);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 0 var(--shade), inset 0 1px 0 var(--color-chrome-hi);
    color: var(--color-ink);
    overflow: hidden;
}

.rail__head {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background:
        linear-gradient(
            180deg,
            var(--color-accent-deep) 0%,
            var(--color-accent-deeper) 100%
        );
    border-bottom: var(--rule-hair) solid var(--color-chrome-edge);
}

.rail__title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1.1;
    color: var(--color-ink-inverse);
    text-shadow: 0 1px 0 var(--color-accent-deeper);
}

/* Blown before the catalogue, the way a title bar deserves. */
.rail__herald { flex: 0 0 auto; }

.rail__note {
    margin: 0 0 0 auto;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-ink-inverse);
}

.rail__body { padding: var(--space-md); }

.rail + .rail { margin-top: var(--space-lg); }

/* Animated red rule, straight off a 1997 homepage — used as the divider
   between discovery surfaces, so the ornament does a job. */
.rule-gif {
    height: 9px;
    margin-block: var(--space-lg);
    background-image: url("../assets/gifs/rule-red.gif");
    background-repeat: repeat-x;
    background-size: auto 9px;
}

/* ================================================================= welcome */

.welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    align-items: start;
}
@media (min-width: 52rem) {
    .welcome { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

.welcome__banner { display: block; margin-bottom: var(--space-xs); }

.welcome__lede {
    margin: 0 0 var(--space-sm);
    max-width: 62ch;
    font-size: var(--text-lg);
    color: var(--color-ink);
}

.welcome__aside {
    display: grid; gap: var(--space-xs); justify-items: center;
    padding: var(--space-sm);
    text-align: center;
}

/* Arms up over the counter, cheering a number that is telling the truth. */
.welcome__hail { margin-bottom: calc(var(--space-2xs) * -1); }

/* Real count, real date — a hit counter that isn't lying about anything. */
.counter-label {
    margin: 0;
    font-family: var(--font-display); font-weight: 700;
    font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--color-ink-2);
}

.counter {
    display: inline-flex; gap: 2px;
    padding: var(--space-2xs) var(--space-xs);
    background: var(--color-paper);
    border: var(--rule-slab) inset var(--color-chrome-lo);
    border-radius: var(--radius-sm);
}
.counter span {
    font-family: var(--font-outlier);          /* outlier slot 2 of 2 — the counter */
    font-size: var(--text-lg);
    color: var(--color-accent);
    text-shadow: 0 0 8px var(--color-accent-deep);
}

/* ================================================================= new flag */

/* The "NEW→" arrow off a 1997 homepage, pinned to the corner of anything
   added in the last month, so the ornament means something. Drawn at twice
   its 32×21 to read at arm's length — pixelated on purpose, not resampled.
   It carries alt text because "this one is new" is information, not decor. */
.card-new {
    position: absolute; top: 8px; left: 8px; z-index: var(--z-raised);
    display: block;
    width: 64px; height: auto;
    image-rendering: pixelated;
    pointer-events: none;
}

/* ============================================================== the console */

.filters {
    display: grid;
    gap: var(--space-md);
}
.filters .field { margin-bottom: 0; }
.filters__point { margin-left: var(--space-2xs); }

/* Sprinting away from the controls, towards the list. */
.filters__runner { flex: 0 0 auto; margin-left: auto; }

.price-filter { border: 0; padding: 0; margin: 0; min-width: 0; }
.price-filter legend {
    padding: 0; margin-bottom: var(--space-2xs);
    font-family: var(--font-display); font-weight: 700;
    font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--color-ink);
}
.price-options { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }

/* Bubble buttons: the radio disappears, its label becomes a glossy lozenge. */
.price-option input {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; margin: 0;
}
.price-option label {
    display: inline-block;
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-pill);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    background:
        linear-gradient(180deg, var(--color-chrome-hi) 0%, var(--color-chrome-mid) 50%,
                        var(--color-chrome-lo) 51%, var(--color-chrome-mid) 100%);
    box-shadow: inset 0 1px 0 var(--color-chrome-hi);
    font-family: var(--font-display);
    font-size: var(--text-sm); font-weight: 600;
    color: var(--color-ink);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--dur-short) var(--ease-out);
}
.price-option input:hover + label { background-color: var(--color-panel); }
.price-option input:focus-visible + label {
    outline: var(--rule-slab) solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: inset 0 1px 0 var(--color-chrome-hi), 0 0 0 2px var(--color-focus-contrast);
}
.price-option input:checked + label {
    background: linear-gradient(180deg, var(--color-accent-deep) 0%, var(--color-accent-deeper) 100%);
    color: var(--color-ink-inverse);
    border-color: var(--color-accent-deeper);
    box-shadow: inset 0 1px 0 var(--flare);
}

/* ================================================================== fields */

.field { margin-bottom: var(--space-md); }
.field > label, fieldset > legend, .file-label {
    display: block; margin-bottom: var(--space-2xs);
    font-family: var(--font-display); font-weight: 700;
    font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--color-ink);
}

input[type="text"], input[type="search"], input[type="email"], input[type="url"],
input[type="password"], input[type="file"], textarea, select {
    width: 100%; max-width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font: inherit;
    font-family: var(--font-body);
    color: var(--color-ink);
    background: var(--color-panel);
    /* Sunken field — the inverse of the raised chrome. Pure 2002 form control. */
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-top-color: var(--color-chrome-lo);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 2px 3px var(--shade);
}
select { appearance: auto; }
textarea { resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--color-muted); }

input:hover, textarea:hover, select:hover { background: var(--color-panel); }
input:disabled, textarea:disabled, select:disabled {
    background: var(--color-panel-3); color: var(--color-muted); cursor: not-allowed;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
    box-shadow: inset 0 2px 3px var(--shade), 0 0 0 2px var(--color-focus-contrast);
}

input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
    border-color: var(--color-danger);
    box-shadow: inset 0 2px 3px var(--shade), 0 0 0 1px var(--color-danger);
}

.hint { margin: var(--space-3xs) 0 0; font-size: var(--text-xs); color: var(--color-muted); }
.required { color: var(--color-danger); }

.field-error {
    margin: var(--space-3xs) 0 0;
    padding: var(--space-3xs) var(--space-2xs);
    background: var(--color-danger-soft);
    border-left: var(--rule-slab) solid var(--color-danger);
    font-size: var(--text-sm); font-weight: 600; color: var(--color-danger-ink);
}
.field-error[hidden] { display: none; }

.input-with-prefix { display: flex; align-items: stretch; }
.input-prefix {
    display: flex; align-items: center; padding-inline: var(--space-sm);
    background: linear-gradient(180deg, var(--color-chrome-hi), var(--color-chrome-lo));
    border: var(--rule-hair) solid var(--color-chrome-edge); border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-family: var(--font-display); font-weight: 700; color: var(--color-ink);
}
.input-with-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.form-actions {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: var(--space-sm); margin-top: var(--space-md);
}
.form-status { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xs); color: var(--color-ink-2); }
.inline-form { display: inline; }
.stack { max-width: 48rem; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ================================================================= buttons */

.button, button {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--space-2xs);
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-display);
    font-size: var(--text-sm); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;                         /* never two lines */
    text-decoration: none;
    color: var(--color-ink-inverse);
    background: linear-gradient(180deg, var(--color-accent-deep) 0%, var(--color-accent-deeper) 100%);
    border: var(--rule-hair) solid var(--color-accent-deeper);
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1px 0 var(--flare), 0 2px 0 var(--color-chrome-edge);
    cursor: pointer;
    /* one signal on hover — brightness. Nothing else moves. */
    transition: filter var(--dur-short) var(--ease-out);
}
.button:hover, button:hover { filter: brightness(1.15); color: var(--color-ink-inverse); }
.button:active, button:active {
    /* press-in: the bubble depresses into its socket */
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px var(--shade);
}
.button[disabled], button[disabled], button:disabled {
    filter: none; opacity: 0.55; cursor: not-allowed;
    background: var(--color-panel-3); color: var(--color-muted);
    border-color: var(--color-chrome-edge); box-shadow: none; transform: none;
}

/* The buttons declare their own box-shadow, which would otherwise out-order the
   ring's dark band. Restate both together on focus. */
.button:focus-visible, button:focus-visible {
    box-shadow: inset 0 1px 0 var(--flare), 0 0 0 2px var(--color-focus-contrast);
}

.button-secondary {
    color: var(--color-ink);
    background: linear-gradient(180deg, var(--color-chrome-hi) 0%, var(--color-chrome-mid) 50%,
                var(--color-chrome-lo) 51%, var(--color-chrome-mid) 100%);
    border-color: var(--color-chrome-edge);
}
.button-secondary:hover { color: var(--color-ink); }

.button-danger {
    background: linear-gradient(180deg, var(--color-danger) 0%, var(--color-danger-deep) 100%);
    border-color: var(--color-danger);
}

.button-link {
    background: none; border-color: transparent; box-shadow: none;
    color: var(--color-accent); text-decoration: underline;
    padding-inline: var(--space-2xs);
}
.button-link:hover { color: var(--color-accent-2); }

/* ============================================================== item cards */

.result-count {
    margin: 0 0 var(--space-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-ink-2);
}

.item-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: var(--space-md);
    /* minmax(0, …) — a 1000 px card image must not set the track minimum */
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
}
.item-grid[hidden], .card[hidden] { display: none; }

.card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--panel-glass-2);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 var(--color-chrome-hi), 0 3px 0 var(--shade);
    color: var(--color-ink);
    overflow: hidden;
}

.card-image {
    display: block; width: 100%; height: auto;
    aspect-ratio: 4 / 3; object-fit: cover;
    background: var(--color-panel-3);
    border-bottom: var(--rule-hair) solid var(--color-chrome-edge);
}

.card-body {
    display: flex; flex-direction: column; gap: var(--space-2xs);
    padding: var(--space-sm); flex: 1;
}

.card-category {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--color-accent-deeper);
}

.card-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-ink); }

.card-price {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-xl);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    color: var(--color-ink);
}

.card-description {
    margin: 0; font-size: var(--text-sm); color: var(--color-ink-2);
}

.card-link { margin-top: auto; }

.card-unavailable {
    margin: auto 0 0;
    padding: var(--space-2xs) var(--space-xs);
    background: var(--color-panel-3);
    border: var(--rule-hair) dashed var(--color-chrome-edge);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-ink-2);
    text-align: center;
}

.empty-state {
    padding: var(--space-lg);
    background: var(--color-panel-2);
    border: var(--rule-slab) dashed var(--color-chrome-edge);
    border-radius: var(--radius-md);
    color: var(--color-ink-2);
    text-align: center;
}
.empty-state[hidden] { display: none; }

/* ================================================================ combobox */

.combobox { position: relative; }

.combobox-list {
    position: absolute; left: 0; right: 0; z-index: var(--z-dropdown);
    list-style: none; margin: var(--space-3xs) 0 0; padding: 0;
    max-height: 14rem; overflow-y: auto;
    background: var(--color-panel);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 0 var(--shade);
}
.combobox-list[hidden] { display: none; }
.combobox-list li { padding: var(--space-2xs) var(--space-xs); cursor: pointer; color: var(--color-ink); }
.combobox-list li[aria-selected="true"], .combobox-list li:hover {
    background: var(--color-accent-deeper); color: var(--color-ink-inverse);
}
.combobox-list .no-match { color: var(--color-muted); cursor: default; }
.combobox-list .no-match:hover { background: none; color: var(--color-muted); }

.combobox-selection { margin: var(--space-3xs) 0 0; font-size: var(--text-sm); color: var(--color-ink); }
.combobox-selection[hidden] { display: none; }

/* ================================================================== alerts */

.alert {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    border: var(--rule-slab) solid var(--color-chrome-edge);
    border-radius: var(--radius-sm);
    background: var(--color-panel);
    color: var(--color-ink);
    font-weight: 600;
}
.alert-success { border-color: var(--color-success); background: var(--color-success-soft); color: var(--color-success-ink); }
.alert-error   { border-color: var(--color-danger);  background: var(--color-danger-soft);  color: var(--color-danger-ink); }

.form-message { margin-top: var(--space-md); }
.form-message[hidden] { display: none; }

/* ============================================================ things I like */

/* A shelf of GIFs standing in for the things I would not put a price on.
   Every one is animated, so the whole shelf is decoration and nothing else —
   which is why it leaves under prefers-reduced-motion rather than sitting
   there as a heading over an empty strip. */
.likes__lede {
    margin: 0 0 var(--space-md);
    max-width: 62ch;
    color: var(--color-ink);
}

.likes__shelf {
    display: flex; flex-wrap: wrap;
    align-items: flex-end; justify-content: center;
    gap: var(--space-md);
}
.likes__shelf .gif { flex: 0 0 auto; max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
    .likes { display: none; }
}

/* ============================================================ ask a question */

.ask__head {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}
.ask__mail { flex: 0 0 auto; }
.ask__angel { flex: 0 0 auto; }

/* ================================================================== footer */

.site-footer {
    margin-top: var(--space-2xl);
    border-top: var(--rule-slab) solid var(--color-accent);
    background: var(--dark-glass);
    overflow: hidden;
}

.marquee { overflow: hidden; }
.marquee__track {
    /* No flex gap: the two copies must be exactly half the track each, or
       translateX(-50%) leaves a visible seam every lap. */
    display: flex; gap: 0;
    white-space: nowrap;
    padding-block: var(--space-xs);
    animation: marquee-slide 34s linear infinite;
}
.marquee__track span {
    padding-inline-end: var(--space-2xl);
    font-family: var(--font-display); font-weight: 700;
    font-size: var(--text-sm); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--color-accent);
}
@keyframes marquee-slide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.colophon {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm);
    padding-block: var(--space-md);
    font-size: var(--text-xs);
    color: var(--color-muted-inverse);
}
.colophon a { color: var(--color-accent); }
.colophon__lemon { flex: 0 0 auto; }

/* =================================================================== admin */

.panel {
    background: var(--panel-glass);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 0 var(--shade), inset 0 1px 0 var(--color-chrome-hi);
    color: var(--color-ink);
    padding: var(--space-md);
}
.panel + .panel { margin-top: var(--space-lg); }
.panel-narrow { max-width: 26rem; }

.panel-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--space-sm); margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: var(--rule-slab) solid var(--color-rule);
}
.panel-header h2 {
    font-size: var(--text-xl); text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--color-ink);
}
.count { font-family: var(--font-display); font-size: var(--text-sm); color: var(--color-muted); }

.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-left: auto; }
.admin-nav a {
    font-family: var(--font-display); font-size: var(--text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}

.table-wrapper { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td {
    padding: var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule);
    vertical-align: top; color: var(--color-ink);
}
.admin-table thead th {
    background: linear-gradient(180deg, var(--color-chrome-hi), var(--color-chrome-lo));
    font-family: var(--font-display); font-size: var(--text-xs);
    text-transform: uppercase; letter-spacing: 0.08em;
    border-bottom: var(--rule-slab) solid var(--color-chrome-edge);
}
.admin-table td.nowrap { font-variant-numeric: tabular-nums; }
.thumb {
    width: 80px; height: 60px; object-fit: cover;
    border: var(--rule-hair) solid var(--color-chrome-edge); border-radius: var(--radius-sm);
}
.row-actions { display: flex; flex-wrap: wrap; gap: var(--space-3xs); }

.category-list { list-style: none; margin: 0 0 var(--space-lg); padding: 0; display: grid; gap: var(--space-xs); }
.category-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--color-panel-2);
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-sm);
}
.category-rename { display: flex; flex: 1 1 18rem; gap: var(--space-xs); }
.category-rename input { flex: 1 1 auto; }
.category-count {
    font-family: var(--font-display); font-weight: 600; font-size: var(--text-xs);
    color: var(--color-ink-2); white-space: nowrap;
}
.category-add {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-sm);
    padding-top: var(--space-md); border-top: var(--rule-slab) solid var(--color-rule);
}
.category-add .field { flex: 1 1 16rem; margin-bottom: 0; }

/* ================================================================= cropper */

.image-field {
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-sm);
    background: var(--color-panel-2);
    padding: var(--space-md);
    min-width: 0;
}
.current-image img {
    border: var(--rule-hair) solid var(--color-chrome-edge); border-radius: var(--radius-sm);
}
.cropper { margin-top: var(--space-md); }
.cropper[hidden] { display: none; }
.cropper-stage { max-width: 100%; overflow: hidden; }
#croppie-container { max-width: 100%; }
.cropper-controls { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); }
.cropper-preview { margin-top: var(--space-md); }
.cropper-preview img {
    width: 200px; height: 150px; object-fit: cover;
    border: var(--rule-hair) solid var(--color-chrome-edge);
    border-radius: var(--radius-sm); background: var(--color-panel-3);
}
.croppie-container .cr-slider:focus-visible {
    outline: var(--rule-slab) solid var(--color-focus); outline-offset: 2px;
}

/* =============================================================== gif layer */

/* Decorative period artifacts. Each one is anchored to something real — the
   greeting, the postbox, the divider, the credit line — never scattered. */
.gif { display: block; image-rendering: pixelated; }
.gif--inline { display: inline-block; vertical-align: middle; }

/* ============================================================== responsive */

@media (max-width: 48rem) {
    .site-header .container { row-gap: var(--space-2xs); }
    .site-intro { flex-basis: 100%; order: 3; }
    .nav-links { margin-left: 0; }
    .row-actions { flex-direction: column; align-items: stretch; }
    .category-rename { flex: 1 1 100%; }
    .category-row .inline-form, .category-row .inline-form .button { width: 100%; }
    .cropper-controls .button { flex: 1 1 auto; }
    .card-new { width: 48px; }
}

@media (max-width: 26rem) {
    .price-options { gap: var(--space-3xs); }
    .price-option label { padding-inline: var(--space-xs); font-size: var(--text-xs); }
}

/* ========================================================== reduced motion */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: var(--dur-instant) !important;
    }
    .marquee__track { animation: none; }
    /* Animated GIFs can't be paused from CSS. They're decorative here, so a
       reader who asked for less motion simply doesn't get them. */
    .gif--animated { display: none; }
    .button:active, button:active { transform: none; }
}
