:root {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --surface-2: #efe7dc;
  --text: #2a241d;
  --muted: #7a6e60;
  --line: #e2d8ca;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --accent-soft: #fbe3d4;
  --good: #15803d;
  --warn: #a16207;
  --grab: #00a651;
  --gofood: #e2231a;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 4px 16px rgb(60 40 20 / 6%);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1916; --surface: #25221e; --surface-2: #302c26; --text: #f2ece4; --muted: #a89c8d;
    --line: #3a352e; --accent: #fb8a4c; --accent-text: #1b1916; --accent-soft: #4a2c1b;
    --good: #4ade80; --warn: #facc15; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1916; --surface: #25221e; --surface-2: #302c26; --text: #f2ece4; --muted: #a89c8d;
  --line: #3a352e; --accent: #fb8a4c; --accent-text: #1b1916; --accent-soft: #4a2c1b;
  --good: #4ade80; --warn: #facc15; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
main { max-width: 560px; margin: 0 auto; padding-block: 20px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 28px 0 10px; }
h3 { font-size: 19px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }

.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.segmented button { flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding-inline: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 15px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.chip.ghost { border-style: dashed; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card .top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card .note { margin-top: 4px; font-size: 15px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 13px; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.open { color: var(--good); font-weight: 600; }
.unknown { color: var(--warn); font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.grab { color: var(--grab); }
.btn.gofood { color: var(--gofood); }
.btn.wide { width: 100%; }
.btn.flex { flex: 1; }
.btn:disabled { opacity: 0.5; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.banner { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.banner .actions { margin-top: 10px; }

.fallback { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 4px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .actions { justify-content: center; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; }
.row:first-child { border-top: 0; }
.row .name { font-weight: 600; }
.verdicts { display: flex; gap: 4px; }
.verdicts button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 40px; min-height: 40px; }
.verdicts button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }

input[type=text], input[type=url], input[type=password], input[type=search], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 12px; min-height: 44px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; margin: 12px 0; }
.check input { width: 20px; height: 20px; }

.tabs { position: fixed; inset: auto 0 0 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; border: 0; background: none; padding: 14px 4px; font-weight: 600; color: var(--muted); min-height: 56px; }
.tabs button[aria-current="page"] { color: var(--accent); }

.sheet { position: fixed; inset: 0; background: rgb(0 0 0 / 40%); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet .panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; background: var(--text); color: var(--bg); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; gap: 12px; z-index: 20; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; }

.login { max-width: 360px; margin: 18vh auto 0; text-align: center; }
.login form { margin-top: 20px; display: grid; gap: 10px; }
