/* ================= SHADOW LABS (default) =================
   Matches the shadowbot Worker UI: deep black-violet, purple glow, chamfered corners, scanlines. */
:root, [data-theme=shadow] {
  --bg: #040308;
  --bg-fx: radial-gradient(ellipse 70% 55% at 50% -10%, rgba(124,52,214,.30), transparent 70%), radial-gradient(ellipse 50% 40% at 100% 100%, rgba(124,52,214,.14), transparent 70%);
  --scan: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
  --scan-o: 1;
  --panel: rgba(18,10,36,.82); --panel-solid: #120a24; --panel-2: rgba(40,22,74,.55);
  --border: #6a45ad; --row-border: rgba(106,69,173,.35);
  --accent: #b46bff; --accent-2: #c58bff;
  --good: #7cff4f; --warn: #ffd24d; --bad: #ff4d6d;
  --text: #e9ddff; --dim: #8f7bb8;
  --hover: rgba(180,107,255,.12); --focus: rgba(180,107,255,.28);
  --input-bg: rgba(8,4,18,.75);
  --primary-bg: linear-gradient(135deg, #7c34d6, #b46bff); --primary-fg: #fff; --primary-border: #c58bff;
  --nav-on-bg: linear-gradient(90deg, rgba(180,107,255,.28), rgba(180,107,255,.06)); --nav-on-fg: #fff; --nav-on-shadow: inset 2px 0 0 #b46bff;
  --row-open: rgba(180,107,255,.16); --row-sel: rgba(124,255,79,.08); --row-open-shadow: inset 3px 0 0 #c58bff;
  --badge-bg: #7cff4f; --badge-fg: #071a00;
  --radius: 0px; --btn-radius: 0px; --input-radius: 0px; --nav-radius: 0px; --avatar-radius: 0; --tag-radius: 0;
  --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  --chamfer-sm: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  --shadow: 0 0 0 1px rgba(180,107,255,.06), 0 0 30px rgba(124,52,214,.18);
  --glow: 0 0 18px rgba(180,107,255,.55), 0 0 2px #c58bff;
  --glow-sm: 0 0 10px rgba(180,107,255,.45);
  --text-glow: 0 0 10px rgba(180,107,255,.7);
  --dot-glow: 0 0 6px currentColor;
  --font-head: 'Orbitron', 'Share Tech Mono', sans-serif;
  --font-body: 'Share Tech Mono', ui-monospace, monospace;
  --btn-font: 'Orbitron', sans-serif; --btn-case: uppercase; --btn-ls: .12em; --btn-fs: .72em;
  --head-ls: .1em; --head-case: uppercase; --label-case: uppercase; --label-ls: .12em; --tag-case: uppercase; --tag-ls: .08em;
  --head-color: #c58bff;
  --sidebar-w: 248px; --list-w: 390px; --gap: 12px; --rail-w: 70px;
  --logo-filter: drop-shadow(0 0 8px rgba(180,107,255,.8));
  --editor-bg: #fff; --editor-fg: #1b1430;
}
[data-theme=shadow] .avatar { clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
[data-theme=shadow] .msg-row.unread::before { width: 4px; border-radius: 0; background: #7cff4f; box-shadow: 0 0 10px #7cff4f; }
[data-theme=shadow] .badge { box-shadow: 0 0 8px rgba(124,255,79,.7); border-radius: 0; }
[data-theme=shadow] .stat-n { color: #c58bff; }
[data-theme=shadow] .reader-subj { font-size: 1.15em; }
[data-theme=shadow] .fab { border-radius: 0; }
[data-theme=shadow] .list-title::before { content: '> '; color: #7cff4f; }
[data-theme=shadow] ::selection { background: #b46bff; color: #040308; }
[data-theme=shadow] .tab.on { text-shadow: 0 0 8px rgba(180,107,255,.8); }

/* ================= GLASS =================
   Frosted floating cards, rounded, roomy gaps, list rendered as cards. */
[data-theme=glass] {
  --bg: #120f2e;
  --bg-fx: radial-gradient(circle at 15% 20%, #6d4aff 0, transparent 38%), radial-gradient(circle at 85% 15%, #00c2ff 0, transparent 35%), radial-gradient(circle at 70% 85%, #ff5fa2 0, transparent 38%), radial-gradient(circle at 20% 90%, #22d3a6 0, transparent 30%), #120f2e;
  --scan: none; --scan-o: 0;
  --panel: rgba(255,255,255,.10); --panel-solid: rgba(38,32,78,.96); --panel-2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.22); --row-border: transparent;
  --accent: #8fb3ff; --accent-2: #b9cdff;
  --good: #5cf2b5; --warn: #ffd166; --bad: #ff6b8b;
  --text: #f4f6ff; --dim: rgba(235,238,255,.68);
  --hover: rgba(255,255,255,.12); --focus: rgba(143,179,255,.35);
  --input-bg: rgba(255,255,255,.10);
  --primary-bg: linear-gradient(135deg, rgba(143,179,255,.95), rgba(196,140,255,.95)); --primary-fg: #10123a;
  --nav-on-bg: rgba(255,255,255,.20); --nav-on-fg: #fff;
  --row-bg: rgba(255,255,255,.07); --row-hover: rgba(255,255,255,.14); --row-open: rgba(255,255,255,.22); --row-sel: rgba(92,242,181,.16);
  --badge-bg: #fff; --badge-fg: #2a2470;
  --radius: 22px; --btn-radius: 14px; --input-radius: 14px; --nav-radius: 14px; --tag-radius: 999px; --row-radius: 16px;
  --chamfer: none; --chamfer-sm: none;
  --blur: blur(22px) saturate(160%);
  --shadow: 0 10px 40px rgba(10,6,40,.35), inset 0 1px 0 rgba(255,255,255,.25);
  --glow: 0 8px 26px rgba(143,179,255,.45); --glow-sm: none; --text-glow: none;
  --font-head: 'Inter', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif;
  --btn-case: none; --head-case: none; --head-ls: -.01em; --label-case: none; --tag-case: none;
  --sidebar-w: 250px; --list-w: 400px; --gap: 18px; --rail-w: 76px;
  --list-pad: 4px 10px 10px; --row-gap: 0 0 8px; --row-pad: 14px 16px;
  --frame-radius: 16px;
  --editor-bg: #fff; --editor-fg: #1b1430;
}
[data-theme=glass] .msg-row { box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
[data-theme=glass] .msg-row.unread::before { left: 6px; top: 50%; bottom: auto; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%); background: #b9cdff; }
[data-theme=glass] .list-head { padding-top: 18px; }
[data-theme=glass] .list-title { font-size: 1.5em; font-weight: 700; }
[data-theme=glass] .reader-subj { font-size: 1.6em; font-weight: 700; }
[data-theme=glass] .compose-win, [data-theme=glass] .modal { backdrop-filter: blur(30px) saturate(160%); }
[data-theme=glass] .stat-n { color: #fff; }

/* ================= FUTURISTIC PREMIUM =================
   Graphite + champagne gold + cyan. Permanent slim icon rail, big rounded cards, avatars as squircles. */
[data-theme=futuristic] {
  --bg: #0b0d12;
  --bg-fx: radial-gradient(ellipse 60% 50% at 80% 0%, rgba(214,178,94,.16), transparent 70%), radial-gradient(ellipse 50% 40% at 0% 100%, rgba(0,212,255,.10), transparent 70%), linear-gradient(180deg, #0b0d12, #07080b);
  --scan: none; --scan-o: 0;
  --panel: rgba(20,23,31,.92); --panel-solid: #14171f; --panel-2: #1b1f2a;
  --border: rgba(214,178,94,.22); --row-border: rgba(255,255,255,.05);
  --accent: #d6b25e; --accent-2: #f1d38b;
  --good: #3ee6c1; --warn: #f5b942; --bad: #ff5d73;
  --text: #eef0f5; --dim: #8a90a2;
  --hover: rgba(214,178,94,.08); --focus: rgba(214,178,94,.25);
  --input-bg: #0f1218;
  --primary-bg: linear-gradient(135deg, #f1d38b, #b8913f); --primary-fg: #15110a;
  --nav-on-bg: linear-gradient(135deg, rgba(214,178,94,.22), rgba(0,212,255,.08)); --nav-on-fg: #f1d38b;
  --row-bg: transparent; --row-open: linear-gradient(90deg, rgba(214,178,94,.14), transparent); --row-sel: rgba(62,230,193,.08); --row-open-shadow: inset 2px 0 0 #d6b25e;
  --badge-bg: #00d4ff; --badge-fg: #001a20;
  --radius: 18px; --btn-radius: 12px; --input-radius: 12px; --nav-radius: 14px; --avatar-radius: 30%; --tag-radius: 6px; --fab-radius: 18px;
  --chamfer: none; --chamfer-sm: none;
  --shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  --glow: 0 6px 24px rgba(214,178,94,.35); --glow-sm: none; --text-glow: none;
  --font-head: 'Rajdhani', 'Inter', sans-serif; --font-body: 'Inter', system-ui, sans-serif;
  --btn-font: 'Rajdhani', sans-serif; --btn-case: uppercase; --btn-ls: .08em; --btn-fs: .9em;
  --head-case: uppercase; --head-ls: .06em; --label-case: uppercase; --label-ls: .1em; --tag-case: uppercase; --tag-ls: .06em;
  --head-color: #f1d38b;
  --sidebar-w: 80px; --list-w: 420px; --gap: 14px; --rail-w: 80px;
  --row-pad: 16px 18px;
  --frame-radius: 14px; --frame-shadow: 0 10px 30px rgba(0,0,0,.4);
  --editor-bg: #fff; --editor-fg: #1b1430;
}
/* rail sidebar on every width (except phone drawer) */
@media (min-width: 700px) {
  [data-theme=futuristic] .sidebar { padding: 14px 8px; align-items: center; }
  [data-theme=futuristic] .sidebar .brand span, [data-theme=futuristic] .nav-item > span, [data-theme=futuristic] .compose-btn span,
  [data-theme=futuristic] .nav-title, [data-theme=futuristic] .me-card span, [data-theme=futuristic] .nav-item small { display: none; }
  [data-theme=futuristic] .compose-btn { width: 52px; height: 52px; padding: 0; border-radius: 16px; margin-bottom: 14px; }
  [data-theme=futuristic] .nav-item { justify-content: center; width: 52px; height: 46px; padding: 0; }
  [data-theme=futuristic] .nav-item .badge { position: absolute; top: 2px; right: 0; font-size: .6em; padding: 0 4px; min-width: 16px; }
  [data-theme=futuristic] .nav-group { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
  [data-theme=futuristic] .brand { padding: 2px 0 14px; }
  [data-theme=futuristic] .me-card { justify-content: center; padding: 6px 0 0; }
  [data-theme=futuristic] .nav-item:hover::after { content: attr(title); position: absolute; left: 60px; white-space: nowrap; padding: 4px 10px; border-radius: 8px; background: #000; color: #f1d38b; font-size: .8em; z-index: 20; pointer-events: none; }
}
[data-theme=futuristic] .msg-row.unread::before { background: linear-gradient(#f1d38b, #00d4ff); }
[data-theme=futuristic] .list-title { font-size: 1.5em; font-weight: 700; }
[data-theme=futuristic] .reader-subj { font-size: 1.9em; font-weight: 700; letter-spacing: .02em; }
[data-theme=futuristic] .stat { background: linear-gradient(160deg, #1b1f2a, #12151c); }
[data-theme=futuristic] .stat-n { font-size: 2.5em; color: #f1d38b; }
[data-theme=futuristic] .avatar { background: linear-gradient(135deg, hsl(var(--h) 40% 30%), hsl(var(--h) 40% 18%)); border-color: rgba(214,178,94,.35); color: #f1d38b; }

/* ================= AURORA =================
   Animated northern-lights gradient, pill shapes, big avatars, airy. */
[data-theme=aurora] {
  --bg: #061423;
  --bg-fx: linear-gradient(120deg, #052a3a, #0b3b4f 20%, #133f6b 40%, #3c2a7a 60%, #0a4a43 80%, #052a3a);
  --scan: none; --scan-o: 0;
  --panel: rgba(6,20,35,.62); --panel-solid: #0a2033; --panel-2: rgba(255,255,255,.06);
  --border: rgba(126,255,214,.20); --row-border: rgba(255,255,255,.06);
  --accent: #5ef2c7; --accent-2: #9ff7e0;
  --good: #7dff9b; --warn: #ffd36e; --bad: #ff7a90;
  --text: #ecfffa; --dim: #8fb7b4;
  --hover: rgba(94,242,199,.10); --focus: rgba(94,242,199,.25);
  --input-bg: rgba(0,0,0,.25);
  --primary-bg: linear-gradient(120deg, #5ef2c7, #6aa8ff, #b388ff); --primary-fg: #04121c;
  --nav-on-bg: linear-gradient(120deg, rgba(94,242,199,.25), rgba(179,136,255,.25)); --nav-on-fg: #fff;
  --row-open: rgba(94,242,199,.12); --row-sel: rgba(179,136,255,.14);
  --badge-bg: linear-gradient(120deg, #5ef2c7, #b388ff); --badge-fg: #04121c;
  --radius: 26px; --btn-radius: 999px; --input-radius: 999px; --nav-radius: 999px; --tag-radius: 999px; --row-radius: 0;
  --chamfer: none; --chamfer-sm: none;
  --blur: blur(18px);
  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --glow: 0 6px 30px rgba(94,242,199,.4); --glow-sm: none; --text-glow: none;
  --font-head: 'Manrope', sans-serif; --font-body: 'Manrope', system-ui, sans-serif;
  --btn-case: none; --head-case: none; --head-ls: -.01em; --label-case: none; --tag-case: none;
  --sidebar-w: 260px; --list-w: 420px; --gap: 16px; --rail-w: 76px;
  --row-pad: 16px 20px;
  --frame-radius: 20px;
  --editor-bg: #fff; --editor-fg: #1b1430;
}
[data-theme=aurora] .fx-bg { background-size: 400% 400%; animation: aurora 24s ease infinite; }
[data-theme=aurora] .fx-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.6), transparent 60%); }
@keyframes aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
[data-theme=aurora] .avatar { width: 46px; height: 46px; font-size: .9em; }
[data-theme=aurora] .avatar.sm { width: 30px; height: 30px; }
[data-theme=aurora] .msg-row.unread::before { left: 4px; width: 4px; border-radius: 4px; background: linear-gradient(#5ef2c7, #b388ff); }
[data-theme=aurora] .list-title { font-size: 1.55em; font-weight: 800; }
[data-theme=aurora] .reader-subj { font-size: 1.7em; font-weight: 800; }
[data-theme=aurora] .card, [data-theme=aurora] .stat { border-radius: 26px; }
[data-theme=aurora] .stat-n { background: linear-gradient(120deg, #5ef2c7, #b388ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ================= CLEAN (light) =================
   Flat, dense, no effects. Panels joined edge to edge. */
[data-theme=clean] {
  --bg: #f3f4f7; --bg-fx: none; --scan: none; --scan-o: 0;
  --panel: #ffffff; --panel-solid: #ffffff; --panel-2: #f5f6f9;
  --border: #e3e5eb; --row-border: #eef0f3;
  --accent: #5b3bd6; --accent-2: #5b3bd6;
  --good: #16a34a; --warn: #d97706; --bad: #dc2626;
  --text: #16151d; --dim: #6b6f7b;
  --hover: #f1f0fb; --focus: rgba(91,59,214,.18);
  --input-bg: #fff;
  --primary-bg: #5b3bd6; --primary-fg: #fff;
  --nav-on-bg: #ece8ff; --nav-on-fg: #3d22b0;
  --row-open: #ece8ff; --row-sel: #eaf7ee;
  --badge-bg: #5b3bd6; --badge-fg: #fff;
  --radius: 8px; --btn-radius: 6px; --input-radius: 6px; --nav-radius: 6px; --tag-radius: 4px;
  --chamfer: none; --chamfer-sm: none;
  --shadow: none; --glow: none; --glow-sm: none; --text-glow: none;
  --font-head: 'Inter', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif;
  --btn-case: none; --head-case: none; --head-ls: 0; --label-case: none; --tag-case: none;
  --sidebar-w: 224px; --list-w: 380px; --gap: 0px; --rail-w: 64px;
  --row-pad: 9px 14px; --snip-display: none; --fs: 13.5px;
  --logo-filter: none;
  --editor-bg: #fff; --editor-fg: #16151d;
}
[data-theme=clean] .app > .panel { border-radius: 0; border-top: 0; border-bottom: 0; border-left: 0; }
[data-theme=clean] .sidebar { background: #f8f8fb; }
[data-theme=clean] .avatar { width: 30px; height: 30px; font-size: .68em; }
[data-theme=clean] .msg-row.unread::before { display: none; }
[data-theme=clean] .unread .msg-from::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
[data-theme=clean] .brand b { color: var(--accent); }
[data-theme=clean] .modal-back { background: rgba(20,20,30,.35); }
[data-theme=clean] .mail-frame { border: 1px solid var(--border); }
[data-theme=clean] .avatar { color: hsl(var(--h) 60% 30%); background: hsl(var(--h) 70% 92%); border-color: hsl(var(--h) 50% 80%); }

/* ---------- theme preview swatches (settings) ---------- */
.tp-shadow { background: radial-gradient(circle at 50% 0, rgba(124,52,214,.5), #040308 70%); }
.tp-shadow i { background: rgba(18,10,36,.9); border: 1px solid #6a45ad; clip-path: polygon(5px 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%,0 5px); }
.tp-glass { background: radial-gradient(circle at 20% 20%, #6d4aff, transparent 50%), radial-gradient(circle at 80% 70%, #ff5fa2, transparent 50%), #120f2e; gap: 6px !important; }
.tp-glass i { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); border-radius: 8px !important; }
.tp-futuristic { background: #0b0d12; grid-template-columns: 10% 36% 1fr !important; }
.tp-futuristic i { background: #1b1f2a; border: 1px solid rgba(214,178,94,.35); border-radius: 6px !important; }
.tp-aurora { background: linear-gradient(120deg, #0b3b4f, #3c2a7a, #0a4a43); }
.tp-aurora i { background: rgba(6,20,35,.6); border-radius: 12px !important; }
.tp-clean { background: #f3f4f7; gap: 0 !important; padding: 0 !important; }
.tp-clean i { background: #fff; border-right: 1px solid #e3e5eb; border-radius: 0 !important; }
