/* Restaurant Referee: one stylesheet for the site, portals and referee desk. */
:root {
  --ink: #14181F;
  --ink-2: #1F2530;
  --text: #374151;
  --muted: #4B5563;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --paper: #FFFFFF;
  --sand: #F7F7F5;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --accent-soft: #FFEDD5;
  --accent-ink: #7C2D12;
  --accent-on-dark: #FDBA74;
  --blue-soft: #E0EAF5;
  --blue-ink: #1E3A5F;
  --ok-soft: #DCFCE7;
  --ok-ink: #14532D;
  --radius: 16px;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(38px, 6vw, 64px); letter-spacing: -0.03em; }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 21px; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img, svg { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 880px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.lead { font-size: 20px; color: var(--text); max-width: 620px; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow-sm { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.topbar--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--display); font-weight: 700; font-size: 20px; }
.brand small { font-family: Inter, sans-serif; font-weight: 500; font-size: 13px; color: #D1D5DB; }
.brand:hover { color: inherit; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-size: 15px; font-weight: 500; }
.nav a { color: inherit; text-decoration: none; padding: 8px 0; }
.nav a:hover { text-decoration: underline; color: inherit; }
.nav a.btn { padding: 10px 18px; color: #fff; text-decoration: none; }
.topbar__note { font-size: 14px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 14px 26px; border-radius: 12px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; text-decoration: none; border: 1px solid var(--ink); cursor: pointer; }
.btn:hover { background: #000; color: #fff; }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--ghost:hover { background: var(--sand); color: var(--ink); }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--light:hover { background: var(--sand); color: var(--ink); }
.btn--outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn--outline-light:hover { background: var(--ink-2); color: #fff; }
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.btn--danger { background: #fff; color: #991B1B; border-color: #991B1B; }
.btn--danger:hover { background: #FEF2F2; color: #7F1D1D; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Sections */
.section { padding: 88px 0; }
.section--sand { background: var(--sand); }
.section--dark { background: var(--ink); color: #fff; }
.section--dark .lead, .section--dark .muted, .section--dark p { color: #D1D5DB; }
.section--dark .eyebrow { color: var(--accent-on-dark); }
.section__head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin-bottom: 40px; }
.stripe { height: 10px; background: repeating-linear-gradient(90deg, var(--ink) 0 28px, #fff 28px 56px); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 72px 0 88px; }
.hero__copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero__card { flex: 1 1 380px; min-width: 0; }

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.card--sand { background: var(--sand); }
.card--bold { border: 2px solid var(--ink); }
.card--dark { background: var(--ink-2); border-color: #374151; color: #fff; }
.card--dark p, .card--dark li { color: #D1D5DB; }
.card--accent { background: var(--accent-soft); border-color: var(--accent-soft); }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.tile p { color: var(--muted); font-size: 15px; }
.callout { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 26px 30px; font-size: 18px; }
.statement { font-family: var(--display); font-size: 24px; font-weight: 600; text-align: center; margin-top: 36px; }
.tag { align-self: flex-start; background: #F3F4F6; color: var(--text); font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.tag--dark { background: var(--ink); color: #fff; }
.tag--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* Control columns */
.panel { border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.panel--in { background: #FFF7ED; border: 1px solid #FED7AA; }
.panel--in h3 { color: var(--accent-ink); }
.panel--out { background: #EEF3FA; border: 1px solid #BFD3EA; }
.panel--out h3 { color: var(--blue-ink); }
.list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.step { border-top: 4px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.step__n { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1; }
.step__t { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.step p { color: var(--muted); font-size: 15px; }

/* Scorecard demo bars */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar__label { display: flex; justify-content: space-between; font-size: 15px; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar > i.w2 { width: 40%; } .bar > i.w3 { width: 60%; } .bar > i.w4 { width: 80%; } .bar > i.accent { background: var(--accent); }
.big-score { font-family: var(--display); font-size: 28px; font-weight: 700; }

/* Chips and pills */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #F3F4F6; font-size: 14px; padding: 6px 12px; border-radius: 8px; }
.chip--in { background: var(--accent-soft); color: var(--accent-ink); }
.chip--out { background: var(--blue-soft); color: var(--blue-ink); }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill--wait { background: var(--accent-soft); color: var(--accent-ink); }
.pill--info { background: var(--blue-soft); color: var(--blue-ink); }
.pill--muted { background: #F3F4F6; color: var(--muted); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 22px; }
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.form-card h2 { font-size: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.field small { font-weight: 400; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #9CA3AF; border-radius: 10px; padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 130px; resize: vertical; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 10px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; font-weight: 400; }
.choice input { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; flex: none; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--sand); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.errors { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; border-radius: 12px; padding: 16px 20px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.notice { background: var(--accent-soft); border-radius: 12px; padding: 16px 20px; font-size: 15px; }
.flash { margin: 20px 0 0; padding: 14px 18px; border-radius: 12px; font-weight: 500; }
.flash--ok { background: var(--ok-soft); color: var(--ok-ink); }
.flash--err { background: #FEF2F2; color: #7F1D1D; }

/* Score picker */
.scores { display: flex; flex-direction: column; gap: 4px; }
.score-row { border-top: 1px solid var(--line); padding: 14px 0 4px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.score-row legend { float: left; margin: 0; }
.score-row__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.score-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.score-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 46px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 10px; font-weight: 600; cursor: pointer; background: #fff; }
.score-btn--skip { font-weight: 500; font-size: 14px; color: var(--muted); border-color: var(--line-2); }
.score-input:checked + .score-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.score-input:focus-visible + .score-btn { outline: 3px solid var(--accent); outline-offset: 2px; }
.score-total { font-family: var(--display); font-size: 20px; font-weight: 600; margin-top: 10px; min-height: 1em; }

/* Option cards (thank-you, final say) */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.option { position: relative; display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--line-2); border-radius: 14px; padding: 18px 20px; cursor: pointer; background: #fff; }
.option input { position: absolute; opacity: 0; }
.option strong { font-family: var(--display); font-size: 18px; }
.option span { font-size: 15px; color: var(--muted); }
.option:has(input:checked) { border-color: var(--ink); background: var(--sand); }
.option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.dark-box { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.dark-box p { color: #D1D5DB; }
.dark-box .eyebrow-sm { color: var(--accent-on-dark); }
.dark-box .option { background: var(--ink-2); border-color: #4B5563; color: #fff; }
.dark-box .option span { color: #D1D5DB; }
.dark-box .option:has(input:checked) { background: #fff; color: var(--ink); border-color: var(--accent-on-dark); }
.dark-box .option:has(input:checked) span { color: var(--text); }

/* Call Sheet */
.sheet__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.sheet__block { border-top: 1px solid var(--line); padding-top: 16px; }
blockquote { margin: 0; font-style: italic; color: var(--text); }
.quote { background: var(--sand); border-radius: 12px; padding: 16px 18px; color: var(--text); white-space: pre-line; }
.suggest { background: var(--sand); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; color: var(--text); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.timeline li { border-top: 4px solid var(--line-2); padding-top: 10px; font-size: 14px; color: var(--muted); }
.timeline li.done { border-color: var(--ink); color: var(--ink); }
.timeline li.now { border-color: var(--accent); color: var(--ink); font-weight: 600; }

/* Tables (referee desk) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--sand); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; }
.stat span { font-size: 14px; color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); text-decoration: none; color: var(--ink); font-size: 14px; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.is-admin main { background: var(--sand); padding-bottom: 64px; min-height: 70vh; }
.page-title { padding: 36px 0 20px; display: flex; flex-direction: column; gap: 8px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.log { font-size: 14px; color: var(--muted); }
pre.mail { white-space: pre-wrap; font: 14px/1.5 ui-monospace, Menlo, monospace; background: var(--sand); padding: 14px; border-radius: 10px; margin: 0; }

/* Footer */
.footer { background: var(--ink); color: #D1D5DB; font-size: 14px; padding-bottom: env(safe-area-inset-bottom); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-top: 44px; padding-bottom: 44px; }
.footer__inner > div { display: flex; flex-direction: column; gap: 4px; }
.footer strong { color: #fff; font-family: var(--display); font-size: 18px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer a { color: #fff; }

/* Install prompt */
.install { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.install[hidden] { display: none; }
.install p { font-size: 15px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 44px 0 64px; }
  .card, .form-card { padding: 22px; }
}

/* Page helpers */
.page { padding-top: 40px; padding-bottom: 72px; }
.h-page { font-size: clamp(32px, 5vw, 44px); line-height: 1.08; }
.h2-sm { font-size: 24px; }
.h-lg { font-size: 26px; }
.h-display { font-family: var(--display); font-size: 18px; }
.legend-note { font-weight: 400; font-size: 15px; }
.small { font-size: 14px; }
.mt { margin-top: 28px; }
.grow { flex: 1 1 260px; }
.center { align-items: center; text-align: center; }
.row--center { justify-content: center; }
.on-dark { color: #fff; }
.hero--flat { padding: 0; }
.card--hl { border-color: var(--accent-on-dark); }
.form-card--dark { background: var(--ink-2); border-color: #374151; color: #fff; }
.form-card--dark .field small { color: #D1D5DB; }
.steps--thin .step { border-top-width: 2px; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 19px; min-height: 28px; }
.faq p { margin-top: 10px; color: var(--muted); }
details.card summary { cursor: pointer; min-height: 28px; }
.callout .eyebrow-sm { color: var(--accent-on-dark); }
.panel legend { color: inherit; }
.panel--in legend { color: var(--accent-ink); }
.panel--out legend { color: var(--blue-ink); }

@media (max-width: 640px) {
  .topbar { position: static; }
  .topbar__inner { padding-top: 10px; padding-bottom: 10px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 18px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .nav a.btn { margin-left: auto; }
}
