/* JT — design tokens, light + dark. Accent is injected by JS (--accent). */
:root {
  --bg: #F7F5F1; --bg2: #EFECE6; --card: #FFFFFF; --text: #14201C; --text2: #56605B; --line: #E4E0D8;
  --accent: #0B7D62; --on-accent: #fff; --danger: #D43D3D; --ok: #10B981;
  --shadow: 0 1px 2px rgba(20,32,28,.05), 0 6px 18px rgba(20,32,28,.06);
  --shadow-lg: 0 10px 40px rgba(20,32,28,.18);
  --r: 20px; --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-mode="dark"] {
  --bg: #0D1210; --bg2: #151B18; --card: #1A211E; --text: #F1F4F2; --text2: #98A29D; --line: #28312D;
  --danger: #FF6B6B; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; }
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--text2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }

/* ---------- shell ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: calc(var(--sat) + 18px) 18px calc(var(--nav-h) + var(--sab) + 28px); -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.view-in { animation: viewin .32s cubic-bezier(.2,.8,.2,1); }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 0 12px calc(var(--sab) + 8px); pointer-events: none; }
#nav .bar { pointer-events: auto; width: 100%; max-width: 480px; height: var(--nav-h); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 6px; }
#nav button[aria-current="page"] .ic { color: var(--accent); }
#nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 20px; color: var(--text2); font-size: 11px; font-weight: 600; transition: color .2s, background .2s; }
#nav button[aria-current="page"] { color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- headings ---------- */
.page-title { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text2); letter-spacing: .01em; }
.section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin: 26px 4px 10px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 52px; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item .grow { min-width: 0; } .item .t { font-weight: 600; } .item .s { font-size: 13px; color: var(--text2); }
.item .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
button.item:active { background: var(--bg2); }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 16px; font-weight: 700; transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--bg2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.text { color: var(--accent); height: 36px; padding: 0 8px; }
.btn.sm { height: 36px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--bg2); color: var(--text); transition: transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.accent { background: var(--accent); color: var(--on-accent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 700; color: var(--text2); padding-left: 2px; }
.input, textarea.input, select.input { width: 100%; background: var(--bg2); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; min-height: 48px; outline: none; transition: border-color .15s, background .15s; appearance: none; -webkit-appearance: none; }
.input:focus { border-color: var(--accent); background: var(--card); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.45; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.seg { display: flex; background: var(--bg2); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 38px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--text2); transition: all .18s; padding: 0 8px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.3,.9,.3,1); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip { text-align: left; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--bg2); color: var(--text2); }

/* ---------- today ---------- */
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.today-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin-top: 2px; }
.progress-card { margin-top: 18px; display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.progress-ring { position: relative; width: 76px; height: 76px; flex: none; }
.progress-ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.progress-card .txt h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(max(var(--cols, 2), 3), 1fr); } }
.tile { --c: #10B981; --ink: #fff; position: relative; display: flex; flex-direction: column; justify-content: space-between; text-align: left; min-height: 142px; padding: 0; border-radius: 24px; background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); overflow: hidden; transition: transform .18s cubic-bezier(.3,.9,.3,1), background .35s, box-shadow .35s; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tile:active { transform: scale(.965); }
.tile-main { display: flex; flex-direction: column; justify-content: space-between; width: 100%; flex: 1; padding: 14px; text-align: left; border-radius: inherit; color: inherit; }
.tile.add { padding: 14px; }
.tile .glyph { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); transition: background .35s, color .35s; }
.tile .tname { font-weight: 700; font-size: 16px; letter-spacing: -.01em; line-height: 1.2; margin-top: 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .tsub { font-size: 12.5px; color: var(--text2); margin-top: 2px; font-weight: 500; transition: color .3s; }
.tile .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--text2); font-variant-numeric: tabular-nums; }
.streak .ic { color: #F59E0B; }
.tile .check { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: all .25s cubic-bezier(.3,1.4,.5,1); }
.tile .info { position: absolute; bottom: 10px; right: 10px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--text2); opacity: .75; }
.tile .pbar { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--c); border-radius: 0 4px 0 0; transition: width .4s; opacity: .85; }
.tile.done { background: var(--c); color: var(--ink); border-color: transparent; box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 40%, transparent); }
.tile.done .glyph { background: color-mix(in srgb, var(--ink) 20%, transparent); color: var(--ink); }
.tile.done .tsub, .tile.done .streak, .tile.done .info { color: var(--ink); }
.tile.done .streak .ic { color: var(--ink); }
.tile.done .check { background: var(--ink); border-color: var(--ink); color: var(--c); }
.tile.done .pbar { background: var(--ink); }
.tile.slip { border-color: var(--danger); } .tile.slip .check { background: var(--danger); border-color: var(--danger); color: #fff; }
.tile.rest, .tile.off { opacity: .62; box-shadow: none; }
.tile.add { align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--text2); font-weight: 700; }
.tile.just { animation: pop .55s cubic-bezier(.3,1.5,.5,1); }
.tile.just .check svg { animation: draw .4s .1s both; }
@keyframes pop { 0% { transform: scale(.94); } 45% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes draw { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tile.done .check .ic svg { stroke-width: 3.2; }
.mini-tag { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); }
.empty { text-align: center; padding: 40px 24px; }
.empty .art { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 30px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.empty h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; } .empty p { margin-bottom: 18px; max-width: 320px; margin-inline: auto; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); margin-top: 14px; }
.banner.warn { background: color-mix(in srgb, #F59E0B 14%, var(--card)); border-color: color-mix(in srgb, #F59E0B 35%, transparent); }
.banner .ic { color: var(--accent); } .banner.warn .ic { color: #D97706; }
.search { position: relative; margin-top: 14px; } .search .input { padding-left: 42px; } .search .ic { position: absolute; left: 13px; top: 13px; color: var(--text2); }

/* ---------- sheets ---------- */
#sheets, #toasts, #fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#fx { z-index: 80; } #toasts { z-index: 70; inset: auto 0 0 0; }
.sheet-wrap { position: fixed; inset: 0; pointer-events: auto; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(8,14,12,.45); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.9,.25,1); outline: none; padding-bottom: var(--sab); }
.sheet.tall { height: 92dvh; }
.sheet-wrap.in .sheet-back { opacity: 1; } .sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.closing .sheet-back { opacity: 0; } .sheet-wrap.closing .sheet { transform: translateY(100%); }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; max-height: 88dvh; transform: translateY(24px) scale(.98); opacity: 0; } .sheet-wrap.in .sheet { opacity: 1; transform: none; } .sheet-wrap.closing .sheet { opacity: 0; transform: translateY(24px); } .sheet.tall { height: 88dvh; } .grabber { display: none; } }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; }
.sheet-head h2 { flex: 1; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; padding: 8px 18px 28px; -webkit-overflow-scrolling: touch; }
.toast { pointer-events: auto; position: absolute; left: 50%; bottom: calc(var(--nav-h) + var(--sab) + 26px); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: toastin .3s cubic-bezier(.2,.9,.3,1.2); }
.toast.out { opacity: 0; transition: opacity .25s; }
.toast-act { color: color-mix(in srgb, var(--accent) 45%, #fff); font-weight: 800; }
:root[data-mode="dark"] .toast-act { color: color-mix(in srgb, var(--accent) 55%, #000); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } }
.confetti { position: fixed; width: 8px; height: 12px; border-radius: 2px; animation: conf 1s cubic-bezier(.1,.7,.3,1) forwards; pointer-events: none; }
@keyframes conf { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 140px)) rotate(var(--rot)); opacity: 0; } }

/* ---------- forms ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; max-height: 232px; overflow-y: auto; padding: 4px; margin: 0 -4px; }
.icon-grid button { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; background: var(--bg2); color: var(--text); transition: all .12s; }
.icon-grid button.on { background: var(--c, var(--accent)); color: var(--ink, #fff); transform: scale(1.06); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--line); display: grid; place-items: center; color: #fff; transition: transform .12s; }
.sw.on { box-shadow: 0 0 0 2.5px var(--text); transform: scale(1.08); }
.days { display: flex; gap: 6px; } .days button { flex: 1; height: 42px; border-radius: 12px; background: var(--bg2); font-weight: 700; font-size: 13px; color: var(--text2); } .days button.on { background: var(--accent); color: var(--on-accent); }
.tpl-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 8px; scrollbar-width: none; } .tpl-row::-webkit-scrollbar { display: none; }
.tpl { flex: none; width: 112px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.2; }
.tpl .g { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; }
.preview-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.preview-tile .glyph { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; }
.reminder { display: flex; gap: 8px; align-items: center; background: var(--bg2); border-radius: 14px; padding: 8px; flex-wrap: wrap; }
.reminder input[type=time] { width: 136px; flex: none; } .reminder .input { min-height: 40px; padding: 8px 10px; background: var(--card); }
.sticky-actions { position: sticky; bottom: -28px; margin: 18px -18px -28px; padding: 14px 18px calc(18px); background: linear-gradient(transparent, var(--bg) 28%); display: flex; gap: 10px; }

/* ---------- detail ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 18px; padding: 12px; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; } .stat .l { font-size: 12px; color: var(--text2); font-weight: 600; margin-top: 2px; }
.hero { display: flex; gap: 14px; align-items: center; }
.hero .glyph { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text2); padding-bottom: 2px; }
.day { --c: var(--accent); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; position: relative; font-variant-numeric: tabular-nums; color: var(--text); }
button.day:active { transform: scale(.92); }
.day.out { visibility: hidden; } .day.future { color: var(--text2); }
.day.done { background: var(--c); color: var(--ink, #fff); } .day.miss { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.day.slip { background: var(--danger); color: #fff; } .day.skip { border: 1.5px dashed var(--text2); } .day.rest, .day.off { color: var(--text2); }
.day.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.day.partial::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 3px solid var(--c); border-right-color: transparent; border-bottom-color: transparent; transform: rotate(var(--rot, 0deg)); opacity: .9; }
.note-item { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; } .note-item .d { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 4px; } .note-item p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }

/* ---------- stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.kpi { padding: 14px; } .kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; } .kpi .l { font-size: 13px; color: var(--text2); font-weight: 600; }
.chart { width: 100%; display: block; overflow: visible; } .chart text { font-family: var(--font); fill: var(--text2); font-size: 10.5px; font-weight: 600; }
.chart .bar-rect { transition: opacity .15s; cursor: pointer; } .chart .bar-rect:hover { opacity: .8; }
.heat { display: block; width: 100%; overflow: visible; } .heat rect { rx: 3; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; } .hrow + .hrow { border-top: 1px solid var(--line); }
.hrow .glyph { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.hrow .pb { height: 6px; background: var(--bg2); border-radius: 9px; overflow: hidden; margin-top: 6px; } .hrow .pb i { display: block; height: 100%; border-radius: 9px; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 6px 9px; border-radius: 9px; white-space: nowrap; transform: translate(-50%, -120%); z-index: 3; }

/* ---------- timer ---------- */
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 10px 0 6px; }
.timer-dial { position: relative; width: 250px; height: 250px; } .timer-dial .time { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-size: 54px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; } .timer-dial .time small { display: block; font-size: 14px; font-weight: 600; color: var(--text2); letter-spacing: 0; margin-top: 2px; text-align: center; }
.timer-btns { display: flex; gap: 14px; align-items: center; }
.big-btn { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: var(--ink, #fff); box-shadow: 0 10px 24px color-mix(in srgb, var(--c, var(--accent)) 40%, transparent); transition: transform .12s; } .big-btn:active { transform: scale(.94); }
.pill-timer[hidden] { display: none; }
.pill-timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--sab) + 22px); z-index: 25; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 99px; background: var(--text); color: var(--bg); font-weight: 700; box-shadow: var(--shadow-lg); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
@media (prefers-contrast: more) { :root { --line: #9AA39E; --text2: #46514C; } :root[data-mode="dark"] { --line: #5B6761; --text2: #C0C9C4; } }

/* ---- reorder (drag handles) ---- */
.drag-handle { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text2); touch-action: none; cursor: grab; flex: none; }
.drag-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile.reorder { cursor: default; min-height: 120px; padding: 14px; justify-content: flex-start; touch-action: pan-y; }
.tile.reorder .drag-handle { position: absolute; top: 6px; right: 6px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.tile.reorder:active { transform: none; }
.dragging { z-index: 20; box-shadow: 0 18px 40px rgba(0,0,0,.28); transition: none !important; position: relative; }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.item.dragging { background: var(--card); border-radius: 14px; }
.item .drag-handle { width: 40px; height: 40px; }

/* ---- app lock ---- */
.lock-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.lock-box { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: stretch; }
.lock-box h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.lock-ico { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.lock-input { text-align: center; font-size: 26px; letter-spacing: .4em; font-weight: 800; min-height: 56px; }
.lock-msg { min-height: 20px; font-size: 13.5px; color: var(--danger); }
.lock-forgot { color: var(--text2); font-size: 13.5px; text-decoration: underline; padding: 8px; }

/* ---- v1.2: review, trophies, mood, time-of-day ---- */
.review-hero { display: flex; align-items: center; gap: 16px; }
.review-hero .progress-ring { position: relative; width: 96px; height: 96px; flex: none; }
.review-hero .num { font-size: 22px; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--text); }
.delta.up .ic { color: var(--ok); } .delta.down .ic { color: var(--danger); }
.review-card .ric, .ico.good, .ico.warn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none; }
.ico.good, .ico.warn { width: 32px; height: 32px; border-radius: 10px; }
.ico.warn { background: color-mix(in srgb, #F59E0B 20%, transparent); color: var(--text); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ach { background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; }
.ach:not(.on) .aic { opacity: .55; }
.ach.on { border-style: solid; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); }
.ach .aic { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--text2); }
.ach.on .aic { background: var(--accent); color: var(--on-accent); }
.ach .at { font-weight: 700; font-size: 13px; line-height: 1.2; }
.ach .ad { font-size: 11.5px; color: var(--text2); margin-top: 3px; line-height: 1.25; }
.mood-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood-row.three { grid-template-columns: repeat(3, 1fr); }
.mood-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 14px; background: var(--bg2); color: var(--text2); font-size: 11.5px; font-weight: 600; border: 1.5px solid transparent; min-height: 58px; transition: all .15s; }
.mood-btn.on { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-color: var(--accent); color: var(--text); }
.mood-strip { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.mood-strip i { flex: 1; background: var(--accent); border-radius: 3px; min-height: 3px; }
.slot-head { display: flex; align-items: center; gap: 8px; margin: 22px 4px 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.slot-head .cnt { margin-left: auto; font-weight: 700; letter-spacing: 0; text-transform: none; }
.upnext { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; }
.upnext .glyph { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; }
.chain .node { padding: 4px 10px; border-radius: 99px; background: var(--bg2); font-weight: 600; }
.chain .node.me { background: var(--accent); color: var(--on-accent); }
