:root {
  --bg: #f4f2ec;
  --card: #ffffff;
  --ink: #17231f;
  --muted: #68756f;
  --line: #e3dfd5;
  --accent: #0e7a5f;
  --accent-ink: #ffffff;
  --soft: #e3f1ec;
  --warn: #b7791f;
  --bad: #b3413a;
  --radius: 16px;
  --deen: #0e7a5f; --work: #2f6fd0; --money: #b7791f; --health: #c9486a; --time: #6d55d6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1716;
    --card: #18221f;
    --ink: #eaf0ec;
    --muted: #93a39c;
    --line: #26332f;
    --accent: #3fc79f;
    --accent-ink: #06231b;
    --soft: #1c302a;
    --warn: #e0a94a;
    --bad: #e37a72;
    --deen: #3fc79f; --work: #6aa5f5; --money: #e0a94a; --health: #f07f9c; --time: #a493f5;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 84px);
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
}
h1 { font-size: 26px; margin: 8px 0 2px; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
p { margin: 0; }
.sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mid { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .card { margin: 0; }
.grid2 > * { min-width: 0; }
.mini { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; min-height: 32px; padding: 0 10px; font-size: 13px; cursor: pointer; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 0 16px; min-height: 46px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.quiet { background: var(--soft); color: var(--ink); }
.btn.bad { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.icon { background: none; border: 0; color: var(--muted); min-width: 44px; min-height: 44px; font-size: 20px; cursor: pointer; border-radius: 10px; }
.form { display: grid; gap: 8px; }
.form .row > * { flex: 1; }
.form .row > .fit { flex: 0 0 auto; width: auto; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { overflow-wrap: anywhere; }
.done .t { color: var(--muted); text-decoration: line-through; }
.check { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; border: 2px solid var(--line); background: none; cursor: pointer; color: var(--accent-ink); font-size: 16px; line-height: 1; padding: 0; }
.check.on { background: var(--accent); border-color: var(--accent); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.prayers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.prayer { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 2px; text-align: center; cursor: pointer; min-height: 76px; }
.prayer b { display: block; font-size: 13px; }
.prayer small { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prayer em { display: block; font-style: normal; font-size: 12px; margin-top: 4px; color: var(--muted); }
.prayer.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prayer.on small, .prayer.on em { color: var(--accent-ink); }
.prayer.late { border-color: var(--warn); }
.prayer.late em { color: var(--warn); }
.prayer.miss { border-color: var(--bad); }
.prayer.miss em { color: var(--bad); }
.prayer.next { box-shadow: 0 0 0 2px var(--accent); }

.week { display: grid; grid-template-columns: 44px repeat(5, 1fr); gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.dot { height: 18px; border-radius: 6px; background: var(--soft); }
.dot.on { background: var(--accent); }
.dot.late { background: var(--warn); }
.dot.miss { background: var(--bad); }
.dots { display: flex; gap: 4px; }
.dots .dot { width: 14px; height: 14px; border-radius: 50%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; min-height: 38px; cursor: pointer; font-weight: 600; color: var(--muted); padding: 0 12px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.msg { border-top: 1px solid var(--line); padding: 12px 0; }
.msg:first-child { border-top: 0; padding-top: 0; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--ink); }
.tag.warn { background: transparent; border: 1px solid var(--warn); color: var(--warn); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
}
.tabs button { flex: 1; max-width: 110px; background: none; border: 0; color: var(--muted); font-size: 11px; padding: 6px 0; cursor: pointer; border-radius: 12px; min-height: 52px; }
.tabs svg { width: 24px; height: 24px; display: block; margin: 0 auto 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--accent); font-weight: 600; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet .panel { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px); max-height: 92vh; overflow: auto; }
.steps { margin: 12px 0; padding-left: 20px; }
.steps li { padding: 4px 0; }
.center { text-align: center; }

.plus { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 28px; line-height: 1; cursor: pointer; }
.plus.sm { width: 36px; height: 36px; flex-basis: 36px; font-size: 22px; background: var(--soft); color: var(--ink); margin-top: -8px; }
.cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 96px; margin-top: 14px; }
.cols div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.cols i { display: block; width: 100%; min-height: 3px; background: var(--accent); border-radius: 6px; }
.cols span { font-size: 11px; color: var(--muted); }
.wheelwrap { position: relative; margin: 14px 0; }
.wheelwrap::before { content: ""; position: absolute; left: 0; right: 0; top: 44px; height: 44px; border-radius: 12px; background: var(--soft); pointer-events: none; }
.wheel { position: relative; height: 132px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.wheel::-webkit-scrollbar { display: none; }
.wheel .w, .wheel .pad { height: 44px; }
.wheel .w { scroll-snap-align: center; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 20; max-width: 90vw; text-align: center; }
.toast[hidden] { display: none; }

/* ---- structure: Today, Areas, +, Coach, Me */
.tabs { align-items: center; }
.tabs .fab { flex: 0 0 56px; width: 56px; height: 56px; max-width: none; min-height: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 32px; line-height: 1; padding: 0 0 3px; margin: -18px 6px 0; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.pip { display: inline-block; width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; }
.back { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px 8px 8px 0; min-height: 44px; cursor: pointer; }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 14px 0 4px; }
.strip button { background: none; border: 1px solid transparent; border-radius: 12px; padding: 6px 0; min-height: 52px; cursor: pointer; color: var(--muted); }
.strip span { display: block; font-size: 11px; }
.strip b { display: block; font-size: 16px; color: var(--ink); }
.strip button.on { background: var(--card); border-color: var(--line); }
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 2px; }
.ring { position: relative; background: none; border: 0; padding: 0; cursor: pointer; text-align: center; color: var(--ink); }
.ring svg { width: 100%; max-width: 68px; display: block; margin: 0 auto; }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring b { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; max-height: 68px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.ring span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.card.now { border-width: 2px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); min-height: 52px; }
.tl li:first-child { border-top: 0; }
.tl .tm { width: 46px; flex: 0 0 46px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl li.live .tm { color: var(--ink); font-weight: 700; }
.tl li.due .t { color: var(--warn); }
.tl li.done .t { color: var(--muted); text-decoration: line-through; }
.tl .nowline { min-height: 0; padding: 2px 0; border-top: 0; }
.tl .nowline span { width: 46px; flex: 0 0 46px; font-size: 12px; font-weight: 700; color: var(--bad); }
.tl .nowline i { flex: 1; height: 2px; background: var(--bad); border-radius: 2px; }
.state { min-width: 78px; min-height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer; }
.state.on { background: var(--deen); border-color: var(--deen); color: var(--accent-ink); font-weight: 600; }
.state.late { border-color: var(--warn); color: var(--warn); }
.state.miss { border-color: var(--bad); color: var(--bad); }
.area { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; cursor: pointer; color: var(--ink); }
.area .cols { height: 44px; margin-top: 8px; }
.area .cols span { display: none; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; min-height: 68px; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; color: var(--ink); }
.sheet h2 { margin-bottom: 8px; }
button:disabled { opacity: .45; cursor: default; }
