:root {
  --bg: #f3f0ea;
  --surface: #fffcf8;
  --fg: #1b1916;
  --muted: #6e6860;
  --subtle: #8a847c;
  --accent: #2c3a4a;
  --accent-fg: #f6f3ee;
  --border: #e4ded4;
  --line: #d4cdc2;
  --danger: #8f3a32;
  --success: #2f5d50;
  --radius: 12px;
  --font: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Fraunces", "Times New Roman", serif;
  --shadow-card: 0 1px 2px rgb(27 25 22 / 0.04), 0 10px 28px rgb(27 25 22 / 0.06);
  --shadow-lift: 0 1px 2px rgb(27 25 22 / 0.05), 0 16px 36px rgb(27 25 22 / 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.page {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; margin: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
p { text-wrap: pretty; }
button, [role="button"] { cursor: pointer; font-family: inherit; }
::selection { background: color-mix(in oklab, var(--accent) 18%, white); }
.hidden { display: none !important; }
.wrap { width: min(72rem, calc(100% - 2.5rem)); margin-inline: auto; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: inherit; }
.logo { width: 32px; height: 32px; flex: 0 0 32px; }
.brand-copy { line-height: 1.15; }
.brand strong { display: block; font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 1px; font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.lede { max-width: 28rem; margin: 1.15rem 0 0; color: var(--muted); font-size: 1.125rem; line-height: 1.6; }
.hint, .quiet { color: var(--subtle); font-size: 0.9rem; }
.quiet { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.error { color: var(--danger); font-size: 0.9rem; }
.flash { background: color-mix(in oklab, var(--success) 12%, white); color: var(--success); padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.7rem 1.35rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; background: var(--accent); color: var(--accent-fg); }
.btn.lg { min-height: 48px; padding-inline: 1.75rem; }
.btn.ghost { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }
.btn.sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn.ring { width: 100%; min-height: 64px; margin-top: 2rem; font-size: 1.125rem; letter-spacing: 0.01em; }
.btn .ico { width: 18px; height: 18px; }
.text-btn { display: inline-flex; align-items: center; gap: 0.2rem; min-height: 44px; background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; }
.more-btn { display: block; width: 100%; min-height: 44px; margin-top: 1rem; background: none; border: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.more-btn:hover { color: var(--fg); }

.topbar, .foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.25rem; }
.foot { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; flex-wrap: wrap; }
.foot nav { display: flex; gap: 1rem; }
.foot a:hover { color: var(--fg); }

.hero { display: grid; gap: 3rem; align-items: center; padding: 1.5rem 0 4rem; }
.hero h1 { max-width: 16ch; font-size: clamp(3rem, 6vw, 4.15rem); line-height: 1.02; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: 2.5rem; } }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.actions.stacked { flex-direction: column; }
.actions.stacked .btn { width: 100%; }

.hero-card { width: min(100%, 24rem); margin-inline: auto; }
.plate-stage { background: var(--accent); color: var(--accent-fg); border-radius: 2rem; padding: 1.25rem 1.25rem 1.5rem; display: grid; justify-items: center; box-shadow: var(--shadow-lift); }
.stage-label { margin: 0 0 1rem; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in oklab, var(--accent-fg) 70%, transparent); }
.plate-svg svg, .plate-stage svg { width: min(6cm, 100%); height: auto; display: block; background: var(--surface); }
.plate-note { margin: 1rem 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }

.steps { display: grid; border-top: 1px solid var(--border); background: var(--border); gap: 1px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps article { padding: 2rem 1.5rem; background: var(--bg); }
.steps span { font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--subtle); }
.steps h2 { margin-top: 0.75rem; }
.steps p { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.features { display: grid; gap: 1.5rem; padding: 4rem 0; }
@media (min-width: 800px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--surface); border-radius: 20px; padding: 1.5rem; box-shadow: 0 0 0 1px var(--border); }
.feature-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); color: var(--accent); }
.feature h2 { margin-top: 1rem; }
.feature p { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.visitor { min-height: 100dvh; display: flex; flex-direction: column; width: min(28rem, 100%); margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom)); }
.visitor-head { display: flex; justify-content: space-between; align-items: center; padding-block: 0.75rem; }
.visitor-body { display: flex; flex: 1; flex-direction: column; padding-top: 1rem; }
.house { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.welcome { margin-top: 0.75rem; font-size: 2.15rem; line-height: 1.05; }
.welcome-copy { margin: 0.75rem 0 0; max-width: 20rem; color: var(--muted); font-size: 17px; line-height: 1.55; }
.visitor-form { display: flex; flex: 1; flex-direction: column; }
.panel { display: flex; flex: 1; flex-direction: column; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-top: 1.75rem; }
.cat {
  min-height: 5.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  padding: 0.9rem; border: 0; border-radius: 12px; background: var(--surface); text-align: left;
  font-weight: 600; font-size: 13.5px; line-height: 1.3; color: var(--fg);
  box-shadow: 0 0 0 1px var(--border), 0 8px 20px rgb(27 25 22 / 0.04);
  transition: transform 150ms var(--ease);
}
.cat:active { transform: scale(0.98); }
.cat-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--bg); color: var(--accent); }
.fine { margin: 1.5rem 0 0; text-align: center; font-size: 0.75rem; line-height: 1.5; color: var(--subtle); }
.picked { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.picked-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: var(--accent-fg); }
.picked .eyebrow { font-size: 11px; letter-spacing: 0.16em; }
.picked h2 { font-size: 1.5rem; }
.fields { display: grid; gap: 1rem; margin-top: 1.5rem; }
label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 500; color: var(--fg); }
label span { font-weight: 400; color: var(--subtle); }
input:not([type="checkbox"]), textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.8rem; font: inherit; background: var(--surface); color: var(--fg); }
textarea { min-height: 6.5rem; resize: vertical; }
.auth label, .form-card label { margin-top: 0.85rem; }

.ok-badge { width: 64px; height: 64px; margin-top: 1.5rem; display: grid; place-items: center; border-radius: 999px; background: color-mix(in oklab, var(--success) 12%, white); color: var(--success); }
.ok-badge .ico { width: 28px; height: 28px; stroke-width: 2; }
.ready-actions { margin-top: auto; display: grid; gap: 0.75rem; padding-top: 2.5rem; }
.ready-actions .btn { width: 100%; }
.ready-actions .hint { text-align: center; margin: 0; }

.auth { width: min(28rem, calc(100% - 3rem)); margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-block: 3rem; }
.auth h1 { margin-top: 2rem; font-size: 2.25rem; }
.stack { display: grid; margin-top: 2rem; }
.stack .btn { margin-top: 1.25rem; width: 100%; }
.check { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-weight: 500; }
.check input { width: auto; min-height: 0; }
.auth-foot { margin-top: 2rem; color: var(--subtle); font-size: 0.9rem; }
.auth-foot a { color: var(--fg); }

.legal { width: min(40rem, calc(100% - 2.5rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.legal h1 { margin-top: 2rem; font-size: 2.25rem; }
.legal .copy { margin-top: 1.5rem; display: grid; gap: 1rem; color: var(--muted); font-size: 15px; line-height: 1.65; }
.legal .copy p { margin: 0; }

.admin-shell { min-height: 100dvh; }
@media (min-width: 960px) { .admin-shell { display: grid; grid-template-columns: 15.5rem 1fr; } }
.rail { display: none; background: var(--surface); }
@media (min-width: 960px) {
  .rail { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
  .rail .brand { padding: 1.25rem 1.25rem 0.5rem; }
}
.rail nav { display: flex; flex-direction: column; gap: 2px; padding: 0.75rem; }
.rail a, .tabbar a {
  display: flex; align-items: center; gap: 0.65rem; min-height: 40px; padding: 0.4rem 0.75rem;
  border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 0.9rem; font-weight: 500;
}
.rail a.is-active { background: var(--bg); color: var(--fg); }
.admin-col { display: flex; min-width: 0; flex-direction: column; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--border); background: var(--surface); padding: 0.75rem 1rem; }
.admin-bar p { margin: 0; color: var(--muted); font-size: 0.9rem; }
@media (min-width: 960px) { .admin-bar { padding-inline: 2rem; } .admin-bar .brand { display: none; } }
.desk-only { display: none; }
@media (min-width: 960px) { .desk-only { display: block; } }
.admin-main { flex: 1; padding: 1.5rem 1rem 5.5rem; }
@media (min-width: 960px) { .admin-main { padding: 1.75rem 2rem 2rem; } }
.tabbar {
  position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.25rem;
  border-top: 1px solid var(--border); background: var(--surface); padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom));
}
.tabbar a { flex-direction: column; justify-content: center; gap: 0.2rem; min-height: 48px; padding: 0.2rem; font-size: 10px; }
.tabbar a.is-active { color: var(--fg); }
.tabbar .ico { width: 16px; height: 16px; }
@media (min-width: 960px) { .tabbar { display: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.5rem; }
.page-head .actions { margin-top: 0; }
.page-head h1 { font-size: 1.875rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; padding: 0; margin: 0 0 2rem; list-style: none; }
.stats li { background: var(--surface); border-radius: 12px; padding: 1.25rem; box-shadow: 0 0 0 1px var(--border); }
.stats span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stats strong { display: block; margin-top: 0.45rem; font-family: var(--display); font-size: 1.875rem; font-weight: 600; }
.card { background: var(--surface); border-radius: 12px; padding: 1.25rem; box-shadow: 0 0 0 1px var(--border); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.card-head h2 { font-size: 1.25rem; }
.card-head a { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.card-head a:hover { color: var(--fg); }
.split { display: grid; gap: 1.5rem; }
@media (min-width: 960px) { .split { grid-template-columns: 1.2fr 22rem; align-items: start; } }
.form-card { max-width: 36rem; }
.form-card p, .meta p { margin: 0.35rem 0; }
.meta strong { display: inline-block; min-width: 6.5rem; }
.status-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.75rem 0.35rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: ui-monospace, monospace; font-size: 0.82rem; }
.empty { border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); padding: 3rem 1.5rem; text-align: center; }
.empty p { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; }
.pagination { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.pagination svg { width: 1rem; height: 1rem; }

.sticker-plate {
  width: 6cm; height: 7cm; background: var(--surface); color: var(--fg);
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1.5px var(--fg);
}
.sticker-brand { display: flex; align-items: center; justify-content: center; gap: 0.14cm; width: 100%; padding: 0.22cm 0.24cm 0.1cm; }
.sticker-logo {
  width: 0.42cm; height: 0.42cm; border-radius: 0.08cm; background: var(--accent);
  background-image: linear-gradient(var(--accent-fg), var(--accent-fg)), linear-gradient(var(--accent-fg), var(--accent-fg)), linear-gradient(var(--accent-fg), var(--accent-fg));
  background-size: 0.1cm 0.1cm; background-position: 0.09cm 0.09cm, 0.23cm 0.09cm, 0.09cm 0.23cm; background-repeat: no-repeat; flex: 0 0 0.42cm;
}
.sticker-wordmark { margin: 0; font-family: var(--display); font-size: 0.32cm; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.sticker-rule { width: 4.4cm; height: 1px; background: var(--accent); }
.sticker-qr { width: 4cm; height: 4cm; margin-top: 0.1cm; }
.sticker-qr svg { width: 4cm; height: 4cm; display: block; }
.sticker-copy { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 0.08cm 0.24cm; text-align: center; }
.sticker-owner { margin: 0; font-family: var(--display); font-size: 0.4cm; font-weight: 700; line-height: 1.08; }
.sticker-house { margin: 0.08cm 0 0; font-size: 0.2cm; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.sticker-cta { width: 100%; margin: 0; background: var(--accent); color: var(--accent-fg); text-align: center; padding: 0.16cm 0.2cm 0.18cm; font-size: 0.18cm; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.plate-stage.flat { border-radius: 16px; padding: 1rem; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .cat { transition: none; }
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1; min-width: min(100%, 16rem); max-width: 28rem; }
.card > .toolbar { margin-bottom: 0.35rem; }
.check-col { width: 2.25rem; }
th.check-col, td.check-col, .check-col { text-align: center; }
.row-actions { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
th .sort { display: inline-flex; align-items: center; gap: 0.3rem; color: inherit; text-decoration: none; }
th .sort:hover { color: var(--fg); }
.select-note { margin: 0; color: var(--danger); }
.select-note[hidden] { display: none; }

@media print {
  .sticker-plate { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
