:root {
  --bg: #07110d;
  --bg-soft: #0b1914;
  --surface: rgba(19, 38, 30, .78);
  --surface-solid: #12251d;
  --surface-2: #183127;
  --line: rgba(218, 239, 228, .11);
  --line-strong: rgba(218, 239, 228, .2);
  --text: #f3faf6;
  --muted: #9cb3a7;
  --accent: #b7f36b;
  --accent-2: #62d79b;
  --accent-dark: #183516;
  --warning: #ffd375;
  --danger: #ff8d8d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background:
  radial-gradient(circle at 80% -15%, rgba(98, 215, 155, .16), transparent 38rem),
  radial-gradient(circle at 10% 45%, rgba(183, 243, 107, .08), transparent 30rem), var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
button, label, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(183, 243, 107, .42); outline-offset: 2px; }
[hidden] { display: none !important; }
noscript { display: block; padding: 1rem; background: #421; color: #fff; text-align: center; }

.glass-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(27, 52, 42, .86), rgba(12, 27, 21, .88)); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.eyebrow { display: inline-block; margin-bottom: .45rem; color: var(--accent-2); font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
.brand-lockup { display: flex; align-items: center; gap: .8rem; }
.brand-lockup > div:last-child { display: grid; gap: .2rem; }
.brand-lockup b { font-size: 1.05rem; letter-spacing: -.02em; }
.brand-lockup span { color: var(--muted); font-size: .72rem; }
.brand-lockup.large b { font-size: 1.25rem; }
.brand-icon { display: grid; width: 42px; height: 42px; border: 1px solid rgba(183, 243, 107, .42); border-radius: 14px; place-items: center; color: #132116; background: linear-gradient(145deg, var(--accent), #79d98e); box-shadow: 0 8px 30px rgba(183, 243, 107, .16); font: 900 1.1rem/1 Georgia, serif; }

.boot-screen { position: fixed; z-index: 1000; inset: 0; display: grid; place-content: center; justify-items: center; gap: .7rem; background: var(--bg); transition: opacity .28s ease, visibility .28s ease; }
.boot-screen.done { opacity: 0; visibility: hidden; }
.boot-screen strong { font-size: 1.35rem; }
.boot-screen small { color: var(--muted); }
.boot-mark { display: flex; align-items: end; gap: 5px; height: 44px; }
.boot-mark span { display: block; width: 9px; border-radius: 8px; background: var(--accent); animation: bootPulse .8s ease-in-out infinite alternate; }
.boot-mark span:nth-child(1) { height: 20px; }
.boot-mark span:nth-child(2) { height: 34px; animation-delay: .15s; }
.boot-mark span:nth-child(3) { height: 26px; animation-delay: .3s; }
@keyframes bootPulse { to { height: 10px; opacity: .4; } }

.center-view { min-height: 100vh; padding: 1.2rem; display: grid; place-items: center; }
.setup-card { width: min(100%, 490px); padding: clamp(1.3rem, 5vw, 2.2rem); border-radius: 30px; }
.setup-copy { margin: 2rem 0 1.3rem; }
.setup-copy h1, .page-heading h1, .welcome-row h1 { margin: 0; line-height: 1.35; letter-spacing: -.04em; }
.setup-copy h1 { font-size: clamp(1.55rem, 6vw, 2.15rem); }
.setup-copy p, .page-heading p, .story-copy p { color: var(--muted); line-height: 1.9; }

.stack-form { display: grid; gap: 1rem; }
.stack-form label { display: grid; gap: .5rem; color: #dbe8e1; font-size: .82rem; font-weight: 700; }
input, select { width: 100%; min-height: 48px; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: rgba(3, 12, 8, .52); transition: border-color .2s, background .2s, box-shadow .2s; }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: rgba(183, 243, 107, .6); background: rgba(4, 15, 10, .8); box-shadow: 0 0 0 4px rgba(183, 243, 107, .07); outline: none; }
input::placeholder { color: #667b70; }
label small { color: var(--muted); font-size: .68rem; font-weight: 400; }
.primary-btn, .secondary-btn, .text-btn, .circle-add, .sync-pill, .avatar-btn, .close-btn { border: 0; cursor: pointer; }
.primary-btn { min-height: 48px; padding: .75rem 1rem; border-radius: 14px; color: #112015; background: linear-gradient(135deg, var(--accent), #75da8d); font-weight: 900; box-shadow: 0 10px 24px rgba(104, 207, 130, .13); transition: transform .15s, filter .15s; }
.primary-btn:hover { filter: brightness(1.05); }
.primary-btn:active { transform: translateY(1px) scale(.99); }
.primary-btn:disabled { cursor: wait; filter: grayscale(.6); opacity: .65; }
.secondary-btn { min-height: 40px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: .76rem; font-weight: 800; }
.text-btn { padding: .4rem; color: var(--accent-2); background: transparent; font-size: .78rem; font-weight: 700; }
.wide { width: 100%; }
.form-error { min-height: 1.15rem; margin: 0; color: var(--danger); font-size: .73rem; line-height: 1.6; }
.help-details { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; line-height: 1.8; }
.help-details summary { cursor: pointer; color: #dbe8e1; font-weight: 700; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
.auth-story { position: relative; overflow: hidden; min-height: 100vh; padding: clamp(1.5rem, 5vw, 4.5rem); display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(150deg, #0e241a 0%, #0a1712 62%, #07110d 100%); }
.auth-story::after { position: absolute; inset: 0; content: ""; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(to bottom, black, transparent 85%); }
.auth-story > * { position: relative; z-index: 1; }
.story-copy { max-width: 650px; }
.story-copy h1 { max-width: 600px; margin: 0; font-size: clamp(2rem, 4.3vw, 4.7rem); line-height: 1.22; letter-spacing: -.065em; }
.story-copy p { max-width: 570px; font-size: clamp(.9rem, 1.25vw, 1.05rem); }
.horizon-art { position: relative; height: min(38vh, 380px); margin: 1rem -5vw; overflow: hidden; }
.sun { position: absolute; top: 8%; right: 22%; width: 95px; height: 95px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 80px rgba(183, 243, 107, .35); }
.hill { position: absolute; right: -10%; bottom: -42%; width: 75%; aspect-ratio: 1; border-radius: 46% 54% 0 0; transform: rotate(-9deg); }
.hill-back { right: 37%; bottom: -57%; background: #173c2c; }
.hill-front { background: #0f2b20; }
.path { position: absolute; right: 30%; bottom: -15%; width: 14%; height: 70%; border-radius: 50%; background: linear-gradient(to top, rgba(183,243,107,.35), rgba(183,243,107,0)); transform: rotate(-22deg); filter: blur(2px); }
.tree { position: absolute; right: 52%; bottom: 9%; width: 7px; height: 72px; border-radius: 8px; background: #bb9561; }
.tree i { position: absolute; width: 52px; height: 42px; border-radius: 50%; background: #4abb7b; }
.tree i:nth-child(1) { right: -12px; top: -20px; }.tree i:nth-child(2) { right: -34px; top: -7px; }.tree i:nth-child(3) { right: 3px; top: 2px; }
.auth-panel { padding: 2rem; display: grid; place-items: center; }
.auth-card { width: min(100%, 450px); min-height: 500px; padding: clamp(1.25rem, 4vw, 2.1rem); border-radius: 30px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 2rem; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 13, 9, .5); }
.segmented button { min-height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.segmented button.active { color: var(--text); background: var(--surface-2); box-shadow: 0 5px 18px rgba(0,0,0,.2); }
.form-heading h2 { margin: 0; font-size: 1.45rem; }
.form-heading p { margin: .4rem 0 .6rem; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.password-field { position: relative; display: block; }
.password-field input { padding-left: 48px; }
.reveal-btn { position: absolute; left: 4px; top: 4px; width: 40px; height: 40px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.auth-message { min-height: 1.4rem; margin: 1rem 0 0; color: var(--muted); font-size: .74rem; line-height: 1.8; text-align: center; }
.auth-message.error { color: var(--danger); }.auth-message.success { color: var(--accent-2); }

.app-shell { min-height: 100vh; padding-bottom: calc(84px + var(--safe-bottom)); }
.topbar { position: sticky; z-index: 50; top: 0; min-height: 72px; padding: 12px max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); background: rgba(7, 17, 13, .8); backdrop-filter: blur(18px); }
.brand-lockup.compact .brand-icon { width: 38px; height: 38px; border-radius: 13px; }
.top-actions { display: flex; align-items: center; gap: .65rem; }
.sync-pill { min-height: 36px; padding: .45rem .7rem; display: flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: .68rem; font-weight: 800; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px rgba(98,215,155,.55); }
.sync-pill.syncing i { animation: syncPulse .7s infinite alternate; background: var(--warning); }
.sync-pill.error i, .sync-pill.offline i { background: var(--danger); }
@keyframes syncPulse { to { opacity: .25; transform: scale(.65); } }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; color: #173019; background: linear-gradient(145deg, var(--accent), #69d695); font-weight: 900; }
.app-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.app-view { padding: 2rem 0 4rem; animation: viewIn .23s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }
.welcome-row { margin-bottom: 1.35rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.welcome-row h1 { font-size: clamp(1.55rem, 4vw, 2.45rem); }
.welcome-row p { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }
.circle-add { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 17px; color: #132116; background: var(--accent); font-size: 1.65rem; box-shadow: 0 10px 28px rgba(183,243,107,.16); }

.progress-hero { position: relative; min-height: 310px; padding: clamp(1.25rem, 4vw, 2.2rem); overflow: hidden; display: grid; grid-template-columns: 1fr minmax(260px, .7fr); grid-template-rows: 1fr auto auto; column-gap: 2rem; border-radius: 30px; }
.progress-hero::before { position: absolute; top: -50%; left: -10%; width: 420px; height: 420px; content: ""; border-radius: 50%; background: rgba(183,243,107,.06); filter: blur(30px); }
.level-copy { position: relative; z-index: 1; align-self: center; }
.level-copy > span { display: inline-block; margin-bottom: .75rem; padding: .4rem .7rem; border: 1px solid rgba(183,243,107,.25); border-radius: 999px; color: var(--accent); background: rgba(183,243,107,.07); font-size: .72rem; font-weight: 900; }
.level-copy h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.25rem); letter-spacing: -.04em; }
.level-copy p { color: var(--muted); font-size: .78rem; }
.living-world { position: relative; min-height: 210px; grid-row: 1 / 4; grid-column: 2; }
.world-glow { position: absolute; right: 50%; bottom: 35px; width: 180px; height: 180px; border-radius: 50%; background: rgba(98,215,155,.12); transform: translateX(50%); filter: blur(24px); }
.world-ground { position: absolute; right: 50%; bottom: 30px; width: 230px; height: 54px; border-radius: 50%; background: linear-gradient(#2c6a49, #163424); transform: translateX(50%); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.world-tree { position: absolute; z-index: 2; right: 50%; bottom: 54px; width: 14px; height: 100px; transform: translateX(50%) scale(var(--tree-scale, .65)); transform-origin: center bottom; transition: transform .5s ease; }
.world-tree .trunk { position: absolute; inset: 20px 3px 0; border-radius: 10px; background: linear-gradient(90deg, #765639, #bc9365); }
.world-tree i { position: absolute; width: 75px; height: 62px; border-radius: 52% 48%; background: linear-gradient(145deg, #86dc76, #299764); box-shadow: inset -10px -8px 20px rgba(0,0,0,.12); }
.world-tree i:nth-of-type(1) { right: -15px; top: -15px; }.world-tree i:nth-of-type(2) { right: -48px; top: 6px; }.world-tree i:nth-of-type(3) { right: 12px; top: 10px; }.world-tree i:nth-of-type(4) { right: -17px; top: 28px; }
.world-tree.stage-2 { --tree-scale: .78; }.world-tree.stage-3 { --tree-scale: .9; }.world-tree.stage-4 { --tree-scale: 1.02; }.world-tree.stage-5 { --tree-scale: 1.16; }
.progress-track { position: relative; z-index: 2; height: 8px; overflow: hidden; grid-column: 1; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 14px rgba(183,243,107,.32); transition: width .55s cubic-bezier(.2,.8,.2,1); }
.hero-metrics { position: relative; z-index: 1; margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--muted); font-size: .72rem; }
.hero-metrics b { color: var(--text); font-size: .9rem; }

.section-block { margin-top: 2.4rem; }
.section-heading { margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.05rem, 2vw, 1.35rem); letter-spacing: -.03em; }
.count-chip { padding: .4rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .7rem; }
.mission-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mission-card { position: relative; min-height: 185px; padding: 1.1rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(24,49,39,.82), rgba(13,29,23,.9)); box-shadow: 0 12px 40px rgba(0,0,0,.14); transition: border-color .2s, transform .2s, opacity .2s; }
.mission-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.mission-card.done { opacity: .72; background: rgba(15,35,26,.55); }
.mission-card.done h3 { text-decoration: line-through; text-decoration-color: rgba(183,243,107,.5); }
.mission-top { display: flex; justify-content: space-between; gap: .8rem; }
.habit-symbol { display: grid; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; place-items: center; background: rgba(255,255,255,.035); font-size: 1.25rem; }
.xp-chip { color: var(--accent); font-size: .68rem; font-weight: 900; }
.mission-card h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.mission-card p { margin: 0 0 1rem; color: var(--muted); font-size: .69rem; line-height: 1.7; }
.mission-actions { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.complete-btn { min-height: 42px; border: 0; border-radius: 12px; color: #152217; background: var(--accent); cursor: pointer; font-weight: 900; }
.minimum-btn { min-width: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: .66rem; font-weight: 800; }
.mission-card.done .complete-btn { color: var(--accent); background: rgba(183,243,107,.09); }
.mission-empty, .empty-state { padding: 2rem; border: 1px dashed var(--line-strong); border-radius: 20px; color: var(--muted); text-align: center; }
.mission-empty b, .empty-state b { display: block; margin-bottom: .35rem; color: var(--text); }

.stats-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stats-grid article { position: relative; min-height: 102px; padding: 1rem; overflow: hidden; display: grid; align-content: center; gap: .45rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,32,25,.72); }
.stats-grid span { color: var(--muted); font-size: .68rem; }.stats-grid b { font-size: 1.05rem; }
.stat-icon { position: absolute; left: .9rem; bottom: .65rem; color: rgba(183,243,107,.25); font-size: 1.7rem; font-style: normal; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .65rem; }
.day-cell { min-height: 92px; padding: .7rem .35rem; display: grid; place-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(15,32,25,.65); }
.day-cell.today { border-color: rgba(183,243,107,.38); box-shadow: inset 0 0 0 1px rgba(183,243,107,.08); }
.day-cell span { color: var(--muted); font-size: .65rem; }.day-cell b { font-size: .85rem; }.day-cell i { width: 25px; height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.day-cell i::after { display: block; width: var(--score, 0%); height: 100%; content: ""; background: var(--accent); }
.habit-list { display: grid; gap: .75rem; }
.habit-row { padding: .9rem 1rem; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 17px; background: rgba(15,32,25,.62); }
.habit-row .habit-symbol { width: 38px; height: 38px; border-radius: 12px; }
.habit-row h3 { margin: 0 0 .22rem; font-size: .86rem; }.habit-row p { margin: 0; color: var(--muted); font-size: .64rem; }
.streak-badge { color: var(--warning); font-size: .7rem; font-weight: 800; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; }

.page-heading { margin: .5rem 0 2rem; max-width: 720px; }.page-heading h1 { font-size: clamp(1.7rem, 4vw, 2.8rem); }.page-heading p { margin-bottom: 0; }
.wallet-card { min-height: 170px; padding: 1.5rem; margin-bottom: 2rem; display: flex; align-items: center; justify-content: space-between; border-radius: 26px; }
.wallet-card > div:first-child { display: grid; gap: .5rem; }.wallet-card span { color: var(--muted); font-size: .75rem; }.wallet-card b { font-size: clamp(1.6rem, 4vw, 2.7rem); }.wallet-card i { color: var(--accent); font-style: normal; }
.coin-orbit { display: grid; width: 95px; height: 95px; border: 1px solid rgba(183,243,107,.2); border-radius: 50%; place-items: center; color: var(--accent); background: radial-gradient(circle, rgba(183,243,107,.18), transparent 67%); box-shadow: 0 0 45px rgba(183,243,107,.09); font-size: 2.2rem; }
.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.reward-card { min-height: 170px; padding: 1rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: rgba(15,32,25,.68); }
.reward-card .reward-icon { font-size: 1.6rem; }.reward-card h3 { margin: .75rem 0 .35rem; font-size: .92rem; }.reward-card p { margin: 0; color: var(--muted); font-size: .68rem; }.reward-card button { min-height: 40px; margin-top: auto; border: 0; border-radius: 12px; color: #142116; background: var(--accent); cursor: pointer; font-size: .72rem; font-weight: 900; }.reward-card button:disabled { color: var(--muted); background: rgba(255,255,255,.06); cursor: not-allowed; }
.insight-summary { padding: 1.1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 22px; }.insight-summary > div { padding: 1rem; display: grid; gap: .4rem; border-left: 1px solid var(--line); }.insight-summary > div:last-child { border: 0; }.insight-summary span { color: var(--muted); font-size: .7rem; }.insight-summary b { font-size: 1.45rem; }
.chart-card { margin-top: 1rem; padding: 1.2rem; border-radius: 22px; }.bar-chart { height: 230px; padding-top: 1.5rem; display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: clamp(3px, 1vw, 10px); border-bottom: 1px solid var(--line); }.chart-bar { position: relative; min-height: 4px; height: var(--height); border-radius: 7px 7px 2px 2px; background: linear-gradient(to top, #3ab579, var(--accent)); }.chart-bar:hover::after { position: absolute; bottom: calc(100% + 6px); right: 50%; padding: .25rem .4rem; content: attr(data-value); border-radius: 6px; color: var(--text); background: #020704; font-size: .55rem; transform: translateX(50%); white-space: nowrap; }
.performance-list { display: grid; gap: .8rem; }.performance-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; align-items: center; gap: 1rem; }.performance-row h3 { margin: 0; font-size: .78rem; }.performance-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }.performance-track span { display: block; width: var(--rate); height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }.performance-row b { color: var(--muted); font-size: .7rem; }
.profile-card { padding: 1.1rem; display: flex; align-items: center; gap: 1rem; border-radius: 20px; }.settings-avatar { display: grid; width: 52px; height: 52px; border-radius: 17px; place-items: center; color: #102014; background: var(--accent); font-weight: 900; }.profile-card > div:last-child { display: grid; gap: .25rem; }.profile-card span { color: var(--muted); font-size: .7rem; direction: ltr; text-align: right; }
.settings-group, .settings-actions { margin-top: 1rem; overflow: hidden; border-radius: 20px; }
.toggle-row, .settings-actions button, .action-label { min-height: 72px; padding: .9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: right; cursor: pointer; }
.toggle-row:last-child, .settings-actions > *:last-child { border-bottom: 0; }.toggle-row span, .settings-actions span, .action-label span { display: grid; gap: .25rem; }.toggle-row small, .settings-actions small, .action-label small { color: var(--muted); font-size: .65rem; font-weight: 400; }.settings-actions button, .action-label { width: 100%; }.settings-actions i, .action-label i { color: var(--muted); font-style: normal; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }.toggle-row > i { position: relative; width: 44px; height: 25px; flex: 0 0 44px; border-radius: 99px; background: #304138; transition: background .2s; }.toggle-row > i::after { position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; content: ""; border-radius: 50%; background: #8ca095; transition: transform .2s, background .2s; }.toggle-row input:checked + i { background: rgba(183,243,107,.35); }.toggle-row input:checked + i::after { background: var(--accent); transform: translateX(-19px); }
.danger-zone button:last-child { color: var(--warning); }.version-line { margin-top: 1.6rem; color: #65786e; font-size: .65rem; text-align: center; }

.bottom-nav { position: fixed; z-index: 60; right: 50%; bottom: max(10px, var(--safe-bottom)); width: min(480px, calc(100% - 24px)); min-height: 66px; padding: 6px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-strong); border-radius: 22px; background: rgba(13,28,22,.92); box-shadow: 0 18px 55px rgba(0,0,0,.38); backdrop-filter: blur(18px); transform: translateX(50%); }
.bottom-nav button { min-width: 0; border: 0; border-radius: 16px; color: var(--muted); background: transparent; cursor: pointer; }
.bottom-nav i { display: block; margin-bottom: .2rem; font-size: 1rem; font-style: normal; }.bottom-nav span { font-size: .6rem; font-weight: 800; }.bottom-nav button.active { color: #162319; background: var(--accent); }

.app-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 26px; color: var(--text); background: #0e2018; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.app-dialog::backdrop { background: rgba(0,8,5,.72); backdrop-filter: blur(5px); }
.dialog-card { padding: clamp(1rem, 4vw, 1.7rem); display: grid; gap: 1rem; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }.dialog-heading h2 { margin: 0; }.close-btn { width: 38px; height: 38px; border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.05); font-size: 1.35rem; }
.habit-name-row { display: flex; align-items: end; gap: .8rem; }.emoji-label { width: 82px; flex: 0 0 82px; }.emoji-label input { text-align: center; font-size: 1.2rem; }.grow { flex: 1; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }.dialog-card label { display: grid; gap: .45rem; color: #dbe8e1; font-size: .76rem; font-weight: 700; }
.difficulty-field { margin: 0; padding: .8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; border: 1px solid var(--line); border-radius: 16px; }.difficulty-field legend { padding: 0 .45rem; color: var(--muted); font-size: .68rem; }.difficulty-field label { cursor: pointer; }.difficulty-field input { position: absolute; opacity: 0; }.difficulty-field span { padding: .65rem; display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); text-align: center; }.difficulty-field small { font-size: .58rem; }.difficulty-field input:checked + span { border-color: rgba(183,243,107,.45); color: var(--text); background: rgba(183,243,107,.08); }
.priority-check { display: flex !important; align-items: center; gap: .6rem !important; cursor: pointer; }.priority-check input { width: 18px; min-height: 18px; accent-color: var(--accent); }.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; }.dialog-actions > span { flex: 1; }.danger-text { border: 0; color: var(--danger); background: transparent; cursor: pointer; }.compact-dialog { width: min(440px, calc(100% - 24px)); text-align: center; }.confirm-icon { display: grid; width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; place-items: center; color: var(--warning); background: rgba(255,211,117,.1); font-size: 1.3rem; }.compact-dialog h2, .compact-dialog p { margin: 0; }.compact-dialog p { color: var(--muted); line-height: 1.8; }

.celebration { position: fixed; z-index: 200; top: 50%; right: 50%; width: 180px; height: 180px; display: grid; place-content: center; justify-items: center; border: 1px solid rgba(183,243,107,.28); border-radius: 50%; color: var(--text); background: rgba(8,25,17,.94); box-shadow: 0 0 90px rgba(183,243,107,.19); opacity: 0; pointer-events: none; transform: translate(50%, -50%) scale(.75); }
.celebration.show { animation: celebrate 1.45s cubic-bezier(.2,.8,.2,1) both; }.reward-burst { color: var(--accent); font-size: 2.7rem; }.celebration b { margin-top: .25rem; color: var(--accent); font-size: 1.1rem; }.celebration span { margin-top: .25rem; color: var(--muted); font-size: .67rem; }
@keyframes celebrate { 0% { opacity: 0; transform: translate(50%,-50%) scale(.55) rotate(-9deg); } 18%,72% { opacity: 1; transform: translate(50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(50%,-50%) scale(1.12); } }
.toast-region { position: fixed; z-index: 300; right: 50%; bottom: calc(92px + var(--safe-bottom)); width: min(420px, calc(100% - 28px)); display: grid; gap: .55rem; transform: translateX(50%); pointer-events: none; }.toast { padding: .8rem 1rem; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--text); background: rgba(14,32,24,.96); box-shadow: 0 15px 40px rgba(0,0,0,.35); font-size: .72rem; line-height: 1.6; animation: toastIn .24s ease both; }.toast.error { border-color: rgba(255,141,141,.35); }.toast.success { border-color: rgba(183,243,107,.32); } @keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .auth-view { grid-template-columns: 1fr; }.auth-story { min-height: 42vh; padding-bottom: 2rem; }.horizon-art { position: absolute; inset: 0; height: auto; opacity: .45; }.story-copy { margin-top: 6rem; }.story-copy h1 { font-size: clamp(1.9rem, 8vw, 3.2rem); }.auth-panel { padding: 1rem; }.auth-card { min-height: auto; }
  .progress-hero { grid-template-columns: 1fr minmax(210px,.65fr); }.mission-list, .reward-grid { grid-template-columns: repeat(2,1fr); }.mission-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .app-main { width: min(100% - 24px, 1180px); }.topbar { padding: 10px 12px; }.brand-lockup.compact span { display: none; }.sync-pill span { display: none; }.sync-pill { width: 36px; padding: 0; justify-content: center; }
  .app-view { padding-top: 1.25rem; }.welcome-row { align-items: center; }.circle-add { width: 44px; height: 44px; flex-basis: 44px; border-radius: 14px; }
  .progress-hero { min-height: 390px; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto; gap: .5rem; }.living-world { min-height: 160px; grid-row: 2; grid-column: 1; }.world-ground { bottom: 18px; transform: translateX(50%) scale(.8); }.world-tree { bottom: 39px; }.progress-track, .hero-metrics { grid-column: 1; }.hero-metrics { justify-content: space-between; gap: .5rem; }.hero-metrics span { display: grid; text-align: center; }
  .mission-list, .reward-grid { grid-template-columns: 1fr; }.mission-card:last-child:nth-child(odd) { grid-column: auto; }.mission-card { min-height: 165px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }.stats-grid article:last-child { grid-column: 1 / -1; }.week-strip { gap: .35rem; overflow-x: auto; padding-bottom: .3rem; }.day-cell { min-width: 52px; min-height: 82px; border-radius: 13px; }
  .habit-row { grid-template-columns: auto 1fr auto; }.habit-row .streak-badge { grid-column: 2; }.habit-row .icon-btn { grid-row: 1 / 3; grid-column: 3; }
  .insight-summary { grid-template-columns: 1fr; }.insight-summary > div { border-left: 0; border-bottom: 1px solid var(--line); }.performance-row { grid-template-columns: 1fr auto; }.performance-track { grid-row: 2; grid-column: 1 / -1; }
  .two-cols { grid-template-columns: 1fr; }.difficulty-field { gap: .3rem; }.difficulty-field span { padding: .55rem .25rem; }.dialog-actions { flex-wrap: wrap; }.bottom-nav { border-radius: 19px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
