:root {
  color-scheme: dark;
  --ink: #f7f8ff;
  --muted: #aeb8d3;
  --night: #0b1020;
  --panel: rgba(23, 31, 61, .74);
  --panel-strong: #171f3d;
  --violet: #8b78ff;
  --violet-deep: #6c5ce7;
  --mint: #14d5c4;
  --coral: #ff7b80;
  --sun: #ffd166;
  --green: #55c98b;
  --line: rgba(255, 255, 255, .10);
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  font-family: Inter, ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--night); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 50% 0%, #18275b 0, #0b1020 52%, #080b15 100%); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.aurora { position: fixed; inset: auto; width: 360px; height: 360px; border-radius: 50%; filter: blur(90px); opacity: .22; pointer-events: none; }
.aurora-one { background: var(--violet); top: -160px; left: -100px; }
.aurora-two { background: var(--mint); top: 35%; right: -260px; }
.app-shell { width: min(100%, 560px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px 120px; position: relative; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark, .icon-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(139,120,255,.34), rgba(20,213,196,.13)); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.brand-mark { color: var(--sun); font-size: 22px; }
.icon-button { margin-left: auto; font-size: 12px; font-weight: 800; cursor: pointer; }
.brand-kicker, .eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 800; color: var(--mint); }
h1 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
h2 { margin: 8px 0 14px; font-size: clamp(31px, 9vw, 48px); line-height: .98; letter-spacing: -.055em; }
h3 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
p { line-height: 1.55; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.hidden { display: none !important; }

.welcome-view { padding: 22px 2px 40px; }
.hero-orbit { width: 170px; height: 170px; margin: 0 auto 28px; position: relative; display: grid; place-items: center; }
.planet { width: 90px; height: 90px; border-radius: 32px; display: grid; place-items: center; font-size: 45px; color: #0b1020; background: linear-gradient(145deg, var(--mint), #b4fff4); box-shadow: 0 0 80px rgba(20,213,196,.35); transform: rotate(-8deg); }
.orbit { position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; animation: spin 18s linear infinite; }
.orbit::after { content: "✦"; position: absolute; top: 8px; left: 22px; color: var(--sun); }
.orbit-b { inset: 27px -16px; transform: rotate(58deg); animation-duration: 13s; animation-direction: reverse; }
.orbit-b::after { color: var(--coral); top: auto; bottom: 5px; left: auto; right: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

.start-form { display: grid; gap: 14px; }
label { color: #d9def1; font-size: 13px; font-weight: 700; }
input[type="text"], input:not([type]), textarea { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; background: rgba(255,255,255,.055); color: var(--ink); outline: none; transition: .2s ease; }
input:focus, textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(20,213,196,.1); }
.consent-row, .done-row { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; font-weight: 500; color: var(--muted); }
.consent-row input, .done-row input { width: 20px; height: 20px; accent-color: var(--mint); flex: 0 0 auto; }
.primary-button, .secondary-button { width: 100%; border: 0; border-radius: 17px; padding: 16px 18px; font-weight: 850; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.primary-button { display: flex; justify-content: space-between; color: #071614; background: linear-gradient(100deg, var(--mint), #a5f6e9); box-shadow: 0 16px 38px rgba(20,213,196,.18); }
.primary-button:active, .secondary-button:active { transform: scale(.985); }
.primary-button:hover { filter: brightness(1.06); }
.secondary-button { color: var(--ink); background: rgba(139,120,255,.18); border: 1px solid rgba(139,120,255,.35); }
.fine-print { text-align: center; color: #7f89a7; font-size: 11px; }

.mode-picker { display: grid; gap: 9px; margin: 3px 0; }
.mode-picker legend { margin-bottom: 1px; color: #d9def1; font-size: 13px; font-weight: 700; }
.mode-option { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.04); cursor: pointer; }
.mode-option:has(input:checked) { border-color: rgba(20,213,196,.52); background: linear-gradient(135deg, rgba(20,213,196,.13), rgba(139,120,255,.12)); }
.mode-option input { width: 20px; height: 20px; accent-color: var(--mint); }
.mode-option span { display: grid; gap: 4px; }
.mode-option strong { color: var(--ink); font-size: 14px; }
.mode-option small { color: var(--muted); font-weight: 500; }

.hello-row, .section-heading, .progress-labels, .card-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello-row h2 { font-size: 34px; margin-bottom: 0; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; padding: 6px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.035); }
.mode-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 47px; border: 0; border-radius: 14px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; }
.mode-switch button.active { color: #071614; background: linear-gradient(100deg, var(--mint), #a5f6e9); }
.mode-description { margin: 9px 4px 0; color: var(--muted); font-size: 12px; }
.points-pill { border: 1px solid rgba(255,209,102,.24); background: rgba(255,209,102,.1); color: #fff2c1; border-radius: 999px; padding: 10px 13px; font-size: 12px; white-space: nowrap; }
.points-pill span { color: var(--sun); }
.progress-card, .discovery-card, .checkin-card, .world-section { border: 1px solid var(--line); border-radius: 26px; background: var(--panel); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.progress-card { padding: 17px 18px; margin: 24px 0 16px; }
.progress-labels { font-size: 12px; color: var(--muted); }
.progress-labels strong { color: var(--mint); }
.progress-track { height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 10px 0 11px; }
.progress-track span { display: block; height: 100%; width: 3%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--mint)); transition: width .5s ease; }
.progress-card p { margin: 0; font-size: 13px; color: #dce3f7; }

.discovery-card { padding: 22px; background: linear-gradient(150deg, rgba(108,92,231,.24), rgba(23,31,61,.82) 45%, rgba(20,213,196,.09)); }
.card-topline { margin-bottom: 18px; }
.card-tag, .confidence { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.card-tag { color: var(--sun); }
.confidence { color: var(--green); border: 1px solid rgba(85,201,139,.25); border-radius: 999px; padding: 6px 8px; }
.discovery-card > p { color: var(--muted); }
.mission-box { display: flex; align-items: flex-start; gap: 13px; border-radius: 19px; padding: 16px; background: rgba(5,11,27,.45); border: 1px solid rgba(255,255,255,.08); margin: 18px 0 12px; }
.mission-box p { margin: 4px 0 0; color: var(--ink); line-height: 1.42; }
.mission-box small, .spark-card small { color: var(--mint); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mission-icon { width: 37px; height: 37px; border-radius: 13px; display: grid; place-items: center; background: rgba(20,213,196,.14); color: var(--mint); }
.minimum-copy { color: #d9def1 !important; border-left: 2px solid var(--violet); padding-left: 12px; }
.source-link { display: inline-block; color: #9fafff; font-size: 12px; margin-top: 15px; text-decoration: none; }
.spark-card { display: flex; gap: 14px; align-items: center; padding: 17px 18px; margin: 14px 0; border-radius: 22px; background: linear-gradient(100deg, rgba(255,209,102,.12), rgba(255,123,128,.08)); border: 1px solid rgba(255,209,102,.16); }
.spark-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--sun); background: rgba(255,209,102,.12); }
.spark-card p { margin: 4px 0 0; font-size: 13px; color: #e6e1d1; }

.checkin-card, .world-section { padding: 22px; margin-top: 16px; }
.feedback-card { padding: 20px; margin: 16px 0 110px; border: 1px solid rgba(20,213,196,.18); border-radius: 24px; background: linear-gradient(145deg, rgba(20,213,196,.10), rgba(108,92,231,.10)); }
.feedback-card h3 { margin: 4px 0 8px; }
.feedback-card p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.45; }
.feedback-history { display: grid; gap: 8px; max-height: 210px; overflow: auto; }
.feedback-history article { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.feedback-history small { color: var(--mint); }
.feedback-history p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.section-heading { align-items: flex-end; }
.section-heading > span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.ritual-intro { margin: 10px 0 18px; color: var(--muted); font-size: 13px; }
.habit-tracker { display: grid; gap: 11px; margin-bottom: 20px; }
.habit-mark-card { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(20,213,196,.08), rgba(108,92,231,.10)); }
.habit-mark-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.habit-mark-heading span { color: var(--mint); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .09em; }
.habit-mark-heading strong { font-size: 14px; text-align: right; }
.habit-mark-card p { margin: 10px 0 13px; color: #dce3f7; font-size: 13px; }
.habit-choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.habit-choice-row button { min-height: 49px; border: 1px solid var(--line); border-radius: 13px; padding: 8px 5px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 10px; font-weight: 750; cursor: pointer; }
.habit-choice-row button span { display: block; margin-bottom: 3px; color: var(--sun); font-size: 15px; }
.habit-choice-row button.selected { color: #071614; background: linear-gradient(100deg, var(--mint), #a5f6e9); border-color: transparent; }
.habit-choice-row button.selected span { color: #071614; }
fieldset { border: 0; padding: 0; margin: 21px 0; }
legend { color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button { border: 1px solid var(--line); border-radius: 13px; padding: 11px 0; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; }
.scale button.selected { background: var(--violet); color: white; border-color: transparent; box-shadow: 0 8px 20px rgba(108,92,231,.28); }
.done-row { margin: 8px 0 18px; }
.note-label { display: block; margin-bottom: 16px; }
.note-label > span { display: block; }
.note-label > small { display: block; margin: 5px 0 9px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.positive-note-label { padding: 16px; border: 1px solid rgba(255,209,102,.18); border-radius: 20px; background: linear-gradient(135deg, rgba(255,209,102,.10), rgba(255,123,128,.06)); }
.positive-note-label > span { color: #fff0ba; font-size: 16px; }
.challenge-note-label textarea { min-height: 66px; }
.evidence-note { margin: -3px 0 18px; color: #8691af; font-size: 10px; line-height: 1.5; }
textarea { min-height: 88px; resize: vertical; font-weight: 500; }
.coach-reply { margin-top: 16px; padding: 16px; border-radius: 17px; border: 1px solid rgba(20,213,196,.2); background: rgba(20,213,196,.08); color: #d8fff9; font-size: 14px; line-height: 1.5; }

.text-button { border: 0; background: none; color: var(--mint); cursor: pointer; font-size: 12px; }
.territory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.territory { min-height: 118px; border-radius: 19px; padding: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); display: flex; flex-direction: column; justify-content: space-between; }
.territory.active { background: linear-gradient(145deg, rgba(20,213,196,.18), rgba(108,92,231,.18)); border-color: rgba(20,213,196,.24); }
.territory.preview { opacity: .52; }
.territory-icon { font-size: 22px; color: var(--sun); }
.territory strong { font-size: 13px; line-height: 1.25; }
.territory small { color: var(--muted); font-size: 10px; }
.world-note { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.page-view { padding-top: 12px; }
.page-view > h2 { max-width: 470px; }
.metric-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin: 24px 0 14px; }
.metric-row.metric-three { grid-template-columns: repeat(3, 1fr); }
.metric-row article { min-height: 120px; border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(145deg, rgba(139,120,255,.15), rgba(20,213,196,.06)); }
.metric-row article > span { color: var(--sun); font-size: 20px; margin-bottom: auto; }
.metric-row strong { font-size: 30px; letter-spacing: -.05em; }
.metric-row small { color: var(--muted); margin-top: 4px; }
.badge-grid { display: grid; gap: 10px; margin-top: 18px; }
.badge { display: flex; align-items: center; gap: 13px; border-radius: 18px; padding: 14px; background: rgba(255,255,255,.045); border: 1px solid var(--line); }
.badge > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,209,102,.12); color: var(--sun); font-size: 20px; }
.badge strong { display: block; font-size: 14px; }
.badge small { display: block; color: var(--muted); margin-top: 3px; }
.discovery-grid { display: grid; gap: 12px; }
.library-card { border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: linear-gradient(150deg, rgba(108,92,231,.18), rgba(23,31,61,.78)); }
.library-card .library-top { display: flex; justify-content: space-between; gap: 10px; color: var(--mint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.library-card h3 { font-size: 19px; margin: 12px 0 8px; }
.library-card p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.library-card a { color: #a9b4ff; font-size: 11px; text-decoration: none; }

.profile-dialog { width: min(calc(100% - 26px), 520px); border: 0; padding: 0; border-radius: 28px; color: var(--ink); background: transparent; }
.profile-dialog::backdrop { background: rgba(3,6,15,.78); backdrop-filter: blur(12px); }
.dialog-card { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 28px; background: #131a32; box-shadow: var(--shadow); }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.05); font-size: 22px; cursor: pointer; }
select { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #202944; color: var(--ink); }
.danger-button { width: 100%; border: 1px solid rgba(255,123,128,.28); border-radius: 16px; padding: 14px; color: #ffd6d8; background: rgba(255,123,128,.08); cursor: pointer; font-weight: 750; }

.how-it-works-card { margin: 14px 0 18px; padding: 18px; border: 1px solid rgba(139,120,255,.22); border-radius: 24px; background: linear-gradient(145deg, rgba(139,120,255,.13), rgba(20,213,196,.055)); }
.how-it-works-card .section-heading { align-items: flex-start; gap: 12px; }
.how-it-works-card h3 { font-size: 20px; }
.status-chip { flex: 0 0 auto; max-width: 130px; padding: 7px 10px; border-radius: 999px; color: #fff0ba !important; background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.22); text-align: center; font-size: 10px !important; font-weight: 800; line-height: 1.2; }
.status-chip.complete { color: #c8fff3 !important; background: rgba(20,213,196,.11); border-color: rgba(20,213,196,.24); }
.status-chip.hold { color: #ffd6d8 !important; background: rgba(255,123,128,.10); border-color: rgba(255,123,128,.22); }
.daily-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 17px 0; }
.daily-route-grid article { min-width: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.daily-route-grid article > span { display: block; margin-bottom: 8px; font-size: 20px; }
.daily-route-grid strong { display: block; font-size: 12px; }
.daily-route-grid p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.question-route { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.question-route em { color: #d8fff9; font-style: normal; }
.guide-actions { display: grid; grid-template-columns: 1fr; gap: 4px; }
.guide-actions .secondary-button { margin: 0; }
.dialog-lead { margin: -5px 0 0; color: var(--muted); font-size: 13px; }
.onboarding-dialog { max-height: calc(100vh - 24px); }
.onboarding-card { max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.onboarding-section { margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.025); }
.onboarding-section legend { padding: 0 7px; color: #dbe3ff; font-size: 13px; font-weight: 850; }
.onboarding-section label { display: block; margin-top: 12px; }
.compass-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compass-grid label:last-child { grid-column: 1 / -1; }
.compass-grid input, .time-grid input { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--ink); background: #202944; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.check-grid label { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 11px; border-radius: 14px; background: rgba(255,255,255,.035); color: var(--muted); font-size: 11px; font-weight: 600; }
.check-grid input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--mint); }
.time-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.time-grid label { min-width: 0; font-size: 11px; }
.safety-section { border-color: rgba(255,209,102,.18); background: rgba(255,209,102,.035); }
.onboarding-result { margin: 0; padding: 14px; border: 1px solid rgba(255,123,128,.25); border-radius: 15px; background: rgba(255,123,128,.08); color: #ffe1e2; font-size: 13px; line-height: 1.5; }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px), 530px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: rgba(10,15,30,.9); backdrop-filter: blur(24px); box-shadow: 0 18px 55px rgba(0,0,0,.45); }
.bottom-nav button { border: 0; background: none; color: #8791ad; font-size: 10px; display: grid; gap: 4px; place-items: center; padding: 7px 2px; cursor: pointer; }
.bottom-nav button span { font-size: 18px; }
.bottom-nav button.active { color: var(--mint); }
.toast { position: fixed; left: 50%; bottom: 94px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; border-radius: 14px; background: #f8f9ff; color: #151b33; padding: 12px 16px; font-size: 13px; font-weight: 750; transition: .25s ease; z-index: 20; box-shadow: var(--shadow); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { .daily-route-grid { grid-template-columns: 1fr; } .daily-route-grid article { display: grid; grid-template-columns: 32px 1fr; } .daily-route-grid article > span { grid-row: 1 / span 2; } .daily-route-grid p { grid-column: 2; } .compass-grid, .check-grid { grid-template-columns: 1fr; } .compass-grid label:last-child { grid-column: auto; } }
@media (max-width: 360px) { .territory-grid { grid-template-columns: 1fr; } .metric-row.metric-three, .time-grid { grid-template-columns: 1fr; } h2 { font-size: 33px; } .confidence { display: none; } }
