/* Neutral "late-night diner" look. Not based on any company's brand. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e1d7;
  --accent: #c2410c;      /* coffee-orange */
  --accent-ink: #ffffff;
  --navy: #1e2a44;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn-bg: #fef3c7;
  --err-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f1ece4; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
h1 { font-size: 1.9rem; margin: .6rem 0 .8rem; line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 1.8rem 0 .7rem; }
h3 { font-size: 1.05rem; margin: .6rem 0 .4rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 18px !important; }

/* Header */
.site-header { background: var(--navy); color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.6rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.2rem; letter-spacing: .06em; }
.brand-text small { color: #c7cfdf; font-size: .78rem; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a, .nav .link { color: #e6eaf2; font-size: .95rem; }
.nav a.btn { color: var(--accent-ink); }
.subnav { display: flex; gap: 18px; margin-bottom: 16px; }

/* Buttons & forms */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn-small { padding: 5px 12px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn-danger { background: #b91c1c; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link.danger, a.danger { color: #b91c1c; }
form.inline { display: inline; margin: 0; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
input[type=file] { padding: 6px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { max-width: 320px; }
.filters select { width: auto; }

/* Layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin: 16px 0; }
.narrow { max-width: 560px; margin: 24px auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-top: 16px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--accent); font-weight: 700; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }
.prose { max-width: 760px; }
.prose li { margin: 6px 0; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; padding: 28px 0 8px; }
.hero h1 { font-size: 2.4rem; }
.lead { font-size: 1.1rem; color: #3b4252; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats.compact { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 1.7rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f4efe7; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #4b5563; }
.table tr:last-child td { border-bottom: 0; }
.table td.group { background: #faf6ef; font-weight: 700; color: var(--navy); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eee8de; font-size: .8rem; font-weight: 600; color: #4b5563; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; border: 1px solid transparent; }
.flash-success { background: var(--ok-bg); border-color: #bbf7d0; }
.flash-error { background: var(--err-bg); border-color: #fecaca; }
.flash-warn { background: var(--warn-bg); border-color: #fde68a; }
.flash-info { background: #e0f2fe; border-color: #bae6fd; }

/* Awards */
.award-group { margin-top: 18px; color: var(--muted); text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.award { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; opacity: .6; }
.award.earned { opacity: 1; border-color: #f0b27a; box-shadow: var(--shadow); }
.award-icon { font-size: 1.6rem; }

/* Map */
#map { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0; z-index: 0; }
.pin-live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { stroke-opacity: 1; } 50% { stroke-opacity: .2; } 100% { stroke-opacity: 1; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--muted); font-size: .85rem; }
.site-footer .notice { max-width: 760px; }

@media (max-width: 760px) {
  .hero, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .table { display: block; overflow-x: auto; }
}

/* ---------------------------------------------------------------------------
   Theme: tiles — yellow sign tiles, black letters, late-night diner colors.
   Built from plain CSS; no third-party logo artwork is used.
   Switch off with WHOTA_THEME=neutral.
--------------------------------------------------------------------------- */
.tiles { display: none; }
.theme-neutral .brand::before { content: "📻"; font-size: 1.6rem; }

.theme-tiles {
  --bg: #fffbea;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #5b5446;
  --line: #e8dca8;
  --accent: #111111;
  --accent-ink: #ffd200;
  --navy: #111111;
  --sign: #ffd200;       /* sign yellow */
  --ketchup: #c8102e;    /* booth red */
  --coffee: #5a3a1e;
}
.theme-tiles .site-header { background: #111; border-bottom: 6px solid var(--sign); }
.theme-tiles .tiles { display: inline-flex; gap: 4px; }
.theme-tiles .tile {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sign); color: #111; font-weight: 900; font-size: 1.45rem; line-height: 1;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  border: 2px solid #111; box-shadow: inset 0 0 0 2px #111, 0 2px 0 rgba(255,210,0,.35);
}
.theme-tiles .brand-short { display: none; }
.theme-tiles .brand-text small { color: var(--sign); font-weight: 600; letter-spacing: .04em; font-size: .85rem; }
.theme-tiles .nav a, .theme-tiles .nav .link { color: #fff; font-weight: 600; }
.theme-tiles .nav a:hover, .theme-tiles .nav .link:hover { color: var(--sign); }
.theme-tiles .nav a.btn { background: var(--sign); color: #111; }

.theme-tiles .btn { background: #111; color: var(--sign); }
.theme-tiles .btn-ghost { background: transparent; color: #111; box-shadow: inset 0 0 0 2px #111; }
.theme-tiles .btn-danger { background: var(--ketchup); color: #fff; }
.theme-tiles a { color: var(--ketchup); }
.theme-tiles .nav a, .theme-tiles .brand { color: #fff; }

.theme-tiles h1, .theme-tiles h2 { font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.01em; }
.theme-tiles .eyebrow { color: var(--ketchup); }
.theme-tiles .hero { background: var(--sign); margin: 0 -20px; padding: 32px 20px; border-bottom: 4px solid #111; }
.theme-tiles .hero .lead { color: #222; }
.theme-tiles .hero .stat { border: 2px solid #111; box-shadow: 3px 3px 0 #111; }

.theme-tiles .stat span { color: #111; }
.theme-tiles .card, .theme-tiles .table, .theme-tiles .stat { border-color: #111; }
.theme-tiles .card { box-shadow: 4px 4px 0 #111; }
.theme-tiles .table { box-shadow: 4px 4px 0 #111; border-width: 2px; }
.theme-tiles .table th { background: #111; color: var(--sign); }
.theme-tiles .table td.group { background: var(--sign); color: #111; }
.theme-tiles .table tbody tr:nth-child(even) td { background: #fffdf2; }
.theme-tiles .badge.ok { background: var(--sign); color: #111; border: 1px solid #111; }
.theme-tiles code { background: #fff3b0; }
.theme-tiles .award.earned { border: 2px solid #111; background: #fff6c4; box-shadow: 3px 3px 0 #111; }
.theme-tiles input, .theme-tiles select, .theme-tiles textarea { border: 2px solid #111; }
.theme-tiles input:focus, .theme-tiles select:focus, .theme-tiles textarea:focus { outline: 3px solid var(--sign); outline-offset: 0; }
.theme-tiles .site-footer { background: #111; color: #d6d0bd; border-top: 6px solid var(--sign); }
.theme-tiles .site-footer a { color: var(--sign); }
.theme-tiles #map { border: 2px solid #111; box-shadow: 4px 4px 0 #111; }

@media (max-width: 760px) {
  .theme-tiles .tile { width: 30px; height: 30px; font-size: 1.1rem; }
}

label.attest { align-items: flex-start; font-weight: 500; background: #fffbe6; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); }
label.attest input { margin-top: 4px; }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0; }

.badge.rbn { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.badge.live { background: #fee2e2; color: #b91c1c; }

/* Awards */
.award-body { flex: 1; min-width: 0; }
.bar { height: 8px; background: #eee6cc; border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar span { display: block; height: 100%; background: var(--sign, var(--accent)); border-right: 2px solid #111; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.state-chip { text-align: center; padding: 6px 0; font-weight: 800; border: 2px dashed #c9bf9f; border-radius: 6px; color: #9a917c; }
.state-chip.done { background: var(--sign, #fde68a); color: #111; border: 2px solid #111; }

/* ---------------------------------------------------------------------------
   Dark mode: "3 AM at the diner". On when html[data-theme=dark], which
   static/theme.js sets from the visitor's saved choice or their device setting.
--------------------------------------------------------------------------- */
html[data-theme="dark"] body[class] {
  --bg: #121110; --surface: #1c1a17; --ink: #f2eee2; --muted: #a39b88; --line: #3a352b;
  --accent: #ffd200; --accent-ink: #111; --navy: #ffd200; --ketchup: #ff5a5f; --sign: #ffd200;
  background: var(--bg); color: var(--ink); color-scheme: dark;
}
html[data-theme="dark"] body[class] a { color: #ffd200; }
html[data-theme="dark"] body[class] .eyebrow { color: #ff5a5f; }
html[data-theme="dark"] body[class] .lead, html[data-theme="dark"] body[class] .hero .lead { color: #d8d2c2; }
html[data-theme="dark"] body[class] .hero { background: #1a1813; border-bottom: 4px solid #ffd200; }
html[data-theme="dark"] body[class] .hero h1 { color: #ffd200; }
html[data-theme="dark"] body[class] .btn { background: #ffd200; color: #111; }
html[data-theme="dark"] body[class] .btn-ghost { background: transparent; color: #ffd200; box-shadow: inset 0 0 0 2px #ffd200; }
html[data-theme="dark"] body[class] .card, html[data-theme="dark"] body[class] .stat, html[data-theme="dark"] body[class] .table { background: var(--surface); border-color: #4a4436; }
html[data-theme="dark"] body[class] .card, html[data-theme="dark"] body[class] .table { box-shadow: 4px 4px 0 #000; }
html[data-theme="dark"] body[class] .hero .stat { border-color: #ffd200; box-shadow: 3px 3px 0 #000; }
html[data-theme="dark"] body[class] .stat span { color: #ffd200; }
html[data-theme="dark"] body[class] .table th { background: #0b0b0a; color: #ffd200; border-bottom-color: #4a4436; }
html[data-theme="dark"] body[class] .table td { border-bottom-color: #2e2a22; }
html[data-theme="dark"] body[class] .table tbody tr:nth-child(even) td { background: #201e1a; }
html[data-theme="dark"] body[class] .table td.group { background: #ffd200; color: #111; }
html[data-theme="dark"] body[class] .badge { background: #2e2a22; color: #d8d2c2; }
html[data-theme="dark"] body[class] .badge.ok { background: #ffd200; color: #111; border-color: #ffd200; }
html[data-theme="dark"] body[class] .badge.rbn { background: #172554; color: #bfdbfe; border-color: #1e40af; }
html[data-theme="dark"] body[class] .badge.live { background: #4c0d10; color: #fecaca; }
html[data-theme="dark"] body[class] code { background: #2e2a22; color: #ffe680; }
html[data-theme="dark"] body[class] input, html[data-theme="dark"] body[class] select, html[data-theme="dark"] body[class] textarea { background: #0f0e0c; color: var(--ink); border-color: #5a5344; }
html[data-theme="dark"] body[class] .award { background: var(--surface); border-color: #3a352b; }
html[data-theme="dark"] body[class] .award.earned { background: #2a2410; border: 2px solid #ffd200; box-shadow: 3px 3px 0 #000; }
html[data-theme="dark"] body[class] .bar { background: #2e2a22; }
html[data-theme="dark"] body[class] .bar span { border-right-color: #fff3; }
html[data-theme="dark"] body[class] .state-chip { border-color: #4a4436; color: #6f6857; }
html[data-theme="dark"] body[class] .state-chip.done { background: #ffd200; color: #111; border-color: #ffd200; box-shadow: 0 0 10px #ffd20055; }
html[data-theme="dark"] body[class] .flash-success { background: #0f2e1a; border-color: #166534; }
html[data-theme="dark"] body[class] .flash-error { background: #3b0d0d; border-color: #7f1d1d; }
html[data-theme="dark"] body[class] .flash-warn { background: #3a2e05; border-color: #854d0e; }
html[data-theme="dark"] body[class] .flash-info { background: #0c2738; border-color: #075985; }
html[data-theme="dark"] body[class] #map { border-color: #4a4436; box-shadow: 4px 4px 0 #000; }
html[data-theme="dark"] body[class] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
html[data-theme="dark"] body[class] .leaflet-container { background: #1a1a1a; }
html[data-theme="dark"] body[class] .leaflet-popup-content-wrapper, html[data-theme="dark"] body[class] .leaflet-popup-tip { background: #1c1a17; color: var(--ink); }
html[data-theme="dark"] body[class] .site-footer { background: #0b0b0a; }
html[data-theme="dark"] body[class] .leaflet-bar a { background: #1c1a17; color: #ffd200; border-color: #4a4436; }
html[data-theme="dark"] body[class] .leaflet-control-attribution { background: rgba(0,0,0,.7); color: #bdb6a4; }
html[data-theme="dark"] body[class] .site-header { background: #0b0b0a; }
html[data-theme="dark"] body[class] label.attest { background: #2a2410; border-color: #4a4436; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  background: none; border: 0; padding: 0; cursor: pointer; color: #fff; border-radius: 8px; }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle:hover { color: #ffd200; background: rgba(255,255,255,.08); }
.theme-toggle:focus-visible { outline: 2px solid #ffd200; outline-offset: 2px; }
.theme-toggle .when-dark { display: none; }
html[data-theme="dark"] .theme-toggle .when-dark { display: block; }
html[data-theme="dark"] .theme-toggle .when-light { display: none; }
html[data-theme="dark"] body[class] .nav a, html[data-theme="dark"] body[class] .nav .link,
html[data-theme="dark"] body[class] .brand { color: #fff; }
html[data-theme="dark"] body[class] .nav a:hover { color: #ffd200; }
html[data-theme="dark"] body[class] .nav a.btn { color: #111; }
