/**
 * theme.css — shared tokens and components for every page.
 * theme.js sets <html data-mode="light|dark" data-style="normal|glass|soft|tactile|neon">.
 * Pages define their own :root palette; the selectors below are more specific, so they win.
 *
 *   normal   Classic navy + gold
 *   glass    Glassmorphism: frosted panels over the blurred campus photo
 *   soft     Neumorphism: one surface colour, raised / pressed shadows
 *   tactile  Skeuomorphism: warm paper, bevels, stitched header
 *   neon     Dark only: deep background, glowing cyan / magenta accents
 */

/* ---------- Light (default) ---------- */
:root{
    color-scheme:light;
    --bar:#0e2748; --bar2:#0b1f3a;
    --soft:#fafbfd; --field:#ffffff; --hover:#f7f9fc;
    --accent:#0e2748;
    --chip-bg:#eef3fa; --chip-line:#dce6f3;
    --gold-soft:#fdf6e3; --gold-line:#f0e0b4; --gold-ink:#8a6408; --mark:#fdf0c8;
    --ok-soft:#e9f6ec; --ok-line:#bfe6cb;
    --danger-soft:#fdf0e9; --danger-line:#f2d3c4;
    --veil:rgba(241,244,248,.9);
    --glass-edge:transparent; --blur:none;
    --raise:0 1px 2px rgba(9,22,40,.04);
    --press:none;
}

/* ---------- Dark ---------- */
html[data-mode="dark"]{
    color-scheme:dark;
    --bg:#0b1422; --card:#131f31; --soft:#18263b; --field:#0f1a2a; --hover:#1b2a40;
    --ink:#e7edf5; --body:#b4c0cf; --text:#b4c0cf; --muted:#8a98ab; --line:#26364d;
    --navy:#1f4c85; --navy2:#183e6e; --bar:#08111e; --bar2:#0c1828;
    --accent:#9cc0f0; --blue:#86b4ff;
    --chip-bg:#1c2b42; --chip-line:#2b3d57;
    --gold-soft:rgba(217,158,33,.14); --gold-line:rgba(217,158,33,.38); --gold-ink:#f0c35a; --mark:rgba(217,158,33,.4);
    --ok:#4ade80; --ok-soft:rgba(34,197,94,.13); --ok-line:rgba(74,222,128,.32);
    --danger:#fb8a5a; --danger-soft:rgba(194,65,12,.16); --danger-line:rgba(251,138,90,.36);
    --veil:rgba(8,15,27,.92);
}
html[data-mode="dark"] body{ background:var(--bg); }

/* ======================================================================
   GLASS — glassmorphism
   ====================================================================== */
html[data-style="glass"]{
    --bg:transparent;
    --card:rgba(255,255,255,.58); --soft:rgba(255,255,255,.38); --field:rgba(255,255,255,.66); --hover:rgba(255,255,255,.9);
    --line:rgba(15,28,46,.12); --chip-bg:rgba(238,243,250,.7); --chip-line:rgba(15,28,46,.1);
    --bar:rgba(14,39,72,.72); --bar2:rgba(11,31,58,.6);
    --glass-edge:rgba(255,255,255,.7);
    --blur:blur(18px) saturate(1.35);
    --overlay:linear-gradient(180deg, rgba(222,231,242,.5), rgba(241,244,248,.72));
    --veil:rgba(241,244,248,.55);
}
html[data-style="glass"][data-mode="dark"]{
    --card:rgba(17,28,45,.55); --soft:rgba(255,255,255,.04); --field:rgba(9,17,29,.5); --hover:rgba(40,60,90,.55);
    --line:rgba(255,255,255,.1); --chip-bg:rgba(255,255,255,.07); --chip-line:rgba(255,255,255,.12);
    --bar:rgba(6,13,24,.62); --bar2:rgba(9,18,32,.52);
    --glass-edge:rgba(255,255,255,.12);
    --overlay:linear-gradient(180deg, rgba(5,11,21,.7), rgba(8,15,27,.84));
    --veil:rgba(8,15,27,.7);
}
html[data-style="glass"]{ background:#1a2a40; }
html[data-style="glass"] body{ background:transparent; }

html[data-style="glass"] body.tbg::before,
html[data-style="glass"] body.tbg::after{ content:""; position:fixed; inset:0; pointer-events:none; }
html[data-style="glass"] body.tbg::before{
    z-index:-2; background:url('campus-bg.jpg') center 35%/cover no-repeat;
    filter:blur(4px) saturate(1.1); transform:scale(1.05);
}
html[data-style="glass"] body.tbg::after{ z-index:-1; background:var(--overlay); }

/* Header and nav strip blur through a pseudo-element, not on themselves: an element with backdrop-filter
   becomes the backdrop root for its children, so dropdowns inside it (All modules menu, style picker)
   would see nothing to blur and show the page through them. */
html[data-style="glass"] :is(.top,.nav)::before{
    content:""; position:absolute; inset:0; z-index:-1; pointer-events:none;
    -webkit-backdrop-filter:var(--blur); backdrop-filter:var(--blur);
}
/* dropdown menus hold dense text: frosted but nearly opaque */
html[data-style="glass"] .mega{ background:rgba(246,249,253,.88); border-bottom-color:var(--glass-edge);
    box-shadow:0 30px 50px -24px rgba(9,22,40,.6), inset 0 1px 0 rgba(255,255,255,.5); }
html[data-style="glass"][data-mode="dark"] .mega{ background:rgba(12,21,35,.9); box-shadow:0 30px 50px -24px rgba(0,0,0,.8); }
html[data-style="glass"] .tsw-pop{ -webkit-backdrop-filter:var(--blur); backdrop-filter:var(--blur); }
html[data-style="glass"] :is(.foot,.subbar,.mega,.subcard,.count,.stat,.noresult,.addbar,.modal,.shell,.aside,.info-grid,.add-strip,.rail,.tsw-pop){
    -webkit-backdrop-filter:var(--blur); backdrop-filter:var(--blur);
}
html[data-style="glass"] :is(.subcard,.count,.stat,.noresult,.addbar,.modal,.shell,.rail){
    border-color:var(--glass-edge);
    box-shadow:0 18px 40px -26px rgba(9,22,40,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
html[data-style="glass"] .top{ border-top-color:rgba(217,158,33,.9); }
html[data-style="glass"] .shell .panel{ background:rgba(255,255,255,.5); }
html[data-style="glass"][data-mode="dark"] .shell .panel{ background:rgba(9,17,29,.35); }
html[data-style="glass"] .erow{ -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }

/* ======================================================================
   SOFT — neumorphism. One surface colour; depth comes from paired shadows.
   ====================================================================== */
html[data-style="soft"]{
    --bg:#e4e9f0; --card:#e4e9f0; --soft:#e4e9f0; --field:#e4e9f0; --hover:#e9eef5;
    --line:rgba(15,28,46,.06); --chip-bg:#e4e9f0; --chip-line:transparent;
    --sh-d:#c2cad6; --sh-l:#ffffff;
    --raise:7px 7px 16px var(--sh-d), -7px -7px 16px var(--sh-l);
    --raise-sm:3px 3px 7px var(--sh-d), -3px -3px 7px var(--sh-l);
    --press:inset 3px 3px 7px var(--sh-d), inset -3px -3px 7px var(--sh-l);
    --veil:rgba(228,233,240,.92);
}
html[data-style="soft"][data-mode="dark"]{
    --bg:#1d2330; --card:#1d2330; --soft:#1d2330; --field:#1d2330; --hover:#222939;
    --line:rgba(255,255,255,.04);
    --sh-d:#12161f; --sh-l:#283041;
    --veil:rgba(29,35,48,.94);
}
html[data-style="soft"] body{ background:var(--bg); }
html[data-style="soft"] :is(.subcard,.count,.stat,.noresult,.addbar,.modal,.shell,.rail,.info-grid){
    border-color:transparent; box-shadow:var(--raise);
}
html[data-style="soft"] .subcard{ overflow:visible; }
html[data-style="soft"] .sub-head{ border-bottom-color:transparent; border-radius:12px 12px 0 0; }
html[data-style="soft"] :is(.erow,.add-strip){ border-color:transparent; box-shadow:var(--raise-sm); }
html[data-style="soft"] a.erow:hover{ box-shadow:var(--press); border-color:transparent; }
html[data-style="soft"] :is(input,select,.sub-count){ border-color:transparent; box-shadow:var(--press); }
html[data-style="soft"] :is(input,select):focus{ box-shadow:var(--press), 0 0 0 2px var(--accent); }
html[data-style="soft"] :is(.chip,.echip,.sub-num,.ico,.btn-ghost,.btn-danger,.modal-x){ border-color:transparent; box-shadow:var(--raise-sm); }
html[data-style="soft"] :is(.ico,.btn-ghost,.btn-danger,.modal-x):active{ box-shadow:var(--press); }
html[data-style="soft"] :is(.btn-primary,.btn-gold,.panel button[type="submit"]){ box-shadow:var(--raise-sm); }
html[data-style="soft"] :is(.btn-primary,.btn-gold,.panel button[type="submit"]):active{ box-shadow:var(--press); transform:translateY(1px); }
html[data-style="soft"] .addsub{ border-color:var(--sh-d); }
html[data-style="soft"] .shell .panel{ background:var(--card); }

/* ======================================================================
   TACTILE — skeuomorphism. Warm paper, bevelled controls, stitched chrome.
   ====================================================================== */
html[data-style="tactile"]{
    --bg:#ebe3d4; --card:#f8f3e9; --soft:#f1e9da; --field:#fffdf8; --hover:#fff8ea;
    --ink:#2b2216; --body:#5a4c38; --text:#5a4c38; --muted:#8c7c64; --line:#d8cab0;
    --accent:#6b4a1e; --blue:#8a5a14;
    --chip-bg:#efe3cb; --chip-line:#d8c7a5;
    --navy:#5b3d1a; --navy2:#4a3114;
    --bar:linear-gradient(180deg,#3b2a19,#2a1d11); --bar2:#33241a;
    --raise:0 1px 0 #fff inset, 0 2px 0 #d3c3a5, 0 12px 22px -14px rgba(70,48,20,.45);
    --press:inset 0 2px 4px rgba(70,48,20,.22), inset 0 -1px 0 #fff;
    --veil:rgba(235,227,212,.92);
}
html[data-style="tactile"][data-mode="dark"]{
    --bg:#1f1a14; --card:#2c251d; --soft:#332a20; --field:#241e17; --hover:#3a3025;
    --ink:#f2e8d6; --body:#cdbda3; --text:#cdbda3; --muted:#9e8d72; --line:#4a3e2f;
    --accent:#e7c58b; --blue:#f0c35a;
    --chip-bg:#3a3025; --chip-line:#54452f;
    --navy:#7a5426; --navy2:#684620;
    --bar:linear-gradient(180deg,#17110b,#0f0b07); --bar2:#17120d;
    --raise:0 1px 0 rgba(255,255,255,.06) inset, 0 2px 0 #14100b, 0 14px 24px -14px rgba(0,0,0,.7);
    --press:inset 0 2px 5px rgba(0,0,0,.5), inset 0 -1px 0 rgba(255,255,255,.05);
    --veil:rgba(31,26,20,.94);
}
html[data-style="tactile"] body{
    background-color:var(--bg);
    background-image:
        radial-gradient(rgba(120,90,40,.07) 1px, transparent 1.2px),
        radial-gradient(rgba(255,255,255,.18) 1px, transparent 1.2px);
    background-size:6px 6px, 9px 9px; background-position:0 0, 3px 4px;
}
html[data-style="tactile"] :is(.top,.foot){ background:var(--bar); }
html[data-style="tactile"] .top{ border-top-color:#c79a4b; box-shadow:inset 0 -7px 0 -6px rgba(231,197,139,.45); }
html[data-style="tactile"] .top-in{ border-bottom:1px dashed rgba(231,197,139,.35); }
html[data-style="tactile"] :is(.subcard,.count,.stat,.noresult,.addbar,.modal,.shell,.rail){ box-shadow:var(--raise); }
html[data-style="tactile"] .sub-head{ background:linear-gradient(180deg,var(--card),var(--soft)); }
html[data-style="tactile"] :is(.erow){ box-shadow:0 1px 0 #fff inset, 0 1px 0 var(--line); }
html[data-style="tactile"][data-mode="dark"] .erow{ box-shadow:0 1px 0 rgba(255,255,255,.05) inset, 0 1px 0 #14100b; }
html[data-style="tactile"] a.erow:hover{ transform:translateY(-1px); }
html[data-style="tactile"] :is(input,select){ box-shadow:var(--press); }
html[data-style="tactile"] :is(.sec-num){ background:linear-gradient(180deg,#8a6131,#5b3d1a); box-shadow:inset 0 1px 0 rgba(255,255,255,.3), inset 0 -3px 0 #c79a4b, 0 2px 3px rgba(0,0,0,.25); }
html[data-style="tactile"] :is(.btn-primary,.panel button[type="submit"]){
    background:linear-gradient(180deg,#7a5426,#4f3416); color:#fff8ea;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.28), 0 2px 0 #2e1f0e, 0 6px 12px -6px rgba(0,0,0,.4);
}
html[data-style="tactile"] :is(.btn-gold,.admin,.tlink.gold){
    background:linear-gradient(180deg,#f0c769,#c7952f); border-color:#a77a20;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 2px 0 #8a6408;
}
html[data-style="tactile"] :is(.btn-primary,.btn-gold,.panel button[type="submit"]):active{ transform:translateY(2px); box-shadow:inset 0 2px 4px rgba(0,0,0,.35); }
html[data-style="tactile"] :is(.chip,.echip,.sub-num,.ico){ box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 1px 0 var(--line); }
html[data-style="tactile"] .shell .panel{ background:var(--card); }

/* ======================================================================
   NEON — glow on deep navy-black. theme.js always pairs it with dark mode.
   ====================================================================== */
html[data-style="neon"]{
    --bg:#06070f; --card:rgba(16,18,34,.86); --soft:rgba(255,255,255,.025); --field:rgba(10,12,24,.9); --hover:rgba(30,34,64,.9);
    --ink:#eef1ff; --body:#aab2d6; --text:#aab2d6; --muted:#7d86ad; --line:rgba(130,150,255,.16);
    --accent:#7df9ff; --blue:#7df9ff; --gold:#ffcc4d;
    --navy:#3b2cff; --navy2:#2b1fd6;
    --chip-bg:rgba(125,249,255,.08); --chip-line:rgba(125,249,255,.25);
    --bar:rgba(8,9,20,.92); --bar2:rgba(12,13,28,.92);
    --glow-c:#7df9ff; --glow-m:#ff4fd8;
    --gold-ink:#ffd76a; --mark:rgba(255,79,216,.35);
    --veil:rgba(6,7,15,.9);
}
html[data-style="neon"] body{
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(59,44,255,.22), transparent 60%),
        radial-gradient(800px 500px at 100% 10%, rgba(255,79,216,.14), transparent 60%),
        radial-gradient(700px 600px at 50% 110%, rgba(125,249,255,.10), transparent 60%),
        var(--bg);
    background-attachment:fixed;
}
html[data-style="neon"] .top{ border-top:3px solid transparent;
    border-image:linear-gradient(90deg,var(--glow-c),#7b61ff,var(--glow-m)) 1; box-shadow:0 8px 30px -12px rgba(123,97,255,.5); }
html[data-style="neon"] :is(.subcard,.count,.stat,.noresult,.addbar,.modal,.shell,.rail){
    border-color:var(--line); box-shadow:0 0 0 1px rgba(125,249,255,.04), 0 20px 40px -28px rgba(0,0,0,.9);
}
html[data-style="neon"] .subcard:hover{ border-color:rgba(125,249,255,.4); box-shadow:0 0 24px -6px rgba(125,249,255,.35); }
html[data-style="neon"] a.erow:hover{ border-color:var(--glow-c); box-shadow:0 0 0 1px rgba(125,249,255,.4), 0 0 20px -2px rgba(125,249,255,.35); }
html[data-style="neon"] :is(.chip,.echip,.sub-num){ text-shadow:0 0 8px currentColor; }
html[data-style="neon"] .sec-num{ background:linear-gradient(135deg,#3b2cff,#ff4fd8); box-shadow:0 0 18px -2px rgba(255,79,216,.6); }
html[data-style="neon"] :is(.head h1,.panel h1){
    background:linear-gradient(90deg,#fff,var(--glow-c) 55%,var(--glow-m)); -webkit-background-clip:text; background-clip:text; color:transparent;
}
html[data-style="neon"] :is(.btn-primary,.panel button[type="submit"]){
    background:linear-gradient(90deg,#3b2cff,#a12cff); box-shadow:0 0 20px -4px rgba(161,44,255,.8);
}
html[data-style="neon"] :is(.btn-gold,.admin,.tlink.gold){ box-shadow:0 0 18px -4px rgba(255,204,77,.75); }
html[data-style="neon"] :is(input,select):focus{ border-color:var(--glow-c); box-shadow:0 0 0 3px rgba(125,249,255,.18), 0 0 16px -4px rgba(125,249,255,.6); }
html[data-style="neon"] .tab.on{ color:#fff; text-shadow:0 0 10px var(--liq,#7df9ff); }
html[data-style="neon"] .shell .panel{ background:rgba(10,12,24,.75); }

/* ======================================================================
   SWITCHER — pull-cord lamp (light/dark) + style picker
   ====================================================================== */
.tsw{ display:inline-flex; align-items:center; gap:6px; padding:3px; border-radius:12px;
      background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18); flex:none; }
.tsw.float{ position:fixed; top:16px; right:16px; z-index:100;
            background:rgba(9,22,40,.55); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }

/* pull-cord lamp: lamp on = light mode, lamp off = dark mode */
.tsw .lampsw{ appearance:none; position:relative; width:36px; height:30px; padding:0; margin:0; border:0; border-radius:9px;
     background:transparent; cursor:pointer; flex:none; overflow:visible; box-shadow:none; }
.tsw .lampsw:hover{ background:rgba(255,255,255,.08); }
.lampsw svg{ position:absolute; left:3px; top:0; width:30px; height:26px; overflow:visible; }
.lampsw .lsw-shade{ fill:#d99e21; stroke:#f0c35a; stroke-width:1; }
.lampsw .lsw-bulb{ fill:#59606c; transition:fill .35s, filter .35s; }
.lampsw[aria-checked="false"] .lsw-bulb{ fill:#ffe39a; filter:drop-shadow(0 0 4px #ffd35a) drop-shadow(0 0 9px rgba(255,200,60,.85)); }
.lampsw::after{ content:""; position:absolute; left:50%; top:20px; width:46px; height:20px; margin-left:-23px; pointer-events:none;
     background:radial-gradient(ellipse 50% 100% at 50% 0, rgba(255,214,120,.45), transparent 75%); opacity:0; transition:opacity .35s; }
.lampsw[aria-checked="false"]::after{ opacity:1; animation:lswFlicker .6s steps(1) 1; }
.lsw-cord{ position:absolute; left:26px; top:17px; width:10px; height:30px; transform-origin:top center; pointer-events:none;
     transition:transform .25s cubic-bezier(.3,1.6,.5,1); }
.lsw-cord::before{ content:""; position:absolute; left:4px; top:0; width:1.5px; height:24px; border-radius:2px; background:#c8d3e2; }
.lsw-cord::after{ content:""; position:absolute; left:1px; top:22px; width:8px; height:9px; border-radius:3px 3px 5px 5px;
     background:linear-gradient(180deg,#f0c35a,#d99e21); box-shadow:0 2px 3px rgba(0,0,0,.35); }
.lampsw:hover .lsw-cord{ transform:rotate(-8deg); }
.lampsw.pull .lsw-cord{ transform:translateY(8px); transition-duration:.15s; }
@keyframes lswFlicker{ 0%{opacity:.2} 20%{opacity:.9} 30%{opacity:.3} 50%{opacity:1} 65%{opacity:.6} 80%,100%{opacity:1} }

/* style picker */
.tsw-style{ position:relative; }
.tsw .tsw-btn{
    appearance:none; width:auto; margin:0; display:inline-flex; align-items:center; gap:7px;
    padding:7px 10px; border:0; border-radius:9px; background:transparent; color:#d5e0ee;
    font:inherit; font-size:.76rem; font-weight:700; line-height:1; cursor:pointer; white-space:nowrap;
    transition:background .15s, color .15s; box-shadow:none;
}
.tsw .tsw-btn:hover,.tsw .tsw-btn[aria-expanded="true"]{ background:rgba(255,255,255,.12); color:#fff; }
.tsw .tsw-btn svg{ width:13px; height:13px; flex:none; opacity:.8; }
.tsw-dot{ width:14px; height:14px; border-radius:5px; flex:none; box-shadow:0 0 0 1.5px rgba(255,255,255,.55); }

/* swatches used by the button dot and the menu previews */
[data-s="normal"].tsw-dot, .tsw-prev[data-s="normal"]{ background:linear-gradient(135deg,#0e2748 50%,#d99e21 50%); }
[data-s="glass"].tsw-dot,  .tsw-prev[data-s="glass"] { background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(160,190,230,.45)), url('campus-bg.jpg') center/cover; }
[data-s="soft"].tsw-dot,   .tsw-prev[data-s="soft"]  { background:#e4e9f0; }
[data-s="tactile"].tsw-dot,.tsw-prev[data-s="tactile"]{ background:linear-gradient(180deg,#f8f3e9,#e4d6bb); }
[data-s="neon"].tsw-dot,   .tsw-prev[data-s="neon"]  { background:radial-gradient(circle at 30% 30%,#ff4fd8,transparent 55%), radial-gradient(circle at 75% 70%,#7df9ff,transparent 55%), #0b0c1c; }

.tsw-pop{ position:absolute; right:0; top:calc(100% + 10px); z-index:120; width:270px; padding:8px;
          border-radius:14px; background:var(--card,#fff); color:var(--ink,#0f1c2e);
          border:1px solid var(--line,#dfe5ec); box-shadow:0 30px 60px -24px rgba(9,22,40,.6);
          animation:popIn .18s ease-out; }
.tsw-pop[hidden]{ display:none; }
html[data-style="glass"] .tsw-pop{ background:rgba(255,255,255,.82); }
html[data-style="glass"][data-mode="dark"] .tsw-pop{ background:rgba(17,28,45,.86); }
html[data-style="neon"] .tsw-pop{ background:#0d0f20; box-shadow:0 0 0 1px rgba(125,249,255,.15), 0 30px 60px -24px #000; }
.tsw-pop-h{ font-size:.64rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:var(--muted,#7c8798); padding:6px 8px 8px; }
.tsw-pop button{ appearance:none; width:100%; margin:0; display:flex; align-items:center; gap:11px; text-align:left;
                 padding:8px; border:0; border-radius:10px; background:transparent; color:inherit; font:inherit; cursor:pointer; box-shadow:none; }
.tsw-pop button:hover,.tsw-pop button:focus-visible{ background:var(--hover,#f7f9fc); outline:none; }
.tsw-pop button[aria-checked="true"]{ background:var(--chip-bg,#eef3fa); }
.tsw-pop button > span{ flex:1; min-width:0; }
.tsw-pop button b{ display:block; font-size:.84rem; color:var(--ink,#0f1c2e); }
.tsw-pop button small{ display:block; font-size:.72rem; color:var(--muted,#7c8798); margin-top:1px; }
.tsw-prev{ position:relative; width:42px; height:32px; border-radius:8px; flex:none; overflow:hidden;
           box-shadow:0 0 0 1px rgba(15,28,46,.12); }
.tsw-prev b{ position:absolute; left:6px; right:6px; height:7px; border-radius:3px; background:rgba(255,255,255,.85); }
.tsw-prev b:first-child{ top:7px; } .tsw-prev b:last-child{ top:18px; right:16px; }
.tsw-prev[data-s="normal"] b{ background:#fff; }
.tsw-prev[data-s="soft"] b{ background:#e4e9f0; box-shadow:2px 2px 3px #b9c2cf, -2px -2px 3px #fff; }
.tsw-prev[data-s="tactile"] b{ background:#fffdf8; box-shadow:0 1px 0 #cdbb98; }
.tsw-prev[data-s="neon"] b{ background:transparent; box-shadow:0 0 0 1px #7df9ff, 0 0 6px #7df9ff; }
.tsw-tick{ width:16px; height:16px; flex:none; color:var(--accent,#0e2748); opacity:0; }
.tsw-pop button[aria-checked="true"] .tsw-tick{ opacity:1; }
@keyframes popIn{ from{ opacity:0; transform:translateY(-6px) scale(.98); } }

@media(max-width:760px){ .tsw .tsw-name{ display:none; } .tsw .tsw-btn{ padding:7px 8px; } }

/* ======================================================================
   LIQUID NAV — a blob slides to the active tab and changes colour
   ====================================================================== */
.has-liquid{ position:relative; }
.liquid{ position:absolute; left:0; top:6px; bottom:6px; width:0; border-radius:999px; pointer-events:none; z-index:0;
         background:color-mix(in srgb, var(--liq,#d99e21) 22%, transparent);
         box-shadow:0 0 0 1px color-mix(in srgb, var(--liq,#d99e21) 45%, transparent), 0 0 22px -4px var(--liq,#d99e21);
         transition:transform .55s cubic-bezier(.68,-.4,.27,1.4), width .45s cubic-bezier(.68,-.4,.27,1.4), background .4s, box-shadow .4s, opacity .2s; }
.liquid::after{ content:""; position:absolute; left:50%; bottom:-6px; width:26px; height:3px; margin-left:-13px; border-radius:3px;
                background:var(--liq,#d99e21); box-shadow:0 0 10px var(--liq,#d99e21); }
.has-liquid > :not(.liquid){ position:relative; z-index:1; }
.has-liquid .tab.on{ border-bottom-color:transparent; }

/* ======================================================================
   SNACKBARS — gradient toasts with icon, timer bar and close button
   ====================================================================== */
.snack-stack{ position:fixed; right:20px; bottom:20px; z-index:200; display:flex; flex-direction:column; gap:10px;
              align-items:flex-end; pointer-events:none; }
.snack{ --g1:#16a34a; --g2:#0d9488; pointer-events:auto; position:relative; overflow:hidden;
        display:flex; align-items:center; gap:12px; min-width:260px; max-width:380px; padding:12px 12px 14px 12px;
        border-radius:14px; color:#fff; background:linear-gradient(120deg,var(--g1),var(--g2));
        box-shadow:0 18px 36px -16px color-mix(in srgb, var(--g1) 80%, #000), inset 0 1px 0 rgba(255,255,255,.25);
        font-size:.84rem; animation:snackIn .35s cubic-bezier(.2,1.2,.4,1); }
.snack-info{ --g1:#2563eb; --g2:#7c3aed; }
.snack-warn{ --g1:#f59e0b; --g2:#ea580c; }
.snack-err { --g1:#e11d48; --g2:#be123c; }
.snack.out{ animation:snackOut .26s ease-in forwards; }
.snack-ic{ width:32px; height:32px; border-radius:10px; flex:none; display:grid; place-items:center;
           background:rgba(255,255,255,.22); box-shadow:inset 0 0 0 1px rgba(255,255,255,.3); }
.snack-ic svg{ width:18px; height:18px; }
.snack-tx{ flex:1; min-width:0; line-height:1.3; }
.snack-tx b{ display:block; font-size:.74rem; letter-spacing:.06em; text-transform:uppercase; opacity:.85; }
.snack-tx span{ display:block; font-weight:600; overflow-wrap:anywhere; }
.snack-x{ appearance:none; width:26px; height:26px; margin:0; padding:0; flex:none; border:0; border-radius:8px;
          background:rgba(255,255,255,.16); color:#fff; font-size:1.05rem; line-height:1; cursor:pointer; box-shadow:none; }
.snack-x:hover{ background:rgba(255,255,255,.3); }
.snack-bar{ position:absolute; left:0; bottom:0; height:3px; width:100%; background:rgba(255,255,255,.6);
            transform-origin:left; animation:snackBar var(--ms,3200ms) linear forwards; }
.snack.hold .snack-bar{ animation-play-state:paused; }
@keyframes snackIn{ from{ opacity:0; transform:translateY(14px) scale(.96); } }
@keyframes snackOut{ to{ opacity:0; transform:translateX(30px); } }
@keyframes snackBar{ to{ transform:scaleX(0); } }
@media(max-width:620px){ .snack-stack{ left:12px; right:12px; bottom:12px; align-items:stretch; } .snack{ max-width:none; } }

@media(prefers-reduced-motion:reduce){
    .lampsw *, .lampsw, .lampsw::after, .liquid, .snack, .snack-bar, .tsw-pop{ animation:none!important; transition:none!important; }
}
