/* FamilyFoodClub: fresh market green and tangerine, phone-first. Light and dark follow the phone's setting. */

:root {
  --bg: #f5f8f6;
  --surface: #ffffff;
  --surface-2: #edf3ef;
  --surface-3: #e1eae4;
  --text: #17201b;
  --muted: #5b6a61;
  --border: #dbe5de;
  --primary: #1b7f53;
  --primary-press: #156643;
  --primary-ink: #ffffff;
  --primary-soft: #dcefe4;
  --accent: #f07a2c;
  --accent-soft: #ffeadb;
  --ok: #1b7f53;
  --ok-soft: #dcefe4;
  --warn: #9a5b00;
  --warn-soft: #fdebc8;
  --danger: #b3261e;
  --danger-soft: #fbe0dd;
  --info-soft: #e4ecf7;
  --info: #2f5b94;
  --shadow: 0 1px 2px rgba(15, 35, 25, 0.06), 0 4px 16px rgba(15, 35, 25, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 48px;
  --tabs-h: 64px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang HK", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1311;
    --surface: #181d1a;
    --surface-2: #1f2622;
    --surface-3: #29312c;
    --text: #edf2ee;
    --muted: #a2afa7;
    --border: #2c3530;
    --primary: #4cc38a;
    --primary-press: #72d3a4;
    --primary-ink: #06200f;
    --primary-soft: #173a28;
    --accent: #ff9a52;
    --accent-soft: #45290f;
    --ok: #5fcf95;
    --ok-soft: #173a28;
    --warn: #f3bb5c;
    --warn-soft: #463413;
    --danger: #ff8f84;
    --danger-soft: #4a1d1a;
    --info-soft: #1f2d42;
    --info: #9fc0ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.has-sheet { overflow: hidden; }

a { color: var(--primary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
.lead { font-size: 18px; }
.pre { white-space: pre-wrap; }

/* ---------- layout ---------- */

.view {
  max-width: 640px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    calc(env(safe-area-inset-right, 0px) + var(--gutter))
    calc(env(safe-area-inset-bottom, 0px) + var(--tabs-h) + 28px)
    calc(env(safe-area-inset-left, 0px) + var(--gutter));
}

body.no-tabs .view { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px); }

.screen { display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.live { display: contents; }

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.noscript { padding: 24px; text-align: center; }

/* ---------- tab bar ---------- */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 4px calc(env(safe-area-inset-right, 0px) + 4px) calc(env(safe-area-inset-bottom, 0px) + 4px) calc(env(safe-area-inset-left, 0px) + 4px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
}
body.no-tabs .tabs { display: none; }

.tab {
  flex: 1 1 0;
  max-width: 128px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tab .icon { width: 25px; height: 25px; }
.tab.on { color: var(--primary); }
.tab.on .icon { stroke-width: 2.4; }
.tab:active { background: var(--surface-2); }
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- headers and sections ---------- */

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 6px;
}
.page-head-text { flex: 1; min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
/* Chinese dates such as 12月15日星期二 have no spaces to wrap at, so a smaller size keeps
   them on one line beside the back button and the status badge on a phone. */
:lang(zh) .page-head h1 { font-size: 23px; letter-spacing: 0; }
.page-sub { color: var(--muted); margin-top: 4px; font-size: 16px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex: none; padding-top: 2px; }

.back-btn {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  margin-left: -10px;
  display: grid;
  place-items: center;
  color: var(--text);
  border-radius: 50%;
}
.back-btn:active { background: var(--surface-2); }
.back-btn .icon { width: 26px; height: 26px; }

.section { display: flex; flex-direction: column; gap: 10px; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 8px 2px 0;
}
:lang(zh-Hant-HK) .section-title { text-transform: none; letter-spacing: 0.02em; font-size: 16px; }

.sub-title { font-size: 17px; font-weight: 700; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ---------- badges, chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  flex: none;
}
.badge-open { background: var(--info-soft); color: var(--info); }
.badge-closed { background: var(--surface-3); color: var(--muted); }
.badge-drawn { background: var(--accent-soft); color: var(--warn); }
.badge-booked, .badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-past { background: var(--surface-2); color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 600;
}
.chip-match { background: var(--primary-soft); color: var(--primary-press); }
@media (prefers-color-scheme: dark) { .chip-match { color: var(--primary); } }
.chip-retired { text-decoration: line-through; opacity: 0.7; }
.chip-rank {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 800;
}

.chip-btn {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.chip-btn .icon { width: 18px; height: 18px; }
.chip-btn:active { transform: scale(0.97); }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip-btn.on .chip-rank { background: var(--primary-ink); color: var(--primary); }
.chip-btn.suggested:not(.on) { border-style: dashed; border-color: var(--primary); }

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  font-size: 17px;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease, background-color 0.15s ease;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:active { background: var(--primary-press); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:active { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:active { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:active { background: var(--danger-soft); }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid currentColor;
  border-color: var(--muted) transparent var(--muted) transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-primary.is-busy::after { border-color: var(--primary-ink) transparent var(--primary-ink) transparent; }

.btn-choice {
  width: 100%;
  min-height: 64px;
  font-size: 20px;
  background: var(--surface-2);
  color: var(--text);
  border: 2px solid transparent;
}
.btn-choice.on { border-color: var(--primary); background: var(--primary-soft); }

.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1 1 auto; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row.wrap > .btn { flex: 1 1 auto; min-width: 100px; }

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.icon-btn:active { background: var(--surface-3); }
.icon-btn:disabled { opacity: 0.25; }

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--primary);
  font-weight: 600;
  min-height: 44px;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  align-self: flex-start;
  text-align: left;
}

.more-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--tap);
  font-weight: 650;
  text-decoration: none;
  border-top: 1px solid var(--border);
  margin: 4px -16px -16px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.more-link:active { background: var(--surface-2); }
.more-link .icon { width: 18px; height: 18px; }

/* ---------- segmented, switch ---------- */

.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: var(--surface-2);
}
.seg {
  flex: 1 1 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  min-height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.seg .icon { width: 20px; height: 20px; opacity: 0.6; }
.seg.on { background: var(--surface); box-shadow: var(--shadow); }
.seg.on .icon { opacity: 1; }
.seg.on.seg-yes { background: var(--accent); color: #2b1300; }
.seg.on.seg-no { background: var(--surface-3); color: var(--text); }
.seg-small .seg { min-height: 44px; font-size: 15px; }
.lang-seg { max-width: 320px; }
.lang-seg .seg { white-space: nowrap; padding: 6px 14px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--tap);
  cursor: pointer;
  position: relative;
}
.switch-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.switch-label { font-weight: 650; }
.switch-sub { color: var(--muted); font-size: 15px; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  flex: none;
  width: 56px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  transition: background-color 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.switch-input:checked + .switch-track { background: var(--ok); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(22px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch-input:disabled + .switch-track { opacity: 0.5; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 650; font-size: 16px; }
.field-hint { color: var(--muted); font-size: 15px; }
.field-hint.ok { color: var(--ok); }
.form-error { color: var(--danger); font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }

.input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { min-height: 80px; resize: vertical; line-height: 1.4; }
.select {
  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, 6px 6px;
  background-repeat: no-repeat;
}
.input[type="date"], .input[type="time"] { min-width: 0; }
.input[readonly] { background: var(--surface-2); font-size: 15px; }
.card .input { background: var(--surface); }

.inline-field { display: flex; gap: 8px; align-items: stretch; }
.inline-field .input { flex: 1; min-width: 0; }
.inline-field .btn { flex: none; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  appearance: none; border: 0; background: none;
  color: var(--primary);
  font: inherit; font-weight: 650; font-size: 15px;
  min-height: 44px; min-width: 72px;
  cursor: pointer;
}

.bday-row { display: grid; grid-template-columns: minmax(6.5em, 1fr) 2fr; gap: 8px; }
.bday-row > :nth-child(3) { grid-column: 1 / -1; }

.search-box { position: relative; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 46px; }

.check-row { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check-input {
  flex: none;
  width: 28px; height: 28px;
  margin: 2px 0 0;
  accent-color: var(--ok);
}
.check-text { display: flex; flex-direction: column; gap: 3px; }
.check-label { font-weight: 700; }
.check-sub { font-size: 15px; color: var(--muted); }
.hint-list { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.hint { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.hint .icon { width: 17px; height: 17px; }
.hint-yes { color: var(--ok); }
.hint-no { color: var(--muted); }

/* ---------- sheets, toast ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 18, 12, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.overlay.show { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 640px;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.2s ease;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
}
.overlay.show .sheet { transform: none; }
.sheet-tall { height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px); }
.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 6px 20px;
}
.sheet-title { flex: 1; font-size: 20px; font-weight: 750; overflow-wrap: anywhere; }
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#toast {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabs-h) + 14px);
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
body.no-tabs #toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); }
#toast.show { opacity: 1; transform: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  max-width: 520px;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.toast-error { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .toast-error { color: #2a0b08; } }

/* ---------- loading, empty ---------- */

.loading { display: grid; place-items: center; min-height: 40vh; }
.spinner {
  width: 34px; height: 34px;
  border: 3.5px solid var(--surface-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}
.empty-icon { width: 40px; height: 40px; color: var(--primary); opacity: 0.7; }

/* ---------- lists ---------- */

.list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list > .empty { background: var(--surface); }
.list-row {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  min-height: 64px;
  text-decoration: none;
  cursor: pointer;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row:active { background: var(--surface-2); }
.list-row.is-retired, .list-row.is-past { opacity: 0.72; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.row-chev { color: var(--muted); width: 20px; height: 20px; }

.open-days { display: inline-flex; gap: 3px; }
.od {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.od-on { background: var(--ok-soft); color: var(--ok); }
.od-off { background: var(--surface-2); color: var(--muted); opacity: 0.6; text-decoration: line-through; }

.date-block {
  flex: none;
  width: 56px;
  padding: 6px 0;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-press);
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.1;
}
@media (prefers-color-scheme: dark) { .date-block { color: var(--primary); } }
.is-past .date-block { background: var(--surface-2); color: var(--muted); }
.db-wd { font-size: 13px; font-weight: 700; }
.db-day { font-size: 24px; font-weight: 800; }
.db-mon { font-size: 13px; font-weight: 600; }
.bday-tag { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; color: var(--text); }

.filters { display: flex; flex-direction: column; gap: 10px; }
.count-line { margin: -4px 4px 0; }

/* ---------- this week ---------- */

.hero {
  background: linear-gradient(150deg, #1b7f53 0%, #1f8c5c 65%, #2f9a66 130%);
  color: #fff;
  gap: 10px;
  padding: 20px;
}
@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(150deg, #145e3e 0%, #18704a 65%, #1f7d53 130%); }
}
.hero a:not(.btn) { color: #fff; }
.hero-kicker { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.92; }
:lang(zh-Hant-HK) .hero-kicker { text-transform: none; letter-spacing: 0.02em; }
.hero-name { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.hero-when { font-size: 19px; display: flex; flex-wrap: wrap; gap: 6px; }
.hero-when .dot { opacity: 0.7; }
.hero-for { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hero .btn-secondary { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hero .btn-secondary:active { background: rgba(255, 255, 255, 0.32); }
.hero .note { background: rgba(255, 255, 255, 0.15); color: #fff; }
.hero .birthday { background: rgba(255, 255, 255, 0.18); color: #fff; }
.hero-answer .seg { font-size: 16px; padding: 6px; gap: 6px; white-space: nowrap; }
.hero-answer { background: rgba(255, 255, 255, 0.95); color: var(--text); border-radius: 16px; padding: 12px; margin-top: 4px; }
@media (prefers-color-scheme: dark) { .hero-answer .seg { font-size: 16px; padding: 6px; gap: 6px; white-space: nowrap; }
.hero-answer { background: var(--surface); } }
.hero .more-link { border-top-color: rgba(255, 255, 255, 0.25); margin: 4px -20px -20px; }
.hero .more-link:active { background: rgba(255, 255, 255, 0.12); }
.hero-empty { background: var(--surface); color: var(--text); }
.hero-empty .hero-kicker { color: var(--muted); }

.dinner-card { gap: 14px; }
.dinner-card.is-birthday { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.dc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dc-date { font-size: 21px; font-weight: 750; }

.birthday {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-weight: 650;
}
.cake { font-size: 24px; line-height: 1; }

.deadline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.deadline .icon { width: 19px; height: 19px; color: var(--primary); }
.deadline.muted .icon { color: var(--muted); }
.deadline.muted { font-weight: 500; }

.booked-line, .picks-short { display: flex; gap: 8px; align-items: center; font-weight: 650; }
.booked-line .icon { color: var(--ok); }
.picks-short .icon { color: var(--warn); }

/* answer */
.answer { display: flex; flex-direction: column; gap: 10px; }
.answer-q { font-weight: 700; font-size: 18px; }
.answer-seg .seg { font-size: 17px; }
.wishes { display: flex; flex-direction: column; gap: 8px; }
.wishes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wishes-edit { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

.ranked { display: flex; flex-wrap: wrap; gap: 8px; }
.ranked-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 650;
  font-size: 16px;
}
.ranked-n {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 800;
}
.ranked-item.is-matched { background: var(--primary-soft); }

/* picker */
.picker { display: flex; flex-direction: column; gap: 12px; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 4px 4px 4px 10px;
  border-radius: 14px;
  background: var(--surface-2);
}
.slot.slot-empty { background: transparent; border: 2px dashed var(--border); }
.slot.slot-empty.optional { opacity: 0.75; }
.slot-rank {
  flex: none;
  min-width: 46px;
  padding: 3px 8px;
  text-align: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 14px;
  font-weight: 800;
}
.slot.slot-empty .slot-rank { background: var(--surface-3); color: var(--muted); }
.slot-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.slot.slot-empty .slot-name { color: var(--muted); font-weight: 500; font-size: 15px; }
.slot-tools { display: flex; flex: none; }
.picker-hint { font-weight: 600; color: var(--primary); }
.tag-groups { display: flex; flex-direction: column; gap: 14px; }
.tag-group { display: flex; flex-direction: column; gap: 8px; }
.tag-group-title { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
:lang(zh-Hant-HK) .tag-group-title { text-transform: none; font-size: 15px; }

.sticky-save {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabs-h) + 8px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin: 0 -10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.sheet .sticky-save { bottom: 0; }
body.no-tabs .sticky-save { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
.screen > .sticky-save { margin: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); }

.grandpa { padding-top: 4px; border-top: 1px solid var(--border); }

/* people */
.people-summary { display: flex; flex-direction: column; gap: 6px; }
.counts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
}
.count-pill .icon { width: 18px; height: 18px; }
.who { font-size: 16px; }
.who-label { font-weight: 700; margin-right: 6px; }
.who-yes .who-label { color: var(--ok); }
.who-no .who-label { color: var(--muted); }
.who-wait .who-label { color: var(--warn); }

.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.person + .person { border-top: 1px solid var(--border); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.person-name { font-weight: 700; }
.person-status { font-size: 15px; font-weight: 600; }
.avatar {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  font-weight: 800;
  color: var(--muted);
}
.st-yes { color: var(--ok); }
.avatar.st-yes { background: var(--ok-soft); }
.st-no { color: var(--muted); }
.st-wait { color: var(--warn); }
.avatar.st-wait { background: var(--warn-soft); }
.ranked-compact { font-size: 15px; color: var(--muted); }
.ranked-compact b { color: var(--primary); margin-right: 3px; }

/* picks */
.picks { display: flex; flex-direction: column; gap: 12px; }
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-2);
}
.pick.is-booked { box-shadow: inset 0 0 0 2px var(--ok); }
.pick > .badge, .pick > .chips { align-self: flex-start; }
.pick-rank { font-size: 14px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
:lang(zh-Hant-HK) .pick-rank { text-transform: none; }
.pick-name { font-size: 20px; font-weight: 750; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.pick-admin { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.tel-line { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 650; text-decoration: none; }
.tel-line.big { font-size: 20px; }
.warn-line { display: flex; align-items: flex-start; gap: 8px; color: var(--warn); font-weight: 600; }
.note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--info-soft);
  color: var(--text);
  white-space: pre-wrap;
}
.note .icon { color: var(--info); width: 20px; height: 20px; margin-top: 1px; }
.draw-notes { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--warn-soft); }
.draw-notes li { padding-left: 16px; position: relative; }
.draw-notes li::before { content: "•"; position: absolute; left: 2px; }

.ring-panel { display: flex; flex-direction: column; gap: 8px; }
.ring-line { display: flex; align-items: flex-start; gap: 10px; font-size: 18px; }
.ring-line.allergy { padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 650; font-size: 17px; }
.ring-line .icon { margin-top: 1px; }

.booking { display: flex; flex-direction: column; gap: 8px; }
.booking-kicker { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 750; }
.booking-name { font-size: 26px; font-weight: 800; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.booking-when { font-size: 18px; font-weight: 650; }
.booking-for { color: var(--muted); }
.booking-card { box-shadow: var(--shadow), inset 0 0 0 2px var(--ok); }
.admin-box { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.book-info { display: flex; flex-direction: column; gap: 6px; }
.admin-tools { gap: 10px; }

/* restaurants */
.rule { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.rule-label { flex: 1; font-weight: 650; }
.rule-val { font-weight: 700; }
.rule-yes { color: var(--ok); }
.rule-yes .rule-label { color: var(--text); }
.rule-no { color: var(--danger); }
.rule-no .rule-label { color: var(--text); }
.rule-unk { color: var(--warn); }
.rule-unk .rule-label { color: var(--text); }
.hints { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.hints li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.hints .icon { width: 17px; height: 17px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.rating .icon { width: 18px; height: 18px; color: var(--accent); fill: var(--accent); }
.hours summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--primary); }
.hours ul { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.hours li { display: flex; gap: 10px; }
.hours-day { min-width: 92px; font-weight: 650; }
.warn-card { background: var(--warn-soft); color: var(--text); box-shadow: none; }
.warn-card ul { padding-left: 4px; display: flex; flex-direction: column; gap: 4px; }
.warn-card li::before { content: "• "; color: var(--warn); font-weight: 800; }
.info-card { background: var(--info-soft); box-shadow: none; }
.steps-list { counter-reset: s; display: flex; flex-direction: column; gap: 8px; }
.steps-list li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; }
.steps-list li::before {
  content: counter(s);
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

/* ---------- login, welcome ---------- */

.auth { padding-top: 8px; max-width: 460px; margin: 0 auto; width: 100%; }
.auth-lang { display: flex; justify-content: flex-end; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 4px; text-align: center; }
.brand-logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: var(--shadow); }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.brand-tag { color: var(--muted); }
.auth-card { padding: 20px; gap: 14px; }
.auth-title { font-size: 24px; font-weight: 750; }

.dots { display: flex; justify-content: center; gap: 8px; padding: 12px 0 4px; }
.dotp { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.dotp.done { background: var(--primary-soft); }
.dotp.on { background: var(--primary); width: 26px; border-radius: 999px; }
.welcome-card { min-height: 52vh; }
.welcome-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.welcome-actions .btn { flex: 1 1 auto; }
.welcome-actions .btn-primary { flex: 2 1 auto; }
.bullets { display: flex; flex-direction: column; gap: 8px; }
.bullets li { padding-left: 22px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.guide { display: flex; flex-direction: column; gap: 12px; }
.guide li { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.guide-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

/* ---------- admin ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 86px;
  padding: 10px 6px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}
.tile .icon { color: var(--primary); width: 28px; height: 28px; }
.tile:active { background: var(--surface-2); }
.req { gap: 8px; }
.req-text { font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
.req .btn-row { flex-wrap: wrap; }
.wanted-list { display: flex; flex-direction: column; }
.wanted { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.wanted + .wanted { border-top: 1px solid var(--border); }
.wanted-tag { font-weight: 750; }

.version { margin-top: 8px; }

@media (min-width: 700px) {
  .view { padding-top: calc(env(safe-area-inset-top, 0px) + 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
