html[data-theme=midnight],html[data-theme=aurora]{--bg:#0a1020;--panel:#111c30;--panel2:#19263b;--border:#2b3c59;--muted:#9aaec8;--text:#edf4ff;--orange:#4e96ff;--orange-light:#95c5ff;--green:#76d9b1;--red:#ff8398}
html[data-theme=aurora]{--orange:#43d6bf;--orange-light:#a0f4df;--panel:#0c2430;--border:#285063}
html[data-theme=batman]{--bg:#0c0e12;--panel:#171b24;--panel2:#222936;--border:#394253;--muted:#abb3c4;--text:#f4f3ef;--orange:#dfb940;--orange-light:#f5dc85;--green:#9cd8b1;--red:#ee8b82}
html[data-theme=spiderman]{--bg:#08142a;--panel:#101f3a;--panel2:#182b49;--border:#344b72;--muted:#abbdd6;--text:#eef4ff;--orange:#ee435e;--orange-light:#ff9cab;--green:#85dbbe;--red:#ffb3aa}
html[data-theme=light]{color-scheme:light;--bg:#edf2f8;--panel:#fff;--panel2:#f3f6fb;--border:#ccd6e5;--muted:#52657e;--text:#14253c;--orange:#2657c6;--orange-light:#2252b3;--green:#1b7551;--red:#b52742}
.appearance-wallpaper{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;z-index:-1;opacity:.36}body{position:relative;isolation:isolate;background:var(--bg)}
html[data-theme]:not([data-theme=fire]) .embers{display:none}
html[data-theme]:not([data-theme=fire]) :is(.sidebar,.topbar,.mobile-nav,.panel,.login-card,.modal,.profile-mini,.choice,.stat-card,.constraint-card,.shop-card,.shop-panel){background:var(--panel);border-color:var(--border);color:var(--text)}
html[data-theme]:not([data-theme=fire]) :is(input,select,textarea,pre,code,.setting-panel .environment-grid>div){background:var(--panel2);border-color:var(--border);color:var(--text)}
html[data-theme]:not([data-theme=fire]) :is(.hero-card,.shop-hero){background:linear-gradient(120deg,var(--panel),var(--panel2));border-color:var(--border)}
html[data-theme]:not([data-theme=fire]) :is(.button.primary,.shop-primary){background:var(--orange);color:var(--bg);border-color:var(--orange)}
html[data-theme=light] :is(.button.primary,.shop-primary){color:#fff}
html[data-theme]:not([data-theme=fire]) :is(.button.secondary,.profile-icon,.activity-icon,.user-avatar,.nav-item.active,.domain-auto,.status-badge){background:var(--panel2);border-color:var(--border);color:var(--orange-light)}
html[data-theme]:not([data-theme=fire]) :is(.hero-card h2,.section-heading h2,.activity-item b,.user-cell b,.profile-card h2,.setting-panel h2,.hero-meta b,.logo-text,.topbar h1,.sidebar nav,.nav-item,.appearance-dialog,.main-footer){color:var(--text)}
html[data-theme]:not([data-theme=fire]) :is(.hero-card p,.hero-meta,.profile-card p,.setting-panel p,.constraint-card p,.traffic-cell,.expiry-value,.muted,.main-footer small){color:var(--muted)}
html[data-theme=light] .qr-caption{color:var(--muted)}
html[data-theme=batman][data-wallpaper=on] body{background-image:radial-gradient(ellipse at 12% 20%,#dfb94018,transparent 45%),linear-gradient(145deg,#151c2b44,transparent)}
html[data-theme=spiderman][data-wallpaper=on] body{background-image:repeating-linear-gradient(35deg,transparent,transparent 170px,#427cbd14 172px,transparent 174px),radial-gradient(ellipse at 5% 10%,#ee435e1f,transparent 48%)}
html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after{animation:none!important;transition:none!important}
.appearance-open{position:fixed;top:18px;left:23px;z-index:60;border:1px solid var(--border);border-radius:30px;padding:8px 13px;background:var(--panel);color:var(--text);font:12px var(--font,Tahoma);box-shadow:0 4px 18px #0002;cursor:pointer}
.appearance-dialog{width:min(640px,calc(100vw - 32px));max-height:90dvh;overflow:auto;border:1px solid var(--border);border-radius:22px;background:var(--panel);color:var(--text);padding:26px;font:14px var(--font,Tahoma)}
.appearance-dialog::backdrop{background:#050a16c7;backdrop-filter:blur(5px)}.appearance-head{display:flex;justify-content:space-between;gap:16px;align-items:start}.appearance-head span{font:10px Arial;letter-spacing:2px;color:var(--orange-light)}.appearance-head h2{font-size:26px;margin:8px 0}.appearance-close{border:0;background:var(--panel2);color:var(--text);border-radius:50%;width:32px;height:32px;font-size:24px;cursor:pointer}.appearance-dialog>p{color:var(--muted);line-height:1.9;font-size:12px}
.appearance-themes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:22px 0}.appearance-choice{display:flex;flex-direction:column;align-items:start;gap:8px;background:var(--panel2);border:1px solid var(--border);border-radius:16px;padding:17px;color:var(--text);font:13px var(--font,Tahoma);cursor:pointer;text-align:right}.appearance-choice span{font-size:28px}.appearance-choice small{font-size:10px;color:var(--muted)}.appearance-choice.selected{border-color:var(--orange);box-shadow:0 0 0 1px var(--orange)}.appearance-options{display:flex;flex-wrap:wrap;gap:20px;padding:15px 0;border-top:1px solid var(--border)}.appearance-options label{display:flex;align-items:center;gap:8px;font-size:12px}.appearance-options input{width:16px;height:16px;margin:0;accent-color:var(--orange)}.appearance-upload{margin-top:16px}.appearance-upload label{font-size:12px}.appearance-upload small{display:block;color:var(--muted);font-size:11px;margin:10px 0}.appearance-reset{background:transparent;border:1px solid var(--border);border-radius:8px;padding:9px;color:var(--text);font:11px var(--font,Tahoma);cursor:pointer}
.location-badge{display:inline-flex;gap:8px;align-items:center;color:var(--text);font-size:12px;padding:7px 12px;border:1px solid var(--border);border-radius:30px;background:var(--panel2)}.location-badge small{color:var(--muted);font-size:10px}.resilience-summary{display:flex;flex-wrap:wrap;gap:12px;margin:18px 0}.resilience-recipes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.resilience-recipe{padding:24px}.resilience-recipe h2{font-size:18px}.resilience-recipe p{font-size:12px;color:var(--muted);line-height:2}.relay-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.relay-result{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.relay-result textarea{width:100%;min-height:150px;font:11px monospace;direction:ltr}.control-country{margin-top:12px}
@media(max-width:700px){.appearance-open{top:auto;bottom:86px;left:16px;font-size:11px;padding:7px 11px}.appearance-dialog{padding:20px}.appearance-head h2{font-size:22px}.appearance-themes{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.appearance-choice{padding:13px}.resilience-recipes{grid-template-columns:1fr}.relay-actions>.button{flex:1;min-width:110px}}

.country-flag{display:inline-block;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px #ffffff25;flex-shrink:0}
html[data-theme]:not([data-theme=fire]) :is(.page-heading h1,.login-card h1,.shop-header h1){color:var(--text)}
html[data-theme]:not([data-theme=fire]) :is(.field-note,.eyebrow,.stat-card small,.stat-card>div,.hero-meta,.logo-text small,.main-footer small){color:var(--muted)}
html[data-theme=light] :is(.panel,.stat-card,.login-card){box-shadow:0 12px 28px #26395712}
html[data-theme=light] :is(.mobile-nav button,.mobile-nav .nav-item){color:var(--muted)}
html[data-theme=light] :is(.mobile-nav button.active,.mobile-nav .nav-item.active){color:var(--orange)}

.country-flag-emoji{display:inline-flex;align-items:center;justify-content:center;width:24px;height:18px;font-size:20px;line-height:1;flex-shrink:0}
