:root {
  --bg: #0e0f13;
  --card: #17191f;
  --card2: #1e2129;
  --line: #2a2e38;
  --text: #f2f3f5;
  --muted: #9aa0ab;
  --accent: #ff8a5b;
  --accent-soft: rgba(255, 138, 91, .14);
  --good: #5fd39b;
  --warn: #ffcc66;
  --bad: #ff6b6b;
  --school: #7aa7ff;
  --work: #c792ea;
  --personal: #5fd39b;
  --money: #ffcc66;
  --military: #8fb3a0;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  min-height: 100dvh;
}
#app { padding: calc(var(--safe-t) + 18px) 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -.4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 2px 10px; font-weight: 600; }
.date { color: var(--muted); font-size: 14px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.headline { background: linear-gradient(135deg, #2a1c17, #17191f 70%); border: 1px solid #3a2a22; }
.headline p { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; }
.headline .meta { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--card2); color: var(--muted); }
.pill.high { color: var(--bad); background: rgba(255,107,107,.12); }
.pill.medium { color: var(--warn); background: rgba(255,204,102,.12); }
.pill.low { color: var(--muted); }
.pill.cat { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.School { background: var(--school); } .dot.Work { background: var(--work); }
.dot.Personal, .dot.Today { background: var(--personal); } .dot.Money { background: var(--money); }
.dot.Military { background: var(--military); } .dot.Business { background: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; padding-top: 1px; }
.timeline .now .t { color: var(--accent); }
.timeline .past { opacity: .45; }
.timeline .what { font-weight: 600; }
.timeline .where { color: var(--muted); font-size: 13px; margin-top: 2px; }
.timeline .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.timeline a { color: var(--accent); text-decoration: none; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .dot { margin-top: 7px; }
.list .grow { flex: 1; min-width: 0; }
.list .small { color: var(--muted); font-size: 13px; margin-top: 2px; }

.item { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.item .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 1px; background: none; padding: 0; }
.item .check.done { background: var(--good); border-color: var(--good); }
.item .title { font-weight: 600; }
.item .next { color: var(--muted); font-size: 14px; margin-top: 3px; }
.item .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.done .title { text-decoration: line-through; color: var(--muted); }

.day { margin-bottom: 10px; }
.day h3 { margin: 0 0 4px; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.day h3 small { color: var(--muted); font-weight: 600; font-size: 12px; }
.day.heavy h3 small { color: var(--warn); }
.day.today { outline: 1px solid #3a2a22; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 0; }

nav#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 8px 10px calc(8px + var(--safe-b)); background: rgba(14,15,19,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
nav#tabs[hidden] { display: none; }
.tab { background: none; border: 0; color: var(--muted); font: 600 13px/1 inherit; font-family: inherit; padding: 10px 14px; border-radius: 12px; }
.tab.on { color: var(--text); background: var(--card2); }
.tab.add { color: var(--bg); background: var(--accent); font-size: 20px; width: 46px; padding: 8px 0; }

button.primary, .btn { background: var(--accent); color: #1a0f0a; border: 0; border-radius: 14px; padding: 13px 16px; font: 700 16px/1 inherit; font-family: inherit; width: 100%; }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.small { width: auto; padding: 9px 12px; font-size: 14px; }
input, textarea, select {
  width: 100%; background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px; font: 16px/1.3 inherit; font-family: inherit; margin: 4px 0 12px;
}
textarea { min-height: 80px; resize: vertical; }
label { font-size: 13px; color: var(--muted); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.seg button { flex: 1; background: var(--card2); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 9px 6px; font: 600 14px/1 inherit; font-family: inherit; }
.seg button.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

#sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 10; }
#sheet[hidden] { display: none; }
#sheet .panel { background: var(--card); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 90dvh; overflow: auto; }
#sheet .panel h2 { margin-top: 4px; }
.actions { display: flex; gap: 10px; margin-top: 6px; }

.banner { background: var(--card2); border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b)); background: var(--card2); color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 20; }
.login { min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; }
.muted { color: var(--muted); }
.section-text { white-space: pre-wrap; }
