:root[data-theme=sakura]{--bg:#210f19;--card:#321b28;--ink:#fff0f4;--mut:#e0b8c6;--line:#704254;--in:#73e2b6;--out:#ff829a;--nav:#401c30;--pop:#f4a1b9;--theme-accent:#a92b50;color-scheme:dark}
:root[data-theme=sakura] .hero{background:radial-gradient(ellipse at 100% 0,#a92b50,transparent 70%),linear-gradient(130deg,#391321,#691e39)}
:root[data-theme=sakura] .brand span,:root[data-theme=sakura] #nav button:not(#n-add).on{color:#ff9ab7}
:root[data-theme=sakura] .btn:not(.sec):not(.del){background:var(--theme-accent);color:#fff}
:root[data-theme=sakura] #nav{background:var(--card)}
:root[data-theme=sakura] #nav .on:not(#n-add){background:#54243b}
#theme-effects{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
#app,.top{position:relative;z-index:1}
#theme-effects i{position:absolute;left:var(--x);top:-20px;width:8px;height:13px;border-radius:85% 0 85% 35%;background:#f47b9c;opacity:.45;animation:theme-petal var(--duration) var(--delay) linear infinite}
@keyframes theme-petal{to{transform:translate(-45px,105vh) rotate(330deg)}}
@media(prefers-reduced-motion:reduce){#theme-effects{display:none}}
:root[data-motion=off] #theme-effects{display:none}
#theme-dialog{position:fixed;inset:0;margin:auto;width:min(92vw,440px);max-height:85dvh;overflow:auto;padding:20px;border:1px solid var(--line);border-radius:22px;background:var(--card);color:var(--ink)}
#theme-dialog::backdrop{background:#0007}
#theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}
.theme-choice{display:grid;gap:5px;text-align:left;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);min-width:0}
.theme-choice[aria-pressed=true]{outline:2px solid var(--in);outline-offset:1px}
.theme-choice small{color:var(--mut)}
.theme-sample{display:grid;gap:5px;padding:10px;border-radius:8px;aspect-ratio:1.6;border:1px solid var(--line)}
.theme-sample i{display:block;background:var(--sample-accent);border-radius:4px;opacity:.8}.theme-sample i:nth-child(2){width:70%}.theme-sample i:nth-child(3){width:85%;opacity:.5}
#theme-save:disabled{opacity:.5;cursor:not-allowed}

/* Crimson Sakura edition: scoped, never changes account artwork. */
:root[data-theme=sakura]{--bg:#190c16;--card:#301923;--ink:#fff1f4;--mut:#e6b9c8;--line:#754052;--nav:#391522;--pop:#ffafc1;--theme-accent:#a92348}
:root[data-theme=sakura] body{background:radial-gradient(ellipse at 95% 5%,#70203b66,transparent 45%),linear-gradient(155deg,#190c16,#2c1020 65%,#190c16);background-attachment:fixed}
:root[data-theme=sakura] .hero{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(105deg,#38101f 15%,#651b35 72%,#8c2948);border:1px solid #a84a65;box-shadow:0 8px 25px #09040888;padding-right:100px}
:root[data-theme=sakura] .hero::after{content:'';position:absolute;right:8px;bottom:5px;width:86px;height:108px;background:url('../themes/sakura-mascot.png') center bottom/contain no-repeat;pointer-events:none;z-index:-1}
:root[data-theme=sakura] .hero .meta{color:#ffe1e9;overflow-wrap:anywhere}
:root[data-theme=sakura] .card:not(.account-card),:root[data-theme=sakura] .tot{box-shadow:0 5px 18px #10050b44}
:root[data-theme=sakura] #nav{border:1px solid #a84a65;background:#391522;box-shadow:0 5px 22px #10050b99}
:root[data-theme=sakura] #nav button{color:#edb6c8}
:root[data-theme=sakura] #nav #n-add{background:#a92348;color:white}
:root[data-theme=sakura] #nav .on:not(#n-add){background:#70243e;color:#fff0f4}
:root[data-theme=sakura] #theme-dialog{border-color:#a84a65;background:linear-gradient(150deg,#421c30,#28131e)}
:root[data-theme=sakura] .theme-choice[aria-pressed=true]{outline-color:#ff9ab7}
.theme-choice[data-theme-id=sakura] .theme-sample{background:linear-gradient(120deg,#210f19,#8c2948)!important;position:relative;overflow:hidden;padding-right:38%}
.theme-choice[data-theme-id=sakura] .theme-sample::after{content:'';position:absolute;right:3px;bottom:2px;width:40%;height:90%;background:url('../themes/sakura-mascot.png') center bottom/contain no-repeat}
:root[data-theme=sakura] #theme-effects i{width:var(--size,9px);height:calc(var(--size,9px)*1.5);background:linear-gradient(135deg,#ff9ab7,#c32c52 70%,#8f1537);opacity:.65;animation-name:sakura-drift}
@keyframes sakura-drift{0%{transform:translate3d(0,-20px,0) rotate(0deg)}50%{transform:translate3d(35px,52vh,0) rotate(155deg)}100%{transform:translate3d(-30px,108vh,0) rotate(340deg)}}
:root[data-theme=sakura][data-motion=on] .hero::after{animation:sakura-float 4s ease-in-out infinite}
:root[data-theme=sakura][data-motion=on] #nav .on svg{animation:sakura-icon .45s ease-out}
@keyframes sakura-float{50%{transform:translateY(-4px)}}
@keyframes sakura-icon{50%{transform:translateY(-3px) scale(1.08)}}
:root[data-motion=off] .hero::after,:root[data-motion=off] #nav svg{animation:none!important}
@media(max-width:350px){:root[data-theme=sakura] .hero{padding-right:75px}:root[data-theme=sakura] .hero::after{width:65px;height:85px}}
@media print{#theme-effects{display:none!important}}

/* 2.9.2: theme chrome and transparent mascot */
:root[data-theme=sakura]{background:#190c16;--theme-link:#ff9ab7;accent-color:#d64b76}
:root[data-theme=sakura] #dock{background:#391522;border-color:var(--line)}
:root[data-theme=sakura] #nav #n-add svg{background:#d13b65;color:#fff}
:root[data-theme=sakura] .section-head button,:root[data-theme=sakura] .hub-tabs button.on,:root[data-theme=sakura] #nav button:not(#n-add).on{color:var(--theme-link)}
:root[data-theme=sakura] .card-art-filter[aria-pressed=true],:root[data-theme=sakura] .card-art-choice[aria-pressed=true]::after{background:#a92348;border-color:#a92348;color:#fff}
:root[data-theme=sakura] .card-art-choice[aria-pressed=true]{border-color:#ff9ab7}
:root[data-theme=sakura] .hero{padding-right:clamp(90px,29%,150px)}
:root[data-theme=sakura] .hero::after{width:clamp(80px,28%,145px);height:145px;right:5px;bottom:5px}
:root[data-theme=sakura] .hero-label{color:#ffe1e9}
@media(prefers-reduced-motion:reduce){:root[data-theme=sakura] .hero::after,:root[data-theme=sakura] #nav svg{animation:none!important}}

/* 2.9.3: one viewport-wide background, independent of content height. */
:root[data-theme=sakura]{min-height:100%;background:#190c16 radial-gradient(ellipse at 95% 5%,#70203b66,transparent 45%) fixed;background-size:100% 100%;}
:root[data-theme=sakura] body{min-height:100vh;min-height:100dvh;background:transparent;}
:root[data-theme=sakura] #app{background:transparent;}

/* Neon Cyberpunk: full viewport, luminous panels, independent account artwork. */
:root[data-theme=cyber]{--bg:#090e25;--card:#131932;--ink:#f0f5ff;--mut:#b8c7e8;--line:#67539b;--in:#66f5d8;--out:#ff85bd;--nav:#10152e;--pop:#63eaff;--theme-accent:#18d7f5;color-scheme:dark;accent-color:#18d7f5;min-height:100%;background:#090e25}
:root[data-theme=cyber] body{min-height:100vh;min-height:100dvh;background:transparent}
:root[data-theme=cyber] body::before{content:'';position:fixed;inset:0;pointer-events:none;background:linear-gradient(180deg,#090e25b8,#090e25e8 65%,#090e25b8),url('../themes/cyber-city.webp') center/cover no-repeat;z-index:-1}
:root[data-theme=cyber] #app{background:transparent}
:root[data-theme=cyber] .hero{position:relative;isolation:isolate;overflow:visible;margin-top:28px;min-height:150px;padding:22px clamp(104px,35%,165px) 20px 18px;background:linear-gradient(120deg,#26143e,#101d39 65%,#34164c);border:1px solid #5feaff;border-radius:12px;box-shadow:0 0 12px #00d9ff77,inset 0 0 18px #e43aff33,0 0 22px #ed39ff44}
:root[data-theme=cyber] .hero::after{content:'';position:absolute;right:0;bottom:0;width:clamp(112px,39%,185px);height:calc(100% + 35px);background:url('../themes/cyber-mascot.webp') right bottom/contain no-repeat;pointer-events:none;z-index:-1;filter:drop-shadow(0 0 7px #d83aff66)}
:root[data-theme=cyber] .hero strong{font-size:clamp(1.15rem,5.5vw,1.9rem);overflow-wrap:anywhere}
:root[data-theme=cyber] .hero .meta{overflow-wrap:anywhere;color:#dce7ff}
:root[data-theme=cyber] .hero-label{color:#c3d9ff}
:root[data-theme=cyber] .brand span,:root[data-theme=cyber] .section-head button,:root[data-theme=cyber] .hub-tabs button.on{color:#63eaff}
:root[data-theme=cyber] .card:not(.account-card),:root[data-theme=cyber] #sum,:root[data-theme=cyber] #theme-dialog{background:linear-gradient(135deg,#211634ed,#101b35f5);border:1px solid #7761a8;border-radius:12px;box-shadow:0 0 10px #a337ed22}
:root[data-theme=cyber] #dock{background:#090e25;border-color:#65519a}
:root[data-theme=cyber] #nav{background:#10152e;border:1px solid #8559c7;box-shadow:0 0 14px #c52bff55;border-radius:12px}
:root[data-theme=cyber] #nav button{color:#c4c9f5}
:root[data-theme=cyber] #nav .on:not(#n-add){background:#352052;color:#6ceaff;box-shadow:inset 0 0 10px #d93bff77}
:root[data-theme=cyber] #nav #n-add{background:#372052;color:#fff}
:root[data-theme=cyber] #nav #n-add svg{background:#087b9e;color:white;box-shadow:0 0 12px #00eaff}
:root[data-theme=cyber] .btn:not(.sec):not(.del){background:#146d92;color:white}
:root[data-theme=cyber] .card-art-filter[aria-pressed=true],:root[data-theme=cyber] .card-art-choice[aria-pressed=true]::after{background:#146d92;border-color:#63eaff;color:white}
:root[data-theme=cyber] #theme-effects i{width:1px;height:55px;border-radius:0;background:linear-gradient(transparent,#68eaff);opacity:.45;animation:cyber-rain calc(var(--duration)/3) var(--delay) linear infinite}
@keyframes cyber-rain{from{transform:translateY(-70px)}to{transform:translateY(110vh)}}
:root[data-theme=cyber][data-motion=on] .hero::after{animation:sakura-float 4s ease-in-out infinite}
:root[data-theme=cyber][data-motion=on] #nav .on svg{animation:sakura-icon .45s ease-out}
.theme-choice[data-theme-id=cyber] .theme-sample{position:relative;background:linear-gradient(120deg,#090e25,#39205c)!important;padding-right:40%;overflow:hidden}
.theme-choice[data-theme-id=cyber] .theme-sample::after{content:'';position:absolute;right:0;bottom:0;width:48%;height:100%;background:url('../themes/cyber-mascot.webp') right bottom/contain no-repeat}
@media(prefers-reduced-motion:reduce){:root[data-theme=cyber] .hero::after,:root[data-theme=cyber] #nav svg{animation:none!important}}
:root[data-theme=cyber] body{isolation:isolate}

/* 2.9.5: angular neon hardware, separate frame and unclipped mascot. */
:root[data-theme=cyber]{--cyber-cut:polygon(15px 0,100% 0,100% calc(100% - 15px),calc(100% - 15px) 100%,0 100%,0 15px)}
:root[data-theme=cyber] body::before{background:linear-gradient(180deg,#090e2555,#090e2599 65%,#090e2566),url('../themes/cyber-city.webp') center/cover no-repeat}
:root[data-theme=cyber] .hero{margin-top:52px;min-height:168px;padding:24px 39% 20px 16px;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;filter:drop-shadow(0 0 7px #25dfff88)}
:root[data-theme=cyber] .hero::before{content:'';position:absolute;inset:0;z-index:-2;clip-path:var(--cyber-cut);background:linear-gradient(135deg,#fa39ee 0%,#763fff 25%,#27eaff 52%,#ed39ff 85%);}
:root[data-theme=cyber] .hero{background:linear-gradient(120deg,#211332,#101d39);background-clip:content-box}
:root[data-theme=cyber] .hero::before{background:linear-gradient(125deg,#20132f,#101c36 65%,#291339) padding-box,linear-gradient(135deg,#ff42e9,#32eaff,#fa39ee) border-box;border:2px solid transparent}
:root[data-theme=cyber] .hero::after{width:43%;height:auto;aspect-ratio:1.36;bottom:7px;right:-2px;background-size:100% 100%;z-index:-1;transform:scale(1.35);transform-origin:right bottom}
:root[data-theme=cyber] .hero strong{font-size:clamp(1.1rem,5.2vw,1.9rem)}
:root[data-theme=cyber] .hero .meta{font-size:.76rem;max-width:94%}
:root[data-theme=cyber] .top #profile,:root[data-theme=cyber] #sum,:root[data-theme=cyber] .card:not(.account-card),:root[data-theme=cyber] #nav{border-radius:0;border:1px solid transparent;background:linear-gradient(130deg,#17152f,#101b35) padding-box,linear-gradient(135deg,#f53de8,#37eaff,#a84cff) border-box;clip-path:var(--cyber-cut)}
:root[data-theme=cyber] #nav button{border-radius:0}
:root[data-theme=cyber] #nav .on:not(#n-add){background:linear-gradient(140deg,#86226f,#29235b);clip-path:var(--cyber-cut);color:#a4f8ff}
:root[data-theme=cyber] #nav #n-add{background:linear-gradient(145deg,#fa36c8,#7225bb);clip-path:polygon(15% 0,85% 0,100% 15%,100% 85%,85% 100%,15% 100%,0 85%,0 15%)}
:root[data-theme=cyber] #nav #n-add svg{background:transparent;box-shadow:none;filter:drop-shadow(0 0 5px #fff)}
:root[data-theme=cyber] #dock{filter:drop-shadow(0 -2px 8px #d73dff66)}
:root[data-theme=cyber][data-motion=on] .hero::after{animation:cyber-mascot-float 4s ease-in-out infinite}
@keyframes cyber-mascot-float{0%,100%{transform:scale(1.35)}50%{transform:translateY(-5px) scale(1.35)}}
@media(prefers-reduced-motion:reduce){:root[data-theme=cyber] .hero::after{animation:none!important}}
:root[data-theme=cyber] .hero::after{width:39%;height:calc(100% + 45px);aspect-ratio:auto;bottom:4px;background-size:auto 100%;background-position:right bottom;transform:none;}
:root[data-theme=cyber][data-motion=on] .hero::after{animation:sakura-float 4s ease-in-out infinite}
:root[data-theme=cyber] .hero{background:none;padding-right:43%}

/* 2.9.6: preserve complete mascot aspect ratio; overlap independently of frame. */
:root[data-theme=cyber] .hero{margin-top:24px;min-height:136px;padding:18px 47% 16px 14px;filter:none;box-shadow:none;margin-bottom:0}
:root[data-theme=cyber] .hero::before{border-width:2px;filter:none}
:root[data-theme=cyber] .hero::after{width:46%;height:auto;aspect-ratio:650 / 473;top:-22px;bottom:auto;right:0;background-size:contain;background-position:center;background-repeat:no-repeat;transform:none;z-index:1;filter:drop-shadow(0 0 5px #e73cff88)}
:root[data-theme=cyber] .hero > *{position:relative;z-index:2}
:root[data-theme=cyber] .hero .meta{max-width:100%}
:root[data-theme=cyber] #dashboard-widgets{gap:10px}
:root[data-theme=cyber] #widget-accounts .section-head{margin-top:8px}
:root[data-theme=cyber] body::before{background:linear-gradient(180deg,#090e25aa,#090e25c9 65%,#090e25aa),url('../themes/cyber-city.webp') center/cover no-repeat}
:root[data-theme=cyber] #nav{box-shadow:inset 0 0 12px #b23dff55}
@media(max-width:360px){:root[data-theme=cyber] .hero{padding-right:45%;padding-left:10px}:root[data-theme=cyber] .hero::after{width:44%;top:-18px}}

/* Royal Gold — executive, independent of account artwork */
:root[data-theme=royal]{--bg:#121110;--card:#211e19;--ink:#fff7e8;--mut:#c7bba4;--line:#79623b;--in:#75d9aa;--out:#ff8790;--nav:#171512;--pop:#e8c77e;--theme-accent:#d8b66b;color-scheme:dark;accent-color:#d8b66b;min-height:100%;background:radial-gradient(ellipse at 100% 0,#55401d55,transparent 45%),linear-gradient(145deg,#121110 15%,#292319 55%,#121110 85%) fixed}
:root[data-theme=royal] body{background:transparent;min-height:100vh;min-height:100dvh}
:root[data-theme=royal] #app{background:transparent}
:root[data-theme=royal] .hero{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(115deg,#191714 10%,#29231a 65%,#55401d);border:2px solid #d8b66b;border-radius:20px 6px;box-shadow:inset 0 0 0 3px #171512,inset 0 0 0 4px #8b713b,0 5px 20px #0008;padding:25px 22px}
:root[data-theme=royal] .hero::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:repeating-linear-gradient(145deg,transparent 0 24px,#d8b66b0b 25px 26px,transparent 27px 48px);mask-image:linear-gradient(90deg,transparent 35%,black)}
:root[data-theme=royal] .hero strong{color:#f3d38b;font-family:Georgia,serif;font-variant-numeric:lining-nums tabular-nums;letter-spacing:-.035em}
:root[data-theme=royal] .hero-label,:root[data-theme=royal] .hero .meta{color:#e6d8bc}
:root[data-theme=royal] .brand,:root[data-theme=royal] .brand span,:root[data-theme=royal] .section-head button,:root[data-theme=royal] .hub-tabs button.on{color:#e8c77e}
:root[data-theme=royal] .card:not(.account-card),:root[data-theme=royal] #sum,:root[data-theme=royal] dialog{background:linear-gradient(145deg,#27231c,#191714);border-color:#9b7d46;box-shadow:0 5px 18px #0004}
:root[data-theme=royal] #dock{background:#121110;border-color:#79623b}
:root[data-theme=royal] #nav{background:#1b1814;border:1px solid #b99550;box-shadow:0 0 12px #c59a3522;border-radius:14px}
:root[data-theme=royal] #nav button{color:#e5c98e}
:root[data-theme=royal] #nav .on:not(#n-add){background:linear-gradient(145deg,#49391e,#282015);color:#ffe4a3}
:root[data-theme=royal] #nav #n-add,:root[data-theme=royal] .btn:not(.sec):not(.del),:root[data-theme=royal] #rng .chip.on,:root[data-theme=royal] .card-art-filter[aria-pressed=true]{background:linear-gradient(145deg,#f3d99b,#b68b3e);color:#20170b;border-color:#e8c77e}
:root[data-theme=royal] #nav #n-add svg{background:transparent;color:#20170b;box-shadow:none}
:root[data-theme=royal] #theme-effects i{width:3px;height:3px;border-radius:50%;background:#f3d38b;box-shadow:0 0 8px #e8c77e;opacity:0;animation:royal-glimmer calc(var(--duration)*2) var(--delay) ease-in-out infinite}
@keyframes royal-glimmer{0%,100%{opacity:0;transform:translateY(90vh)}50%{opacity:.35;transform:translateY(40vh)}}
.theme-choice[data-theme-id=royal] .theme-sample{background:linear-gradient(135deg,#171512 40%,#70552a)!important;border-color:#d8b66b}
:root[data-theme=royal] .theme-choice[aria-pressed=true]{outline-color:#e8c77e}

#theme-dialog.previewing{width:100%;height:100dvh;max-width:100%;max-height:100dvh;box-sizing:border-box;border:0;border-radius:0;padding:0;background:var(--bg)}
#theme-dialog.previewing > :not(#theme-preview){display:none}

#theme-dialog.previewing{overflow:hidden;border:0;border-radius:0}
#theme-preview:not([hidden]){display:grid;height:100%;grid-template-rows:auto minmax(0,1fr) auto auto}
#theme-preview .top{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--card);border-bottom:1px solid var(--line)}
#theme-preview .brand{font-size:1.3rem}
#preview-name,#preview-status{font-weight:650}
.preview-scroll{min-height:0;overflow:auto;padding:14px 16px;display:flex;flex-direction:column;gap:12px}
.preview-scroll>*{flex:none}
#theme-preview .hero{margin:8px 0 0;padding-block:16px;min-height:84px}
#theme-preview .hero strong{display:block}
#theme-preview .account-card{margin:0;width:100%;max-width:100%;box-sizing:border-box;min-height:116px}
#theme-preview .row{margin:0}
.preview-tabs,.preview-actions{display:flex;align-items:center;gap:8px}
.preview-tabs{background:var(--card);border-block:1px solid var(--line);justify-content:space-around;padding:6px}
.preview-tab{font-size:10px;display:grid;justify-items:center;gap:2px;color:var(--mut)}
.preview-tab:first-child{color:var(--pop)}
.preview-tab svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2}
#theme-preview footer{background:var(--card);padding:10px 14px max(12px,env(safe-area-inset-bottom))}
#preview-status:not(:empty){display:block;margin-bottom:6px;text-align:center}
.preview-actions button{margin:0;flex:1;min-height:46px}
.preview-actions #preview-apply{flex:1.65}
#preview-apply[hidden]{display:none}

#theme-preview .bank-card-chip{display:block;width:36px;height:27px;margin:8px 0}
#theme-preview .account-card{padding:14px 18px;border-radius:16px}
#theme-preview .bank-card-name{font-weight:650}
#theme-preview .bank-card-balance{font-size:1.3rem;display:block}
#theme-preview .preview-actions button{align-self:stretch;margin:0}

#theme-preview{background-color:var(--bg)}
