/*
  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: flex; gap: var(--s8); flex-wrap: wrap; }
.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 illustration: built from boxes in CSS, no photo. */
.slab-art { position: relative; justify-self: center; width: min(340px, 86vw); }
.slab {
  position: relative; border-radius: 18px; padding: 10px;
  background: linear-gradient(160deg, #fafafa 0%, #e9e9e9 55%, #f7f7f7 100%);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 #fff inset, 0 30px 60px -30px rgba(0, 0, 0, .35), 0 12px 24px -16px rgba(0, 0, 0, .2);
}
.slab::after { /* the acrylic sheen */
  content: ''; position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .45) 100%);
}
/* The label is 68em wide (section 8), so font-size = available width / 68. */
.slab .label { font-size: calc((min(340px, 86vw) - 22px) / 68); }
.slab-window { margin-top: 10px; aspect-ratio: 63 / 88; border-radius: 10px; background: #dcdcdc; padding: 8%; border: 1px solid #cfcfcf; }
.slab-card { height: 100%; border-radius: 6px; background: linear-gradient(150deg, #2a2a2a, #0d0d0d 60%, #3a3a3a); position: relative; overflow: hidden; }
.slab-card::before { content: ''; position: absolute; inset: 7% 7% 45%; border-radius: 3px; background: linear-gradient(135deg, #9a9a9a, #5d5d5d 40%, #c4c4c4 60%, #6e6e6e); }
.slab-card::after { content: ''; position: absolute; left: 7%; right: 7%; bottom: 9%; height: 26%; border-radius: 2px; background: repeating-linear-gradient(to bottom, #555 0 2px, transparent 2px 9px); opacity: .7; }

/* 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; }
