:root {
  --bg: #f6f1ea;
  --card: #fffdf9;
  --ink: #2b2420;
  --muted: #7a6d63;
  --line: #e6dccf;
  --accent: #b5563a;
  --accent-soft: #f3e1d8;
  --done: #3f7d58;
  --done-soft: #e3f0e7;
  --danger: #a33a2f;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 'Heebo', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.shell { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; }
.brand h1 { font-size: 21px; margin: 0; line-height: 1.1; }
.version { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline dotted; }
.who { text-align: left; font-size: 13px; color: var(--muted); }
.who button { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tabs button.on { background: var(--accent); color: #fff; }

/* cards and lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
h2 { font-size: 18px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 500; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.grey { background: #eee7de; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--accent); padding: 6px 8px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.wide { width: 100%; padding: 12px; }

/* progress */
.progress { height: 8px; background: #eee7de; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress > i { display: block; height: 100%; background: var(--done); border-radius: 99px; transition: width .25s ease; }

/* round checklist */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check.done { background: var(--done-soft); }
.tick { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; margin-top: 2px; }
.tick svg { width: 18px; height: 18px; opacity: 0; }
.check.done .tick { background: var(--done); border-color: var(--done); }
.check.done .tick svg { opacity: 1; }
.check .body { flex: 1; min-width: 0; }
.check .name { font-weight: 500; overflow-wrap: anywhere; }
.check .meta { font-size: 13px; color: var(--done); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* group card details */
.kv { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.pw { font-family: ui-monospace, Consolas, monospace; background: #f1ebe3; padding: 2px 8px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }

/* forms */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; }
.field textarea { min-height: 70px; resize: vertical; }
input[dir="ltr"] { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.search { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; margin-bottom: 10px; font-size: 16px; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(43, 36, 32, .35); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .scrim { align-items: center; } .sheet { border-radius: 18px; } }

.notice { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.error { color: var(--danger); font-size: 14px; }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 20; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login .card { padding: 24px 18px; }
.gsi { display: flex; justify-content: center; margin: 18px 0 6px; min-height: 44px; }
details > summary { cursor: pointer; color: var(--muted); margin: 18px 0 8px; }
