:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #eb6834;      /* ember orange — brand only, never a data series */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  background: #241a14;
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px;
}
.brand { color: #fff; font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.site-header nav a {
  color: #e8ded6; text-decoration: none; padding: 6px 10px; border-radius: 6px;
  font-size: 0.95rem;
}
.site-header nav a:hover { background: rgba(255, 255, 255, 0.12); }
.site-header nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.site-header nav a.user { color: #fff; font-weight: 600; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.sub { color: var(--ink-2); margin: 0 0 20px; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.tile { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(36,26,20,0.10); border-color: rgba(235,104,52,0.35); }
.tile .value { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.tile .label { color: var(--ink-2); font-size: 0.85rem; }
.tile .label a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.tile .label a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.tile .chip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
table.data th {
  text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--grid);
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: var(--page); }
.stars { color: var(--accent); letter-spacing: 2px; }
/* Click-to-rate stars on the restaurants list (owner only): hollow and
   near-white until clicked, solid ember orange once saved. */
.rate-form { display: inline-flex; gap: 2px; }
.star-btn { background: none; border: 0; border-radius: 0; padding: 0;
  cursor: pointer; font-size: 1.3rem; line-height: 1; font-weight: 400;
  color: #d9d5cc; }
.star-btn:hover { filter: none; }
.star-btn.on { color: var(--accent); }
.rate-form:hover .star-btn { color: var(--accent); }
.rate-form .star-btn:hover ~ .star-btn { color: #d9d5cc; }

/* ---------- category tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.tabs a {
  text-decoration: none; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.9rem;
}
.tabs a.active { color: #fff; border-color: transparent; font-weight: 600; }

/* ---------- bar chart (single series) ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; border-bottom: 2px solid #c3c2b7; }
/* The column must have a definite height, or the bars' percentage heights
   resolve to 0 and the chart renders empty. */
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 20px; position: relative; }
.bar-col .bar { width: 100%; max-width: 34px; background: #2a78d6; border-radius: 4px 4px 0 0; flex-shrink: 1; }
.bar-col .val {
  font-size: 0.75rem; color: var(--ink-2); margin-bottom: 3px; line-height: 1;
  visibility: hidden; font-variant-numeric: tabular-nums;
}
.bar-col:hover .val, .bar-col.peak .val { visibility: visible; }
.bar-col:hover .bar { background: #1c5cab; }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 0.72rem; color: var(--muted); min-width: 20px; }

/* ---------- forms ---------- */
form.card, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; max-width: 640px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.field .hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=url], input[type=email], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--grid); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label { font-weight: 400; display: flex; align-items: center; gap: 6px; }

button, .btn {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { filter: brightness(0.92); }
button.secondary, .btn.secondary {
  background: var(--surface); color: var(--ink); border: 1px solid var(--grid);
}
button.danger { background: #d03b3b; }

.flash { border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 0.95rem; }
.flash.ok { background: #e7f5e7; color: #006300; border: 1px solid #b7e0b7; }
.flash.err { background: #fdeaea; color: #a12020; border: 1px solid #f0bcbc; }

/* ---------- map ---------- */
.map-layout { display: flex; gap: 16px; align-items: stretch; }
#map { flex: 1; min-height: 560px; border-radius: 10px; border: 1px solid var(--border); }
.map-side {
  width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; font-size: 0.92rem;
}
.map-side h3 { margin: 0 0 8px; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }
.map-side label.cat { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.map-side .swatch { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.map-side .count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.map-side select { margin-top: 4px; }

/* ---------- hero banner ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 16px; margin: 4px 0 24px;
  padding: 40px 28px; color: #fff; text-align: center;
  background:
    radial-gradient(1200px 300px at 50% -40%, rgba(235,104,52,0.55), transparent 70%),
    linear-gradient(135deg, #2a1a12 0%, #3d2417 45%, #241a14 100%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(36,26,20,0.35);
}
.hero-smoke {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    radial-gradient(400px 160px at 18% 120%, rgba(235,104,52,0.35), transparent 70%),
    radial-gradient(360px 150px at 82% 130%, rgba(237,161,0,0.28), transparent 70%);
}
.hero-inner { position: relative; }
.hero-emoji { font-size: 2.2rem; letter-spacing: 6px; margin-bottom: 6px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.hero-title { font-size: 2.4rem; font-weight: 800; margin: 0; letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffd9a0, #ffb066, #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-tagline { margin: 8px auto 0; max-width: 560px; color: #e8ded6; font-size: 1rem; }
.dash-sub { margin: 0; font-size: 1.1rem; color: var(--ink-2); }

/* ---------- page head + judge filter ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.judge-filter { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.9rem; }
.judge-filter .jf-label { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.judge-filter select { border: none; background: transparent; font: inherit; font-weight: 600; color: var(--accent-dark, #b3541e); cursor: pointer; padding: 2px 4px; }
.judge-filter select:focus { outline: none; }

.tile-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; }
.muted-note { color: var(--muted); font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
/* "+2" beside a visit date: the other days the photos say he was there. */
.more-visits { font-size: 0.78em; color: #8a7a68; border: 1px solid #e2d6c4; border-radius: 999px;
  padding: 0 0.35em; cursor: help; }

.assoc-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; color: #fff; background: var(--c, #666); }

.site-footer { border-top: 1px solid var(--grid); color: var(--muted); font-size: 0.85rem; padding: 16px 0; }
/* Which build you're looking at — the difference between "not live yet"
   and "live and wrong". Quieter than the footer text around it. */
.site-footer .site-version { display: inline-block; margin-top: 4px; opacity: 0.75; font-size: 0.8rem; }
.footer-meta { font-size: 0.72rem; opacity: 0.75; margin-top: 4px; }

.actions { white-space: nowrap; }
.actions a { color: var(--ink-2); font-size: 0.85rem; }

@media (max-width: 760px) {
  .map-layout { flex-direction: column; }
  .map-side { width: auto; }
  .field-row { flex-direction: column; gap: 0; }
}

/* — certifications — */
.cert-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
.cert-expired { background: #e34948; color: #fff; }
.cert-soon    { background: #eda100; color: #2a2a2a; }

.cert-add { margin: 10px 0 26px; }
.cert-add summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}
.cert-add[open] summary { margin-bottom: 8px; }
