/* Colour refresh, scoped to the authenticated app. No layout or copy replacement. */
:root{--money:#0f8a80;--productivity:#5258d6;--fitness:#e5603f;--neutral:#8e8e93;--gain:#1f8a57;--loss:#b4506e}
:root[data-section]{--bg:#f5f5f7;--side:rgba(245,245,247,.82);--card:#fff;--ink:#202126;--muted:#62656d;--line:rgba(30,40,50,.12);--card-line:rgba(30,40,50,.1);--teal:#0f8a80;--primary-ink:#fff;--primary-hover:#0b7068;--active:rgba(15,138,128,.12);--active-ink:#08665f;--soft:#e7f2ef;--shadow:0 4px 22px rgba(24,39,52,.035);--pillar:var(--neutral)}
:root[data-section=money]{--bg:#f1f8f6;--side:rgba(230,244,240,.82);--pillar:var(--money)}
:root[data-section=productivity]{--bg:#f3f4fe;--side:rgba(236,238,253,.8);--teal:#4a50cf;--primary-hover:#383eb2;--active:rgba(74,80,207,.12);--active-ink:#3238a8;--soft:#ecedfb;--pillar:var(--productivity)}
:root[data-section=fitness]{--bg:#fdf6f2;--side:rgba(251,238,231,.82);--teal:#d24f31;--primary-hover:#ca4029;--primary-ink:#301008;--active:rgba(229,87,63,.13);--active-ink:#a8381c;--soft:#f9e9e1;--pillar:var(--fitness)}
[data-pillar=money]{--pillar:var(--money)}[data-pillar=productivity]{--pillar:var(--productivity)}[data-pillar=fitness]{--pillar:var(--fitness)}[data-pillar=neutral]{--pillar:var(--neutral)}
:root[data-theme=dark][data-section]{--bg:#090d13;--side:rgba(13,18,26,.8);--card:#111821;--line:rgba(255,255,255,.07);--card-line:rgba(255,255,255,.07);--ink:#f2f5f9;--muted:#98a3b3;--teal:#5fe0d2;--primary-hover:#8ff0e5;--primary-ink:#04201d;--active:rgba(95,224,210,.12);--active-ink:#8ff0e5;--soft:#162a2d;--money:#4fd1c5;--productivity:#8f8cff;--fitness:#ffb547;--gain:#65d49b;--loss:#ed9ab4;--shadow:0 4px 24px #0002}
.native-shell{font-family:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI Variable','Segoe UI',sans-serif}
.native-shell .sidebar{background:var(--side);backdrop-filter:blur(22px);border-right:1px solid var(--line)}
.native-shell .card{border:1px solid var(--card-line);border-radius:20px;box-shadow:var(--shadow);background:var(--card)}
.native-shell button,dialog button{border-radius:999px}.native-shell button.primary{background:var(--teal);color:var(--primary-ink)}
:root[data-section=fitness]:not([data-theme=dark]) .native-shell button.primary{background:#e8553d;border-color:#e8553d}
:root[data-section=fitness]:not([data-theme=dark]) .native-shell button.primary:hover{background:#f17862}
.native-shell .nav button.active,.native-shell .primary-navigation button[aria-current=page]{background:var(--active);color:var(--active-ink)}
.native-shell .primary-navigation button,.native-shell .nav button,.area-shortcuts button{display:flex;align-items:center;gap:10px}
.colour-icon,.native-shell .nav .sym.colour-icon{width:24px;height:24px;flex:0 0 24px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;background:var(--tile,var(--pillar));color:#fff;font-size:15px;line-height:1;margin:0;font-weight:650}
:root[data-theme=dark] .colour-icon{color:#09131a}
.native-shell .nav-group>summary{color:var(--active-ink)}
.native-shell #content .card[data-pillar] h2{color:color-mix(in srgb,var(--pillar) 78%,var(--ink))}
.area-shortcuts button{background:var(--card);border:1px solid var(--card-line);min-height:44px}
.colour-tools{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px!important}.colour-tools article{min-width:0;background:var(--bg);border-radius:16px;padding:14px}.colour-tools article>h3,.colour-tools article>p{margin-top:0}.colour-tool{display:flex;align-items:center;gap:12px;width:100%;min-width:0;min-height:78px;background:color-mix(in srgb,var(--ink) 4%,var(--card))!important;color:var(--ink)!important;border:1px solid var(--card-line);border-radius:16px!important;text-align:left;padding:14px!important;white-space:normal}
.colour-tool:hover{box-shadow:0 5px 15px #00000007}.tool-icon{width:34px;height:34px;flex-basis:34px;border-radius:10px;font-size:20px}.tool-copy{flex:1;min-width:0}.tool-copy>span{display:block;font-weight:650}.tool-copy small{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:5px}.tool-chevron{font-size:24px;color:var(--muted);transition:transform .2s}.colour-tool:hover .tool-chevron{transform:translateX(3px)}
.native-shell .chart polyline{stroke:var(--pillar)}.native-shell .chart circle{fill:var(--pillar)}.native-shell .bars div{background:color-mix(in srgb,var(--pillar) 70%,transparent)}.native-shell .cal-event{background:color-mix(in srgb,var(--pillar) 14%,var(--card));color:color-mix(in srgb,var(--pillar) 72%,var(--ink));border-left:3px solid var(--pillar)}
.weekly-progress{display:grid;grid-template-columns:180px minmax(0,1fr);align-items:center;gap:28px}.weekly-progress h2{margin:8px 0 20px}.weekly-rings{width:180px;height:180px;overflow:visible}.weekly-rings circle{fill:none;stroke:var(--pillar);stroke-width:11}.ring-track{opacity:.14}.ring-value{stroke-linecap:round;transform:rotate(-90deg);transform-origin:90px 90px;animation:colour-ring 1.1s cubic-bezier(.22,1,.36,1) both}.ring-legend{display:grid;gap:12px}.ring-legend>div{display:flex;align-items:center;gap:9px;font-size:13px}.ring-legend i{width:8px;height:8px;border-radius:50%;background:var(--pillar);flex-shrink:0}.ring-legend strong{margin-left:auto;white-space:nowrap;font-variant-numeric:tabular-nums}.weekly-progress .small{font-size:11px;line-height:1.5;color:var(--muted)}
.native-shell .first-step-gold{background:linear-gradient(135deg,#fffaf0,#fff3d9);border:1px solid #f3dca2;box-shadow:0 8px 36px #eaa41615;display:flex;gap:20px;color:#342916}.first-step-gold .eyebrow{color:#9a6700}.first-step-gold .small{color:#705528}.gold-tick{width:48px;height:48px;border-radius:50%;background:linear-gradient(135deg,#ffd66b,#eaa416);display:grid;place-items:center;flex-shrink:0;font-size:24px;color:#5a3900}.native-shell .milestone-next{background:#24272d;color:#fff;border-color:#24272d}.native-shell .first-step-gold [data-colour-dismiss]{background:transparent;color:#594315;border-color:#b49b68}.setup-segments{display:flex;gap:5px;margin-top:18px;max-width:340px}.setup-segments span{height:5px;flex:1;background:#f3e6c4;border-radius:4px}.setup-segments .filled{background:#e9a51c}
.market-pill{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:99px;font-size:12px;font-weight:650;white-space:nowrap}.market-gain{color:var(--gain);background:color-mix(in srgb,var(--gain) 11%,transparent)}.market-loss{color:var(--loss);background:color-mix(in srgb,var(--loss) 11%,transparent)}.colour-sparkline{display:block;width:220px;max-width:100%;height:38px;margin:8px 0;color:var(--money)}
.native-shell .colour-record{background:linear-gradient(180deg,color-mix(in srgb,var(--record-colour) 7%,var(--card)),var(--card) 70%);position:relative}.colour-record>.card-head h2{color:color-mix(in srgb,var(--record-colour) 58%,var(--ink))}.colour-record .progress{background:color-mix(in srgb,var(--record-colour) 14%,transparent)}.colour-record .progress>div{background:var(--record-colour)}.colour-record progress{accent-color:var(--record-colour)!important}.colour-share{height:6px;background:color-mix(in srgb,var(--record-colour) 14%,transparent);border-radius:9px;overflow:hidden;margin-top:18px}.colour-share span{display:block;background:var(--record-colour);height:100%;transform-origin:left;animation:colour-bar .9s cubic-bezier(.22,1,.36,1)}.colour-swatches{display:flex;justify-content:flex-end;gap:0;margin:10px -6px -6px 0}.native-shell .colour-swatches button{background:transparent;border:0;width:32px;height:32px;min-height:32px;padding:8px;position:relative}.colour-swatches button:before{content:'';display:block;width:16px;height:16px;border-radius:50%;background:var(--swatch)}.colour-swatches button[aria-pressed=true]:before{outline:2px solid var(--ink);outline-offset:3px}.account-stack{display:flex;height:8px;border-radius:9px;overflow:hidden;margin-top:18px;background:var(--line)}.account-stack span{height:100%;transform-origin:left;animation:colour-bar .9s cubic-bezier(.22,1,.36,1)}
.colour-enter{animation:colour-rise .9s cubic-bezier(.22,1,.36,1) both;animation-delay:var(--stagger,0ms)}@keyframes colour-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes colour-ring{from{stroke-dashoffset:100}to{stroke-dashoffset:var(--ring-offset)}}@keyframes colour-bar{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(max-width:650px){.weekly-progress{grid-template-columns:1fr;gap:12px}.weekly-rings{justify-self:center;width:156px;height:156px}.colour-tools{grid-template-columns:1fr}.ring-legend>div{flex-wrap:wrap}.native-shell .first-step-gold{gap:12px}.first-step-gold h2{font-size:19px}.colour-swatches button{width:36px;height:36px;padding:10px}.ring-legend strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Readable text variants retain the approved colours for decorative fills. */
:root[data-section=money],:root[data-section=neutral]{--teal:#0c776f;--primary-hover:#09665f}
:root[data-theme=dark][data-section]{--teal:#5fe0d2;--primary-hover:#8ff0e5}
.native-shell button.link{color:var(--active-ink)}
.market-gain{color:#176d44}.market-loss{color:#a0425e}
:root[data-theme=dark] .market-gain{color:#65d49b}:root[data-theme=dark] .market-loss{color:#ed9ab4}
.first-step-gold .eyebrow{background:#fffaf0;width:fit-content}
/* Explicit foregrounds prevent headings and bold values inheriting black in dark mode. */
:root[data-theme=dark] .native-shell h1,
:root[data-theme=dark] .native-shell h2,
:root[data-theme=dark] .native-shell h3,
:root[data-theme=dark] .native-shell h4,
:root[data-theme=dark] .native-shell strong,
:root[data-theme=dark] .native-shell b,
:root[data-theme=dark] .native-shell .metric-value,
:root[data-theme=dark] .native-shell .ring-legend strong{color:#f2f5f9}
:root[data-theme=dark] .native-shell .colour-record>.card-head h2{color:color-mix(in srgb,var(--record-colour) 58%,#f2f5f9)}
:root[data-theme=dark] .native-shell .first-step-gold h2,
:root[data-theme=dark] .native-shell .first-step-gold strong,
:root[data-theme=dark] .native-shell .first-step-gold b{color:#342916}
/* Shared dark foregrounds across every section, table, label and disclosure. */
:root[data-theme=dark] .native-shell :where(h1,h2,h3,h4,h5,h6,p,span,strong,b,label,legend,summary,dt,dd,li,td,th,a,.metric-label,.metric-value,.row){color:#f2f5f9}
:root[data-theme=dark] .native-shell :where(.small,.subtitle,.metric-note,small,.native-date,.native-note){color:#98a3b3}
:root[data-theme=dark] .native-shell :where(input,select,textarea){color:#f2f5f9;background-color:#111821}
:root[data-theme=dark] .native-shell input::placeholder,
:root[data-theme=dark] .native-shell textarea::placeholder{color:#98a3b3;opacity:1}
:root[data-theme=dark] .native-shell .eyebrow{color:#8ff0e5}
:root[data-theme=dark] .native-shell .colour-icon,
:root[data-theme=dark] .native-shell .nav .sym.colour-icon{color:#09131a}
:root[data-theme=dark] .native-shell .market-gain,
:root[data-theme=dark] .native-shell .market-gain span{color:#65d49b}
:root[data-theme=dark] .native-shell .market-loss,
:root[data-theme=dark] .native-shell .market-loss span{color:#ed9ab4}
:root[data-theme=dark] .native-shell .first-step-gold :where(h1,h2,h3,p,span,strong,b,label,small){color:#342916}
:root[data-theme=dark] .native-shell .first-step-gold .eyebrow{color:#9a6700}
:root[data-theme=dark] .native-shell .first-step-gold .small{color:#705528}
:root[data-theme=dark] .native-shell button.primary,
:root[data-theme=dark] .native-shell button.primary span{color:#04201d}
:root[data-theme=dark] .native-shell .milestone-next,
:root[data-theme=dark] .native-shell .milestone-next span{color:#fff}
/* Regional date formatting stays automatic; omit the locale picker from setup UI. */
.native-shell label.native-input:has(> #setup-locale),
.native-shell label.native-input:has(> #guided-locale){display:none}

/* App footer follows the chosen appearance, independent of the OS theme. */
:root[data-theme] .native-shell .public-footer{background:var(--card);color:var(--muted);border-color:var(--line);border-radius:20px}
:root[data-theme] .native-shell .public-footer a{color:var(--active-ink,var(--teal))}
:root[data-theme] .native-shell .public-footer p{color:var(--muted)}
:root[data-theme] .native-shell .public-footer a:focus-visible{outline-color:var(--teal)}

.weekly-goals-controls{display:flex;flex-wrap:wrap;align-items:center;gap:16px;margin-top:-4px;margin-bottom:8px}.weekly-goals-prompt{display:flex;align-items:center;justify-content:space-between;gap:20px;flex:1 1 420px;padding:18px 22px;background:var(--card);border:1px solid var(--line);border-radius:20px}.weekly-goals-prompt p{margin:5px 0 0}.weekly-goals-controls>button{flex-shrink:0}@media(max-width:600px){.weekly-goals-prompt{align-items:flex-start;flex-direction:column;gap:12px}.weekly-goals-controls>button{width:100%}}

/* Keep overview progress visible immediately; redraws must not restart rings. */
html[data-section="neutral"] .weekly-rings .ring-value{animation:none;transition:stroke-dashoffset .25s ease}
@supports(content-visibility:auto){
 html[data-overview="true"] #content .grid.two>.card{content-visibility:auto;contain-intrinsic-block-size:auto 280px}
}
@media(prefers-reduced-motion:reduce){.weekly-rings .ring-value{transition:none!important}}
