:root {
  --bg: #f4f6f9; --card: #fff; --ink: #1d2733; --muted: #5d6b7a; --line: #dde3ea;
  --navy: #0B2945; --accent: #239CD7; --good: #3EB04A; --field: #f7f9fb;
  --tabs-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c1622; --card: #14212f; --ink: #e8eef4; --muted: #93a3b4; --line: #26384b;
          --navy: #9fd3f0; --field: #0f1b28; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 10px; background: #0B2945; color: #fff; }
.top .title { flex: 1; text-align: center; }
.top h1 { margin: 0; font-size: 20px; }
.top .sub { font-size: 13px; opacity: .8; }
.nav { width: 44px; height: 44px; border: 0; background: transparent; font-size: 30px; line-height: 1; color: inherit; border-radius: 10px; }
.nav:disabled { opacity: .25; }
.top .nav { color: #fff; }

main { max-width: 640px; margin: 0 auto; padding: 12px 14px 24px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 22px 4px 8px; }

.promise { background: var(--card); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-bottom: 10px; }
.promise b { color: var(--navy); }

.progress { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 2px 4px 4px; }
.progress .bar { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--good); transition: width .2s; }

.group { background: var(--card); border-radius: 14px; overflow: hidden; }
.item { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 12px 14px; border-top: 1px solid var(--line); min-height: 56px; }
.item:first-child { border-top: 0; }
.box { flex: none; width: 28px; height: 28px; border: 2px solid var(--muted); border-radius: 8px; margin-top: 1px;
  display: grid; place-items: center; font-size: 18px; color: transparent; transition: background .15s, border-color .15s; }
.item.on .box { background: var(--good); border-color: var(--good); color: #fff; }
.item .lbl { font-weight: 600; }
.item .note { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }

.q { display: block; background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.q > span { display: block; font-weight: 600; margin-bottom: 6px; }
textarea, input[type=text] { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
textarea { min-height: 64px; resize: vertical; }
.pair { display: flex; align-items: center; gap: 8px; }
.pair .with { color: var(--muted); font-size: 15px; }
.saved { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; transition: opacity .3s; }
blockquote { margin: 22px 8px 4px; font-style: italic; color: var(--muted); font-size: 14px; }
blockquote cite { display: block; font-style: normal; margin-top: 4px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { margin: 0; font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--muted); }
.cal button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 15px; padding: 0; }
.cal button.l1 { background: rgba(62,176,74,.25); } .cal button.l2 { background: rgba(62,176,74,.5); }
.cal button.l3 { background: rgba(62,176,74,.8); color: #fff; }
.cal button.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal button:disabled { opacity: .35; }
.hint { font-size: 14px; color: var(--muted); }
.recent { background: var(--card); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; border: 0; width: 100%; text-align: left; }
.recent .d { font-weight: 600; } .recent .t { font-size: 14px; color: var(--muted); }

.seg { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; font-size: 15px; }
.seg button.on { background: #0B2945; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--card); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--navy); }
.stat span { font-size: 12px; color: var(--muted); }
.trow { background: var(--card); padding: 9px 14px; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.trow .top2 { display: flex; justify-content: space-between; font-size: 15px; }
.trow .top2 span { color: var(--muted); font-variant-numeric: tabular-nums; }
.trow .tb { height: 6px; background: var(--line); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.trow .tb span { display: block; height: 100%; background: var(--accent); }

.big { display: block; width: 100%; text-align: center; padding: 14px; border: 0; border-radius: 12px; background: #0B2945; color: #fff; font-weight: 600; }
.file { position: relative; overflow: hidden; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.file input { position: absolute; inset: 0; opacity: 0; }
.steps { padding-left: 22px; } .steps li { margin-bottom: 6px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; height: var(--tabs-h); border: 0; background: transparent; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tabs button span { font-size: 20px; }
.tabs button.on { color: var(--accent); font-weight: 600; }
