:root {
  --bg: #fff8f0;
  --surface: #ffffff;
  --text: #2a1d14;
  --muted: #7a6656;
  --accent: #e8590c;
  --accent-soft: #ffe8d6;
  --border: #f0dfcf;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1410;
    --surface: #251d17;
    --text: #f7ece2;
    --muted: #b8a596;
    --accent: #ff8a3d;
    --accent-soft: #3a2618;
    --border: #3a2e25;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.top, main, .foot { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 24px; }
h1 { margin: 0; font-size: 1.8rem; color: var(--accent); }
.tagline { margin: 4px 0 16px; color: var(--muted); }

/* ---- greeting ---- */
.bubble {
  display: inline-block;
  margin: 0 0 14px;
  padding: 10px 18px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 18px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.2s both;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
}
.sample-note {
  margin: -6px 0 16px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}
.sample-note[hidden] { display: none; }
.now-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #2f9e44;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}
.soon-chip { background: var(--muted); }

.filters {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.when { display: flex; gap: 8px; flex-wrap: wrap; }
.when label {
  flex: 1 1 0;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.when input { position: absolute; opacity: 0; pointer-events: none; }
.when label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.when label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row[hidden] { display: none; }
.row label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.hint { font-weight: normal; }
select, input[type="time"], input[type="search"] {
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  width: 100%;
}
/* The native caret sits flush against the border; draw our own with room to breathe. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.status { color: var(--muted); margin: 16px 0 8px; }
.results { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 { margin: 0; font-size: 1.1rem; }
.area {
  flex-shrink: 0;
  font-size: 0.8rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
}
.meta { margin: 2px 0 8px; color: var(--muted); font-size: 0.9rem; }
.window { border-top: 1px solid var(--border); }
.window summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.menu { list-style: none; margin: 0 0 8px; padding: 0; }
.menu li { display: flex; justify-content: space-between; padding: 4px 0; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.foot { color: var(--muted); font-size: 0.8rem; padding-bottom: 24px; }

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* ---- admin ---- */
.home-link { color: inherit; text-decoration: none; }
.panel {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.panel[hidden], section[hidden] { display: none; }
.panel h2 { margin: 0; font-size: 1.15rem; }
.panel label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.panel input[type="email"], .panel input[type="password"], .panel input[type="file"] {
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.help { margin: 0; color: var(--muted); font-size: 0.9rem; }
.help a, .link { color: var(--accent); }
code { font-size: 0.85em; background: var(--accent-soft); border-radius: 4px; padding: 1px 4px; }
.modes { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.modes legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.panel .modes label { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); font-size: 1rem; }
.modes input { width: 20px; height: 20px; accent-color: var(--accent); }
button {
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 18px;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; text-decoration: underline; font-weight: normal; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-error { margin: 0; color: #c92a2a; min-height: 1.2em; }
.issues h3 { margin: 0 0 4px; font-size: 0.95rem; }
.issues ul { margin: 0; padding-left: 20px; font-size: 0.9rem; }
.issues.errors h3 { color: #c92a2a; }
.issues.warnings h3 { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
