/* Theme owns every reading surface; atmosphere never owns text contrast. */
html[data-theme=dark]{--page:#111113;--panel:#202023;--input:#171719;--text-primary:#f5f5f5;--text-secondary:#ccccd0;--text-detail:#b9b9bf;--surface-line:#606066;--accent:#dedee2;--control-surface:#2b2b30;--control-text:#f5f5f5;--ink:#f5f5f5;--muted:#ccccd0;--readable-panel:#202023;--readable-input:#171719;--readable-muted:#ccccd0;--readable-border:#606066}
html[data-theme=light]{--page:#f7f7f5;--panel:#fdfdfc;--input:#efefed;--text-primary:#19191c;--text-secondary:#49494f;--text-detail:#55555c;--surface-line:#929298;--accent:#35353a;--control-surface:#e9e9e7;--control-text:#19191c;--ink:#19191c;--muted:#49494f;--readable-panel:#fdfdfc;--readable-input:#efefed;--readable-muted:#49494f;--readable-border:#929298}
html[data-theme] body,html[data-theme] body.experience,html[data-theme] body.portal-view{background:var(--page)!important;color:var(--text-primary)!important}
html[data-theme] .living-background{opacity:.22;pointer-events:none}html[data-theme] #atmosphere{opacity:.12}html[data-theme] .portal-ambient{opacity:.25}
html[data-theme] :is(.flow-section,.after-scene,.home-collection,.coach-shell,.collection-world){background-color:var(--page)!important;color:var(--text-primary)!important}
html[data-theme] :is(main,.coach-shell,dialog,.recorded-menu) :is(h1,h2,h3,h4,h1 em,h2 em,h3 em,strong){color:var(--text-primary)!important}
html[data-theme] :is(main,.coach-shell,dialog,.recorded-menu) :is(p,small,label,.eyebrow,.small,.notice,.empty,.voice-status,.coach-footnote,.text-btn){color:var(--text-secondary)!important;opacity:1!important}
html[data-theme] :is(.glass,.card,.memory-panel){background:var(--panel)!important;color:var(--text-primary)!important;border:1px solid var(--surface-line)!important;box-shadow:0 4px 18px #00000006!important;backdrop-filter:none!important}
html[data-theme] :is(.round-control,.circle,.profile,.period-control,.period-control button,.tag){color:var(--control-text)!important;background:var(--control-surface)!important;border-color:var(--surface-line)!important}
html[data-theme] .period-control button.selected{background:var(--text-primary)!important;color:var(--page)!important}
html[data-theme] .pill.light{background:var(--text-primary)!important;color:var(--page)!important}
.flow-inner{will-change:auto}.flow-section{scroll-margin-top:32px}
html[data-theme=light] .scroll-stage{background:var(--page)!important}
html[data-theme] .coach-shell{background:radial-gradient(ellipse at 75% 35%,#9fa1aa20,transparent 60%),var(--page)!important;overflow:visible;min-height:100svh}
html[data-theme] .coach-layout{height:auto;min-height:100svh;max-width:1160px;margin:auto;padding:96px 32px 48px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:40px;align-items:center}
html[data-theme] .conversation{width:100%;max-width:none;max-height:none;order:1}
html[data-theme] .coach-layout>.liquid-orb{order:2;width:min(36vw,420px);height:min(36vw,420px);margin:0;position:relative;inset:auto;transform:none}
html[data-theme] .conversation-bottom{padding:24px;border-radius:24px;border:1px solid var(--surface-line);background:var(--panel)!important;gap:14px}
html[data-theme] .conversation-log{max-height:36svh;min-height:0;padding:8px 0;margin-bottom:16px;justify-content:normal}
html[data-theme] .bubble{background:var(--panel)!important;color:var(--text-primary)!important;box-shadow:none;border:1px solid var(--surface-line);padding:16px 18px;font-size:15px;max-width:94%}
html[data-theme] .bubble.mine{background:var(--control-surface)!important;color:var(--control-text)!important}
html[data-theme] .coach-input{background:var(--input)!important;border:1px solid var(--surface-line)!important;border-radius:16px;box-shadow:none;padding:4px 8px;min-height:54px}
html[data-theme] .coach-input input{border:0!important;background:transparent!important;min-width:0;padding:12px 8px}
html[data-theme] .coach-input button{color:var(--text-primary)!important;min-width:44px;min-height:44px}
.coach-open .global-experience-controls{display:none!important}.coach-footnote{margin:0}.voice-sharing{margin:0 0 14px;align-items:flex-start}.voice-sharing input{margin-top:3px}.voice-controls{margin:0;gap:8px}
html[data-theme] .portal-heading{padding:28px 0;margin-bottom:20px}.portal-heading h1{max-width:24ch!important;font-size:clamp(32px,4vw,56px)!important;margin:16px 0!important}.portal-heading p{margin-bottom:0}
html[data-theme] .portal-main .glass{padding:24px;border-radius:20px;min-width:0}.portal-two{gap:20px!important;margin:20px 0!important}.portal-main :is(h2,h3){font-size:clamp(22px,2.4vw,32px)!important;line-height:1.2!important;text-transform:none!important;letter-spacing:-.02em!important;margin:14px 0}
.stat-grid{gap:12px!important;margin:20px 0!important}.stat-tile{min-height:160px!important}.stat-tile>span{color:var(--text-secondary)!important;letter-spacing:.08em;font-size:10px!important}.stat-tile>strong{font-size:48px!important;font-variant-numeric:tabular-nums;line-height:1.1}.stat-tile>strong small{font-size:16px!important}.stat-tile p{margin-bottom:0;font-size:13px!important}
.north-star{gap:20px!important;align-items:center}.north-star h2{max-width:24ch}.progress-ring{width:124px!important;height:124px!important;flex-shrink:0;background:conic-gradient(var(--accent) calc(var(--value)*1%),var(--surface-line) 0)!important;padding:5px!important;box-shadow:none!important}.progress-ring>div{background:var(--panel)!important;width:100%;height:100%;box-shadow:none!important}.progress-ring strong{font-size:32px!important}.progress-ring span{color:var(--text-secondary)!important;font-size:9px!important}
.chart-card{min-height:0!important}.chart-empty{padding:16px 0!important;min-height:0!important}.chart-empty p{font-size:14px!important;margin:12px 0}.chart-empty .empty-wave{display:none}.energy-chart{height:170px}.energy-column i,.bar i{background:var(--accent)!important}.chart-lines,.energy-column small,.milestone small{color:var(--text-secondary)!important}.task{padding:16px 0!important;border-color:var(--surface-line)!important}.task label{font-size:15px;line-height:1.5}.task input{accent-color:var(--accent);width:20px;height:20px;flex-shrink:0}.empty{padding:18px 0!important}.milestone-track{margin:20px 0!important}.memory-panel{margin:24px 0!important;padding:24px!important}.memory-panel h2{font-size:26px!important}.toolbar{gap:16px;flex-wrap:wrap}.row{gap:12px}.portal-footer{margin-top:40px!important}.portal-main{padding-bottom:calc(110px + env(safe-area-inset-bottom))!important}nav{bottom:calc(12px + env(safe-area-inset-bottom))!important}nav button{min-height:52px!important}
@media(max-width:650px){html[data-theme] .coach-layout{display:flex;flex-direction:column;gap:4px;padding:76px 18px 36px;min-height:100svh}.coach-layout>.liquid-orb{order:0!important;width:190px!important;height:190px!important;flex-shrink:0}.conversation{order:1!important}.conversation-bottom{padding:18px!important}.coach-top{top:18px;right:18px}.coach-shell .preview-label{position:relative;bottom:auto;padding:0 18px 24px}.coach-footnote{font-size:12px!important}.portal-heading h1{font-size:34px!important;line-height:1.08!important}.portal-main .glass{padding:20px!important}.portal-two{grid-template-columns:1fr!important}.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.stat-tile{padding:18px!important;min-height:148px!important}.stat-tile>strong{font-size:38px!important}.north-star{display:flex!important;flex-wrap:wrap}.north-star>div:first-child{flex:1;min-width:180px}.progress-ring{width:100px!important;height:100px!important}.portal-main h2,.portal-main h3{font-size:25px!important}.global-experience-controls{position:absolute!important;top:22px!important}.portal-view>header{padding-right:105px}.portal-heading{padding-top:22px!important}.period-control{width:max-content;max-width:100%}.chart-card .row{align-items:flex-start}.chart-card .text-btn{white-space:nowrap}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}.flow-inner{transform:none!important}}
html[data-theme] body.portal-view .portal-main .glass{background:var(--panel)!important;border-color:var(--surface-line)!important;box-shadow:0 4px 18px #00000006!important}
html[data-theme] body.portal-view .portal-main .glass:after{display:none!important}
html[data-theme] body.portal-view .portal-main :is(h2,h3){font-size:clamp(22px,2.4vw,32px)!important;text-transform:none!important}
html[data-theme] .global-experience-controls{top:22px!important;right:76px!important}
html[data-theme] .portal-main .portal-heading>p{text-transform:none!important;font-family:Garnet,sans-serif!important}
html[data-theme] .portal-main .stat-tile p{font-size:13px!important}
html[data-theme] .portal-main .milestone>span{color:var(--text-primary)!important;background:var(--control-surface)!important}
html[data-theme=light] .portal-view .living-background{opacity:.09!important}
html[data-theme=light] .portal-view #atmosphere{opacity:.04!important}
