:root {
  --bg: #0D0B1E; --panel: #1A1533; --panel2: #14112B; --line: #2E2550; --line2: #221B40;
  --text: #F5F0FF; --soft: #D8D0EE; --muted: #A89CC8;
  --pink: #FF4FA3; --teal: #3DEBD9; --amber: #FFB547; --violet: #9D7BFF;
  --display: Anton, Impact, 'Arial Narrow', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 15px; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; }
input::placeholder, textarea::placeholder { color: #8F84B0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; padding: calc(20px + var(--safe-t)) 18px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 18px; }
.page.full { padding-bottom: calc(24px + var(--safe-b)); }

/* header */
.hdr { display: flex; align-items: center; gap: 12px; }
.kicker, .label { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.title { font-family: var(--display); font-size: 36px; letter-spacing: .5px; line-height: 1.05; font-weight: 400; }
.title.brand { color: var(--pink); font-size: 40px; }
.back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--panel); }

/* cards */
.card { background: var(--panel); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.hero { border: 2px solid var(--pink); border-radius: 22px; padding: 18px; gap: 12px; }
.card.alert { border: 2px solid var(--amber); }
.card.dashed { background: var(--panel2); border: 1px dashed var(--violet); }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: 13px; } .tiny { font-size: 11px; }
.b { font-weight: 700; } .center { text-align: center; }
.display { font-family: var(--display); letter-spacing: .5px; font-weight: 400; line-height: 1.05; }
.mission-title { font-family: var(--display); font-size: 34px; letter-spacing: .5px; line-height: 1.05; }
.xp { font-size: 12px; font-weight: 800; color: var(--amber); white-space: nowrap; }
.pink { color: var(--pink); } .teal { color: var(--teal); } .amber { color: var(--amber); } .violet { color: var(--violet); }

/* list rows */
.item { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 16px; padding: 12px 14px; min-height: 60px; }
.item .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: #2A1640; }
.item.done { opacity: .55; }
.line-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line2); }

/* buttons */
.btn { height: 50px; border: 0; border-radius: 14px; padding: 0 18px; font-weight: 800; font-size: 16px; background: var(--pink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.teal { background: var(--teal); } .btn.amber { background: var(--amber); }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; }
.btn.quiet { background: transparent; border: 2px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.btn.sm { height: 38px; font-size: 13px; padding: 0 12px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: flex; gap: 8px; } .btns > * { flex: 1; } .btns > .btn:first-child { flex: 2; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--panel); display: grid; place-items: center; flex-shrink: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip.on { border-color: var(--pink); color: var(--pink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { height: 48px; border-radius: 14px; border: 2px solid var(--line); background: transparent; font-weight: 700; }
.seg button.on { background: var(--pink); border-color: var(--pink); color: var(--bg); }
.tick { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: transparent; font-weight: 800; font-size: 15px; flex-shrink: 0; display: grid; place-items: center; }
.tick.on { background: var(--teal); border-color: var(--teal); color: var(--bg); }
.tick.pinkb { border-color: var(--pink); }

/* forms */
.input { height: 48px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); width: 100%; font-size: 16px; }
.input.sm { height: 40px; font-size: 15px; }
textarea.input { height: auto; padding: 12px 14px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch input { width: 46px; height: 28px; appearance: none; border-radius: 999px; background: var(--line); position: relative; transition: .2s; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: .2s; }
.switch input:checked { background: var(--teal); } .switch input:checked::after { left: 21px; background: var(--bg); }

/* rings */
.ring { position: relative; flex-shrink: 0; }
.ring svg { display: block; }
.ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-num { font-family: var(--display); line-height: 1; }
.rings5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.rings5 > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--soft); }

/* nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(20, 17, 43, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + var(--safe-b)); }
.nav-in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); min-height: 48px; justify-content: center; }
.nav a.on { color: var(--pink); font-weight: 800; }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(5, 3, 15, .7); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--panel2); border: 1px solid var(--line); border-bottom: 0; width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: up .2s ease-out; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; }
.sheet-h h2 { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .5px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* celebrations */
.toasts { position: fixed; left: 0; right: 0; top: calc(16px + var(--safe-t)); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--amber); color: var(--bg); font-weight: 800; padding: 8px 16px; border-radius: 999px; animation: pop .25s ease-out; }
.passed { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(13,11,30,.0) 0%, rgba(13,11,30,.85) 70%); animation: fade .2s; }
.passed-in { text-align: center; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.passed h2 { font-family: var(--display); font-weight: 400; font-size: 54px; color: var(--teal); letter-spacing: 1px; line-height: 1; text-shadow: 0 0 24px rgba(61, 235, 217, .5); }
.passed p { font-weight: 800; color: var(--amber); font-size: 20px; margin: 8px 0 0; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* routine mode */
.focus-step { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; text-align: center; padding: 10px 0; }
.focus-step .big { font-family: var(--display); font-size: 52px; line-height: 1.02; letter-spacing: .5px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.dots span.on { background: var(--teal); } .dots span.cur { background: var(--pink); }

.empty { padding: 18px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 16px; font-size: 14px; }
.ex-cues { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--soft); font-size: 14px; line-height: 1.45; }
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
