/* Pathshala — "Glass" design tokens. Light glass first; dark redefines tokens only. */
:root {
  --bg: #E8EDFB;
  --surface: rgba(255, 255, 255, .55);
  --surface-2: rgba(255, 255, 255, .38);
  --solid: rgba(255, 255, 255, .92);
  --glass-a: rgba(255, 255, 255, .78);
  --glass-b: rgba(255, 255, 255, .42);
  --glass-border: rgba(255, 255, 255, .78);
  --glass-hi: rgba(255, 255, 255, .95);
  --spec: rgba(255, 255, 255, .55);
  --line: rgba(30, 38, 90, .09);
  --line-strong: rgba(30, 38, 90, .16);
  --ink: #0B1027;
  --ink-2: #2A3257;
  --muted: #5B6488;
  --brand: #4B5CFF;
  --brand-2: #A259FF;
  --brand-ink: #FFFFFF;
  --brand-soft: rgba(75, 92, 255, .12);
  --brand-line: rgba(75, 92, 255, .38);
  --navy: #11173D;
  --gold: #F2A60C;
  --gold-soft: rgba(242, 166, 12, .16);
  --ok: #0E8A55;
  --ok-soft: rgba(14, 138, 85, .13);
  --warn: #A86200;
  --warn-soft: rgba(242, 166, 12, .17);
  --bad: #D02F4A;
  --bad-soft: rgba(208, 47, 74, .12);
  --info: #0B7AA3;
  --info-soft: rgba(11, 122, 163, .12);
  --violet: #6D45E0;
  --violet-soft: rgba(109, 69, 224, .12);
  --shape-a: rgba(91, 108, 255, .30);
  --shape-b: rgba(192, 132, 252, .14);
  --shape-edge: rgba(255, 255, 255, .85);
  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 12px 32px -14px rgba(28, 38, 110, .28);
  --shadow-lg: 0 40px 90px -24px rgba(20, 28, 90, .45);
  --glow: 0 10px 30px -10px rgba(75, 92, 255, .65);
  --g1: #5B6CFF; --g2: #8B5CF6; --g3: #C084FC; --g-rgb: 91, 108, 255; --g3-rgb: 192, 132, 252;
  --hero-1: #2A3CB8; --hero-2: #141B52; --hero-3: #0A0F2E;
  --aurora-1: 91,108,255; --aurora-2: 192,132,252; --aurora-3: 34,211,238; --aurora-4: 236,72,153;
  --blur: 18px;
  --radius: 18px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --topbar-h: 68px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Sora", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #05070F; --surface: rgba(255, 255, 255, .055); --surface-2: rgba(255, 255, 255, .035); --solid: rgba(14, 19, 40, .94);
    --glass-a: rgba(255, 255, 255, .10); --glass-b: rgba(255, 255, 255, .025); --glass-border: rgba(255, 255, 255, .11); --glass-hi: rgba(255, 255, 255, .30); --spec: rgba(150, 165, 255, .16);
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
    --ink: #EEF1FF; --ink-2: #C5CBE6; --muted: #8B94B8;
    --brand: #8595FF; --brand-2: #C084FC; --brand-ink: #05070F; --brand-soft: rgba(133, 149, 255, .15); --brand-line: rgba(133, 149, 255, .42);
    --navy: #1A2260; --gold: #FFC24B; --gold-soft: rgba(255, 194, 75, .14);
    --ok: #46D597; --ok-soft: rgba(70, 213, 151, .13); --warn: #F5B650; --warn-soft: rgba(245, 182, 80, .14);
    --bad: #FF7A8E; --bad-soft: rgba(255, 122, 142, .13); --info: #5CCBF0; --info-soft: rgba(92, 203, 240, .13);
    --violet: #B3A2FF; --violet-soft: rgba(179, 162, 255, .14);
    --shape-a: rgba(133, 149, 255, .22); --shape-b: rgba(34, 211, 238, .06); --shape-edge: rgba(255, 255, 255, .28);
    --shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 20px 40px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 40px 100px -20px rgba(0, 0, 0, .8);
    --glow: 0 10px 34px -8px rgba(120, 110, 255, .75);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05070F; --surface: rgba(255, 255, 255, .055); --surface-2: rgba(255, 255, 255, .035); --solid: rgba(14, 19, 40, .94);
  --glass-a: rgba(255, 255, 255, .10); --glass-b: rgba(255, 255, 255, .025); --glass-border: rgba(255, 255, 255, .11); --glass-hi: rgba(255, 255, 255, .30); --spec: rgba(150, 165, 255, .16);
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
  --ink: #EEF1FF; --ink-2: #C5CBE6; --muted: #8B94B8;
  --brand: #8595FF; --brand-2: #C084FC; --brand-ink: #05070F; --brand-soft: rgba(133, 149, 255, .15); --brand-line: rgba(133, 149, 255, .42);
  --navy: #1A2260; --gold: #FFC24B; --gold-soft: rgba(255, 194, 75, .14);
  --ok: #46D597; --ok-soft: rgba(70, 213, 151, .13); --warn: #F5B650; --warn-soft: rgba(245, 182, 80, .14);
  --bad: #FF7A8E; --bad-soft: rgba(255, 122, 142, .13); --info: #5CCBF0; --info-soft: rgba(92, 203, 240, .13);
  --violet: #B3A2FF; --violet-soft: rgba(179, 162, 255, .14);
  --shape-a: rgba(133, 149, 255, .22); --shape-b: rgba(34, 211, 238, .06); --shape-edge: rgba(255, 255, 255, .28);
  --shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 20px 40px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 40px 100px -20px rgba(0, 0, 0, .8);
  --glow: 0 10px 34px -8px rgba(120, 110, 255, .75);
}


/* ---------- Palettes: Crimson (red + black) and Blossom (pink + violet) ---------- */
:root[data-palette="crimson"] {
  --bg: #F2ECEC; --ink: #150A0C; --ink-2: #3B2427; --muted: #765C60;
  --brand: #C8142A; --brand-2: #7E0B18; --brand-soft: rgba(200, 20, 42, .10); --brand-line: rgba(200, 20, 42, .34);
  --g1: #E3243A; --g2: #8E0D1C; --g3: #1B0A0D; --g-rgb: 215, 25, 43; --g3-rgb: 120, 12, 24;
  --hero-1: #6E0E1A; --hero-2: #2A080D; --hero-3: #0C0405; --navy: #1B0A0D;
  --aurora-1: 225,29,46; --aurora-2: 30,20,22; --aurora-3: 190,20,40; --aurora-4: 70,60,62; --aurora-alpha: .16;
  --shape-a: rgba(215, 25, 43, .26); --shape-b: rgba(25, 8, 10, .14);
  --glow: 0 10px 30px -10px rgba(215, 25, 43, .6);
}
:root[data-palette="blossom"] {
  --bg: #F7ECF6; --ink: #1F0B27; --ink-2: #452A51; --muted: #7C6488;
  --brand: #C8267A; --brand-2: #7C3AED; --brand-soft: rgba(200, 38, 122, .10); --brand-line: rgba(200, 38, 122, .34);
  --g1: #EC4899; --g2: #A855F7; --g3: #7C3AED; --g-rgb: 214, 51, 132; --g3-rgb: 168, 85, 247;
  --hero-1: #8A2379; --hero-2: #43155C; --hero-3: #1D0A2C; --navy: #2A0F3D;
  --aurora-1: 236,72,153; --aurora-2: 168,85,247; --aurora-3: 244,114,182; --aurora-4: 124,58,237;
  --shape-a: rgba(236, 72, 153, .24); --shape-b: rgba(168, 85, 247, .16);
  --glow: 0 10px 30px -10px rgba(214, 51, 132, .6);
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="crimson"]:not([data-theme="light"]) {
    --bg: #050505; --glass-a: rgba(255, 255, 255, .07); --glass-b: rgba(255, 255, 255, .02); --glass-border: rgba(255, 255, 255, .10); --spec: rgba(255, 70, 90, .15);
    --ink: #F8EDEE; --ink-2: #DCC5C8; --muted: #A08A8E;
    --brand: #FF4A5E; --brand-2: #FF8A4C; --brand-soft: rgba(255, 74, 94, .14); --brand-line: rgba(255, 74, 94, .42);
    --g1: #FF3B50; --g2: #A30E1E; --g3: #FF7A45; --g-rgb: 255, 59, 80; --g3-rgb: 255, 122, 69;
    --hero-1: #7A0E1B; --hero-2: #2C070C; --hero-3: #0E0305; --navy: #2C070C;
    --aurora-1: 230,20,45; --aurora-2: 20,0,4; --aurora-3: 100,0,14; --aurora-4: 8,0,2; --aurora-alpha: .09;
    --shape-a: rgba(255, 59, 80, .20); --shape-b: rgba(255, 122, 69, .05); --shape-edge: rgba(255, 180, 180, .25);
    --glow: 0 10px 34px -8px rgba(255, 59, 80, .7);
  }
  :root[data-palette="blossom"]:not([data-theme="light"]) {
    --bg: #0D0513; --glass-border: rgba(255, 160, 220, .13); --spec: rgba(255, 120, 200, .15);
    --ink: #FBEFF8; --ink-2: #E2CAE6; --muted: #A68DAE;
    --brand: #FF6FB5; --brand-2: #B794FF; --brand-soft: rgba(255, 111, 181, .14); --brand-line: rgba(255, 111, 181, .42);
    --g1: #FF5FA8; --g2: #B06BFF; --g3: #7C5CFF; --g-rgb: 255, 95, 168; --g3-rgb: 176, 107, 255;
    --hero-1: #8F2380; --hero-2: #3E1257; --hero-3: #16071F; --navy: #3E1257;
    --aurora-1: 255,80,170; --aurora-2: 160,80,255; --aurora-3: 255,140,200; --aurora-4: 110,50,230;
    --shape-a: rgba(255, 95, 168, .20); --shape-b: rgba(176, 107, 255, .08); --shape-edge: rgba(255, 200, 235, .26);
    --glow: 0 10px 34px -8px rgba(255, 95, 168, .7);
  }
}
:root[data-palette="crimson"][data-theme="dark"] {
  --bg: #050505; --glass-a: rgba(255, 255, 255, .07); --glass-b: rgba(255, 255, 255, .02); --glass-border: rgba(255, 255, 255, .10); --spec: rgba(255, 70, 90, .15);
  --ink: #F8EDEE; --ink-2: #DCC5C8; --muted: #A08A8E;
  --brand: #FF4A5E; --brand-2: #FF8A4C; --brand-soft: rgba(255, 74, 94, .14); --brand-line: rgba(255, 74, 94, .42);
  --g1: #FF3B50; --g2: #A30E1E; --g3: #FF7A45; --g-rgb: 255, 59, 80; --g3-rgb: 255, 122, 69;
  --hero-1: #7A0E1B; --hero-2: #2C070C; --hero-3: #0E0305; --navy: #2C070C;
  --aurora-1: 230,20,45; --aurora-2: 20,0,4; --aurora-3: 100,0,14; --aurora-4: 8,0,2; --aurora-alpha: .09;
  --shape-a: rgba(255, 59, 80, .20); --shape-b: rgba(255, 122, 69, .05); --shape-edge: rgba(255, 180, 180, .25);
  --glow: 0 10px 34px -8px rgba(255, 59, 80, .7);
}
:root[data-palette="blossom"][data-theme="dark"] {
  --bg: #0D0513; --glass-border: rgba(255, 160, 220, .13); --spec: rgba(255, 120, 200, .15);
  --ink: #FBEFF8; --ink-2: #E2CAE6; --muted: #A68DAE;
  --brand: #FF6FB5; --brand-2: #B794FF; --brand-soft: rgba(255, 111, 181, .14); --brand-line: rgba(255, 111, 181, .42);
  --g1: #FF5FA8; --g2: #B06BFF; --g3: #7C5CFF; --g-rgb: 255, 95, 168; --g3-rgb: 176, 107, 255;
  --hero-1: #8F2380; --hero-2: #3E1257; --hero-3: #16071F; --navy: #3E1257;
  --aurora-1: 255,80,170; --aurora-2: 160,80,255; --aurora-3: 255,140,200; --aurora-4: 110,50,230;
  --shape-a: rgba(255, 95, 168, .20); --shape-b: rgba(176, 107, 255, .08); --shape-edge: rgba(255, 200, 235, .26);
  --glow: 0 10px 34px -8px rgba(255, 95, 168, .7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.num, .tabnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100%; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; letter-spacing: -.02em;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 600; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.school-card { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.school-card b { display: block; font-size: 12.5px; }

.main-col { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.icon-btn.menu-btn { display: none; }
.cohort {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer;
}
.cohort { min-width: 0; flex: 0 1 auto; }
.cohort select { border: 0; background: transparent; font-weight: 700; cursor: pointer; padding-right: 2px; appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.cohort select:focus { outline: none; }
.search { position: relative; flex: 1; max-width: 380px; }
.search input {
  width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 9px; padding: 0 12px 0 36px; font-size: 13px;
}
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow: auto; z-index: 50;
}
.search-results button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.search-results button:hover, .search-results button:focus { background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.xp-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px;
  background: var(--gold-soft); color: var(--ink); font-weight: 800; font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); cursor: pointer;
}
.coin { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE08A, var(--gold) 60%, #C98400); display: grid; place-items: center; color: #6B4300; font-size: 11px; font-weight: 800; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.me { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.me .who { font-size: 12.5px; font-weight: 700; line-height: 1.15; padding-right: 8px; }
.me .who small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }

.popover {
  position: absolute; right: 0; top: 46px; width: 340px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden;
}
.popover-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.popover-list { max-height: 360px; overflow: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif.unread { background: var(--brand-soft); }
.notif small { color: var(--muted); display: block; }

.view { padding: 24px; padding-bottom: 96px; outline: none; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs button { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; font-size: 12px; }

/* ---------- Layout ---------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.split-wide { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rail { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-head h2, .section-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card-head p { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 14px 18px 18px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; cursor: pointer; font-size: 13px; padding: 4px 2px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-gold { background: var(--gold-soft); color: var(--warn); }

/* ---------- Chips, badges, buttons ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.6; }
.chip-outline { border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }
.dot-s { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: color-mix(in srgb, var(--navy) 85%, #000); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 700; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input {
  height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 11px; font-size: 13.5px; width: 100%;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 11px; resize: vertical; }
.input:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
.input.sm { height: 32px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.err { font-size: 12px; color: var(--bad); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 140px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.t .r { text-align: right; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { font-weight: 700; display: block; white-space: nowrap; }
.person small { color: var(--muted); font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; color: #fff; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.row-link { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.row-link:hover b { color: var(--brand); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- Progress, rings, bars ---------- */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; text-align: center; line-height: 1.1; }
.ring .ring-label b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring .ring-label small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }

/* ---------- Newton-style task cards / carousel ---------- */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 280px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.carousel > * { scroll-snap-align: start; }
.task { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-type { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.task-type .tico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.task h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: auto; }
.xp { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 12.5px; }
.xp .coin { width: 18px; height: 18px; font-size: 9px; }
.mult { font-size: 10.5px; font-weight: 800; color: var(--violet); background: var(--violet-soft); padding: 1px 6px; border-radius: 5px; }
.solved-by { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.lockin {
  position: relative; overflow: hidden; padding: 20px; color: #fff; border: 0;
  background: linear-gradient(120deg, #0E1B3D 0%, #1C3478 70%, #2A4FB8 100%);
}
.lockin h3 { font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.lockin p { color: #C9D5F5; font-size: 13px; margin-top: 4px; max-width: 46ch; }
.lockin .bar { background: rgba(255,255,255,.15); border-color: transparent; }
.lockin .bar > span { background: var(--gold); }
.lockin .mascot { position: absolute; right: 12px; bottom: -8px; width: 120px; opacity: .95; }
.lockin-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; max-width: 360px; }
.lockin-row .bar { flex: 1; }

.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.hello p { color: var(--muted); margin-top: 2px; }

/* ---------- Schedule rail ---------- */
.sched-item { display: grid; grid-template-columns: 68px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sched-item:last-child { border-bottom: 0; }
.sched-time { font-size: 11.5px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.sched-body { border-left: 3px solid var(--brand); padding-left: 10px; }
.sched-body b { font-size: 13px; display: block; }
.sched-body small { color: var(--muted); font-size: 12px; }
.sched-item.past .sched-body b { text-decoration: line-through; color: var(--muted); }
.sched-item.past .sched-body { border-left-color: var(--line-strong); }
.sched-item.now .sched-body { border-left-color: var(--ok); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.days button { border: 1px solid transparent; background: none; border-radius: 9px; padding: 6px 0; cursor: pointer; display: grid; gap: 1px; font-size: 11px; color: var(--muted); font-weight: 700; }
.days button b { font-size: 15px; color: var(--ink); }
.days button.on { background: var(--brand); color: #fff; }
.days button.on b { color: #fff; }

/* ---------- Attendance marking ---------- */
.att-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-toggle { display: inline-flex; gap: 4px; }
.att-toggle button { width: 38px; height: 32px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 800; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.att-toggle button.on.P { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-toggle button.on.A { background: var(--bad); border-color: var(--bad); color: #fff; }
.att-toggle button.on.L { background: var(--warn); border-color: var(--warn); color: #fff; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .hd { font-size: 10.5px; color: var(--muted); font-weight: 700; text-align: center; }
.heat .hc { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); max-width: 100%; }
.hc.P { background: var(--ok-soft); color: var(--ok); }
.hc.A { background: var(--bad-soft); color: var(--bad); }
.hc.L { background: var(--warn-soft); color: var(--warn); }
.hc.H { background: var(--violet-soft); color: var(--violet); }
.hc.today { outline: 2px solid var(--brand); }

/* ---------- Timetable ---------- */
.tt { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; }
.tt th { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px; text-align: left; }
.tt td { background: var(--surface-2); border-radius: 8px; padding: 8px 9px; font-size: 12.5px; vertical-align: top; border: 1px solid var(--line); }
.tt td b { display: block; font-size: 12.5px; }
.tt td small { color: var(--muted); font-size: 11px; }
.tt td.brk { background: none; border: 1px dashed var(--line); text-align: center; color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: middle; }
.tt td.mine { background: var(--brand-soft); border-color: var(--brand-line); }
.tt td.today-col { box-shadow: inset 0 0 0 1px var(--brand-line); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .ch { padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .cd { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .cd.out { background: var(--surface-2); }
.cal .cd.out .dn { color: var(--line-strong); }
.cal .dn { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal .cd.today .dn { background: var(--brand); color: #fff; border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; }
.ev { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Misc blocks ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-size: 13.5px; }
.list-row .grow small { color: var(--muted); font-size: 12px; }
.notice { padding: 16px 18px; border-top: 1px solid var(--line); }
.notice:first-child { border-top: 0; }
.notice h3 { font-size: 14.5px; font-weight: 700; }
.notice p { color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; max-width: 72ch; }
.formula { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; color: var(--ink-2); line-height: 1.6; overflow-x: auto; }
.breakdown { display: grid; gap: 12px; }
.breakdown .bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.breakdown .bd-row .bar { grid-column: 1 / -1; }
.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.ledger-row small { color: var(--muted); font-size: 12px; }
.ledger-row .amt { font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; grid-row: span 2; align-self: center; }
.rank { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--surface-2); flex: none; }
.rank.g1 { background: #FFE9A8; color: #7A5200; }
.rank.g2 { background: #E6EAF2; color: #3E4A60; }
.rank.g3 { background: #F6D9C3; color: #7A3E12; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.alert b { display: block; }
.subject-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; border: 1px solid var(--line); }
.subject-card:hover { border-color: var(--brand-line); }
.subj-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.report-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 14px; }
.quiz-q { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.quiz-q + .quiz-q { margin-top: 10px; }
.quiz-opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); margin-top: 6px; cursor: pointer; }
.quiz-opt:hover { background: var(--surface-2); }
.quiz-opt.right { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-methods label { border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; display: grid; gap: 4px; cursor: pointer; font-weight: 700; font-size: 13px; }
.pay-methods label small { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.pay-methods input { position: absolute; opacity: 0; pointer-events: none; }
.pay-methods label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-methods label:has(input:focus-visible) { outline: 2px solid var(--brand); }
.demo-banner { font-size: 12px; font-weight: 600; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal, drawer, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 13, 30, .5); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100% - 16px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 800; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { background: var(--surface); width: 440px; max-width: 100%; height: 100%; overflow: auto; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; animation: fade .2s; }
.toast.bad { background: var(--bad); }

/* ---------- Neo assistant ---------- */
.neo-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 8px; border-radius: 999px; border: 0;
  background: var(--navy); color: #fff; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-lg);
}
.neo-fab .orb { width: 32px; height: 32px; border-radius: 50%; background: conic-gradient(from 200deg, #5B8CFF, #8E6CFF, #3DD6C4, #5B8CFF); display: grid; place-items: center; }
.neo-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 75; width: 380px; max-width: calc(100vw - 32px);
  height: min(620px, calc(100% - 100px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.neo-head { padding: 14px 16px; background: var(--navy); color: #fff; display: flex; gap: 10px; align-items: center; }
.neo-head small { display: block; color: #B8C4E6; font-size: 11.5px; font-weight: 600; }
.neo-head .tuned { margin-left: auto; font-size: 10.5px; font-weight: 800; background: rgba(255,255,255,.12); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.neo-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.neo-qa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.neo-qa button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: left; cursor: pointer; font-size: 12px; color: var(--muted); }
.neo-qa button b { display: block; color: var(--ink); font-size: 13px; }
.neo-qa button:hover { border-color: var(--brand-line); }
.neo-sugg button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 9px 2px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.neo-sugg button:hover { color: var(--brand); }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.neo-input { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; }
.neo-input input { flex: 1; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: var(--surface); min-width: 0; }
.neo-foot { font-size: 10.5px; color: var(--muted); text-align: center; padding: 0 10px 8px; }

/* =====================================================================
   GLASS LAYER — frosted surfaces, 3D depth, backdrop scene, motion
   ===================================================================== */
body { background: var(--bg); }
h1, h2, h3, .kpi-val, .brand-name, .section-title { font-family: var(--display); }

/* ---- backdrop scene (built by fx.js) ---- */
.fx-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fx-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-grain { position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
@keyframes fx-float { 50% { translate: 0 -26px; } }
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 95; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--g1), var(--g3), var(--g3)); box-shadow: 0 0 12px rgba(var(--g-rgb), .8); pointer-events: none; }

/* ---- glass surfaces ---- */
.card, .sidebar, .topbar, .modal, .drawer, .neo-panel, .popover, .search-results {
  background: linear-gradient(150deg, var(--glass-a), var(--glass-b));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  border-color: var(--glass-border);
}
.card { position: relative; border: 1px solid var(--glass-border); box-shadow: var(--shadow); border-radius: var(--radius); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, var(--glass-hi), transparent 38%, transparent 70%, rgba(255, 255, 255, .12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%), var(--spec), transparent 42%); }
.card:hover::after { opacity: 1; }
.popover, .search-results { background: var(--solid); }
.sidebar { background: linear-gradient(180deg, var(--glass-a), var(--glass-b)); border-right: 1px solid var(--glass-border); box-shadow: 1px 0 0 rgba(255, 255, 255, .06), 20px 0 60px -40px rgba(20, 28, 90, .35); }
.topbar { background: linear-gradient(180deg, var(--glass-a), var(--glass-b)); border-bottom: 1px solid var(--glass-border); transition: box-shadow .3s ease, background .3s ease; }
.topbar.scrolled { box-shadow: 0 18px 40px -26px rgba(20, 28, 90, .55); }

/* ---- brand, nav ---- */
.brand-mark { background: linear-gradient(135deg, var(--g1), var(--g2) 60%, var(--g3)); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .5); border-radius: 12px; transform: perspective(300px) rotateX(10deg) rotateY(-12deg); }
.nav-item { position: relative; border-radius: 11px; transition: background .2s ease, color .2s ease, transform .2s ease; }
.nav-item:hover { background: var(--surface); transform: translateX(3px); }
.nav-item.active { background: linear-gradient(90deg, var(--brand-soft), transparent 90%); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-line); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--g1), var(--g3)); box-shadow: 0 0 12px var(--g1); }
.nav-item .count { background: linear-gradient(135deg, #FF5C7A, #FF8A5C); box-shadow: 0 4px 12px -4px rgba(255, 92, 122, .8); }

/* ---- controls ---- */
.btn { background: var(--surface); border-color: var(--line-strong); border-radius: 11px; transition: transform .18s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { background: var(--glass-a); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; color: #fff; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover { background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 14px 34px -10px rgba(var(--g-rgb), .85), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-dark { background: linear-gradient(135deg, var(--hero-2), var(--hero-3)); border-color: rgba(255, 255, 255, .12); color: #fff; box-shadow: 0 10px 24px -12px rgba(14, 20, 56, .9); }
.btn-dark:hover { background: linear-gradient(135deg, var(--hero-1), var(--hero-3)); }
.btn-ok { background: linear-gradient(135deg, #10B26C, #0E8A55); border-color: transparent; }
.btn:disabled:hover { transform: none; }
.icon-btn, .cohort, .me { background: var(--surface); border-color: var(--line-strong); border-radius: 12px; transition: transform .18s ease, background .2s ease; }
.icon-btn:hover { background: var(--glass-a); transform: translateY(-1px); }
.me { border-radius: 999px; }
.xp-pill { background: linear-gradient(135deg, rgba(255, 207, 92, .32), rgba(255, 170, 60, .16)); border-color: rgba(242, 166, 12, .45); box-shadow: 0 8px 22px -12px rgba(242, 166, 12, .9); }
.input, select.input, textarea.input, .search input { background: var(--surface-2); border-color: var(--line-strong); border-radius: 11px; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.input:focus, .search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--glass-a); }
.seg { background: var(--surface-2); border-color: var(--line-strong); border-radius: 12px; }
.seg button.on { background: var(--glass-a); box-shadow: var(--shadow); color: var(--brand); }
.tabs { border-bottom-color: var(--line-strong); }
.tab.active { border-bottom-color: transparent; background-image: linear-gradient(90deg, var(--g1), var(--g3)); background-size: 100% 2px; background-repeat: no-repeat; background-position: bottom; }
.chip { border-radius: 7px; backdrop-filter: saturate(140%); }
.att-toggle button { background: var(--surface); border-color: var(--line-strong); transition: transform .15s ease; }
.att-toggle button:hover:not(:disabled) { transform: translateY(-2px); }
.att-toggle button.on.P { background: linear-gradient(135deg, #16C47A, #0E8A55); box-shadow: 0 6px 16px -6px rgba(22, 196, 122, .8); }
.att-toggle button.on.A { background: linear-gradient(135deg, #FF5C7A, #D02F4A); box-shadow: 0 6px 16px -6px rgba(255, 92, 122, .8); }
.att-toggle button.on.L { background: linear-gradient(135deg, #FFB84D, #D98200); box-shadow: 0 6px 16px -6px rgba(255, 184, 77, .8); }

/* ---- headings & hero ---- */
.hello h1, .page-head h1 { font-size: 30px; letter-spacing: -.03em; font-weight: 700;
  background: linear-gradient(100deg, var(--ink) 30%, var(--brand) 70%, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head h1 { font-size: 26px; }
.hello { margin-bottom: 22px; }

/* ---- KPI tiles: 3D depth ---- */
.kpi-val { font-size: 28px; font-weight: 700; }
.kpi-ico { border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 18px -10px currentColor; transform: translateZ(26px); }
.tone-brand.kpi-ico, .kpi-ico.tone-brand { background: linear-gradient(135deg, rgba(var(--g-rgb), .25), rgba(var(--g-rgb), .08)); }

/* ---- task cards / lock-in ---- */
.task { border-radius: 18px; }
.task-type .tico { border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.lockin { background: radial-gradient(120% 140% at 0% 0%, var(--hero-1) 0%, var(--hero-2) 45%, var(--hero-3) 100%); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 30px 60px -30px rgba(var(--g-rgb), .9), inset 0 1px 0 rgba(255, 255, 255, .2); }
.lockin::after { background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 0%), rgba(255, 255, 255, .18), transparent 45%); }
.lockin h3 { font-family: var(--display); letter-spacing: .02em; text-shadow: 0 4px 24px rgba(var(--g-rgb), .8); }
.lockin .mascot { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); animation: fx-float 5s ease-in-out infinite; }
.carousel { padding: 10px 4px 14px; margin: -10px -4px 0; }

/* ---- tables, lists ---- */
.t th { background: var(--surface-2); }
.t tbody tr { transition: background .2s ease; }
.t tbody tr:hover td { background: var(--brand-soft); }
.list-row { transition: background .2s ease; }
.row-link.list-row:hover { background: var(--surface); }
.bar { background: var(--surface-2); border-color: var(--line); }
.bar > span { background: linear-gradient(90deg, var(--g1), var(--g2)); box-shadow: 0 0 12px -2px rgba(var(--g-rgb), .8); }
.tt td { background: var(--surface-2); }
.tt td.mine { background: var(--brand-soft); }
.cal .ch { background: var(--surface-2); }
.cal .cd.out { background: rgba(0, 0, 0, .03); }
.formula { background: var(--surface-2); }
.rank.g1 { background: linear-gradient(135deg, #FFE08A, #F2A60C); color: #5A3A00; box-shadow: 0 6px 14px -6px rgba(242, 166, 12, .9); }
.rank.g2 { background: linear-gradient(135deg, #F1F4FA, #B8C1D6); color: #2E3850; }
.rank.g3 { background: linear-gradient(135deg, #F8D2B5, #C9824F); color: #4E250A; }
.ring svg circle:last-child { filter: drop-shadow(0 0 6px currentColor); }

/* ---- overlays ---- */
.overlay { background: rgba(5, 8, 22, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { border: 1px solid var(--glass-border); border-radius: 22px; animation: fx-pop .38s cubic-bezier(.2, .9, .3, 1.15); }
.modal-head, .modal-foot { border-color: var(--line); }
.drawer { border-left: 1px solid var(--glass-border); border-radius: 22px 0 0 22px; }
@keyframes fx-pop { from { opacity: 0; transform: perspective(900px) rotateX(10deg) translateY(18px) scale(.96); } }
.toast { background: linear-gradient(135deg, var(--hero-3), var(--hero-2)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; }
.toast.bad { background: linear-gradient(135deg, #E0405C, #B82640); }

/* ---- Neo ---- */
.neo-fab { background: linear-gradient(135deg, var(--hero-2), var(--hero-1)); border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 16px 40px -12px rgba(var(--g-rgb), .8); }
.neo-fab::before { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid rgba(var(--g-rgb), .5); animation: fx-pulse 2.6s ease-out infinite; pointer-events: none; }
.neo-fab .orb { animation: fx-orb 6s linear infinite; box-shadow: 0 0 18px rgba(var(--g-rgb), .9); }
@keyframes fx-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.25); } }
@keyframes fx-orb { to { filter: hue-rotate(360deg); } }
.neo-panel { border-radius: 22px; box-shadow: var(--shadow-lg); animation: fx-pop .35s cubic-bezier(.2, .9, .3, 1.15); }
.neo-head { background: linear-gradient(135deg, var(--hero-2), var(--hero-1)); }
.msg.ai { background: var(--surface); border-color: var(--glass-border); }
.msg.user { background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: var(--glow); }
.neo-qa button { background: var(--surface); border-color: var(--glass-border); transition: transform .2s ease, border-color .2s ease; }
.neo-qa button:hover { transform: translateY(-2px); }

/* ---- 3D tilt (pointer) ---- */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease; will-change: transform; }
.tilt.tilting { transition: transform .08s linear, box-shadow .3s ease; box-shadow: var(--shadow), 0 30px 50px -28px rgba(var(--g-rgb), .55); }

/* ---- scroll reveal + page enter ---- */
.rv { opacity: 0; translate: 0 34px; scale: .97; transition: opacity .7s ease, translate .9s cubic-bezier(.16, .84, .24, 1), scale .9s cubic-bezier(.16, .84, .24, 1); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; translate: 0 0; scale: 1; }
.carousel.rv > * { opacity: 0; translate: 48px 0; transition: opacity .6s ease, translate .9s cubic-bezier(.16, .84, .24, 1); }
.carousel.rv.in > * { opacity: 1; translate: 0 0; }
.view.enter { animation: fx-enter .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes fx-enter { from { opacity: 0; translate: 0 12px; } }

/* =====================================================================
   REFINE — modern borderless system: depth from shadow + fill, pills, no dashed rules
   ===================================================================== */
:root { --line: rgba(20, 20, 45, .06); --line-strong: rgba(20, 20, 45, .10); --pill: 999px; --radius: 22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --line: rgba(255, 255, 255, .06); --line-strong: rgba(255, 255, 255, .10); } }
:root[data-theme="dark"] { --line: rgba(255, 255, 255, .06); --line-strong: rgba(255, 255, 255, .10); }

body { font-weight: 500; letter-spacing: -.005em; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; }
.card-head h2, .section-title { font-size: 15.5px; font-weight: 600; }

/* surfaces: no outlines, one faint hairline, soft layered shadow */
.card, .sidebar, .topbar, .modal, .drawer, .neo-panel, .popover, .search-results { border: 0 !important; }
.card { box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -22px rgba(0, 0, 0, .35); }
.card::before { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .02) 40%, transparent); opacity: .7; }
.sidebar { box-shadow: 18px 0 50px -40px rgba(0, 0, 0, .45); }
.topbar { box-shadow: none; }
.topbar.scrolled { box-shadow: 0 12px 30px -24px rgba(0, 0, 0, .5); }
.modal, .drawer, .neo-panel, .popover { box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); }
.modal-head, .modal-foot, .popover-head { border: 0; }
.modal-foot { padding-top: 6px; }

/* buttons: pills, no borders */
.btn { border: 0; border-radius: var(--pill); height: 38px; padding: 0 18px; font-weight: 600; }
.btn:not(.btn-primary):not(.btn-dark):not(.btn-ok):not(.btn-danger):not(.lockin-cta) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.btn:not(.btn-primary):not(.btn-dark):not(.btn-ok):not(.btn-danger):not(.lockin-cta):not(:disabled):hover { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn.btn-sm { height: 32px; padding: 0 14px; font-size: 12.5px; }
.btn-primary, .btn-primary:hover { color: #fff; box-shadow: var(--glow); }
.btn-dark, .btn-dark:hover { color: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .6); }
.btn-ok, .btn-ok:hover { color: #fff; box-shadow: 0 8px 18px -10px rgba(14, 138, 85, .8); }
.btn-danger { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: var(--bad); color: #fff; }
.link-btn { font-weight: 600; }
.icon-btn { border: 0; border-radius: 50%; background: transparent; width: 40px; height: 40px; }
.icon-btn:hover { background: var(--surface); transform: none; }
.icon-btn .dot { border: 0; box-shadow: 0 0 0 3px var(--bg); }
.cohort, .me { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--pill); }
.cohort { padding: 8px 14px; }
.xp-pill { border: 0; }

/* inputs: filled, borderless */
.input, select.input, textarea.input, .search input { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; }
.search input { border-radius: var(--pill); }
.input:focus, .search input:focus { box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px var(--brand-soft); }

/* chips / status: soft pills */
.chip { border-radius: var(--pill); padding: 3px 10px; font-weight: 600; font-size: 11.5px; }
.chip-outline { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.dot-s { width: 6px; height: 6px; }

/* tabs & segmented: pill groups instead of underlines */
.tabs { border: 0; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: var(--pill); width: max-content; max-width: 100%; box-shadow: inset 0 0 0 1px var(--line); }
.tab { border: 0; margin: 0; padding: 8px 16px; border-radius: var(--pill); font-weight: 600; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--glass-a); background-image: none; color: var(--brand); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); }
.seg { border: 0; border-radius: var(--pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); padding: 4px; }
.seg button { border-radius: var(--pill); padding: 6px 14px; font-weight: 600; }
.seg button.on { box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); }

/* navigation: filled pill, no outlines */
.nav-item { border-radius: 12px; font-weight: 600; }
.nav-item:hover { transform: none; background: var(--surface); }
.nav-item.active { background: var(--brand-soft); box-shadow: none; }
.nav-item.active::before { left: auto; right: 12px; top: 50%; bottom: auto; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-50%); background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.nav-item.active:has(.count)::before { display: none; }
.nav-label { letter-spacing: .1em; font-size: 10.5px; opacity: .8; }
.sidebar-foot { border: 0; }

/* no dashed rules anywhere */
.task-foot { border: 0; padding-top: 4px; }
.sched-item { border: 0; padding: 8px 0; }
.formula { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; }
.tt td.brk { border: 0; background: transparent; opacity: .7; }

/* tables & lists: whisper-thin separators */
.t th { background: transparent; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .06em; }
.t td { border-bottom: 1px solid var(--line); }
.t tbody tr:hover td { background: var(--surface-2); }
.list-row { border-top: 1px solid var(--line); }
.notice { border-top: 1px solid var(--line); }
.ledger-row { border-top: 1px solid var(--line); }
.notif { border-bottom: 1px solid var(--line); }
.tt td { border: 0; border-radius: 12px; }
.cal, .cal .ch, .cal .cd { border-color: var(--line); }
.cal .ch { background: transparent; }

/* small elements */
.bar { border: 0; height: 7px; }
.att-toggle { background: var(--surface-2); padding: 3px; border-radius: var(--pill); box-shadow: inset 0 0 0 1px var(--line); }
.att-toggle button { border: 0; border-radius: var(--pill); background: transparent; width: 36px; height: 30px; }
.att-toggle button:hover:not(:disabled) { background: var(--surface); transform: none; }
.rank { border-radius: 50%; }
.kpi-ico { border-radius: 50%; box-shadow: none; }
.task-type .tico { border-radius: 50%; box-shadow: none; }
.subj-ico { border-radius: 14px; }
.alert { border-radius: 16px; }
.quiz-q { border: 0; background: var(--surface-2); border-radius: 16px; }
.quiz-opt { border: 0; background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.quiz-opt.right { box-shadow: inset 0 0 0 1.5px var(--ok); }
.quiz-opt.wrong { box-shadow: inset 0 0 0 1.5px var(--bad); }
.pay-methods label { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 16px; }
.pay-methods label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--brand); }
.neo-qa button { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; }
.neo-sugg button { border-top: 1px solid var(--line); }
.neo-input { border-top: 0; }
.neo-input input { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--pill); }
.msg.ai { border: 0; }
.days button { border-radius: 14px; }
.lockin { border: 0; }
.demo-banner { border-radius: 12px; }

/* legibility: objects stay atmospheric behind glass */
:root { --blur: 26px; }
.card { background: linear-gradient(150deg, var(--glass-a), var(--glass-b)), color-mix(in srgb, var(--bg) 55%, transparent); }

/* lock-in card: flame emblem + clean type */
.card.lockin { background: radial-gradient(120% 140% at 0% 0%, var(--hero-1) 0%, var(--hero-2) 48%, var(--hero-3) 100%); }
.lockin { display: flex; align-items: center; gap: 20px; padding: 24px 26px; }
.lockin-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.lockin-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #FFD27A; background: rgba(255, 255, 255, .08); padding: 4px 10px; border-radius: 999px; }
.lockin h3 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; text-shadow: none; color: #fff; margin-top: 10px; }
.lockin p { color: rgba(255, 255, 255, .74); font-size: 14px; line-height: 1.55; margin-top: 6px; max-width: 48ch; }
.lockin-row { margin-top: 16px; max-width: 380px; }
.lockin-count { color: rgba(255, 255, 255, .7); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lockin-count b { color: #fff; font-size: 15px; }
.lockin .btn.lockin-cta { margin-top: 18px; background: #fff; color: #120A0C; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7); }
.lockin .btn.lockin-cta:hover { background: #fff; color: #120A0C; transform: translateY(-1px); }
.lockin .mascot { position: relative; order: 2; right: auto; bottom: auto; width: 128px; height: auto; flex: none; opacity: 1; filter: drop-shadow(0 16px 26px rgba(var(--g-rgb), .55)); }

/* =====================================================================
   SIGNATURE — floating glass shell, 3D grid floor, spotlight borders,
   cursor light, blur-in headlines, magnetic buttons
   ===================================================================== */
/* floating shell (desktop) */
@media (min-width: 901px) {
  .sidebar { inset: 12px auto 12px 12px; border-radius: 26px; padding: 18px 14px; }
  .main-col { margin-left: calc(var(--sidebar-w) + 24px); }
  .topbar { top: calc(12px + env(safe-area-inset-top, 0px)); margin: 12px 20px 0 0; height: 62px; border-radius: 22px; padding: 0 10px 0 16px; }
  .view { padding: 26px 20px 96px 0; }
  .rail { top: calc(var(--topbar-h) + 34px); }
}
.sidebar, .topbar { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .10); }
.topbar.scrolled { box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .10); }
.brand { padding: 2px 8px 18px; }
.brand-name { font-size: 18px; letter-spacing: -.03em; }

/* 3D perspective grid floor + cursor light (inside the fixed backdrop) */
.fx-cursor { position: absolute; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--g-rgb), .22), transparent 62%); opacity: 0; transition: opacity .4s ease; will-change: transform; }
.fx-cursor.on { opacity: 1; }
:root:not([data-theme="dark"]) 
/* spotlight ring: card edge lights up where the cursor is */
.card::before { padding: 1.2px; opacity: 1;
  background: radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), rgba(var(--g-rgb), .95), transparent 70%),
              linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03) 45%, transparent); }
.card::after { background: radial-gradient(380px circle at var(--mx, -999px) var(--my, -999px), rgba(var(--g-rgb), .10), transparent 45%); }

/* headlines resolve from blur */
.view.enter .hello h1, .view.enter .page-head h1 { animation: fx-type .9s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter .hello p, .view.enter .page-head p { animation: fx-type .9s .12s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fx-type { from { opacity: 0; filter: blur(10px); letter-spacing: .06em; } }

/* magnetic primary buttons */
.btn-primary, .btn-dark, .lockin-cta { translate: var(--tx, 0) var(--ty, 0); transition: translate .35s cubic-bezier(.2, .8, .2, 1), transform .18s ease, box-shadow .2s ease, background .2s ease; }

/* KPI tiles: numbers take the gradient, soft glow line on hover */
.kpi-val { background: linear-gradient(100deg, var(--ink) 40%, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi { overflow: hidden; }
.kpi .kpi-foot { position: relative; }
.kpi:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 26px 50px -24px rgba(var(--g-rgb), .55); }

/* details */
html { scrollbar-width: thin; scrollbar-color: rgba(var(--g-rgb), .55) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--g1), var(--g2)); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(var(--g-rgb), .35); }
.section-head { margin-top: 4px; }
.hello p, .page-head p { font-size: 13.5px; }

/* =====================================================================
   REAL MANGA BOOK BACKDROP (take2) — monochrome two-page spread: paper, ink,
   screentone, spine shadow, vertical Mincho lettering, hand-lettered SFX
   ===================================================================== */
:root { --rm-paper: #F3EEE1; --rm-ink: #151414; --rm-opacity: .88; }
.fx-manga { position: absolute; left: -5%; top: -5%; width: 110%; height: 110%; opacity: var(--rm-opacity); transform-origin: 50% 40%; will-change: transform; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-manga { filter: brightness(.34) contrast(1.2); opacity: 1; } }
:root[data-theme="dark"] .fx-manga { filter: brightness(.34) contrast(1.2); opacity: 1; }
.fx-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0, color-mix(in srgb, var(--bg) 78%, transparent) 13%, color-mix(in srgb, var(--bg) 30%, transparent) 28%, transparent 46%),
              linear-gradient(90deg, color-mix(in srgb, var(--bg) 35%, transparent), transparent 28%); }
.rm-edge { fill: #D8D0BE; }
.rm-page, .rm-panel { fill: var(--rm-paper); }
.rm-stack { stroke: rgba(0, 0, 0, .28); stroke-width: 1; }
.rm-outline { fill: none; stroke: var(--rm-ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.rm-outline.thin { stroke-width: 1.4; }
.rm-outline.thick { stroke-width: 5; }
.rm-paper { fill: var(--rm-paper); }
.rm-ink { fill: var(--rm-ink); }
.rm-stroke { fill: none; stroke: var(--rm-ink); stroke-linecap: round; stroke-linejoin: round; }
.rm-border { fill: none; stroke: var(--rm-ink); stroke-width: 4.5; stroke-linejoin: miter; }
.rm-dot { fill: var(--rm-ink); }
.rm-lines line { stroke: var(--rm-ink); stroke-linecap: round; }
.rm-win { fill: url(#rm-tone-d); stroke: var(--rm-ink); stroke-width: 1.4; }
.rm-board { fill: #2A2A28; stroke: var(--rm-ink); stroke-width: 3; }
.rm-chalk { fill: #EFECE3; font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 700; letter-spacing: 2px; }
.rm-light { fill: rgba(255, 255, 255, .5); }
.rm-rule { stroke: rgba(0, 0, 0, .22); stroke-width: 1; }
.rm-rule-d { stroke: var(--rm-ink); }
.rm-sec { stroke: var(--rm-ink); transform-box: view-box; transform-origin: 1495px 480px; animation: rm-tick 60s steps(60) infinite; }
@keyframes rm-tick { to { transform: rotate(360deg); } }
.rm-stamp { fill: none; stroke: #B3261E; }
.rm-stamp-t { fill: #B3261E; font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif; font-weight: 700; }
.rm-circle { fill: none; stroke: var(--rm-ink); stroke-width: 4; }
.rm-circle.thin { stroke-width: 2; }
.rm-say, .rm-narr { font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 700; fill: var(--rm-ink); }
.rm-narr { font-weight: 600; }
.rm-folio { font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif; font-weight: 500; fill: rgba(0, 0, 0, .55); letter-spacing: 1px; }
.rm-sfx { font-family: "Dela Gothic One", "Hiragino Sans", sans-serif; fill: var(--rm-ink); stroke: var(--rm-paper); stroke-width: 10px; paint-order: stroke; stroke-linejoin: round; }
.rm-sfx.plain { stroke-width: 0; }
/* restrained motion: petals drift, speed lines streak, glints twinkle, menace shakes */
.rm-petals ellipse { animation: rm-fall 7s linear infinite; }
@keyframes rm-fall { 0% { translate: 20px -40px; opacity: 0; } 15% { opacity: 1; } 100% { translate: -70px 70px; opacity: 0; } }
.rm-speed line { stroke-dasharray: 260 70; animation: rm-dash 1.1s linear infinite; }
@keyframes rm-dash { to { stroke-dashoffset: 330; } }
.rm-spark { transform-box: fill-box; transform-origin: center; animation: rm-twinkle 2.4s ease-in-out infinite; }
@keyframes rm-twinkle { 50% { transform: scale(.55) rotate(45deg); } }
.rm-menace { transform-box: fill-box; transform-origin: center; animation: rm-shake 1.6s ease-in-out infinite; }
@keyframes rm-shake { 0%, 100% { transform: none; } 45% { transform: scale(1.08) rotate(-4deg); } 55% { transform: scale(1.06) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .rm-petals ellipse, .rm-speed line, .rm-spark, .rm-menace, .rm-sec { animation: none !important; } }

/* =====================================================================
   FEATURES — library, transport tracker, messages, achievements, ID card, command palette
   ===================================================================== */
/* library */
.lib-loan { display: flex; gap: 14px; align-items: center; }
.lib-loan .grow { flex: 1; min-width: 0; }
.lib-spine { width: 46px; height: 64px; border-radius: 6px 10px 10px 6px; flex: none; display: grid; place-items: center; font-family: "Dela Gothic One", var(--display); font-size: 22px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 60% 48%), hsl(calc(var(--h) + 40) 55% 32%)); box-shadow: inset 4px 0 0 rgba(255, 255, 255, .25), 0 10px 20px -10px rgba(0, 0, 0, .6); }
.lib-book { display: flex; flex-direction: column; gap: 10px; }
.lib-cover { height: 130px; border-radius: 12px; padding: 14px; display: flex; align-items: flex-end; position: relative; overflow: hidden;
  background: linear-gradient(145deg, hsl(var(--h) 62% 50%), hsl(calc(var(--h) + 50) 58% 28%)); box-shadow: inset 6px 0 0 rgba(0, 0, 0, .18); }
.lib-cover::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.4px); background-size: 8px 8px; -webkit-mask-image: linear-gradient(160deg, #000, transparent 60%); mask-image: linear-gradient(160deg, #000, transparent 60%); }
.lib-cover span { position: relative; z-index: 1; color: #fff; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.2; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }

/* transport tracker */
.bus-track { position: relative; padding: 26px 8px 58px; margin-top: 8px; }
.bus-line { position: relative; height: 6px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.bus-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--g1), var(--g2)); box-shadow: 0 0 14px rgba(var(--g-rgb), .7); }
.bus-dot { position: absolute; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 0 0 5px rgba(var(--g-rgb), .25), 0 8px 20px -6px rgba(var(--g-rgb), .9); animation: bus-bob 1.2s ease-in-out infinite; }
@keyframes bus-bob { 50% { translate: 0 -3px; } }
.bus-stops { position: absolute; left: 8px; right: 8px; top: 26px; height: 0; }
.bus-stop { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; width: 110px; }
.bus-stop:first-child { transform: none; align-items: flex-start; text-align: left; }
.bus-stop:last-child { transform: translateX(-100%); align-items: flex-end; text-align: right; }
.bus-stop i { width: 14px; height: 14px; border-radius: 50%; margin-top: -4px; background: var(--surface); box-shadow: inset 0 0 0 3px var(--line-strong); }
.bus-stop.passed i { box-shadow: inset 0 0 0 3px var(--brand); background: var(--brand); }
.bus-stop.mine i { box-shadow: 0 0 0 4px rgba(var(--g-rgb), .35), inset 0 0 0 3px var(--brand); }
.bus-stop b { font-size: 12px; margin-top: 8px; line-height: 1.2; }
.bus-stop small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bus-stop.mine b { color: var(--brand); }

/* messages */
.msg-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-list { overflow: hidden; }
.msg-list .list-row { width: 100%; text-align: left; }
.msg-list .list-row.on { background: var(--brand-soft); }
.msg-list .grow small { display: block; }
.msg-prev { opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count-pill { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.msg-thread { display: flex; flex-direction: column; min-height: 460px; }
.msg-scroll { flex: 1; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow: auto; }
.msg-scroll .msg { max-width: 78%; }
.msg-scroll .msg small { display: block; font-size: 10.5px; opacity: .7; margin-top: 4px; }

/* achievements */
.badge { display: flex; gap: 14px; padding: 16px; align-items: center; overflow: hidden; }
.badge-kanji { width: 72px; height: 72px; flex: none; border-radius: 18px; display: grid; place-items: center; position: relative;
  font-family: "Dela Gothic One", "Hiragino Sans", var(--display), sans-serif; font-size: 38px; color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); filter: grayscale(1); opacity: .7; }
.badge.got .badge-kanji { filter: none; opacity: 1; color: #fff; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .35), transparent 45%), linear-gradient(145deg, var(--g1), var(--g2));
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, .35); box-shadow: 0 12px 26px -12px rgba(var(--g-rgb), .9), inset 0 1px 0 rgba(255, 255, 255, .4); }
.badge.got .badge-kanji::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background-image: radial-gradient(rgba(255, 255, 255, .28) 1px, transparent 1.4px); background-size: 6px 6px; -webkit-mask-image: linear-gradient(200deg, #000, transparent 70%); mask-image: linear-gradient(200deg, #000, transparent 70%); }
.badge-body { flex: 1; min-width: 0; }
.unlock { position: fixed; left: 50%; top: 90px; z-index: 120; display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 14px; border-radius: 20px; color: #fff; translate: -50% 0;
  background: linear-gradient(135deg, var(--hero-1), var(--hero-3)); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .12); animation: unlock-in .6s cubic-bezier(.2, 1.4, .3, 1); }
.unlock.out { opacity: 0; translate: -50% -20px; transition: opacity .5s ease, translate .5s ease; }
.unlock small { font-size: 11px; letter-spacing: .14em; font-weight: 800; color: #FFD27A; }
.unlock b { display: block; font-family: var(--display); font-size: 18px; }
.unlock p { font-size: 12.5px; opacity: .8; }
.unlock-burst { position: relative; width: 70px; height: 70px; flex: none; display: grid; place-items: center; }
.unlock-burst svg { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); animation: fx-speed 8s linear infinite; }
.unlock-burst polygon { fill: #FFD27A; }
.unlock-burst span { position: relative; font-family: "Dela Gothic One", var(--display); font-size: 32px; color: #1B0A0D; }
@keyframes unlock-in { from { opacity: 0; scale: .6; translate: -50% -30px; } }
@keyframes fx-speed { to { rotate: 360deg; } }

/* ID card */
.id-wrap { max-width: 640px; margin: 0 auto; perspective: 1200px; }
.id-card { border-radius: 24px; overflow: hidden; background: var(--solid); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6), 0 0 0 1px var(--line); transform: rotateX(4deg); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.id-card:hover { transform: rotateX(0deg) translateY(-4px); }
.id-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: #fff; overflow: hidden; background: linear-gradient(120deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3)); }
.id-head::after { content: ""; position: absolute; inset: 0; background-image: repeating-conic-gradient(from 0deg at 85% 50%, rgba(255, 255, 255, .12) 0deg 2deg, transparent 2deg 9deg); }
.id-head b { display: block; font-family: var(--display); font-size: 16px; position: relative; z-index: 1; }
.id-head small { opacity: .75; font-size: 11.5px; position: relative; z-index: 1; }
.id-head .brand-mark { position: relative; z-index: 1; transform: none; }
.id-sfx { margin-left: auto; position: relative; z-index: 1; font-family: "Dela Gothic One", var(--display); font-size: 30px; color: rgba(255, 255, 255, .92); -webkit-text-stroke: 1px rgba(0, 0, 0, .4); }
.id-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; padding: 20px; align-items: center; }
.id-photo .avatar.lg { width: 96px; height: 116px; border-radius: 16px; font-size: 32px; box-shadow: 0 0 0 4px var(--surface), 0 12px 24px -12px rgba(0, 0, 0, .6); }
.id-fields h2 { font-size: 20px; margin-bottom: 8px; }
.id-fields dl { display: grid; grid-template-columns: 82px 1fr; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.id-fields dt { color: var(--muted); font-weight: 600; }
.id-fields dd { margin: 0; font-weight: 600; }
.qr { width: 108px; height: 108px; background: #fff; border-radius: 10px; padding: 4px; }
.qr rect { fill: #111; }
.id-foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 20px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); flex-wrap: wrap; }

/* command palette */
.cmdk .search input { height: 46px; font-size: 15px; }
.cmdk-list { margin-top: 10px; max-height: 360px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; color: var(--ink-2); }
.cmdk-item b { display: block; font-size: 13.5px; color: var(--ink); }
.cmdk-item small { color: var(--muted); font-size: 11.5px; }
.cmdk-item.on, .cmdk-item:hover { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 900px) {
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .id-body { grid-template-columns: auto minmax(0, 1fr); }
  .id-body .qr { grid-column: 1 / -1; justify-self: center; }
  .bus-stop { width: 80px; }
  .bus-stop b { font-size: 10.5px; }
}
@media (max-width: 600px) {
  .bus-track { padding: 66px 8px 62px; }
  .bus-stops { top: 66px; }
  .bus-stop:nth-child(even) { top: -58px; flex-direction: column-reverse; }
  .bus-stop:nth-child(even) i { margin: 4px 0 0; }
  .bus-stop:nth-child(even) b { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .bus-dot, .unlock-burst svg { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 13, 30, .45); z-index: 35; }
  .main-col { margin-left: 0; }
  .icon-btn.menu-btn { display: grid; }
  .topbar { padding: 0 16px; gap: 8px; }
  .me .who { display: none; }
  .me { padding: 3px; }
  .view { padding: 18px 16px 96px; }
}
@media (max-width: 720px) {
  .search { display: none; }
  .cohort .cohort-label { display: none; }
  .cohort { padding: 7px 10px; }
  .cohort select { max-width: 132px; }
  .me { display: none; }
  .topbar { gap: 6px; }
  .top-actions { gap: 6px; }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 110px 1fr; }
  .pay-methods { grid-template-columns: 1fr; }
  .neo-fab span.lbl { display: none; }
  .neo-fab { padding: 0 7px; }
  .lockin { padding: 20px; gap: 12px; align-items: flex-start; }
  .lockin .mascot { width: 72px; }
  .lockin h3 { font-size: 21px; }
  .cal .cd { min-height: 64px; }
  .cal .ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
}
@media (max-width: 440px) {
  .cols-4 { gap: 10px; }
  .kpi { padding: 12px; gap: 4px; }
  .kpi-val { font-size: 20px; }
  .kpi-ico { width: 28px; height: 28px; }
  .kpi-top { font-size: 11.5px; }
  .kpi-foot { font-size: 11px; }
  .xp-pill .xp-num { display: none; }
  .xp-pill { padding: 0 6px; }
}
@media (max-width: 900px) {
  .hello h1 { font-size: 24px; } .page-head h1 { font-size: 22px; }
}
@media (max-width: 440px) {
    .kpi-val { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .carousel.rv > * { opacity: 1 !important; translate: none !important; scale: none !important; }
  .tilt { transform: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* SIGNATURE — floating shell on tablets and phones (after responsive rules) */
@media (max-width: 900px) {
  .sidebar { inset: 8px auto 8px 8px; border-radius: 22px; transform: translateX(calc(-100% - 16px)); }
  .app.nav-open .sidebar { transform: none; }
  .topbar { top: calc(8px + env(safe-area-inset-top, 0px)); margin: 8px 8px 0; border-radius: 18px; height: 58px; padding: 0 8px; }
  }
@media (prefers-reduced-motion: reduce) {
    .btn-primary, .btn-dark, .lockin-cta { translate: none; }
}
