:root {
  --bg: #FFFFFF;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F4F7;
  --text: #0E1116;
  --text-dim: #5B6573;
  --text-faint: #9AA3AF;
  --border: rgba(14,17,22,0.07);
  --border-strong: rgba(14,17,22,0.14);
  --accent: #16A06A;
  --danger: #E5484D;
  --shadow: 0 1px 2px rgba(14,17,22,0.05), 0 10px 30px rgba(14,17,22,0.08);
}

[data-theme="dark"] {
  --bg: #0C0E11;
  --bg-elev: #121519;
  --surface: #191D23;
  --surface-2: #21262D;
  --text: #F1F4F8;
  --text-dim: #9AA4B0;
  --text-faint: #646E7A;
  --border: rgba(255,255,255,0.085);
  --border-strong: rgba(255,255,255,0.16);
  --shadow: 0 2px 8px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "Onest", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
  overflow-x: hidden;
}
button, textarea, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app { min-height: 100vh; padding: calc(env(safe-area-inset-top) + 14px) 16px 112px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }
.brand { flex: 1; font-size: 16px; font-weight: 800; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 13px; background: var(--surface-2); color: var(--text); display: grid; place-items: center; }
.screen { animation: in .24s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.head-main { flex: 1; min-width: 0; }
h1 { margin: 0; font-size: 34px; line-height: 0.98; font-weight: 800; letter-spacing: 0; }
.sub { margin-top: 8px; color: var(--text-dim); font-size: 13px; font-weight: 650; }
.section-title { margin: 22px 0 10px; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; }
.stack { display: grid; gap: 10px; }
.task { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 18px; padding: 13px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 2px rgba(14,17,22,.04); }
.task-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; line-height: 1.25; }
.task.done .task-title { color: var(--text-faint); text-decoration: line-through; }
.check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.task.done .check { background: var(--cat); border-color: var(--cat); }
.flame { color: #F2820C; font-size: 16px; flex: 0 0 auto; }
.cat-head { margin: 15px 0 8px; display: flex; align-items: center; gap: 9px; font-weight: 800; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat); }
.count { margin-left: auto; color: var(--text-dim); font-size: 12px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-card { border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; min-height: 132px; padding: 14px; border-radius: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; }
.cat-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--cat); }
.cat-name { font-weight: 800; font-size: 16px; }
.muted { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.progress { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; flex: 0 0 auto; }
.progress:after { content: ""; position: absolute; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); }
.progress span { position: relative; z-index: 1; font-size: 12px; font-weight: 800; }
.detail-title { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0; }
.detail-title .check { width: 32px; height: 32px; border-radius: 11px; margin-top: 1px; }
.detail-title h1 { flex: 1; font-size: 32px; line-height: 1.05; word-break: break-word; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: color-mix(in srgb, var(--cat) 13%, transparent); color: var(--cat); font-size: 13px; font-weight: 800; }
.btn { border: 0; border-radius: 15px; padding: 13px 15px; background: var(--surface-2); color: var(--text); font-weight: 800; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.btn.ai { width: 100%; margin: 12px 0; color: #fff; background: linear-gradient(135deg, var(--cat), #7C5CD6); box-shadow: 0 12px 28px color-mix(in srgb, var(--cat) 25%, transparent); }
.desc { padding: 15px; line-height: 1.45; color: var(--text-dim); font-size: 14px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px); background: var(--bg-elev); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 20; }
.nav button { border: 0; background: transparent; color: var(--text-faint); padding: 8px 2px; display: grid; gap: 4px; place-items: center; font-size: 10.5px; font-weight: 800; }
.nav button.active { color: var(--accent); }
.fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 82px); width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 42%, transparent); z-index: 25; }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: grid; align-items: end; }
.sheet { background: var(--bg-elev); border-radius: 26px 26px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 18px); max-height: 86vh; overflow: auto; animation: sheet .25s ease both; }
@keyframes sheet { from { transform: translateY(24px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.sheet h2 { margin: 3px 0 14px; font-size: 21px; }
textarea, input { width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 18px; padding: 13px; outline: none; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 9px 12px; font-weight: 800; }
.pick.active { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 13%, var(--surface)); color: var(--cat); }
.schedule-row { width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 20px; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.schedule-row.today { border: 2px solid var(--accent); }
.idea { padding: 14px; display: flex; align-items: center; gap: 12px; }
.boot { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--text-dim); font-weight: 800; }
.boot-mark { width: 48px; height: 48px; border-radius: 16px; background: var(--accent); box-shadow: var(--shadow); }
.empty { color: var(--text-dim); padding: 18px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 20px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; gap: 7px; }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--cat); border-radius: inherit; }
svg { display: block; }
