/* UI colors for the picker. The default theme remains the original design. */
:root{--theme-dialog-bg:#1b2921;--theme-dialog-raised:#25362b;--theme-dialog-border:#526654;--theme-dialog-accent:#dcc38f;--theme-dialog-text:#f4f2e9;--theme-dialog-muted:#aabca9}
:root[data-theme-color]{
  --t-accent:color-mix(in srgb,var(--theme-color) 43%,#ffffff 57%);
  --t-tint:color-mix(in srgb,var(--theme-color) 20%,#e1e7e8 80%);
  --t-bg:color-mix(in srgb,var(--theme-color) 8%,#080d10 92%);
  --t-surface:color-mix(in srgb,var(--theme-color) 13%,#0e1519 87%);
  --t-elevated:color-mix(in srgb,var(--theme-color) 18%,#11191d 82%);
  --t-hover:color-mix(in srgb,var(--theme-color) 25%,#172127 75%);
  --t-border:color-mix(in srgb,var(--theme-color) 25%,#28363b 75%);
  --t-dim:color-mix(in srgb,var(--theme-color) 14%,#a1b0b4 86%);
  --bg:var(--t-bg);--surface:var(--t-surface);--surface-2:var(--t-elevated);--border:var(--t-border);--muted:var(--t-dim);--green:var(--t-accent);--gold:var(--t-accent);
  --theme-dialog-bg:var(--t-surface);--theme-dialog-raised:var(--t-elevated);--theme-dialog-border:var(--t-border);--theme-dialog-accent:var(--t-accent);--theme-dialog-text:#f4f6f6;--theme-dialog-muted:var(--t-dim);
}
:root[data-theme-color] body{background:radial-gradient(ellipse at 100% 0%,color-mix(in srgb,var(--theme-color) 12%,transparent),transparent 45%),var(--t-bg);color:#eff3f4}
:root[data-theme-color] .sidebar,:root[data-theme-color] .topbar{background:var(--t-surface);border-color:var(--t-border)}
:root[data-theme-color] .brand-mark i{background:linear-gradient(var(--t-accent),var(--theme-color))}
:root[data-theme-color] .brand-name small,:root[data-theme-color] .breadcrumb,:root[data-theme-color] .page-heading p,:root[data-theme-color] .date-label,:root[data-theme-color] .update-status,:root[data-theme-color] .sidebar-note{color:var(--t-dim)}
:root[data-theme-color] .eyebrow,:root[data-theme-color] .heading-dot,:root[data-theme-color] .nav-item.active svg,:root[data-theme-color] .panel-heading h2 svg,:root[data-theme-color] .wallet-eyebrow,:root[data-theme-color] .admin-eyebrow,:root[data-theme-color] .sim-eyebrow,:root[data-theme-color] .password-eyebrow{color:var(--t-accent)}
:root[data-theme-color] .tiny-line{background:var(--t-accent)}
:root[data-theme-color] .nav-divider,:root[data-theme-color] .theme-label,:root[data-theme-color] .chart-toolbar,:root[data-theme-color] .asset-stats,:root[data-theme-color] .chart-source,:root[data-theme-color] .table-footer,:root[data-theme-color] .wallet-table-footer,:root[data-theme-color] .sim-heading,:root[data-theme-color] .sim-footer,:root[data-theme-color] .admin-panel-footer{border-color:var(--t-border)}
:root[data-theme-color] .nav-divider{background:var(--t-border)}
:root[data-theme-color] .nav-item:hover,:root[data-theme-color] tbody tr:hover,:root[data-theme-color] .watchlist-item:hover,:root[data-theme-color] .search-result:hover{background:var(--t-hover)}
:root[data-theme-color] .nav-item.active,:root[data-theme-color] .watchlist-item.selected,:root[data-theme-color] tbody tr.selected{background:color-mix(in srgb,var(--theme-color) 23%,var(--t-surface));color:var(--t-tint);border-color:var(--t-accent)}
:root[data-theme-color] .nav-item.active{box-shadow:inset 3px 0 var(--t-accent)}
:root[data-theme-color] .fx-card,:root[data-theme-color] .account-dropdown,:root[data-theme-color] .search-trigger,:root[data-theme-color] .currency-switch,:root[data-theme-color] .chart-types,:root[data-theme-color] .zoom-controls{background:var(--t-elevated);border-color:var(--t-border)}
:root[data-theme-color] .fx-card strong,:root[data-theme-color] .wallet-market-value,:root[data-theme-color] .wallet-preview strong{color:var(--t-tint)!important}
:root[data-theme-color] .profile,:root[data-theme-color] .nav-tag,:root[data-theme-color] .nav-count{background:var(--t-elevated);border-color:var(--t-border);color:var(--t-tint)}
:root[data-theme-color] .currency-switch button.active,:root[data-theme-color] .wallet-add,:root[data-theme-color] .wallet-empty-add,:root[data-theme-color] .wallet-save,:root[data-theme-color] .admin-approve,:root[data-theme-color] .password-submit{background:var(--t-accent);border-color:var(--t-accent);color:#11191b}
:root[data-theme-color] .market-card,:root[data-theme-color] .panel,:root[data-theme-color] .simulation,:root[data-theme-color] .wallet-hero,:root[data-theme-color] .wallet-category,:root[data-theme-color] .admin-overview{background:linear-gradient(145deg,var(--t-elevated),var(--t-surface) 75%);border-color:var(--t-border)}
:root[data-theme-color] .market-card:hover{background:var(--t-hover);border-color:var(--t-accent)}
:root[data-theme-color] .market-card-top,:root[data-theme-color] .asset-identity p,:root[data-theme-color] .watchlist-labels,:root[data-theme-color] .assets-heading p,:root[data-theme-color] .wallet-assets-heading p,:root[data-theme-color] .wallet-hero-title,:root[data-theme-color] .wallet-hero>p,:root[data-theme-color] .wallet-category>span,:root[data-theme-color] .wallet-category>small,:root[data-theme-color] .admin-overview-main p,:root[data-theme-color] .sim-heading p,:root[data-theme-color] .sim-section-head p{color:var(--t-dim)}
:root[data-theme-color] .index-icon,:root[data-theme-color] .icon-button,:root[data-theme-color] .wallet-row-actions button,:root[data-theme-color] .table-filters button,:root[data-theme-color] .admin-refresh{background:var(--t-elevated);border-color:var(--t-border);color:var(--t-tint)!important}
:root[data-theme-color] .icon-button.is-favorite,:root[data-theme-color] .table-filters button.active{background:var(--t-hover);border-color:var(--t-accent);color:var(--t-accent)!important}
:root[data-theme-color] .is-favorite svg{fill:var(--t-accent);color:var(--t-accent)}
:root[data-theme-color] .range-buttons button.active,:root[data-theme-color] .chart-types button.active,:root[data-theme-color] .wallet-tabs button.active{background:var(--t-hover);border-color:var(--t-border);color:var(--t-tint)}
:root[data-theme-color] .chart-wrap{background:linear-gradient(180deg,var(--t-elevated),transparent 85%)}
:root[data-theme-color] .chart-overlay,:root[data-theme-color] .chart-tooltip{background:var(--t-elevated);border-color:var(--t-border);color:var(--t-tint)}
:root[data-theme-color] .chart-watermark{color:color-mix(in srgb,var(--theme-color) 14%,transparent)}
:root[data-theme-color] .chart-hint,:root[data-theme-color] .chart-source,:root[data-theme-color] .chart-source a,:root[data-theme-color] .table-footer,:root[data-theme-color] .page-footer,:root[data-theme-color] .wallet-footnote{color:var(--t-dim)}
:root[data-theme-color] thead,:root[data-theme-color] .admin-list-labels{background:var(--t-elevated);color:var(--t-tint)}
:root[data-theme-color] td,:root[data-theme-color] .watchlist-item,:root[data-theme-color] .admin-user{border-color:var(--t-border)}
:root[data-theme-color] .sim-result-column,:root[data-theme-color] .sim-quantity-card,:root[data-theme-color] .sim-selected,:root[data-theme-color] .wallet-selected,:root[data-theme-color] .admin-count-card{background:var(--t-elevated);border-color:var(--t-border)}
:root[data-theme-color] .sim-heading-icon,:root[data-theme-color] .sim-step,:root[data-theme-color] .wallet-empty>span,:root[data-theme-color] .admin-count-icon,:root[data-theme-color] .admin-avatar,:root[data-theme-color] .password-dialog-icon{background:var(--t-hover);border-color:var(--t-border);color:var(--t-accent)}
:root[data-theme-color] .sim-input-box,:root[data-theme-color] .sim-input-box select,:root[data-theme-color] .wallet-input,:root[data-theme-color] .password-form input{background:var(--t-bg);border-color:var(--t-border)}
:root[data-theme-color] .sim-input-box:focus-within,:root[data-theme-color] .wallet-input:focus-within,:root[data-theme-color] .password-form input:focus{border-color:var(--t-accent)}
:root[data-theme-color] dialog,:root[data-theme-color] #password-dialog.password-dialog{background:var(--t-surface);border-color:var(--t-border);color:#f1f4f5}
:root[data-theme-color] .dialog-search,:root[data-theme-color] .search-footer,:root[data-theme-color] .wallet-dialog-heading,:root[data-theme-color] .hover-details{border-color:var(--t-border)}
:root[data-theme-color] .refresh-select select{background-color:var(--t-elevated);border-color:var(--t-border);color:var(--t-tint)}
:root[data-theme-color] .account-dropdown button:hover,:root[data-theme-color] .wallet-tabs button:hover,:root[data-theme-color] .zoom-controls button:hover{background:var(--t-hover)}
@media(max-width:650px){:root[data-theme-color] .nav-item.active{box-shadow:inset 0 -2px var(--t-accent)}}

#theme-dialog.theme-dialog{position:fixed;inset:0;width:min(520px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:26px;border:1px solid var(--theme-dialog-border);border-radius:13px;background:var(--theme-dialog-bg);color:var(--theme-dialog-text);box-shadow:0 24px 90px #000a;overflow:auto}
#theme-dialog::backdrop{background:#060b0bcc;backdrop-filter:blur(5px)}
.theme-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.theme-eyebrow{display:block;color:var(--theme-dialog-accent);font-size:8px;font-weight:700;letter-spacing:1.5px}.theme-header h2{margin:4px 0 0;font-size:19px;font-weight:650}.theme-close{width:31px;height:31px;border:1px solid var(--theme-dialog-border);border-radius:7px;color:var(--theme-dialog-muted);font-size:21px;line-height:1}.theme-close:hover{background:var(--theme-dialog-raised);color:var(--theme-dialog-text)}
#theme-description{margin:12px 0 19px;color:var(--theme-dialog-muted);font-size:11px;line-height:1.8}
.theme-presets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.theme-preset{display:flex;align-items:center;gap:10px;min-width:0;min-height:60px;padding:9px 10px;border:1px solid var(--theme-dialog-border);border-radius:8px;background:color-mix(in srgb,var(--theme-dialog-bg) 78%,#000 22%);text-align:left}.theme-preset:hover{background:var(--theme-dialog-raised)}.theme-preset.selected{border-color:var(--theme-dialog-accent);background:var(--theme-dialog-raised);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--theme-dialog-accent) 30%,transparent)}.theme-swatch{width:30px;height:30px;flex:none;border-radius:9px;background:linear-gradient(145deg,color-mix(in srgb,var(--swatch) 82%,#fff),color-mix(in srgb,var(--swatch) 45%,#172025));border:1px solid #ffffff35;box-shadow:inset 0 1px #ffffff40}.theme-preset-copy{min-width:0;flex:1}.theme-preset-copy strong{display:block;color:var(--theme-dialog-text);font-size:11px;font-weight:650}.theme-preset-copy small{display:block;color:var(--theme-dialog-muted);font-size:9px;line-height:1.4}.theme-check{color:var(--theme-dialog-accent);font-size:14px;opacity:0}.theme-preset.selected .theme-check{opacity:1}
.theme-custom{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:14px;padding:13px;border:1px solid var(--theme-dialog-border);border-radius:8px;background:color-mix(in srgb,var(--theme-dialog-bg) 82%,#000 18%)}.theme-custom label{color:var(--theme-dialog-text);font-size:11px;font-weight:650}.theme-custom p{margin:3px 0 0;color:var(--theme-dialog-muted);font-size:9px}.theme-color-control{display:flex;align-items:center;gap:8px;color:var(--theme-dialog-muted);font-size:10px;font-variant-numeric:tabular-nums}.theme-color-control input{width:34px;height:34px;border:1px solid var(--theme-dialog-border);border-radius:7px;background:none;padding:2px;cursor:pointer}.theme-color-control input::-webkit-color-swatch-wrapper{padding:0}.theme-color-control input::-webkit-color-swatch{border:0;border-radius:4px}.theme-color-control input::-moz-color-swatch{border:0;border-radius:4px}
.theme-custom.selected{border-color:var(--theme-dialog-accent);background:var(--theme-dialog-raised)}
.theme-hint{margin:12px 0 0;color:var(--theme-dialog-muted);font-size:9px;line-height:1.7}.theme-message{margin:10px 0 0;padding:9px 11px;border:1px solid var(--theme-dialog-border);border-radius:6px;color:var(--theme-dialog-text);font-size:10px}.theme-message.is-error{border-color:#765453;background:#462e2e;color:#f4b8b5}.theme-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.theme-actions button{min-height:40px;padding:0 15px;border-radius:7px;font-size:11px;font-weight:700}.theme-cancel{border:1px solid var(--theme-dialog-border);color:var(--theme-dialog-text)}.theme-cancel:hover{background:var(--theme-dialog-raised)}.theme-save{min-width:130px;border:1px solid var(--theme-dialog-accent);background:var(--theme-dialog-accent);color:#10191a}.theme-save:hover{filter:brightness(1.08);color:#10191a}.theme-dialog button:disabled,.theme-dialog input:disabled{opacity:.5;cursor:wait}.theme-dialog button:focus-visible,.theme-dialog input:focus-visible{outline:2px solid var(--theme-dialog-accent);outline-offset:3px}
.theme-retry{margin-top:8px;padding:6px 9px;border:1px solid var(--theme-dialog-border);border-radius:5px;color:var(--theme-dialog-text);font-size:10px}.theme-retry:hover{background:var(--theme-dialog-raised)}
@media(max-width:650px){#theme-dialog.theme-dialog{width:calc(100vw - 28px);max-width:calc(100vw - 28px);padding:20px 16px}.theme-header h2{font-size:17px}.theme-presets{gap:6px}.theme-preset{padding:8px;gap:7px;min-height:55px}.theme-swatch{width:26px;height:26px}.theme-preset-copy strong{font-size:10px}.theme-preset-copy small{font-size:8px}.theme-custom{padding:10px}.theme-actions button{flex:1}}

/* Default neutral dark palette. A saved custom theme still uses its own rules above. */
:root:not([data-theme-color]){--bg:#070808;--surface:#111414;--surface-2:#191c1c;--border:#303535;--theme-dialog-bg:#111414;--theme-dialog-raised:#1c2020;--theme-dialog-border:#424848;--theme-dialog-text:#f4f5f2;--theme-dialog-muted:#adb7b3}
:root:not([data-theme-color]) body{background:#070808}
:root:not([data-theme-color]) .sidebar,:root:not([data-theme-color]) .topbar{background:#0c0f0f;border-color:#292e2e}
:root:not([data-theme-color]) .market-card,:root:not([data-theme-color]) .panel,:root:not([data-theme-color]) .simulation,:root:not([data-theme-color]) .wallet-hero,:root:not([data-theme-color]) .wallet-category,:root:not([data-theme-color]) .admin-overview{background:linear-gradient(145deg,#1a1e1e,#111414 75%);border-color:#343b3a}
:root:not([data-theme-color]) .chart-wrap{background:linear-gradient(180deg,#191d1d,transparent 85%)}
:root:not([data-theme-color]) .auth-screen{background:#070808}
:root:not([data-theme-color]) .auth-frame{background:#111414;border-color:#343b3a}
:root:not([data-theme-color]) .auth-story{background:linear-gradient(145deg,#1b2020,#101313 75%);border-color:#343b3a}
:root:not([data-theme-color]) .auth-panel{background:linear-gradient(145deg,#181c1c,#101313 80%)}
