/* E-LearningCenter - design system. Dark (default) and light themes, no external fonts or frameworks
   (works offline on the office network; strict CSP: no inline styles anywhere). */

/* ------------------------------------------------------------------ tokens */
:root, html[data-theme="dark"] {
  --bg: #08090d;
  --bg-2: #0d0f15;
  --surface: #13161f;
  --surface-2: #1a1e2a;
  --surface-3: #242a39;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f3f4f8;
  --ink-2: #b9bfcf;
  --ink-3: #828aa0;
  --brand: #f5a524;
  --brand-2: #ff5f45;
  --grad: linear-gradient(135deg, #ffb53d 0%, #ff7a2f 55%, #ff4f5e 100%);
  --brand-ink: #1b1206;
  --link: #ffc768;
  --ok: #3ddc97;
  --ok-bg: rgba(61, 220, 151, .13);
  --warn: #ffcc66;
  --warn-bg: rgba(255, 204, 102, .13);
  --bad: #ff7a7a;
  --bad-bg: rgba(255, 122, 122, .13);
  --focus: #ffc768;
  --shadow: 0 18px 40px -12px rgba(0, 0, 0, .65);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, .6);
  --glass: rgba(10, 12, 18, .66);
  --topbar: rgba(8, 9, 13, .72);
  --hero-fade: #08090d;
  --glow: rgba(255, 110, 50, .7);
  --blob-1: rgba(79, 70, 229, .45); --blob-2: rgba(190, 24, 93, .38); --blob-3: rgba(234, 88, 12, .32); --blob-4: rgba(8, 145, 178, .38);
  --bg-img: url("/static/img/bg-dark.svg");
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --surface-3: #e5e8f1;
  --line: rgba(16, 22, 42, .09);
  --line-2: rgba(16, 22, 42, .16);
  --ink: #0f1222;
  --ink-2: #444b63;
  --ink-3: #737a93;
  --brand-ink: #1b1206;
  --link: #b45309;
  --ok: #0f8a55;
  --ok-bg: #e2f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #c62828;
  --bad-bg: #fde8e7;
  --focus: #d97706;
  --shadow: 0 18px 40px -16px rgba(17, 24, 39, .25);
  --shadow-sm: 0 6px 16px -8px rgba(17, 24, 39, .2);
  --glass: rgba(255, 255, 255, .7);
  --topbar: rgba(255, 255, 255, .8);
  --hero-fade: #f5f6fa;
  --glow: rgba(255, 110, 50, .7);
  --blob-1: rgba(129, 140, 248, .55); --blob-2: rgba(249, 168, 212, .55); --blob-3: rgba(253, 186, 116, .5); --blob-4: rgba(103, 232, 249, .5);
  --bg-img: url("/static/img/bg-light.svg");
  color-scheme: light;
}
/* Green & White: clean white surfaces, emerald brand. */
html[data-theme="green"] {
  --bg: #f4faf6;
  --bg-2: #e9f5ee;
  --surface: #ffffff;
  --surface-2: #f1f8f4;
  --surface-3: #dcefe3;
  --line: rgba(6, 60, 35, .1);
  --line-2: rgba(6, 60, 35, .18);
  --ink: #0d1f16;
  --ink-2: #38503f;
  --ink-3: #688070;
  --brand: #16a34a;
  --brand-2: #059669;
  --grad: linear-gradient(135deg, #4ade80 0%, #22c55e 50%, #15a05a 100%);
  --brand-ink: #052e16;
  --glow: rgba(22, 163, 74, .75);
  --blob-1: rgba(134, 239, 172, .6); --blob-2: rgba(94, 234, 212, .45); --blob-3: rgba(190, 242, 100, .45); --blob-4: rgba(110, 231, 183, .5);
  --link: #047857;
  --ok: #0f8a55;
  --ok-bg: #e2f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #c62828;
  --bad-bg: #fde8e7;
  --focus: #059669;
  --shadow: 0 18px 40px -16px rgba(6, 60, 35, .28);
  --shadow-sm: 0 6px 16px -8px rgba(6, 60, 35, .22);
  --glass: rgba(255, 255, 255, .72);
  --topbar: rgba(255, 255, 255, .82);
  --hero-fade: #f4faf6;
  --bg-img: url("/static/img/bg-green.svg");
  color-scheme: light;
}
/* Blue & Gray: cool gray surfaces, blue brand. */
html[data-theme="blue"] {
  --bg: #e8ecf2;
  --bg-2: #dde3ec;
  --surface: #f7f8fb;
  --surface-2: #eceff5;
  --surface-3: #dbe1eb;
  --line: rgba(30, 41, 59, .1);
  --line-2: rgba(30, 41, 59, .18);
  --ink: #101827;
  --ink-2: #3b4558;
  --ink-3: #6a7487;
  --brand: #2563eb;
  --brand-2: #0ea5e9;
  --grad: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  --brand-ink: #ffffff;
  --glow: rgba(37, 99, 235, .75);
  --blob-1: rgba(147, 197, 253, .6); --blob-2: rgba(165, 180, 252, .45); --blob-3: rgba(125, 211, 252, .45); --blob-4: rgba(148, 163, 184, .5);
  --link: #1d4ed8;
  --ok: #0f8a55;
  --ok-bg: #e2f6ec;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #c62828;
  --bad-bg: #fde8e7;
  --focus: #2563eb;
  --shadow: 0 18px 40px -16px rgba(30, 41, 59, .3);
  --shadow-sm: 0 6px 16px -8px rgba(30, 41, 59, .24);
  --glass: rgba(247, 248, 251, .74);
  --topbar: rgba(240, 243, 248, .84);
  --hero-fade: #e8ecf2;
  --bg-img: url("/static/img/bg-blue.svg");
  color-scheme: light;
}
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --tile-w: clamp(210px, 21vw, 290px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg) var(--bg-img) center / cover fixed no-repeat; color: var(--ink); font: 15.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ------------------------------------------------------------------ living background (repeats forever, theme coloured) */
body::before, body::after { content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none; will-change: transform; }
body::before {
  background: radial-gradient(38% 38% at 20% 25%, var(--blob-1), transparent 70%), radial-gradient(34% 34% at 80% 22%, var(--blob-2), transparent 70%),
              radial-gradient(38% 38% at 76% 80%, var(--blob-3), transparent 70%), radial-gradient(34% 34% at 22% 78%, var(--blob-4), transparent 70%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(30% 30% at 55% 45%, var(--blob-2), transparent 70%), radial-gradient(28% 28% at 40% 65%, var(--blob-3), transparent 70%);
  opacity: .8;
  animation: drift-b 38s ease-in-out infinite alternate;
}
@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(6%, -4%, 0) rotate(8deg) scale(1.12); }
  100% { transform: translate3d(-5%, 5%, 0) rotate(-6deg) scale(1.04); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  50%  { transform: translate3d(-7%, 5%, 0) scale(.92); }
  100% { transform: translate3d(5%, -6%, 0) scale(1.1); }
}
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 10px 24px -12px var(--glow); } 50% { box-shadow: 0 14px 34px -8px var(--glow); } }
.rail-section { animation: fade-up .7s var(--ease) both; }
.rail-section:nth-of-type(2) { animation-delay: .12s; }
.rail-section:nth-of-type(3) { animation-delay: .24s; }
.rail-section:nth-of-type(n+4) { animation-delay: .36s; }
.authcard { animation: fade-up .8s var(--ease) both; }
.authlogo img { animation: float-y 5s ease-in-out infinite; }
.btn.accent { animation: glow-pulse 3.2s ease-in-out infinite; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-family: var(--font-display); letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 750; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3.2vw, 48px); }
.wrap-wide { max-width: 1600px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.page { padding-top: 28px; padding-bottom: 56px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 10px 14px; z-index: 100; border-radius: 8px; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 18px; }
.mb0 { margin-bottom: 0; }
.w100 { width: 100%; }
.narrow { max-width: 560px; }
.inline { display: inline; margin: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--topbar); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); transition: background .25s; }
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 64px; max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3.2vw, 48px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--grad); color: var(--brand-ink); font-weight: 900; font-size: 1.05rem; box-shadow: 0 6px 16px -6px var(--glow); }
.brand-mark.sm { width: 22px; height: 22px; font-size: .75rem; border-radius: 6px; box-shadow: none; vertical-align: middle; margin-right: 6px; }
.brand-logo { height: 46px; width: auto; border-radius: 8px; display: block; }
html[data-theme="dark"] .logo-on-light, html:not([data-theme="dark"]) .logo-on-dark { display: none; }
.topbar-inner { position: relative; }
@font-face { font-family: "Sony Sketch EF"; src: url("/static/fonts/Sony_Sketch_EF.ttf") format("truetype"); font-weight: normal; font-style: normal; font-display: swap; }
.topbar-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; font-family: "Sony Sketch EF", var(--font-display); font-size: clamp(1.1rem, 1.7vw, 1.5rem); font-weight: normal; letter-spacing: .02em; color: var(--ink-2); }
.topbar-title b { font-weight: normal; letter-spacing: .06em; color: var(--ink); margin-right: 6px; }
.brand-name { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.brand-name b { font-weight: 800; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .93rem; font-weight: 550; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-3); }
body.home .topbar:not(.scrolled) .nav a[aria-current="page"] { background: rgba(255, 255, 255, .16); }
.tools { display: flex; align-items: center; gap: 8px; flex: none; }
.topsearch { position: relative; display: flex; align-items: center; margin: 0; }
.topsearch .ico { position: absolute; left: 11px; color: var(--ink-3); pointer-events: none; }
.topsearch input[type=search] { width: 230px; height: 38px; padding: 0 12px 0 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: inherit; font-size: .9rem; transition: width .25s var(--ease), border-color .15s; }
.topsearch input[type=search]:focus { width: 300px; outline: none; border-color: var(--brand); }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 1.1rem; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.themes { display: flex; align-items: center; gap: 7px; padding: 0 6px; }
.swatch { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.swatch:hover { transform: scale(1.15); }
.sw-system { background: linear-gradient(135deg, #1a1e2a 50%, #ffffff 50%); }
.sw-dark { background: linear-gradient(135deg, #1a1e2a 50%, #f5a524 50%); }
.sw-light { background: linear-gradient(135deg, #ffffff 50%, #ff7a2f 50%); }
.sw-green { background: linear-gradient(135deg, #ffffff 50%, #16a34a 50%); }
.sw-blue { background: linear-gradient(135deg, #cfd6e2 50%, #2563eb 50%); }
html[data-theme-pref="system"] .sw-system, html[data-theme-pref="dark"] .sw-dark, html[data-theme-pref="light"] .sw-light, html[data-theme-pref="green"] .sw-green, html[data-theme-pref="blue"] .sw-blue { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: var(--brand-ink); font-weight: 800; text-decoration: none; font-size: .95rem; }
.topbar.public .topbar-inner { justify-content: space-between; }
.avatar-btn { border: 0; cursor: pointer; font-family: inherit; padding: 0; transition: transform .15s var(--ease), box-shadow .15s; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { transform: scale(1.06); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent); }
.usermenu, .dropdown { position: relative; }
.dropdown .menu { top: calc(100% + 6px); width: 230px; }
.dropdown button[aria-expanded="true"] .ico:last-child { transform: rotate(180deg); }
.dropdown button .ico { transition: transform .2s var(--ease); }
.menu { position: absolute; right: 0; top: calc(100% + 12px); width: 270px; max-width: calc(100vw - 24px); padding: 8px; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-head b { font-size: 1rem; }
.menu-head span { color: var(--ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.menu-head small { color: var(--ink-3); font-size: .78rem; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: .95rem; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { width: 1.25em; height: 1.25em; color: var(--ink-2); }
.menu-chev { margin-left: auto; transition: transform .2s var(--ease); }
[aria-expanded="true"] > .menu-chev { transform: rotate(180deg); }
.menu-sub { padding: 2px 0 4px 14px; }
.menu-sub[hidden], .menu[hidden] { display: none; }
.menu-theme .swatch { display: inline-block; flex: none; cursor: inherit; }
html[data-theme-pref="system"] .menu-theme[data-theme-set="system"], html[data-theme-pref="dark"] .menu-theme[data-theme-set="dark"], html[data-theme-pref="light"] .menu-theme[data-theme-set="light"], html[data-theme-pref="green"] .menu-theme[data-theme-set="green"], html[data-theme-pref="blue"] .menu-theme[data-theme-set="blue"] { background: var(--surface-3); font-weight: 650; }
.menu-logout { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.sharedtag { color: var(--ink-3); font-size: .88rem; flex: 1; }

/* ------------------------------------------------------------------ notices */
.notices { padding-top: 14px; }
main { position: relative; }
body.home .notices { position: absolute; top: 76px; left: 0; right: 0; z-index: 6; padding-top: 0; }
.flash, .alert, .notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .93rem; }
.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.flash, .alert, .notice { transition: opacity .5s ease, transform .5s ease; }
.flash.fading, .alert.fading, .notice.fading { opacity: 0; transform: translateY(-6px); }
.flash.dev { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert { background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.alert ul { margin: 0; padding-left: 18px; }
.notice { background: var(--warn-bg); color: var(--warn); }

/* ------------------------------------------------------------------ generated artwork (no cover image) */
.art-0 { background: radial-gradient(120% 90% at 85% 10%, #8b5cf6 0%, transparent 55%), linear-gradient(135deg, #172554, #4c1d95); }
.art-1 { background: radial-gradient(120% 90% at 85% 10%, #22d3ee 0%, transparent 55%), linear-gradient(135deg, #042f2e, #0f766e); }
.art-2 { background: radial-gradient(120% 90% at 85% 10%, #fbbf24 0%, transparent 55%), linear-gradient(135deg, #431407, #c2410c); }
.art-3 { background: radial-gradient(120% 90% at 85% 10%, #fb7185 0%, transparent 55%), linear-gradient(135deg, #4c0519, #9f1239); }
.art-4 { background: radial-gradient(120% 90% at 85% 10%, #a3e635 0%, transparent 55%), linear-gradient(135deg, #052e16, #15803d); }
.art-5 { background: radial-gradient(120% 90% at 85% 10%, #38bdf8 0%, transparent 55%), linear-gradient(135deg, #1e1b4b, #1d4ed8); }
.art-6 { background: radial-gradient(120% 90% at 85% 10%, #f97316 0%, transparent 55%), linear-gradient(135deg, #450a0a, #b91c1c); }
.art-7 { background: radial-gradient(120% 90% at 85% 10%, #e879f9 0%, transparent 55%), linear-gradient(135deg, #2e1065, #a21caf); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; min-height: min(72vh, 640px); display: flex; align-items: flex-end; overflow: hidden; color: #fff; isolation: isolate; }
.hero-sm { min-height: min(46vh, 420px); }
body:not(.home) .hero { margin-top: 0; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; right: -6%; top: 6%; width: 52%; aspect-ratio: 1; border-radius: 50%; z-index: -2; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 62%); }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .45) 42%, rgba(0, 0, 0, .05) 75%), linear-gradient(0deg, var(--hero-fade) 0%, transparent 38%); }
.hero-inner { width: 100%; padding-top: 110px; padding-bottom: clamp(36px, 7vh, 72px); max-width: 1440px; }
.hero-title { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.04; margin: 10px 0 12px; max-width: 18ch; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); letter-spacing: -.025em; }
.hero-sm .hero-title { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.hero-text { max-width: 60ch; color: rgba(255, 255, 255, .86); font-size: 1.02rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: rgba(255, 255, 255, .82); font-size: .93rem; margin-bottom: 18px; }
.watch-main .hero-meta, .pagehead .hero-meta { color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.hero .eyebrow { color: #ffd48a; background: rgba(0, 0, 0, .35); padding: 6px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); font-size: .85rem; font-weight: 600; }
.watch-main .pill, .pagehead .pill { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; margin-bottom: 6px; color: var(--ink-3); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .ico { width: .9em; height: .9em; opacity: .6; }
.hero .crumbs { color: rgba(255, 255, 255, .78); }
.hero .crumbs a:hover { color: #fff; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer;
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 18px; min-height: 42px; text-decoration: none;
  transition: transform .15s var(--ease), filter .15s, background .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.accent { background: var(--grad); color: var(--brand-ink); border-color: transparent; box-shadow: 0 10px 24px -12px var(--glow); }
.btn.secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: .85rem; border-radius: 8px; }
.btn.play { background: #fff; color: #0b0c10; border-color: #fff; padding: 11px 26px; font-size: 1.02rem; border-radius: 10px; }
.btn.play:hover { filter: none; background: #e9e9ee; }
.btn.glass { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(8px); padding: 11px 20px; }
.btn.glass:hover { background: rgba(255, 255, 255, .26); filter: none; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linklike, .linklike-dark { background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.linklike-dark { color: var(--bad); }

/* ------------------------------------------------------------------ rows / rails */
.rails { padding-top: 24px; padding-bottom: 56px; position: relative; z-index: 2; }
.hero + .rails { margin-top: -28px; }
.rail-section { margin: 30px 0 6px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.rail-head h2 { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.38rem); }
.rail-head h2 a { color: inherit; text-decoration: none; }
.rail-sub { color: var(--ink-3); font-weight: 500; font-size: .85em; margin-left: 6px; }
.rail-more { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.rail-more:hover { color: var(--brand); }
.rail-head .rail-action { margin-left: auto; text-decoration: underline; text-underline-offset: 3px; }
.rail-head .rail-action + .rail-more { margin-left: 4px; }
.rail-more { color: var(--ink-2); }
.rail-wrap { position: relative; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: var(--tile-w); gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 4px;
  padding: 6px 4px 18px; margin: -6px -4px 0; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-btn { position: absolute; top: 6px; bottom: 18px; width: 52px; z-index: 3; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 1.6rem; opacity: 0; transition: opacity .2s; }
.rail-btn.prev { left: -4px; background: linear-gradient(90deg, rgba(0, 0, 0, .7), transparent); border-radius: var(--radius) 0 0 var(--radius); }
.rail-btn.next { right: -4px; background: linear-gradient(270deg, rgba(0, 0, 0, .7), transparent); border-radius: 0 var(--radius) var(--radius) 0; }
.rail-wrap:hover .rail-btn:not([disabled]) { opacity: 1; }
.rail-btn[disabled] { pointer-events: none; }
.tilegrid { display: grid; gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tilegrid.big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ------------------------------------------------------------------ tiles */
.tile { display: block; color: inherit; text-decoration: none; min-width: 0; border-radius: var(--radius); }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); isolation: isolate; color: #fff; }
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: none; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.thumb-ico { position: absolute; inset: 0; display: grid; place-items: center; z-index: 0; }
.thumb-ico .ico { width: 34%; height: 34%; opacity: .32; }
.thumb-title { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; font-weight: 750; font-size: 1.02rem; line-height: 1.2; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb:has(img) .thumb-title { display: none; }
.chip { position: absolute; top: 9px; left: 9px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); color: #fff; }
.chip .ico { width: 13px; height: 13px; }
.chip.right { left: auto; right: 9px; background: var(--grad); color: var(--brand-ink); padding-left: 9px; }
.chip.lock { top: auto; bottom: 9px; left: auto; right: 9px; }
.kind-video { background: rgba(229, 9, 20, .82); }
.kind-pdf { background: rgba(198, 40, 40, .78); }
.kind-word { background: rgba(37, 99, 235, .82); }
.kind-powerpoint { background: rgba(234, 88, 12, .85); }
.kind-excel { background: rgba(22, 128, 61, .85); }
.kind-course { background: rgba(124, 58, 237, .82); }
.kind-policy { background: rgba(180, 83, 9, .85); }
.play-hover { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; opacity: 0; transition: opacity .25s; background: rgba(0, 0, 0, .25); }
.play-hover .ico { width: 54px; height: 54px; padding: 15px 13px 15px 17px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: #0b0c10; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.done-dot { position: absolute; top: 9px; right: 9px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #04130b; }
.done-dot .ico { width: 15px; height: 15px; }
.tprog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); z-index: 2; }
.tprog-bar { display: block; height: 100%; width: 0; background: #e50914; }
.tile-body { padding: 10px 2px 0; }
.tile-title { font-weight: 650; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { color: var(--ink-3); font-size: .82rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:hover .thumb, .tile:focus-visible .thumb { transform: translateY(-4px) scale(1.025); box-shadow: var(--shadow); }
.tile:hover .play-hover { opacity: 1; }
.tile:hover .tile-title { color: var(--brand); }
.tile.folder .thumb.stack { overflow: visible; }
.tile.folder .thumb.stack::before { content: ""; position: absolute; left: 8%; right: 8%; top: -7px; height: 20px; border-radius: 10px 10px 0 0; background: inherit; filter: brightness(.6); z-index: -1; }
.tile.folder .thumb.stack img { border-radius: var(--radius); }
.tile.current .thumb { box-shadow: 0 0 0 3px var(--brand); }

/* ------------------------------------------------------------------ home extras */
.ackbar { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); margin: 26px 0 6px; }
.ackbar-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: var(--brand-ink); font-size: 1.4rem; }
.ackbar-list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; font-size: .92rem; }
.emptystate { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin: 30px 0; background: var(--surface); }
.emptystate-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); font-size: 1.8rem; }
.emptystate p { max-width: 60ch; margin: 0 auto; }

/* ------------------------------------------------------------------ page heads, search, lists */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h1 { margin: 6px 0 4px; }
.pagehead p { margin: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head p { color: var(--ink-2); margin: 0; }
.searchbar, .filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead .searchbar { margin: 0; }
.searchbar input[type=search], .filterbar input[type=search] { flex: 1 1 260px; }
.searchbar.big input[type=search] { min-height: 52px; font-size: 1.05rem; border-radius: 12px; padding-left: 16px; }
.searchbar.big .btn { min-height: 52px; padding: 0 26px; border-radius: 12px; }
.filterbar select { width: auto; flex: 0 1 220px; }
.doclist { display: flex; flex-direction: column; gap: 8px; }
.docrow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s var(--ease); }
.docrow:hover { border-color: var(--line-2); transform: translateX(3px); }
.docrow > .ico { color: var(--ink-3); }
.docrow-ico { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.25rem; }
.docrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.docrow-title { font-weight: 650; }
.docrow-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-3); font-size: .84rem; align-items: center; }
.docrow-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* ------------------------------------------------------------------ cards, grids (also used by admin) */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cols { display: grid; gap: 22px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-bottom: .6em; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .2s var(--ease); }
.card-link:hover { border-color: var(--brand); transform: translateY(-2px); }
.card-link h3 { color: var(--ink); }
.stack > * + * { margin-top: 14px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.empty { color: var(--ink-3); padding: 22px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 22px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.subnav a { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 550; }
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.sop { background: rgba(59, 130, 246, .16); color: #7fb2ff; }
html:is([data-theme="light"], [data-theme="green"], [data-theme="blue"]) .badge.sop { color: #1d4ed8; background: #e3ecfd; }
.badge.policy, .badge.warning { background: var(--warn-bg); color: var(--warn); }
.badge.resource, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* progress */
progress.bar { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: block; }
progress.bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress.bar::-webkit-progress-value { background: var(--grad); border-radius: 99px; }
progress.bar::-moz-progress-bar { background: var(--brand); border-radius: 99px; }

/* ------------------------------------------------------------------ forms */
form.stack { max-width: 760px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: var(--ink-2); }
.hint { font-weight: 400; color: var(--ink-3); font-size: .84rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 120px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: .9rem; min-height: 320px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.row, .row2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
fieldset { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0; }
legend { font-weight: 650; font-size: .92rem; padding: 0 6px; }
.checks { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 6px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-family: var(--mono); font-size: .88rem; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 650; font-size: .8rem; color: var(--ink-3); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr.missing td { opacity: .55; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.indent { display: inline-flex; align-items: center; gap: 6px; }
.indent.d2 { padding-left: 22px; } .indent.d3 { padding-left: 44px; } .indent.d4 { padding-left: 66px; } .indent.d5 { padding-left: 88px; } .indent.d6 { padding-left: 110px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 22px 0; color: var(--ink-3); font-size: .9rem; }

/* ------------------------------------------------------------------ viewer (watch page) */
.theater { background: #000; padding: 22px 0; border-bottom: 1px solid var(--line); }
html:is([data-theme="light"], [data-theme="green"], [data-theme="blue"]) .theater { background: #0b0c10; }
.player { position: relative; aspect-ratio: 16 / 9; max-height: 78vh; margin: 0 auto; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.docview { display: block; width: 100%; height: 80vh; border: 0; border-radius: var(--radius); background: #fff; }
.docview.text { background: #fff; }
.imgview { display: grid; place-items: center; max-height: 80vh; }
.imgview img { max-height: 78vh; border-radius: var(--radius); }
.audioview { position: relative; border-radius: var(--radius); min-height: 260px; display: grid; place-items: end center; padding: 24px; color: #fff; }
.audioview audio { position: relative; z-index: 1; width: min(640px, 100%); }
.filecard { display: flex; gap: 26px; align-items: center; padding: clamp(24px, 5vw, 56px); border-radius: var(--radius); color: #fff; max-width: 980px; margin: 0 auto; }
.filecard-ico { flex: none; width: 120px; height: 120px; border-radius: 26px; display: grid; place-items: center; background: rgba(0, 0, 0, .3); font-size: 3.6rem; }
.filecard-name { font-size: 1.35rem; font-weight: 750; word-break: break-word; }
.filecard-body .muted { color: rgba(255, 255, 255, .78); margin-bottom: 8px; }
.filecard-body p { color: rgba(255, 255, 255, .85); }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; padding-top: 24px; padding-bottom: 56px; }
.watch-grid.single { grid-template-columns: minmax(0, 1fr); }
.watch-title { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 4px 0 10px; }
.upnext h2 { font-size: 1rem; color: var(--ink-2); margin-bottom: 10px; }
.uplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.uplist a { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.uplist a:hover { background: var(--surface-2); }
.uplist a.current { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--brand); }
.upthumb { position: relative; flex: none; width: 120px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; display: grid; place-items: center; color: rgba(255, 255, 255, .7); font-size: 1.5rem; }
.upthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uptext { display: flex; flex-direction: column; min-width: 0; }
.uptitle { font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ course pages, content */
.coursehead { position: relative; border-radius: var(--radius); overflow: hidden; color: #fff; margin-bottom: 22px; isolation: isolate; }
.coursehead::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1)); }
.coursehead-inner { padding: clamp(24px, 4vw, 44px); }
.coursehead .crumbs { color: rgba(255, 255, 255, .8); }
.coursehead .hero-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.coursehead .hero-meta { margin-bottom: 0; }
.prose { max-width: 75ch; }
.prose h2, .prose h3 { margin-top: 1.3em; }
.prose table { margin: 1em 0; }
.prose pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; }
.prose blockquote { border-left: 4px solid var(--brand); margin: 1em 0; padding: 4px 14px; color: var(--ink-2); }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--ink-3); font-size: .88rem; margin-bottom: 14px; }
.lessons { counter-reset: l; list-style: none; padding: 0; margin: 0; }
.lessons li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lessons li::before { counter-increment: l; content: counter(l); width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: .82rem; font-weight: 700; color: var(--ink-2); flex: none; }
.lessons li.done::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); }
.lessons a { flex: 1; color: var(--ink); text-decoration: none; font-weight: 550; }
.lessons a:hover { color: var(--brand); }

/* quiz */
.q { margin-bottom: 18px; }
.q legend { font-size: 1rem; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-weight: 450; cursor: pointer; color: var(--ink); border: 1px solid transparent; }
.opt:hover { background: var(--surface-2); border-color: var(--line); }
.opt input { margin-top: 5px; accent-color: var(--brand); }
.right { color: var(--ok); } .wrong { color: var(--bad); }


/* admin tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .n { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; font-family: var(--font-display); }
.kpi .n.small { font-size: 1.15rem; padding: 6px 0 4px; }
.kpi .l { color: var(--ink-3); font-size: .85rem; }
.kpi.down .n { color: var(--bad); }
.secret { font-family: var(--mono); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; word-break: break-all; user-select: all; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--ink-3); } dl.kv dd { margin: 0; }

/* ------------------------------------------------------------------ sign-in */
body.auth .page { max-width: 580px; padding-top: 9vh; }
body.auth .foot { display: none; }
.auth-themes { position: fixed; top: 16px; right: 20px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.auth-themes-label { font-size: .78rem; font-weight: 650; color: var(--ink-2); margin-right: 2px; }
.auth-copy { position: fixed; right: 20px; bottom: 12px; z-index: 5; font-size: .75rem; color: var(--ink-2); opacity: .85; }
.authcard { padding: 34px 32px 28px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.authlogo { display: flex; justify-content: center; margin-bottom: 14px; }
.authlogo img { height: 116px; width: auto; border-radius: 12px; box-shadow: var(--shadow-sm); }
.authtitle { text-align: center; font-family: "Sony Sketch EF", var(--font-display); font-size: clamp(1.25rem, 4.6vw, 1.85rem); letter-spacing: .02em; white-space: nowrap; color: var(--ink); margin-bottom: 18px; }
.authsub { text-align: center; margin-bottom: 18px; }
.authcard h1 { text-align: center; font-size: 1.5rem; margin-bottom: .7em; }
.authcard .btn.accent { min-height: 46px; font-size: 1rem; }
.pwfield { position: relative; }
.pwfield input { padding-right: 46px; }
.pwtoggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.pwtoggle:hover, .pwtoggle[aria-pressed="true"] { color: var(--brand); background: var(--surface-2); }
.authrow { display: flex; justify-content: flex-end; align-items: center; margin: 12px 0 0; font-size: .9rem; line-height: 1.2; }
.authrow + .btn { margin-top: 12px; }
.authrow.center { justify-content: center; margin-top: 16px; }
.authfoot { text-align: center; margin: 18px 0 0; }
.authcard .flash, .authcard .notice { margin-bottom: 16px; }
.authbrand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.authbrand .brand-mark { width: 40px; height: 40px; font-size: 1.25rem; border-radius: 11px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 10px; }

/* ------------------------------------------------------------------ dialog + toast */
.dlg { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.dlg h2 { display: flex; align-items: center; gap: 10px; }
.dlg-x { position: absolute; top: 12px; right: 12px; margin: 0; }
.notice-dlg { text-align: center; }
.notice-dlg h2 { justify-content: center; font-size: 1.25rem; }
.notice-dlg .actions { justify-content: center; flex-direction: column; gap: 8px; }
.notice-ico { width: 58px; height: 58px; margin: 4px auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: var(--brand-ink); font-size: 1.7rem; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200; padding: 11px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ footer */
.foot { color: var(--ink-2); font-size: .9rem; padding: 22px 0 26px; border-top: 1px solid var(--line); text-align: center; }
.foot-rights { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.foot-heart { color: #ff3d77; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .topbar-title { display: none; }
}
@media (max-width: 1100px) {
  .topsearch input[type=search] { width: 170px; }
  .topsearch input[type=search]:focus { width: 220px; }
  .watch-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --tile-w: 62vw; }
  .cols { grid-template-columns: 1fr; }
  .topbar-inner { gap: 10px; }
  .topsearch { display: none; }
  .brand-name { display: none; }
  .hero { min-height: 62vh; }
  .hero-shade { background: linear-gradient(0deg, var(--hero-fade) 2%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .25) 100%); }
  .rail-btn { display: none; }
  .filecard { flex-direction: column; text-align: center; }
  .docview { height: 70vh; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  :root { --tile-w: 74vw; }
  .tilegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .tilegrid.big { grid-template-columns: 1fr; }
  .nav a { padding: 7px 9px; font-size: .88rem; }
  .copyrow { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
