/*
  Select - one stylesheet for the public site, the admin panel and the labels.

  Rules this file follows:
  - Black, white and greys only. (The single exception: amber/red ageing
    badges in the admin queue, because they are warnings, not decoration.)
  - Inter everywhere, self-hosted from assets/fonts. No serif anywhere.
  - Every size and gap is a multiple of 4px (the --s* steps below).
  - Letter-spacing gets tighter as text gets bigger, so large headings do not
    look loose and small labels do not look cramped.

  Sections: 1 fonts & tokens  2 base  3 layout  4 components  5 public pages
            6 chat widget  7 admin  8 slab label  9 print
*/

/* ===================================================== 1. fonts & tokens */

@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-Medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-Bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #0b0b0b;
  --ink-2: #2b2b2b;
  --mute: #6b6b6b;
  --faint: #9e9e9e;
  --line: #e7e7e7;
  --line-2: #d2d2d2;
  --wash: #f5f5f5;
  --wash-2: #ececec;
  --paper: #ffffff;

  --warn: #b26b00;       /* admin ageing only */
  --warn-bg: #fff4e0;
  --late: #b3261e;       /* admin ageing only */
  --late-bg: #fdecea;

  /* 4px spacing grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px; --s32: 128px;

  --radius: 8px;
  --radius-lg: 16px;
  --page: 1160px;
  --gutter: 16px;

  --font: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ===================================================== 2. base */

*, *::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);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.011em;
  /* calt: Inter's contextual alternates (better arrows, colons between digits). */
  font-feature-settings: 'calt' 1, 'kern' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Type scale: size / line-height / tracking. Tracking tightens as size grows. */
.t-display { font-size: clamp(40px, 6.4vw, 72px); line-height: 1; letter-spacing: -0.045em; font-weight: 700; }
h1, .t-h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; margin: 0; }
h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; margin: 0; }
h3 { font-size: 20px; line-height: 28px; letter-spacing: -0.017em; font-weight: 600; margin: 0; }
.t-lead { font-size: 18px; line-height: 28px; letter-spacing: -0.014em; color: var(--ink-2); }
@media (min-width: 720px) { .t-lead { font-size: 20px; line-height: 32px; } }
.t-small, small { font-size: 14px; line-height: 20px; letter-spacing: -0.006em; }
.t-micro { font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.t-num { font-feature-settings: 'tnum' 1, 'calt' 1; }
.mute { color: var(--mute); }
p { margin: 0; }
p + p { margin-top: var(--s4); }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
/* Honeypot field: off-screen for people, still filled in by spam bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ===================================================== 3. layout */

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s16) 0; }
@media (min-width: 720px) { .section { padding: var(--s24) 0; } }
.section + .section { border-top: 1px solid var(--line); }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s8); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; height: 64px; gap: var(--s6); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand img, .brand .mark { width: 28px; height: 28px; }
.brand-tag { font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--mute); padding-left: var(--s2); margin-left: var(--s1); border-left: 1px solid var(--line-2); }
.nav { display: flex; align-items: center; gap: var(--s6); margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.nav a.btn, .nav a.btn:hover, .nav a.btn[aria-current="page"] { color: var(--paper); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: var(--s2); cursor: pointer; }
@media (max-width: 719px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: var(--s2) var(--gutter) var(--s4); }
  .nav.open { display: flex; }
  .nav a { padding: var(--s3) 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; margin-top: var(--s3); text-align: center; }
  .brand-tag { display: none; }
}

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: var(--s12) 0 var(--s16); color: var(--mute); }
.site-footer .wrap { display: grid; gap: var(--s8); }
@media (min-width: 720px) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { margin: 0 0 var(--s3); color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: var(--s2); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ===================================================== 4. components */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 var(--s5); border-radius: 999px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { height: 52px; padding: 0 var(--s6); font-size: 16px; }
.btn-sm { height: 36px; padding: 0 var(--s4); font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--wash); border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; padding: 0 var(--s2); }
.btn-quiet:hover { background: var(--wash); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: var(--s2); }
.field > span, .label-text { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 13px; line-height: 16px; color: var(--mute); letter-spacing: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px var(--s3);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 16px; /* 16px stops iOS Safari from zooming into the field */
  line-height: 22px; transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
textarea.input { resize: vertical; min-height: 88px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url('/assets/icons/chevron-down.svg'); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input-mono { font-feature-settings: 'tnum' 1, 'zero' 1; letter-spacing: 0.04em; text-transform: uppercase; }
.grid-2 { display: grid; gap: var(--s4); }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 22px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }

.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s6); background: var(--paper); }
.panel { background: var(--wash); border-radius: var(--radius-lg); padding: var(--s6); }

.badge { display: inline-flex; align-items: center; gap: var(--s1); height: 24px; padding: 0 var(--s2); border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--wash-2); color: var(--ink-2); white-space: nowrap; }
.badge-ink { background: var(--ink); color: var(--paper); }
.badge-line { background: transparent; border: 1px solid var(--line-2); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-late { background: var(--late-bg); color: var(--late); }

.notice { display: flex; gap: var(--s3); padding: var(--s4); border-radius: var(--radius); background: var(--wash); font-size: 15px; line-height: 22px; }
.notice .icon { margin-top: 1px; }
.form-error { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--ink); border-radius: var(--radius); font-size: 15px; line-height: 22px; font-weight: 500; }

/* No column gap: the total's top border must run unbroken across both columns. */
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) 0; font-size: 15px; line-height: 22px; margin: 0; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; padding-left: var(--s6); text-align: right; font-feature-settings: 'tnum' 1; }
.kv .total { font-weight: 700; color: var(--ink); padding-top: var(--s3); border-top: 1px solid var(--line); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.table th { text-align: left; font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--mute); padding: var(--s3) var(--s3) var(--s2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.table .num { text-align: right; font-feature-settings: 'tnum' 1; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); font-size: 12px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--mute); }
.eyebrow::before { content: ''; width: 16px; height: 1px; background: currentColor; }

/* ===================================================== 5. public pages */

/* hero */
.hero { padding: var(--s16) 0 var(--s20); overflow: hidden; }
.hero .wrap { display: grid; gap: var(--s12); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: var(--s16); } .hero { padding: var(--s24) 0; } }
.hero h1 { margin-top: var(--s5); }
.hero .t-lead { margin-top: var(--s6); max-width: 34em; }
.hero .row { margin-top: var(--s8); }
.hero-meta { margin-top: var(--s10); display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--s5) var(--s6); }
.hero-meta div { font-size: 14px; line-height: 20px; color: var(--mute); }
.hero-meta strong { display: block; font-size: 24px; line-height: 32px; letter-spacing: -0.02em; color: var(--ink); font-feature-settings: 'tnum' 1; }

/*
 * The slab: a clear acrylic case drawn in CSS around the official card scan.
 *   .slab               the case: bevelled edges, a little blue in the plastic
 *   .slab-ridges        the grip ridges along the top
 *   .slab-label-chamber the label, sealed in its own pocket behind the acrylic
 *   .slab-well          the recessed window the card sits in
 *   .slab-holo          rainbow shimmer on holo cards (moves with the pointer)
 *   .slab-glare         the light on the acrylic (moves with the pointer)
 * --rx/--ry tilt and --gx/--gy glare position are set by home.js.
 */
.slab-art { --sw: min(360px, 84vw); position: relative; justify-self: center; width: var(--sw); margin: 0; perspective: 1400px; }
.slab-tilt {
  transform: rotateX(var(--rx, 4deg)) rotateY(var(--ry, -8deg));
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  animation: slab-float 7s ease-in-out infinite;
}
.slab-art.live .slab-tilt { animation: none; transition: transform .12s linear; }
@keyframes slab-float { 50% { transform: rotateX(2deg) rotateY(-3deg) translateY(-6px); } }
.slab {
  position: relative; border-radius: calc(var(--sw) * .055); padding: calc(var(--sw) * .045);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 18%),
    linear-gradient(160deg, #fbfcfd 0%, #eef1f4 45%, #e4e8ec 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .95),
    inset 0 2px 2px rgba(255, 255, 255, 1),
    inset 0 -3px 8px rgba(40, 60, 80, .10),
    inset 3px 0 6px rgba(255, 255, 255, .6),
    0 0 0 1px rgba(30, 40, 50, .14),
    0 2px 3px rgba(0, 0, 0, .06),
    0 22px 40px -18px rgba(20, 30, 40, .45),
    0 60px 80px -50px rgba(20, 30, 40, .35);
}
/* The step in the acrylic just inside the edge. */
.slab::before {
  content: ''; position: absolute; inset: calc(var(--sw) * .018); border-radius: calc(var(--sw) * .04); pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(30, 40, 50, .07), 0 1px 0 rgba(255, 255, 255, .9);
}
.slab-ridges {
  position: absolute; top: calc(var(--sw) * .012); left: 30%; right: 30%; height: calc(var(--sw) * .022); pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(30, 40, 50, .16) 0 1px, rgba(255, 255, 255, .8) 1px 2px, transparent 2px 5px);
  border-radius: 2px; opacity: .8;
}
.slab-label-chamber {
  position: relative; border-radius: calc(var(--sw) * .02); padding: calc(var(--sw) * .012);
  background: linear-gradient(180deg, #f3f5f7, #e7eaee);
  box-shadow: inset 0 1px 3px rgba(20, 30, 40, .18), inset 0 0 0 1px rgba(20, 30, 40, .06), 0 1px 0 rgba(255, 255, 255, .9);
}
.slab-label-chamber::after { /* the acrylic over the label */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, .25) 100%);
}
/* The label is 68em wide (section 8), so font-size = its width / 68. */
.slab .label { font-size: calc((var(--sw) * .91 - var(--sw) * .024) / 68); width: 68em; border-radius: .9em; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.slab-well {
  position: relative; margin-top: calc(var(--sw) * .035); border-radius: calc(var(--sw) * .03);
  padding: calc(var(--sw) * .05) calc(var(--sw) * .055);
  background: linear-gradient(180deg, #e9edf1, #dfe4e9);
  box-shadow: inset 0 2px 5px rgba(20, 30, 40, .22), inset 0 0 0 1px rgba(20, 30, 40, .08), 0 1px 0 rgba(255, 255, 255, .95);
}
.slab-card { position: relative; aspect-ratio: 63 / 88; border-radius: 4.6% / 3.3%; overflow: hidden; background: #cfd5db; box-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 8px 18px -8px rgba(0, 0, 0, .35); }
.slab-card-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slab-holo {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .22;
  background: linear-gradient(calc(110deg + var(--ry, -8deg) * 4), transparent 20%, #ff6ad5 32%, #c774e8 38%, #94d0ff 46%, #8affc1 54%, #fff59d 60%, transparent 72%);
  background-size: 220% 220%; background-position: var(--gx, 30%) var(--gy, 30%);
}
.slab-art.no-holo .slab-holo { display: none; }
.slab-glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle at var(--gx, 25%) var(--gy, 15%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 38%),
    linear-gradient(118deg, rgba(255, 255, 255, 0) calc(var(--gx, 25%) - 14%), rgba(255, 255, 255, .5) calc(var(--gx, 25%) - 6%), rgba(255, 255, 255, 0) calc(var(--gx, 25%) + 2%)),
    linear-gradient(115deg, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, .18) 100%);
  mix-blend-mode: soft-light;
}
.slab-sticker {
  position: absolute; right: calc(var(--sw) * .07); bottom: calc(var(--sw) * .022); width: calc(var(--sw) * .07); height: calc(var(--sw) * .07);
  border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from 30deg, #e8e8e8, #b9d7f2, #f2c9e6, #d5f2c9, #f2ecc9, #e8e8e8);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .1);
}
.slab-sticker img { width: 55%; height: 55%; opacity: .7; }
.slab-caption { margin-top: var(--s6); text-align: center; font-size: 13px; line-height: 18px; color: var(--mute); }
.slab-caption a { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .slab-tilt { animation: none; } }

/* steps */
.steps { display: grid; gap: var(--s8); margin-top: var(--s12); counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); gap: var(--s6); } }
.step { padding-top: var(--s5); border-top: 2px solid var(--ink); }
.step-num { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; color: var(--mute); font-feature-settings: 'tnum' 1; }
.step .icon { width: 28px; height: 28px; stroke-width: 1.5; margin: var(--s5) 0 var(--s4); }
.step p { margin-top: var(--s2); color: var(--ink-2); font-size: 15px; line-height: 22px; }

.section-head { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s4) var(--s8); justify-content: space-between; }
.section-head p { max-width: 32em; color: var(--ink-2); }

/* pricing tiers */
.tiers { display: grid; gap: var(--s4); margin-top: var(--s10); }
@media (min-width: 820px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); background: var(--paper); }
.tier.featured { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tier.featured .mute, .tier.featured .tier-list li { color: #bdbdbd; }
.tier-price { display: flex; align-items: baseline; gap: var(--s2); }
.tier-price strong { font-size: 48px; line-height: 48px; letter-spacing: -0.04em; font-weight: 700; font-feature-settings: 'tnum' 1; }
.tier-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); font-size: 15px; line-height: 22px; color: var(--ink-2); }
.tier-list li { display: flex; gap: var(--s3); }
.tier-list .icon { width: 18px; height: 18px; margin-top: 2px; }
.tier .btn { margin-top: auto; }
.tier.featured .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.fine { margin-top: var(--s6); font-size: 14px; line-height: 20px; color: var(--mute); }

/* grade scale strip */
.scale { margin-top: var(--s10); display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 720px) { .scale { grid-template-columns: repeat(5, 1fr); } }
.scale div { padding: var(--s5) var(--s4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: -1px -1px 0 0; }
.scale strong { display: block; font-size: 32px; line-height: 40px; letter-spacing: -0.03em; font-feature-settings: 'tnum' 1; }
.scale span { font-size: 12px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--mute); }
.scale div:first-child { background: var(--ink); color: var(--paper); }
.scale div:first-child span { color: #bdbdbd; }

/* black call-to-action band */
.band { background: var(--ink); color: var(--paper); }
.band .wrap { padding-top: var(--s16); padding-bottom: var(--s16); display: flex; flex-wrap: wrap; gap: var(--s6); align-items: center; justify-content: space-between; }
.band .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.band p { color: #bdbdbd; margin-top: var(--s2); }

/* page header for inner pages */
.page-head { padding: var(--s16) 0 var(--s10); border-bottom: 1px solid var(--line); }
.page-head p { margin-top: var(--s4); max-width: 36em; }

/* submit form */
.submit-layout { display: grid; gap: var(--s10); padding: var(--s10) 0 var(--s20); align-items: start; }
@media (min-width: 980px) { .submit-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s16); } }
.form-section { padding: var(--s8) 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; }
.form-section > header { display: flex; gap: var(--s3); align-items: baseline; margin-bottom: var(--s6); }
.form-section > header .step-num { min-width: 24px; }
.form-section .stack > * + * { margin-top: var(--s4); }
.tier-pick { display: grid; gap: var(--s3); }
@media (min-width: 560px) { .tier-pick { grid-template-columns: repeat(3, 1fr); } }
.tier-option { position: relative; display: block; cursor: pointer; }
.tier-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tier-option .box { display: block; border: 1px solid var(--line-2); border-radius: var(--radius); padding: var(--s4); transition: border-color .15s, background .15s; height: 100%; }
.tier-option .box strong { display: block; font-size: 16px; }
.tier-option .box .t-num { display: block; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: var(--s2); }
.tier-option .box small { display: block; color: var(--mute); margin-top: var(--s1); }
.tier-option input:checked + .box { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tier-option input:checked + .box small { color: #bdbdbd; }
.tier-option input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.tier-option input:disabled + .box { opacity: .4; cursor: not-allowed; }

.card-rows { display: grid; gap: var(--s3); counter-reset: cardrow; }
.card-row { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; position: relative; }
.card-row-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.card-row-head .step-num::before { counter-increment: cardrow; content: 'Card ' counter(cardrow); }
.card-row .f-name, .card-row .f-set { grid-column: 1 / -1; }
/* Wider screens: name and set share the first line, the short fields the second. */
@media (min-width: 720px) {
  .card-row { grid-template-columns: repeat(6, 1fr); align-items: end; }
  .card-row .f-name, .card-row .f-set { grid-column: span 3; }
  .card-row .f-num, .card-row .f-lang, .card-row .f-val { grid-column: span 2; }
}
.card-row .field > span { font-size: 13px; }
.card-row .input { min-height: 40px; padding: 8px 10px; }
.remove-card { height: 32px; width: 32px; padding: 0; justify-content: center; }

.submit-layout.calc { padding: var(--s8) 0 0; }
.summary { position: sticky; top: 88px; }
.summary h3 { margin-bottom: var(--s5); }
.summary .kv { margin-bottom: var(--s6); }

.success { padding: var(--s16) 0 var(--s20); }
.ref-big { font-size: clamp(40px, 11vw, 88px); line-height: 1; letter-spacing: -0.02em; font-weight: 700; font-feature-settings: 'tnum' 1, 'zero' 1; margin: var(--s4) 0 var(--s6); word-break: break-all; }
.success-actions { margin-top: var(--s6); }
.slip-steps { display: grid; gap: var(--s4); margin-top: var(--s8); }
@media (min-width: 720px) { .slip-steps { grid-template-columns: repeat(3, 1fr); } }

/* track */
.track-layout { display: grid; gap: var(--s10); padding: var(--s10) 0 var(--s20); }
@media (min-width: 980px) { .track-layout { grid-template-columns: 340px minmax(0, 1fr); gap: var(--s16); align-items: start; } }
/* Grid children default to min-width:auto, so a wide table would stretch the
   whole page sideways on a phone. min-width:0 lets them shrink and scroll inside. */
.track-layout > *, .submit-layout > *, .detail-grid > *, .inbox > * { min-width: 0; }
.progress { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.progress li { height: 4px; border-radius: 2px; background: var(--line); }
.progress li.done { background: var(--ink); }
.progress-labels { display: flex; justify-content: space-between; margin-top: var(--s2); font-size: 12px; color: var(--mute); }
.status-big { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin-top: var(--s2); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: var(--s4); padding-bottom: var(--s5); position: relative; }
.timeline li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); margin: 7px 0 0 3px; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:first-child::before { box-shadow: 0 0 0 4px var(--wash-2); }
.timeline strong { display: block; font-size: 15px; }
.timeline small { color: var(--mute); }
.grade-pill { display: inline-flex; align-items: center; height: 28px; padding: 0 var(--s3); border-radius: 6px; background: var(--ink); color: var(--paper); font-weight: 700; font-feature-settings: 'tnum' 1; gap: var(--s2); white-space: nowrap; }
.grade-pill span { font-size: 11px; letter-spacing: 0.06em; font-weight: 600; }

/* terms */
.prose { max-width: 44em; padding: var(--s10) 0 var(--s20); }
.prose h2 { font-size: 22px; line-height: 28px; letter-spacing: -0.02em; margin: var(--s12) 0 var(--s4); }
.prose h3 { font-size: 17px; line-height: 24px; letter-spacing: -0.01em; margin: var(--s8) 0 var(--s2); }
.prose h2 + h3 { margin-top: var(--s4); }
.prose p, .prose li { color: var(--ink-2); }
.prose ol, .prose ul { padding-left: var(--s5); }
.prose li + li { margin-top: var(--s2); }

/* ===================================================== 6. chat widget */

.chat-launcher {
  position: fixed; right: var(--s4); bottom: var(--s4); z-index: 50;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); display: grid; place-items: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}
.chat-launcher .icon { width: 24px; height: 24px; }
.chat-launcher .dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.chat-panel {
  position: fixed; z-index: 60; right: var(--s4); bottom: 88px;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 480px) { .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; } }
.chat-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); }
.chat-head .mark { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--ink); color: var(--paper); }
.chat-head strong { display: block; font-size: 15px; line-height: 20px; }
.chat-head small { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 13px; line-height: 16px; }
.chat-head small::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chat-head small.on::before { background: var(--ink); }
.chat-head button { margin-left: auto; }
.chat-body { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); background: var(--wash); }
.msg { max-width: 82%; padding: var(--s2) var(--s3); border-radius: 14px; font-size: 15px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg time { display: block; font-size: 11px; line-height: 14px; color: var(--faint); margin-top: 2px; }
.msg-visitor { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg-visitor time { color: #9a9a9a; }
.msg-admin { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-system { align-self: center; text-align: center; font-size: 13px; line-height: 18px; color: var(--mute); max-width: 90%; }
.chat-extra { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: grid; gap: var(--s2); background: var(--paper); }
.chat-extra .row { flex-wrap: nowrap; }
.chat-extra .input { min-height: 38px; padding: 6px 10px; font-size: 15px; }
.chat-form { display: flex; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; }
.chat-form .btn { width: 44px; padding: 0; }
.chat-links { display: flex; gap: var(--s4); padding: 0 var(--s4) var(--s3); background: var(--paper); }
.chat-links button { background: none; border: 0; padding: 0; font-size: 13px; color: var(--mute); text-decoration: underline; cursor: pointer; }
.chat-error { font-size: 13px; padding: 0 var(--s4) var(--s2); background: var(--paper); }

/* ===================================================== 7. admin */

.admin-body { background: var(--wash); min-height: 100vh; }
.admin-top { background: var(--ink); color: var(--paper); }
.admin-top .wrap { display: flex; align-items: center; gap: var(--s6); height: 56px; max-width: 1400px; }
.admin-top .brand .mark { width: 24px; height: 24px; }
.admin-nav { display: flex; gap: var(--s1); overflow-x: auto; }
.admin-nav a { display: inline-flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s3); border-radius: 999px; text-decoration: none; color: #c9c9c9; font-size: 14px; font-weight: 500; white-space: nowrap; }
.admin-nav a:hover { color: var(--paper); }
.admin-nav a.active { background: #262626; color: var(--paper); }
.admin-nav .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; font-weight: 700; }
.admin-top .btn-quiet { color: #c9c9c9; }
.admin-top .btn-quiet:hover { background: #262626; color: var(--paper); }
@media (max-width: 719px) { .admin-top .wrap { gap: var(--s3); } .admin-top .brand span { display: none; } }
.admin-main { max-width: 1400px; margin: 0 auto; padding: var(--s8) var(--gutter) var(--s20); }
.admin-main h1 { font-size: 28px; line-height: 36px; letter-spacing: -0.025em; }
.admin-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.admin-card + .admin-card { margin-top: var(--s4); }
.admin-card > header { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.admin-card > .body { padding: var(--s5); }
.toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin: var(--s6) 0 var(--s4); }
.toolbar .input { width: auto; min-height: 36px; padding: 6px 36px 6px 10px; font-size: 14px; }
.toolbar input.input { padding-right: 10px; }
.queue-table tbody tr { cursor: pointer; }
.queue-table tbody tr:hover td { background: var(--wash); }
.queue-table td { white-space: nowrap; }
.queue-table .ref { font-weight: 600; font-feature-settings: 'tnum' 1, 'zero' 1; }
.empty { padding: var(--s16) var(--s5); text-align: center; color: var(--mute); }
.empty .icon { margin: 0 auto var(--s3); }

.login-box { max-width: 380px; margin: 12vh auto 0; padding: 0 var(--gutter); }
.login-box .brand { margin-bottom: var(--s8); }

.detail-grid { display: grid; gap: var(--s4); margin-top: var(--s6); }
@media (min-width: 1100px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.status-track { display: flex; flex-wrap: wrap; gap: var(--s1); }
.status-track span { font-size: 11px; line-height: 16px; letter-spacing: 0.05em; font-weight: 600; padding: 4px 8px; border-radius: 4px; background: var(--wash); color: var(--faint); }
.status-track span.done { background: var(--wash-2); color: var(--ink-2); }
.status-track span.now { background: var(--ink); color: var(--paper); }
.grade-card { border-top: 1px solid var(--line); padding: var(--s5); display: grid; gap: var(--s4); }
.grade-card:first-child { border-top: 0; }
.grade-card-head { display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.grade-card-head strong { font-size: 17px; letter-spacing: -0.015em; }
.grade-fields { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grade-fields { grid-template-columns: 100px 160px repeat(4, 90px) 1fr; align-items: end; } }
.grade-fields .field > span { font-size: 12px; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); }
.grade-fields .input { min-height: 38px; padding: 6px 10px; }
.meta-fields { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .meta-fields { grid-template-columns: 2fr 2fr 1fr 80px 1.5fr; } }
.meta-fields .field > span { font-size: 12px; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mute); }
.meta-fields .input { min-height: 38px; padding: 6px 10px; }
.saved-flag { font-size: 13px; color: var(--mute); }

.settings-grid { display: grid; gap: var(--s4); margin-top: var(--s6); }
.settings-grid > * { min-width: 0; }   /* wide fields may not push the page past the phone's width */
@media (min-width: 1000px) { .settings-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.tier-edit { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.tier-edit:first-child { padding-top: 0; }
@media (min-width: 720px) { .tier-edit { grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto; align-items: end; } }
.tier-edit .input, .hours-row .input { min-height: 38px; padding: 6px 10px; min-width: 0; }
.hours-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); align-items: center; }
.hours-row + .hours-row { margin-top: var(--s2); }

.inbox { display: grid; min-height: 70vh; }
@media (min-width: 900px) { .inbox { grid-template-columns: 320px minmax(0, 1fr); } }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 75vh; }
.inbox-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: var(--s4) var(--s5); cursor: pointer; }
.inbox-item:hover { background: var(--wash); }
.inbox-item.active { background: var(--wash-2); }
.inbox-item .row { gap: var(--s2); flex-wrap: nowrap; }
.inbox-item strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item p { font-size: 14px; line-height: 20px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.inbox-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
.inbox-thread { display: flex; flex-direction: column; min-height: 70vh; }
.inbox-thread .chat-body { min-height: 300px; }
.inbox-thread .chat-head button { margin-left: 0; }
@media (min-width: 900px) { .inbox-thread .chat-head button { display: none; } }
@media (max-width: 899px) { .inbox.thread-open .inbox-list { display: none; } .inbox:not(.thread-open) .inbox-thread { display: none; } }

.toast { position: fixed; left: 50%; bottom: var(--s6); transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); padding: var(--s3) var(--s5); border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }

/* ===================================================== 8. the slab label

   One component, sized in em, so 1em = 1/68 of the label's width. On the
   print sheet font-size is 1mm, making the label exactly 68 x 21 mm. On
   screen the same markup is scaled by giving it a bigger font-size.       */

.label {
  --w: 68em; --h: 21em;
  width: var(--w); height: var(--h);
  display: flex; background: #fff; color: #000; overflow: hidden;
  font-family: var(--font); line-height: 1.15; letter-spacing: 0;
  border-radius: 1.2em;
  font-size: 4px; /* default on-screen scale; overridden by context */
}
/* Inner sizes are in units of the label width: 1 unit = font-size/68 * 68 = 1em. */
.label .l-main { flex: 1; min-width: 0; padding: 1.6em 1.8em 1.4em 2em; display: flex; flex-direction: column; }
.label .l-top { display: flex; align-items: center; gap: 0.9em; }
.label .l-mark { width: 3.6em; height: 3.6em; }
.label .l-word { font-size: 2.4em; font-weight: 700; letter-spacing: 0.14em; }
.label .l-cert { margin-left: auto; font-size: 1.55em; font-weight: 600; color: #555; letter-spacing: 0.06em; font-feature-settings: 'tnum' 1, 'zero' 1; }
.label .l-lines { margin-top: auto; display: flex; flex-direction: column; gap: 0.35em; }
.label .l-set { font-size: 1.85em; font-weight: 600; color: #444; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .l-name { font-size: 2.6em; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .l-variant { font-size: 1.7em; font-weight: 500; color: #555; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.15em; }
.label .l-grade { width: 17em; flex: none; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6em; padding: 0 1em; }
.label .l-num { font-size: 8.4em; font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; font-feature-settings: 'tnum' 1; }
.label .l-num.half { font-size: 6.8em; }
.label .l-gword { font-size: 1.6em; font-weight: 700; letter-spacing: 0.1em; text-align: center; line-height: 1.1; }
.label-back { justify-content: center; align-items: center; flex-direction: column; gap: 1em; }
.label-back .l-word { font-size: 2.2em; }
.label-back .l-verify { font-size: 1.6em; color: #555; letter-spacing: 0.04em; font-feature-settings: 'tnum' 1, 'zero' 1; }

.label-preview .label { font-size: min(6px, calc((100vw - 32px) / 68)); border: 1px solid var(--line-2); box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .35); }

/* ===================================================== 10. grading station
   Phone-first: big tap targets, one step on screen at a time. */

.station { max-width: 720px; margin-top: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.station-sub { margin-top: var(--s2); }
.station-choice {
  display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left; cursor: pointer;
  padding: var(--s5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .15s;
}
.station-choice:hover { border-color: var(--ink); }
.station-choice strong { display: block; font-size: 17px; letter-spacing: -0.015em; }
.station-choice small { display: block; color: var(--mute); font-size: 14px; line-height: 20px; margin-top: 2px; }
.station-context { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); background: var(--ink); color: var(--paper); border-radius: 999px; }
.station-context strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-context .btn-quiet { color: #c9c9c9; }
.station-context .btn-quiet:hover { background: #262626; color: var(--paper); }
.station-scan { display: grid; gap: var(--s3); padding: var(--s6); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.station-scan .btn { cursor: pointer; }
.station-camera { height: 64px; font-size: 17px; }
.station-search { display: grid; gap: var(--s2); }
.station-search .row { flex-wrap: wrap; }
.station-search input.input { flex: 1; min-width: 0; }
.station-search select.input { width: auto; flex: none; max-width: 40%; }
.station-reading { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.station-reading.dashed { border-style: dashed; border-color: var(--line-2); }
.station-reading p { margin-top: var(--s1); }
.station-photo { width: 88px; border-radius: 6px; flex: none; object-fit: cover; aspect-ratio: 63 / 88; background: var(--wash-2); }
.station-candidates { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 560px) { .station-candidates { grid-template-columns: 1fr 1fr; } }
.station-candidate { display: flex; gap: var(--s3); align-items: flex-start; text-align: left; cursor: pointer; padding: var(--s3); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.station-candidate:hover { border-color: var(--ink); }
.station-candidate.best { border: 2px solid var(--ink); padding: calc(var(--s3) - 1px); }
.station-candidate img, .station-noimg { width: 72px; aspect-ratio: 63 / 88; border-radius: 4px; flex: none; object-fit: cover; background: var(--wash-2); }
.station-noimg { display: grid; place-items: center; color: var(--faint); }
.station-candidate strong { display: block; font-size: 15px; margin-top: var(--s1); }
.station-candidate small { display: block; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.station-candidate small.mute { color: var(--faint); }
/* The best match on its own, bigger; the other matches behind "Show other matches". */
.station-best .station-candidate { width: 100%; }
.station-best .station-candidate img, .station-best .station-noimg { width: 132px; }
.station-best .station-candidate strong { font-size: 18px; line-height: 24px; }
.station-others { margin: var(--s3) 0; }
.station-candidates[hidden] { display: none; }
.station-actions { justify-content: flex-start; }
.station-picked { display: flex; gap: var(--s4); align-items: center; }
.station-picked img { width: 96px; border-radius: 6px; box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .4); }
.station-picked strong { font-size: 20px; letter-spacing: -0.02em; }
.station-grade { padding: var(--s5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; gap: var(--s4); }
.station-grade-word { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; font-feature-settings: 'tnum' 1; }
.grade-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s2); }
.grade-btn {
  height: 64px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--paper);
  font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-feature-settings: 'tnum' 1; cursor: pointer;
}
.grade-btn:hover { border-color: var(--ink); }
.grade-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.grade-half { height: 44px; padding: 0 var(--s5); border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); font-size: 16px; font-weight: 700; cursor: pointer; }
.grade-half[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.grade-half:disabled { opacity: .35; cursor: not-allowed; }
.station-details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); }
.station-details summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.station-details[open] summary { margin-bottom: var(--s4); }
.station-details > .input { margin-top: var(--s3); }
.station-sub-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .station-sub-grid { grid-template-columns: repeat(4, 1fr); } }
.station-done { text-align: center; padding: var(--s4) 0; }
.station-done h2 { margin-top: var(--s3); font-size: 40px; line-height: 44px; letter-spacing: -0.035em; }
.station-label { width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .35); aspect-ratio: 68 / 21; }
.station-made-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: 14px; }
.grade-thumb { width: 36px; border-radius: 3px; align-self: center; }
.verify-card { width: min(260px, 70%); border-radius: 12px; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .5); }

/* ===================================================== 9. print */

.print-only { display: none; }
@media print {
  .site-header, .site-footer, .chat-launcher, .chat-panel, .no-print, .band { display: none !important; }
  body { background: #fff; }
  .success { padding: 0; }
  .print-only { display: block; }
  .print-only h1 { font-size: 40pt; line-height: 1; letter-spacing: -0.02em; margin-bottom: 8pt; }
  .print-only p { font-size: 12pt; line-height: 16pt; margin-top: 4pt; }
  .print-only ol { font-size: 11pt; line-height: 16pt; margin-top: 12pt; }
}

/* admin overview ----------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); margin: var(--s6) 0; }
.stat-tile { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
a.stat-tile:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.stat-tile.stat-warn { border-color: var(--warn); }
.stat-label { display: flex; align-items: center; gap: var(--s2); font-size: 12px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--mute); }
.stat-value { font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { font-size: 13px; line-height: 18px; color: var(--mute); }
.overview-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s4); align-items: start; }
.overview-cols .admin-card + .admin-card { margin-top: 0; }
.kv-row { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row > span:last-child { text-align: right; }
.kv-row.kv-warn > span:last-child { color: var(--late); font-weight: 600; }

/* ---- admin: add to the shop (js/admin/shop.js) ---- */
.shop-h2 { margin-top: var(--s8); }
.shop-kinds { display: grid; gap: var(--s3); grid-template-columns: repeat(3, 1fr); }
.shop-kind { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4); text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; }
.shop-kind:hover { border-color: var(--ink); }
.shop-kind.active { border: 2px solid var(--ink); padding: calc(var(--s4) - 1px); }
.shop-kind strong { display: block; font-size: 16px; }
.shop-kind small { display: block; font-size: 13px; line-height: 18px; color: var(--mute); }
.shop-search-row .input[type=search] { flex: 1 1 260px; width: auto; }
.shop-search-row .shop-lang { flex: 0 1 190px; width: auto; }
.shop-pics { display: flex; gap: var(--s3); flex-wrap: wrap; }
.shop-pic { margin: 0; display: flex; flex-direction: column; gap: var(--s1); width: 120px; font-size: 12px; color: var(--mute); }
.shop-pic img, .shop-pic-box { width: 120px; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 6px; background: var(--wash-2); }
.shop-pic-box { display: grid; place-items: center; color: var(--faint); border: 1px dashed var(--line-2); overflow: hidden; }
.shop-pic-box img { width: 100%; height: 100%; object-fit: cover; }
.shop-pic-add { cursor: pointer; }
.shop-pic-add:hover .shop-pic-box { border-color: var(--ink); color: var(--ink); }
.shop-list { display: grid; gap: var(--s2); }
.shop-row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; padding: var(--s3); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-row > img, .shop-row > .station-noimg { width: 48px; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 4px; background: var(--wash-2); flex: none; }
.shop-row-name { flex: 1 1 200px; min-width: 0; }
.shop-row-name strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-row-name small { display: block; font-size: 13px; }
.shop-row-edit { display: flex; gap: var(--s2); align-items: flex-end; flex-wrap: wrap; }
.shop-row-edit .field { width: 92px; gap: 2px; }
.shop-row-edit .field > span { font-size: 12px; }
.shop-row-edit .input { min-height: 36px; padding: 6px 8px; }
.shop-row-edit .check { align-self: center; font-size: 14px; }
@media (max-width: 520px) { .shop-kinds { grid-template-columns: 1fr; } .shop-kind { flex-direction: row; align-items: center; } }

/* ------------------------------------------------------------------
   Step-by-step flows (submit, shop checkout, admin "add product").
   One step on screen at a time; above it a timeline whose line fills
   as you move on. Done steps show a tick and can be tapped to go back.
   ------------------------------------------------------------------ */
.wiz-bar { margin-bottom: var(--s8); }
.wiz-track { list-style: none; margin: 0; padding: 0; display: flex; position: relative; }
.wiz-track { --wiz-n: 4; --wiz-p: 0; }
.wiz-track::before, .wiz-track::after { content: ''; position: absolute; top: 15px; left: calc(50% / var(--wiz-n)); height: 2px; border-radius: 2px; }
.wiz-track::before { right: calc(50% / var(--wiz-n)); background: var(--line); }
.wiz-track::after { width: calc((100% - 100% / var(--wiz-n)) * var(--wiz-p)); background: var(--ink); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.wiz-track li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--s2); position: relative; z-index: 1; min-width: 0; }
.wiz-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--line-2); color: var(--faint);
  font-size: 13px; font-weight: 700; font-feature-settings: 'tnum' 1;
  transition: background .25s, border-color .25s, color .25s, transform .25s; padding: 0; cursor: default;
}
.wiz-dot .icon { width: 16px; height: 16px; stroke-width: 2.5; }
.wiz-track li.done .wiz-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); cursor: pointer; }
.wiz-track li.done .wiz-dot:hover { transform: scale(1.08); }
.wiz-track li.now .wiz-dot { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 5px var(--wash-2); }
.wiz-label { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.wiz-track li.done .wiz-label, .wiz-track li.now .wiz-label { color: var(--ink); }
.wiz-now { margin-top: var(--s4); font-size: 14px; line-height: 20px; color: var(--mute); }
.wiz-now strong { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) {
  .wiz-label { display: none; }
  .wiz-track li.now .wiz-label { display: block; position: absolute; top: 40px; }
  .wiz-track li.now:first-child .wiz-label { left: 0; }
  .wiz-track li.now:last-child .wiz-label { right: 0; }
  .wiz-now { margin-top: var(--s8); }
}

.wiz-step { display: none; }
.wiz-step.on { display: block; animation: wiz-in .35s cubic-bezier(.2, .8, .2, 1); }
.wiz-step.on.back { animation-name: wiz-in-back; }
@keyframes wiz-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes wiz-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wiz-step.on, .wiz-track::after { animation: none; transition: none; } }
.wiz-head { margin-bottom: var(--s6); }
.wiz-title { font-size: 24px; line-height: 32px; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 var(--s1); }
.wiz-step > * + * { margin-top: var(--s5); }
.wiz-step > .wiz-head + * { margin-top: 0; }
.wiz-add { margin-top: var(--s4); }
.wiz-nav { display: flex; gap: var(--s3); margin-top: var(--s8); padding-top: var(--s6); border-top: 1px solid var(--line); }
.wiz-nav [id$="next"], .wiz-nav [type="submit"] { margin-left: auto; }
.wiz-nav .btn[disabled] { opacity: .4; cursor: not-allowed; }
.form-error + .wiz-nav { margin-top: var(--s4); }
.wiz-step + .form-error, .wiz-step ~ .form-error { margin-top: var(--s6); }
@media (max-width: 520px) {
  .wiz-nav { position: sticky; bottom: 0; background: var(--paper); margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom)); z-index: 5; }
  .wiz-nav .btn { flex: 1; }
  .wiz-nav #wiz-back, .wiz-nav [data-wiz="back"] { flex: 0 0 auto; }
}
.field.bad .input { border-color: var(--late); box-shadow: 0 0 0 3px var(--late-bg); }

/* The review step: one block per step, tap to change. */
.review { display: grid; gap: var(--s3); }
.review-block { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; background: var(--paper); font: inherit; color: inherit; cursor: pointer; transition: border-color .15s; width: 100%; }
.review-block:hover { border-color: var(--ink); }
.review-block .t-micro { color: var(--mute); }
.review-block .edit { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 14px; font-weight: 600; text-decoration: underline; }
.review-block ul { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 22px; }
.review-block .total-line { font-weight: 700; font-size: 18px; }
.pay-note { padding: var(--s4); background: var(--wash); border-radius: var(--radius); cursor: default; }
@media (max-width: 520px) {
  /* Keep the chat button clear of the sticky Back / Continue bar. */
  body:has(.wiz-nav) .chat-launcher { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* Once you are past step 1, the big page title makes way for the step itself. */
  body:has(.wiz-step:not(:first-of-type).on) #submit-head { display: none; }
}
.wiz-bar { margin-top: var(--s2); }

/* Admin "Add to shop": scan first, prices that follow the market. */
.shop-scan { display: grid; gap: var(--s2); max-width: 520px; }
.shop-or { display: flex; align-items: center; gap: var(--s3); color: var(--faint); font-size: 13px; margin-top: var(--s2); }
.shop-or::before, .shop-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.shop-row-name small.shop-auto { display: flex; align-items: center; gap: var(--s1); color: var(--ink-2); font-weight: 500; }
.shop-pricing { padding: var(--s3) var(--s4); background: var(--wash); border-radius: var(--radius); }

/* Order tracking: the stage timeline, "what happens next", live payment. */
.track-timeline { margin-top: var(--s6); }
.track-timeline .wiz-bar { margin: 0 0 var(--s5); }
.wiz-date { font-size: 12px; line-height: 16px; color: var(--mute); font-feature-settings: 'tnum' 1; white-space: nowrap; }
@media (max-width: 520px) { .track-stages .wiz-date { display: none; } }
.notice-good { background: #eaf6ee; color: #14532d; }
.live-dot { gap: var(--s2); }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }

/* Population report */
.pop-wrap { padding: var(--s8) var(--gutter) var(--s20); }
.pop-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s8); }
@media (min-width: 720px) { .pop-summary { grid-template-columns: repeat(4, 1fr); } }
.pop-summary > div { background: var(--wash); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); display: grid; gap: var(--s1); }
.pop-summary strong { font-size: 28px; line-height: 32px; letter-spacing: -0.03em; }
.pop-summary > div:last-child strong { font-size: 16px; line-height: 32px; letter-spacing: 0; }
.pop-summary span { font-size: 13px; color: var(--mute); }
.pop-tools { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 720px) { .pop-tools { grid-template-columns: 1fr 220px; } }
.pop-table th, .pop-table td { vertical-align: middle; }
.pop-table .pop-g { text-align: right; width: 56px; }
.pop-table td.zero { color: var(--line-2); }
.pop-table .pop-total { font-weight: 700; }
.pop-card { display: flex; gap: var(--s3); align-items: center; min-width: 240px; font-weight: 400; text-align: left; }
.pop-card img, .pop-noimg { width: 36px; height: 50px; border-radius: 3px; object-fit: cover; background: var(--wash); flex: none; }
.pop-card span { display: grid; }
.pop-card small { font-size: 13px; }
.pop-more { margin-top: var(--s5); }
.pop-note { margin-top: var(--s5); }
.pop-none { padding: var(--s8) 0; }
.empty-state { text-align: center; padding: var(--s16) var(--s4); display: grid; justify-items: center; gap: var(--s3); }
.empty-state .icon-lg { width: 32px; height: 32px; color: var(--faint); }
.pop-table tbody th.pop-card { text-transform: none; letter-spacing: 0; font-size: 15px; line-height: 20px; color: var(--ink); white-space: normal; padding: var(--s3); border-bottom: 1px solid var(--line); }
.hero-meta .hero-stat-link { font-size: 14px; line-height: 20px; color: var(--mute); text-decoration: none; }
.hero-meta .hero-stat-link:hover strong { text-decoration: underline; }
.footer-biz { display: grid; gap: 2px; margin-top: var(--s3); }
.review-block.review-static { cursor: default; }
.review-block.review-static:hover { border-color: var(--line); }

/* 404 */
.notfound { padding: var(--s20) 0 var(--s24); }
.notfound .t-lead { margin-top: var(--s4); max-width: 34em; }
.notfound-links { display: grid; gap: var(--s3); margin: var(--s8) 0; }
@media (min-width: 720px) { .notfound-links { grid-template-columns: repeat(4, 1fr); } }
.notfound-links .card { display: grid; gap: var(--s1); text-decoration: none; padding: var(--s5); transition: border-color .15s; }
.notfound-links .card:hover { border-color: var(--ink); }
