/* Shell styles. Tokens follow the approved wireframes (PMS/wireframes). Pages add their own rules below their section. */
:root {
  --bg: #f4f6f5; --surface: #ffffff; --ink: #18221e; --muted: #5e6b65; --line: #d4dbd7; --fill: #e7ebe9;
  --accent: #1d5c46; --accent-ink: #ffffff; --warn: #a24b00; --warn-soft: #fbeedd; --ok: #1d5c46;
  /* v47 look: soft fills for states, a quiet line, a light shadow under cards */
  --ok-soft: #e4f1ea; --err: #b42318; --err-soft: #fdecea; --info: #1d4e89; --info-soft: #e7eef8; --line-soft: #e2e8e4; --shadow: 0 1px 2px rgba(16, 32, 24, .05), 0 4px 12px rgba(16, 32, 24, .04);
  --font: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, sans-serif;
  --tabs-h: 64px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101614; --surface: #1b2521; --ink: #e4ebe7; --muted: #9aaaa2; --line: #2d3a35; --fill: #24302b;
    --accent: #6cc39e; --accent-ink: #0f1a16; --warn: #e8b45e; --warn-soft: #33291a; --ok: #6cc39e; color-scheme: dark;
    --ok-soft: #1d3a2e; --err: #f19a8f; --err-soft: #3a2220; --info: #9cc0ec; --info-soft: #1c2a3d; --line-soft: #26322d; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #101614; --surface: #1b2521; --ink: #e4ebe7; --muted: #9aaaa2; --line: #2d3a35; --fill: #24302b;
  --accent: #6cc39e; --accent-ink: #0f1a16; --warn: #e8b45e; --warn-soft: #33291a; --ok: #6cc39e; color-scheme: dark;
  --ok-soft: #1d3a2e; --err: #f19a8f; --err-soft: #3a2220; --info: #9cc0ec; --info-soft: #1c2a3d; --line-soft: #26322d; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 8px; }
.brand { font-weight: 700; font-size: 16px; }
.ver { font-weight: 500; font-size: 12px; color: var(--muted); }
.sync { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); text-align: right; }
.sync.warn { color: var(--warn); }
.sync button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; }

main { flex: 1; padding: 4px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); outline: none; }
h1 { font-size: 19px; margin: 8px 0 12px; }
h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.banner { background: var(--warn-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.empty { text-align: center; padding: 48px 12px; color: var(--muted); }
.gate { padding: 48px 4px; }
.gate h1 { font-size: 24px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; max-width: 112px; height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 12px; color: var(--muted); text-decoration: none; }
.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabs[hidden] { display: none; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 9;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
