/* Vazirmatn (SIL Open Font License, see /fonts/OFL.txt) — one variable file for all weights, Persian, Arabic and Latin */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Variable.woff2') format('woff2-variations'), url('/fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ITALYPIU — dark-first theme: midnight navy + royal blue + gold, with Italian flag accents.
   Colours are tokens; [data-theme="light"] swaps them for the light theme. */

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #050a18;
  --bg-glow-1: rgba(61, 114, 228, .22);
  --bg-glow-2: rgba(255, 198, 26, .07);
  --bg-glow-3: rgba(124, 77, 255, .12);
  --surface: rgba(255, 255, 255, .04);
  --surface-solid: #0d1530;
  --surface-2: rgba(255, 255, 255, .055);
  --surface-3: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --text: #e6ebfa;
  --heading: #ffffff;
  --muted: #94a1c4;
  --accent: #7aa5ff;
  --accent-text: #b3caff;
  --accent-soft: rgba(122, 165, 255, .13);
  --input-bg: rgba(255, 255, 255, .035);
  --success-bg: rgba(46, 204, 113, .13); --success-text: #6be59c; --success-line: rgba(107, 229, 156, .45);
  --danger-bg: rgba(255, 90, 84, .13);   --danger-text: #ff8f8a;  --danger-line: rgba(255, 143, 138, .45);
  --warn-bg: rgba(255, 198, 26, .1);     --warn-text: #ffd866;    --warn-line: rgba(255, 198, 26, .32);
  --header-bg: rgba(6, 11, 26, .68);
  --hero-bg:
    radial-gradient(900px 480px at 85% -10%, rgba(80, 130, 255, .45), transparent 60%),
    radial-gradient(600px 420px at 5% 110%, rgba(255, 198, 26, .14), transparent 60%),
    radial-gradient(700px 500px at 30% 20%, rgba(124, 77, 255, .18), transparent 60%),
    linear-gradient(170deg, #0f1f52 0%, #0a1536 55%, #060c20 100%);
  --deep-grad: linear-gradient(150deg, #1a3a8f 0%, #0d1d4d 55%, #070f2a 100%);
  --card-fill: linear-gradient(180deg, #0f1934, #0a1229);
  --card-border: linear-gradient(140deg, rgba(122, 165, 255, .38), rgba(255, 255, 255, .06) 35%, rgba(255, 255, 255, .04) 65%, rgba(255, 198, 26, .3));
  --glass: rgba(13, 22, 48, .62);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow: 0 24px 50px -24px rgba(0, 0, 0, .85);
  --shadow-lg: 0 34px 70px -24px rgba(0, 0, 0, .95);
  --glow: 0 0 0 1px rgba(122, 165, 255, .25), 0 18px 40px -14px rgba(61, 114, 228, .55);
  --dot: rgba(255, 255, 255, .22);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fd;
  --bg-glow-1: rgba(61, 114, 228, .1);
  --bg-glow-2: rgba(255, 198, 26, .08);
  --bg-glow-3: rgba(124, 77, 255, .05);
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #eef3fe;
  --surface-3: #f6f9ff;
  --line: #e1e8f6;
  --line-2: #cbd7ef;
  --text: #111d3f;
  --heading: #0d2463;
  --muted: #5d6b8d;
  --accent: #2c5fd6;
  --accent-text: #2149b0;
  --accent-soft: #eaf0fd;
  --input-bg: #f9fbff;
  --success-bg: #e3f6ea; --success-text: #13703a; --success-line: #9ddcb3;
  --danger-bg: #fde8e7;  --danger-text: #b3231e; --danger-line: #f5b5b2;
  --warn-bg: #fff8de;    --warn-text: #8a6400;   --warn-line: #f2d77a;
  --header-bg: rgba(24, 58, 143, .86);
  --hero-bg:
    radial-gradient(900px 500px at 85% 10%, rgba(143, 176, 245, .55), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(13, 36, 99, .7), transparent 60%),
    linear-gradient(160deg, #5f8ff0 0%, #2c5fd6 45%, #183a8f 100%);
  --deep-grad: linear-gradient(150deg, #3d72e4, #081a4a);
  --card-fill: linear-gradient(#fff, #fff);
  --card-border: linear-gradient(#e1e8f6, #e1e8f6);
  --glass: #ffffff;
  --shadow-sm: 0 2px 8px rgba(17, 45, 120, .06);
  --shadow: 0 18px 40px -12px rgba(17, 45, 120, .18);
  --shadow-lg: 0 30px 60px -15px rgba(8, 26, 74, .35);
  --glow: 0 18px 40px -16px rgba(44, 95, 214, .45);
  --dot: rgba(255, 255, 255, .35);
}

:root {
  /* fixed brand colours */
  --b400: #5f8ff0; --b500: #3d72e4; --b600: #2c5fd6; --b700: #2149b0; --b800: #183a8f;
  --deep: #0d2463; --deep-2: #081a4a;
  --gold: #ffc61a; --gold-2: #ffd75a; --gold-dark: #e6a800; --on-gold: #0d2463;
  --it-green: #1e9e4a; --it-red: #e3342f;
  --radius: 22px;
  /* Vazirmatn covers Persian/Arabic/Latin; the Devanagari names are the fallback for Hindi */
  --font: 'Vazirmatn', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', system-ui, sans-serif;
  --display: 'Vazirmatn', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', system-ui, sans-serif;
  --flag: linear-gradient(90deg, var(--it-green) 33.3%, #fff 33.3% 66.6%, var(--it-red) 66.6%);
}
/* names used by page markup */
:root, [data-theme] {
  --ink: var(--text); --navy: var(--heading);
  --blue-50: var(--surface-2); --blue-100: var(--line); --blue-600: var(--accent); --blue-700: var(--accent-text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.75;
  min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; position: relative;
}
/* ambient aurora behind every page */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 100% 0%, var(--bg-glow-1), transparent 70%),
    radial-gradient(50vw 50vh at 0% 100%, var(--bg-glow-2), transparent 70%),
    radial-gradient(40vw 40vh at 0% 30%, var(--bg-glow-3), transparent 70%);
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-family: var(--display); color: var(--heading); }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- Icons ---------- */
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
[dir="rtl"] .ic-flip { transform: scaleX(-1); }
[dir="ltr"] .ic-back { transform: scaleX(-1); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; color: #fff;
  background: var(--header-bg);
  backdrop-filter: saturate(170%) blur(18px); -webkit-backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar::after { content: ''; position: absolute; inset-inline: 0; bottom: -2px; height: 2px; background: var(--flag); opacity: .85; direction: ltr; }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 900; font-size: 1.4rem; letter-spacing: .6px; font-family: var(--font); direction: ltr; }
.brand img { filter: drop-shadow(0 4px 14px rgba(255, 198, 26, .35)); }
.brand span { background: linear-gradient(180deg, #ffe48a, var(--gold) 60%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand.small { font-size: 1.15rem; }
.nav { display: flex; gap: 2px; align-items: center; margin-inline-start: auto; }
.nav a, .nav button {
  color: rgba(255, 255, 255, .78); padding: 8px 13px; border-radius: 999px; font-weight: 500; font-size: .95rem; white-space: nowrap;
  background: none; border: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, color .2s;
}
.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.nav .pill { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); font-weight: 700; box-shadow: 0 8px 22px -8px rgba(255, 198, 26, .8); }
.nav .pill:hover { background: var(--gold); color: var(--on-gold); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--it-red); color: #fff; font-size: .72rem; font-weight: 700; box-shadow: 0 0 12px rgba(227, 52, 47, .6); }
.lang-select {
  background: rgba(255, 255, 255, .07); color: #fff; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 7px 12px; font-family: inherit; width: auto; flex: none; cursor: pointer;
}
.lang-select option { color: #111d3f; background: #fff; }
.theme-btn, .menu-btn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); color: #fff; transition: background .2s, transform .2s;
}
.theme-btn:hover, .menu-btn:hover { background: rgba(255, 255, 255, .14); }
.theme-btn:active { transform: rotate(-20deg) scale(.95); }
.theme-btn .ic { color: var(--gold); }
.menu-btn { display: none; margin-inline-start: auto; }

@media (max-width: 1180px) {
  .menu-btn { display: grid; }
  .nav {
    display: none; position: absolute; top: 78px; inset-inline: 12px; flex-direction: column; align-items: stretch; padding: 10px;
    background: rgba(9, 15, 34, .96); border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  [data-theme="light"] .nav { background: rgba(24, 58, 143, .97); }
  .nav.open { display: flex; animation: pop .2s; }
  .nav a, .nav button { border-radius: 12px; padding: 12px 14px; }
}
@media (max-width: 420px) { .topbar-inner { gap: 8px; } .brand { font-size: 1.15rem; } .brand img { width: 36px; height: 36px; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: var(--hero-bg); padding: 70px 0 150px; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
.hero::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 90px; background: var(--bg); clip-path: ellipse(75% 100% at 50% 100%); }
.hero h1, .hero h2 { color: #fff; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); font-size: .9rem; font-weight: 500; margin-bottom: 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff;
}
[dir="rtl"] .hero-badge { padding: 6px 6px 6px 14px; }
.hero-badge b { background: var(--gold); color: var(--on-gold); padding: 2px 10px; border-radius: 999px; font-size: .8rem; display: inline-flex; align-items: center; }
.hero .kicker { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 700; opacity: .95; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 900; margin: .05em 0 .35em; letter-spacing: -.5px; text-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.gold-text { background: linear-gradient(180deg, #ffeaa0, var(--gold) 55%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(255, 198, 26, .35)); }
.hero p.lead { max-width: 560px; font-size: 1.12rem; opacity: .9; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 38px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.8rem; font-weight: 900; color: var(--gold); font-family: var(--display); line-height: 1.2; }
.hero-stats span { opacity: .8; font-size: .9rem; }
.hero-art { position: relative; }
.hero-art img { width: 100%; height: auto; display: block; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .45)); }
.chip {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); font-weight: 700; font-size: .92rem; white-space: nowrap; animation: float 6s ease-in-out infinite;
}
.chip .ic-box { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); }
.chip.c1 { top: 6%; inset-inline-start: -4%; animation-delay: -1s; }
.chip.c2 { bottom: 20%; inset-inline-end: -2%; animation-delay: -3s; }
.chip.c3 { bottom: 2%; inset-inline-start: 6%; animation-delay: -5s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@media (max-width: 920px) {
  .hero { padding: 40px 0 120px; text-align: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero p.lead { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-art { max-width: 460px; margin: 0 auto; }
  .chip { font-size: .8rem; padding: 8px 12px; }
}
.page-hero { padding: 56px 0 120px; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.page-hero p { max-width: 640px; margin: 0 auto 24px; opacity: .88; font-size: 1.08rem; }
.page-hero .hero-badge { margin-inline: auto; }

/* ---------- Buttons & forms ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 24px; font-weight: 700; font-size: 1rem; line-height: 1.4;
  font-family: inherit; cursor: pointer; transition: transform .15s, box-shadow .25s, background .2s, filter .2s;
  background: linear-gradient(180deg, #4a80f0, var(--b600)); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 26px -12px rgba(61, 114, 228, .95);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 18px 34px -12px rgba(61, 114, 228, 1); }
.btn:active { transform: translateY(0); }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold) 55%, #f5b400); color: var(--on-gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 30px -12px rgba(255, 198, 26, .85); }
.btn.gold:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 18px 38px -12px rgba(255, 198, 26, 1); }
.btn.ghost { background: var(--surface-2); color: var(--accent-text); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); border-color: var(--accent); filter: none; }
.btn.light { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn.light:hover { background: rgba(255, 255, 255, .18); }
.btn.navy { background: linear-gradient(180deg, #13276a, var(--deep)); color: #fff; box-shadow: 0 14px 28px -12px rgba(8, 26, 74, .9); }
.btn.lg { padding: 16px 30px; font-size: 1.08rem; border-radius: 16px; }
.btn.sm { padding: 7px 14px; font-size: .88rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }

label { display: block; font-weight: 500; margin-bottom: 16px; }
label > span { display: block; margin-bottom: 6px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px 15px; border: 1px solid var(--line-2); border-radius: 14px;
  font-family: inherit; font-size: 1rem; background: var(--input-bg); color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-3); box-shadow: 0 0 0 4px var(--accent-soft); }
select option { background: var(--surface-solid); color: var(--text); }
input[dir="ltr"], textarea[dir="ltr"] { text-align: left; }
input[type="color"] { padding: 4px; height: 48px; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(var(--invert, 0)); }
[data-theme="dark"] input[type="datetime-local"], :root:not([data-theme="light"]) input[type="datetime-local"] { --invert: 1; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.form-error { color: var(--danger-text); min-height: 1.5em; font-weight: 500; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Sections & cards ---------- */
.section { padding: 70px 0; }
.section.tight { padding-top: 30px; }
.section-head { text-align: center; margin-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 700; font-size: .9rem; background: var(--accent-soft); border: 1px solid var(--line); padding: 4px 14px; border-radius: 999px; margin-bottom: 12px; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; }
.section-head p { max-width: 620px; margin: 0 auto; }
.card {
  position: relative; border-radius: var(--radius); padding: 26px; color: var(--text);
  background: var(--card-fill) padding-box, var(--card-border) border-box; border: 1px solid transparent;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.overlap { margin-top: -110px; position: relative; z-index: 2; }

.feature { overflow: hidden; transition: transform .25s, box-shadow .25s; }
.feature:hover { transform: translateY(-6px); box-shadow: var(--glow); }
.feature .icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 18px;
  background: linear-gradient(140deg, var(--b500), var(--deep)); color: var(--gold); box-shadow: 0 12px 24px -10px rgba(61, 114, 228, .9), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.feature h3 { font-size: 1.15rem; }
.feature p { margin: 0; }

/* score boxes & dark cards */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.score-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.score-table div { text-align: center; padding: 18px 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.score-table b { display: block; font-size: 1.8rem; font-weight: 900; font-family: var(--font); direction: ltr; }
.c-green { color: var(--success-text); } .c-red { color: var(--danger-text); } .c-muted { color: var(--muted); }
.dark-card { background: var(--deep-grad); color: #fff; border: 0; overflow: hidden; }
.dark-card::before { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(rgba(122, 165, 255, .6), transparent 70%); opacity: .5; top: -90px; inset-inline-end: -80px; }
.dark-card > * { position: relative; }
.dark-card h3 { color: var(--gold); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check-list .ic { color: var(--success-text); margin-top: 5px; }
.auth-side .check-list .ic, .dark-card .check-list .ic { color: var(--gold); }

/* ---------- Exam cards ---------- */
.exam-card { display: flex; flex-direction: column; gap: 14px; transition: transform .2s, box-shadow .2s; }
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.exam-card .e-head { display: flex; align-items: center; gap: 14px; }
.exam-card .e-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: var(--accent-soft); color: var(--accent); flex: none; }
.exam-card h3 { margin: 0; font-size: 1.15rem; }
.exam-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-text); font-size: .88rem; font-weight: 500; }
.exam-card .btn { margin-top: auto; }
.ribbon { display: inline-block; background: var(--gold); color: var(--on-gold); font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 999px; }

/* ---------- Book store ---------- */
.book { display: flex; flex-direction: column; gap: 12px; padding: 18px; transition: transform .25s, box-shadow .25s; }
.book:hover { transform: translateY(-6px); box-shadow: var(--glow); }
.book-stage { background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); border-radius: 16px; padding: 22px 30px 26px; perspective: 900px; }
.book-cover {
  aspect-ratio: 3 / 4; border-radius: 4px 12px 12px 4px; padding: 20px 18px 20px 26px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; transform: rotateY(-14deg); transform-origin: left center; transition: transform .35s;
  box-shadow: 18px 18px 34px -12px rgba(0, 0, 0, .6), inset 6px 0 0 rgba(255, 255, 255, .12), inset 10px 0 12px -6px rgba(0, 0, 0, .35);
  direction: ltr; text-align: left;
}
.book:hover .book-cover { transform: rotateY(-4deg); }
.book-cover::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .22), transparent 45%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 12px, transparent 12px 24px); }
.book-cover::after { content: ''; position: absolute; bottom: 0; inset-inline: 0; height: 7px; background: var(--flag); }
.book-cover > * { position: relative; }
.book-cover .bc-top { display: flex; align-items: center; gap: 6px; font-family: var(--font); font-weight: 900; color: var(--gold); letter-spacing: 1.5px; font-size: .72rem; }
.book-cover .bc-title { font-weight: 900; font-size: 1.15rem; line-height: 1.35; font-family: var(--display); }
.book-cover[data-rtl] .bc-title { direction: rtl; text-align: right; }
.book-cover .bc-sub { font-size: .75rem; opacity: .8; font-family: var(--font); }
.book h3 { margin: 0; font-size: 1.08rem; }
.book .desc { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.book .price { font-weight: 900; color: var(--heading); font-size: 1.2rem; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .78rem; font-weight: 700; border: 1px solid transparent; }
.tag.gold { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.tag.green { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.tag.red { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-line); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; background: var(--surface-2); border-bottom: 0; }
th:first-child { border-start-start-radius: 12px; border-end-start-radius: 12px; }
th:last-child { border-start-end-radius: 12px; border-end-end-radius: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--surface-2); }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--heading); }
.card-title .ic { color: var(--gold); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: var(--accent); opacity: .55; display: block; margin: 0 auto 10px; }

/* ---------- Auth ---------- */
.auth-wrap {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 1000px; margin: 50px auto; border-radius: 28px; overflow: hidden;
  background: var(--card-fill) padding-box, var(--card-border) border-box; border: 1px solid transparent; box-shadow: var(--shadow-lg);
}
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 44px; background: var(--hero-bg); display: flex; flex-direction: column; gap: 18px; }
.auth-side h2 { font-size: 1.9rem; font-weight: 900; color: #fff; }
.auth-side img.art { width: 82%; margin: auto auto 0; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .4)); }
.auth-form { padding: 44px; }
.auth-form h1 { font-size: 1.8rem; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; margin: 20px auto; } .auth-side { padding: 30px; } .auth-side img.art { display: none; } .auth-form { padding: 28px; } }

/* ---------- Stats & dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-sm); }
.stat .s-ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; background: linear-gradient(140deg, var(--b500), var(--deep)); color: var(--gold); flex: none; box-shadow: 0 10px 22px -10px rgba(61, 114, 228, .9); }
.stat span { color: var(--muted); font-size: .88rem; display: block; }
.stat b { display: block; font-size: 1.55rem; color: var(--heading); font-weight: 900; line-height: 1.3; }
.welcome { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: var(--on-gold); background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 12px 26px -10px rgba(255, 198, 26, .8); }
.welcome h1 { margin: 0; font-size: 1.7rem; }

/* ---------- Lobby ---------- */
.lobby { max-width: 760px; margin: 0 auto; }
.lobby .shield { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-size: 2.2rem; color: var(--gold); background: linear-gradient(140deg, var(--b500), var(--deep)); margin-bottom: 16px; box-shadow: 0 16px 34px -10px rgba(61, 114, 228, .9); }
.rules { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.rules li .n { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--b600); color: #fff; font-weight: 700; font-size: .85rem; margin-top: 2px; }

/* ---------- Exam runner (Safe Exam) ---------- */
body.exam-mode .topbar, body.exam-mode .footer { display: none; }
body.exam-mode { user-select: none; -webkit-user-select: none; }
.exam-bar {
  position: sticky; top: 0; z-index: 20; color: #fff; background: linear-gradient(90deg, #070f2a, #132a6b);
  display: flex; align-items: center; gap: 16px; padding: 12px 22px; flex-wrap: wrap; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7); border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.exam-bar .timer { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 900; color: var(--gold); direction: ltr; background: rgba(255, 255, 255, .07); padding: 2px 14px; border-radius: 12px; text-shadow: 0 0 18px rgba(255, 198, 26, .5); }
.exam-bar .timer.low { color: #ff8a84; text-shadow: 0 0 18px rgba(255, 90, 84, .6); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.exam-bar .viol { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .08); padding: 5px 14px; border-radius: 999px; font-size: .92rem; }
.exam-progress { height: 3px; background: rgba(255, 255, 255, .1); position: absolute; bottom: 0; inset-inline: 0; }
.exam-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); box-shadow: 0 0 12px var(--gold); transition: width .3s; }
.exam-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; padding: 24px; max-width: 1240px; margin: 0 auto; }
@media (max-width: 900px) { .exam-layout { grid-template-columns: 1fr; padding: 14px; } }
.question { direction: ltr; text-align: left; }
.question .q-sub { display: inline-flex; gap: 8px; align-items: center; color: var(--accent-text); font-weight: 700; font-size: .85rem; background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; }
.question .q-text { font-size: 1.22rem; font-weight: 500; margin: 14px 0 20px; font-family: var(--font); line-height: 1.6; color: var(--heading); }
.option {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; font-family: var(--font);
  padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 16px;
  cursor: pointer; font-size: 1rem; color: var(--text); transition: border-color .15s, background .15s, transform .1s, box-shadow .2s;
}
.option:hover { border-color: var(--accent); background: var(--surface-3); }
.option:active { transform: scale(.995); }
.option .letter { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); font-weight: 700; color: var(--accent-text); transition: background .15s; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.option.selected .letter { background: var(--b600); color: #fff; }
.option.right { border-color: var(--success-line); background: var(--success-bg); box-shadow: 0 0 22px -8px rgba(46, 204, 113, .6); }
.option.right .letter { background: var(--it-green); color: #fff; }
.option.wrong { border-color: var(--danger-line); background: var(--danger-bg); }
.option.wrong .letter { background: var(--it-red); color: #fff; }
.option:disabled { cursor: default; }
.q-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.q-nav button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-family: var(--font); font-weight: 500; font-size: .85rem; color: var(--text); }
.q-nav button:hover { border-color: var(--accent); }
.q-nav button.done { background: var(--b600); color: #fff; border-color: var(--b600); }
.q-nav button.current { outline: 2px solid var(--gold); outline-offset: 2px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 14px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; margin-inline-end: 4px; border: 1px solid var(--line-2); }
.legend i.d { background: var(--b600); border-color: var(--b600); }
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: .05; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 40px; transform: rotate(-20deg) scale(1.4);
  font-weight: 900; font-size: 1.1rem; color: var(--heading); direction: ltr;
}
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 7, 20, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 24px; animation: fade .2s;
}
.overlay .card { animation: pop .25s; --card-fill: linear-gradient(180deg, var(--surface-solid), var(--surface-solid)); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.overlay h2 { color: var(--gold); }

/* ---------- Results & ranking ---------- */
.result-hero { background: var(--hero-bg); color: #fff; text-align: center; border: 0; overflow: hidden; box-shadow: var(--shadow-lg); }
.result-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 22px 22px; opacity: .45; mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 75%); }
.result-hero > * { position: relative; }
.result-hero h2 { color: #fff; }
.result-hero .meta { background: rgba(255, 255, 255, .1) !important; border-color: rgba(255, 255, 255, .14); color: #fff !important; }
.result-hero .score-table div { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
[data-theme="light"] .result-hero .score-table div { background: #fff; color: var(--text); }
.result-hero .score-table b[style*="--navy"], .result-hero .score-table b[style*="--heading"] { color: #fff !important; }
[data-theme="light"] .result-hero .score-table b[style*="--navy"] { color: var(--heading) !important; }
.ring { --p: 0; width: 176px; height: 176px; border-radius: 50%; margin: 10px auto 14px; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); box-shadow: 0 0 40px -6px rgba(255, 198, 26, .45); }
.ring > div { width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #13286a, #070f2a); display: grid; place-content: center; box-shadow: inset 0 2px 10px rgba(0, 0, 0, .5); }
.ring b { font-size: 2.2rem; font-weight: 900; color: var(--gold); font-family: var(--font); direction: ltr; line-height: 1.1; text-shadow: 0 0 20px rgba(255, 198, 26, .4); }
.ring small { opacity: .7; font-family: var(--font); direction: ltr; }
.rank-big { display: flex; flex-direction: column; align-items: center; margin: 6px 0; }
.rank-big span { opacity: .85; }
.rank-big b { font-size: 3.8rem; font-weight: 900; color: var(--gold); line-height: 1.1; text-shadow: 0 0 30px rgba(255, 198, 26, .5); }
.rank-big small { opacity: .8; }
.rank-chip { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-weight: 900; }
.rank-chip.r1 { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 0 18px -4px rgba(255, 198, 26, .8); }
.rank-chip.r2 { background: linear-gradient(180deg, #eef2f8, #c4cdd9); color: #3d4a63; }
.rank-chip.r3 { background: linear-gradient(180deg, #f3c9a0, #c98b55); color: #4a2a0e; }
tr.me-row td { background: var(--warn-bg) !important; }
.pct { display: flex; align-items: center; gap: 10px; }
.pct .bar { flex: 1; height: 8px; }
.review-item { margin-bottom: 16px; }
.explain { display: flex; gap: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-inline-start: 4px solid var(--gold); padding: 12px 14px; border-radius: 12px; margin-top: 10px; direction: ltr; text-align: left; font-family: var(--font); color: var(--text); }
.explain .ic { color: var(--gold); margin-top: 3px; }

/* ---------- Notes ---------- */
.note { display: flex; gap: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 18px; padding: 18px; margin-top: 26px; color: var(--text); }
.note .ic { color: var(--gold); margin-top: 4px; }

/* ---------- Footer & toast ---------- */
.footer { background: linear-gradient(180deg, #08112b, #040814); color: rgba(255, 255, 255, .7); padding: 54px 0 0; margin-top: 70px; position: relative; border-top: 1px solid rgba(255, 255, 255, .06); }
.footer::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 3px; background: var(--flag); direction: ltr; opacity: .9; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; padding-bottom: 36px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { color: #fff; margin-bottom: 14px; }
.footer a { color: rgba(255, 255, 255, .7); display: block; padding: 3px 0; transition: color .2s; }
.footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .88rem; }
.flag { display: inline-flex; width: 54px; height: 14px; border-radius: 3px; overflow: hidden; direction: ltr; }
.flag i { flex: 1; }
.flag i:nth-child(1) { background: var(--it-green); }
.flag i:nth-child(2) { background: #fff; }
.flag i:nth-child(3) { background: var(--it-red); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(140px);
  background: rgba(13, 21, 48, .92); color: #fff; padding: 13px 22px; border-radius: 16px; z-index: 200; font-weight: 500;
  border: 1px solid rgba(255, 255, 255, .12); border-bottom: 3px solid var(--gold); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast.error { border-bottom-color: var(--it-red); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Admin panel ---------- */
.admin-tabs {
  display: flex; gap: 6px; padding: 6px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.admin-tabs a:hover { background: var(--surface-2); color: var(--heading); }
.admin-tabs a.active { background: linear-gradient(140deg, var(--b500), var(--deep)); color: #fff; box-shadow: 0 10px 24px -10px rgba(61, 114, 228, .9); }
.admin-tabs a.active .ic { color: var(--gold); }
.form-modal { width: min(620px, 100%); max-height: 92vh; display: flex; flex-direction: column; gap: 12px; color: var(--text); text-align: start; }
.form-modal-body { overflow-y: auto; padding: 4px 4px 4px 2px; margin: 0 -4px; }
.form-modal .form-error { margin: 0; min-height: 0; }
.danger-text { color: var(--danger-text) !important; }
.danger-text:hover { border-color: var(--danger-line) !important; background: var(--danger-bg) !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-btn {
  --c: var(--b600);
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-family: inherit; font-size: .92rem; font-weight: 500;
}
.chip-btn .ic { color: var(--c); }
.chip-btn b { background: var(--surface-3); color: var(--heading); border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.chip-btn:hover { border-color: var(--c); }
.chip-btn.active { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 8px 20px -10px var(--c); }
.chip-btn.active .ic { color: #fff; }
.chip-btn.active b { background: rgba(255, 255, 255, .25); color: #fff; }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; max-width: 460px; position: relative; }
.search > span { position: absolute; inset-inline-start: 14px; color: var(--muted); display: flex; }
.search input { padding-inline-start: 42px; }
.q-card { margin-bottom: 14px; padding: 20px 22px; }
.q-body { direction: ltr; text-align: left; }
.q-title { font-family: var(--font); font-weight: 500; font-size: 1.05rem; margin: 12px 0; color: var(--heading); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.opt-mini { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font); font-size: .92rem; }
.opt-mini b { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; flex: none; }
.opt-mini.ok { background: var(--success-bg); border-color: var(--success-line); }
.opt-mini.ok b { background: var(--it-green); color: #fff; }
.opt-input { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; direction: ltr; }
.radio { margin: 0; flex: none; cursor: pointer; position: relative; }
.radio span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--accent-text); margin: 0; font-size: 1rem; transition: all .15s; }
.radio input:checked + span { background: var(--it-green); border-color: var(--it-green); color: #fff; box-shadow: 0 6px 16px -6px rgba(30, 158, 74, .8); }
.radio input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.bars { display: grid; gap: 12px; margin-bottom: 18px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 48px; align-items: center; gap: 12px; }
.bar-label { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; direction: ltr; }
[dir="rtl"] .bar { direction: rtl; }
.bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s; box-shadow: 0 0 12px -2px currentColor; }
.bar-row b { text-align: end; color: var(--heading); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr 40px; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }
.admin-exam { gap: 12px; }
.admin-exam.is-off { opacity: .65; }
.admin-exam .e-head h3 { margin-bottom: 4px; }
.dist { display: flex; flex-wrap: wrap; gap: 6px; }
.warn { display: flex; gap: 8px; align-items: center; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 8px 12px; font-size: .88rem; font-weight: 500; }
.swatch { display: inline-block; width: 14px; height: 18px; border-radius: 3px; vertical-align: middle; margin-inline-end: 6px; box-shadow: 0 0 10px -2px rgba(0, 0, 0, .4); }
.swatch.big { width: 26px; height: 34px; border-radius: 4px 8px 8px 4px; }
.group-head { --c: var(--b600); display: flex; align-items: center; gap: 8px; color: var(--c); margin: 6px 0 12px; font-size: 1.05rem; }
.bank-filters { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; align-items: end; }
.bank-filters label { margin: 0; }
.bank-filters .search { max-width: none; }
@media (max-width: 760px) { .bank-filters { grid-template-columns: 1fr; } }
.src-admin { margin-bottom: 12px; padding: 18px 20px; }

/* ---------- Applicant chooser (first screen) ---------- */
.chooser {
  min-height: calc(100vh - 74px); min-height: calc(100svh - 74px); display: flex; align-items: center; padding: 40px 0 60px;
  color: #fff; position: relative; overflow: hidden; background: var(--hero-bg);
}
.chooser::before {
  content: ''; position: absolute; inset: 0; background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 26px 26px; opacity: .4;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 70%);
}
/* slow glowing orbs */
.chooser::after {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; top: -180px; inset-inline-start: -160px; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 198, 26, .18), transparent 65%); animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(120px, 80px) scale(1.15); } }
.chooser-inner { position: relative; z-index: 1; max-width: 640px; text-align: center; }
.chooser-logo { filter: drop-shadow(0 0 30px rgba(255, 198, 26, .45)); margin-bottom: 10px; animation: float 6s ease-in-out infinite; }
.chooser-kicker { font-weight: 700; color: var(--gold); letter-spacing: .3px; }
.chooser h1 { font-size: clamp(1.7rem, 6vw, 2.7rem); font-weight: 900; margin: 6px 0 8px; color: #fff; text-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.chooser-sub { opacity: .82; margin-bottom: 28px; }
.choices { display: grid; gap: 14px; text-align: start; }
.choice {
  --c: var(--b600);
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 22px; color: var(--text); position: relative; overflow: hidden;
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
[data-theme="light"] .choice { border-color: transparent; }
.choice::before { content: ''; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--c); box-shadow: 0 0 16px var(--c); }
.choice::after { content: ''; position: absolute; inset: 0; background: radial-gradient(400px 120px at 0% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); opacity: 0; transition: opacity .25s; pointer-events: none; }
[dir="rtl"] .choice::after { background: radial-gradient(400px 120px at 100% 50%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%); }
.choice:hover, .choice:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 24px 50px -20px color-mix(in srgb, var(--c) 70%, black); outline: none; }
.choice:hover::after { opacity: 1; }
.choice:active { transform: scale(.99); }
.choice.last { border-color: rgba(255, 198, 26, .6); }
.ch-ic { width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 85%, white), var(--c)); box-shadow: 0 10px 24px -8px var(--c); position: relative; z-index: 1; }
.ch-text { display: flex; flex-direction: column; flex: 1; min-width: 0; position: relative; z-index: 1; }
.ch-text b { font-size: 1.12rem; color: var(--heading); line-height: 1.5; }
.ch-text small { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.ch-go { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 0 20px -4px rgba(255, 198, 26, .7); position: relative; z-index: 1; transition: transform .25s; }
.choice:hover .ch-go { transform: translateX(-4px); }
[dir="ltr"] .choice:hover .ch-go { transform: translateX(4px); }
.chooser-login { margin-top: 26px; opacity: .9; }
.chooser-login a { color: var(--gold); font-weight: 700; }
@media (max-width: 480px) { .choice { padding: 16px 14px; gap: 12px; } .ch-ic { width: 48px; height: 48px; font-size: 1.35rem; } .ch-text b { font-size: 1.02rem; } .ch-go { width: 34px; height: 34px; } }

/* ---------- Group services page ---------- */
.track-hero { padding-bottom: 130px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .85); font-weight: 500; margin-bottom: 14px; font-size: .95rem; }
.back-link:hover { color: #fff; }
.back-link.dark { color: var(--accent); margin-bottom: 18px; }
.track-hero .hero-badge { display: flex; width: max-content; margin-inline: auto; }
.svc-jump { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.svc-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-weight: 700; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s; }
.svc-jump a:hover { background: rgba(255, 255, 255, .15); }
.svc-jump a span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); font-size: .85rem; }
.login-note { margin: 0 0 18px; align-items: center; }
.login-note span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.service { margin-bottom: 22px; scroll-margin-top: 90px; padding: 28px; overflow: hidden; }
.service::before { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; top: -160px; inset-inline-end: -120px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.svc-head { position: relative; display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.svc-head h2 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); margin-bottom: .2em; }
.svc-head p { margin: 0; color: var(--muted); }
.svc-num { width: 50px; height: 50px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 900; color: var(--on-gold); background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 0 26px -6px rgba(255, 198, 26, .8); }
.svc-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.svc-stats div { text-align: center; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.svc-stats b { display: block; font-size: 1.55rem; font-weight: 900; line-height: 1.3; background: linear-gradient(180deg, var(--heading), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.svc-stats span { font-size: .85rem; color: var(--muted); }
@media (max-width: 600px) { .service { padding: 20px 16px; } .svc-num { width: 42px; height: 42px; font-size: 1.15rem; } }

/* moving list of library books */
.marquee { direction: ltr; overflow: hidden; margin: 0 -28px; padding: 14px 0 22px; mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee calc(var(--n) * 6s) linear infinite; }
.marquee-dup { display: flex; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track, .marquee:active .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (max-width: 600px) { .marquee { margin: 0 -16px; } }
.src-cover { --c: var(--b600); display: block; width: 168px; flex: none; margin: 0 9px; perspective: 800px; color: #fff; }
.sc-book {
  aspect-ratio: 3 / 4; border-radius: 4px 12px 12px 4px; padding: 16px 14px 18px 20px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--c), #0a1a4a); position: relative; overflow: hidden; text-align: left; direction: ltr;
  transform: rotateY(-12deg); transform-origin: left center; transition: transform .35s, box-shadow .35s;
  box-shadow: 14px 16px 28px -12px rgba(0, 0, 0, .7), inset 5px 0 0 rgba(255, 255, 255, .12), inset 9px 0 10px -6px rgba(0, 0, 0, .35);
}
.sc-book::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .25), transparent 45%), repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px); }
.sc-book::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 6px; background: var(--flag); }
.sc-book > * { position: relative; }
.src-cover:hover .sc-book { transform: rotateY(-3deg) translateY(-6px); box-shadow: 14px 22px 34px -12px rgba(0, 0, 0, .75), 0 0 30px -8px var(--c); }
.sc-book .bc-top { display: flex; align-items: center; gap: 5px; font-family: var(--font); font-weight: 900; color: var(--gold); letter-spacing: 1.2px; font-size: .64rem; }
.sc-title { font-family: var(--display); font-weight: 900; font-size: 1.02rem; line-height: 1.4; }
.sc-sub { font-size: .7rem; opacity: .85; font-family: var(--font); }
[dir="rtl"] .sc-sub { direction: rtl; text-align: right; }
.src-cover.big { width: 190px; }

.svc-split { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .svc-split { grid-template-columns: 1fr; } }
.sub-card { border: 1px solid var(--line); border-radius: 20px; padding: 20px; background: linear-gradient(180deg, var(--surface-2), transparent); }
.sub-card.comp { background: linear-gradient(170deg, var(--warn-bg), transparent 70%); border-color: var(--warn-line); }
.sub-card .card-title { margin-bottom: 6px; }
.mini-head { margin: 20px 0 10px; font-size: .98rem; }
.exam-rows { display: grid; gap: 10px; margin-top: 12px; }
.exam-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.exam-row:hover { border-color: var(--line-2); background: var(--surface-3); }
.er-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.comp .er-ic { background: var(--warn-bg); color: var(--gold); }
.er-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.er-main b { color: var(--heading); font-size: .97rem; line-height: 1.5; }
.er-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .8rem; align-items: center; }
.er-meta .ic { width: 1em; height: 1em; }
.exam-row .btn { flex: none; }
@media (max-width: 480px) { .exam-row { flex-wrap: wrap; } .exam-row .btn { width: 100%; } }
.more-link { display: flex; align-items: center; gap: 12px; color: var(--heading); font-weight: 700; padding: 18px 22px; transition: box-shadow .2s, transform .2s; }
.more-link:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.more-link span { flex: 1; }
.more-link .ic:first-child { color: var(--gold); }

/* ---------- Library book page & topics ---------- */
.source-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.source-head h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 10px 0 6px; }
@media (max-width: 640px) { .source-head { grid-template-columns: 1fr; text-align: center; } .source-head .src-cover { margin: 0 auto; width: 150px; } .source-head .exam-meta { justify-content: center; } }
.topic-list { display: grid; gap: 10px; }
.topic { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s, box-shadow .2s; }
.topic:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--glow); }
.tp-num { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--accent-soft); color: var(--accent-text); }
.tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-main b { color: var(--heading); }
.tp-meta { color: var(--muted); font-size: .84rem; }
.tp-main .bar { height: 6px; }
.topic .btn { flex: none; }

/* ---------- Practice ---------- */
.practice { max-width: 860px; }
.practice-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.practice-head h2 { margin: 0; font-size: 1.3rem; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.dots i { width: 22px; height: 8px; border-radius: 999px; background: var(--surface-3); }
.dots i.ok { background: var(--it-green); box-shadow: 0 0 10px -2px var(--it-green); }
.dots i.no { background: var(--it-red); box-shadow: 0 0 10px -2px var(--it-red); }
.dots i.cur { outline: 2px solid var(--gold); outline-offset: 2px; }
.dots i.mk { box-shadow: inset 0 -3px 0 var(--gold); }
.dots i.mk:not(.ok):not(.no) { background: rgba(255, 198, 26, .55); }

/* ---------- Exam builder ---------- */
.builder-src { margin-bottom: 14px; padding: 18px 20px; }
.check.mini { padding: 4px 12px; margin: 0; font-size: .88rem; }
.check.mini input { width: 16px; height: 16px; }
.topic-chips, .topic-admin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tchip { margin: 0; cursor: pointer; position: relative; }
.tchip input, .radio input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; inset-inline-start: 0; top: 0; }
.tchip > span, .tchip.static, .tchip.add { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: .9rem; color: var(--text); margin: 0; transition: all .15s; }
.tchip small { color: var(--muted); font-size: .76rem; }
.tchip input:checked + span { background: var(--b600); border-color: var(--b600); color: #fff; box-shadow: 0 6px 18px -8px var(--b500); }
.tchip input:checked + span small { color: rgba(255, 255, 255, .8); }
.tchip input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.tchip.off { opacity: .4; cursor: not-allowed; }
.tchip.static button { border: 0; background: none; cursor: pointer; padding: 0 2px; color: var(--muted); font-size: .9rem; }
.tchip.add { cursor: pointer; border-style: dashed; color: var(--accent); font-family: inherit; }
.builder-bar { position: sticky; bottom: 12px; z-index: 5; box-shadow: var(--shadow-lg); --card-fill: linear-gradient(180deg, var(--surface-solid), var(--surface-solid)); }
input[type="range"] { padding: 0; height: 32px; accent-color: var(--gold); background: none; border: 0; box-shadow: none; }

/* ---------- Highlights & review list ---------- */
.review-cta {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border-radius: 18px; color: var(--heading);
  background: linear-gradient(120deg, var(--warn-bg), transparent), var(--surface-2); border: 1px solid var(--warn-line); transition: transform .2s, box-shadow .2s;
}
.review-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -16px rgba(255, 198, 26, .55); }
.rc-ic { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 0 18px -4px rgba(255, 198, 26, .7); }
.rc-ic .ic { fill: currentColor; }
.rc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-text small { color: var(--warn-text); font-size: .84rem; opacity: .9; }
.rc-count { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; background: linear-gradient(180deg, #13276a, var(--deep)); color: var(--gold); font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255, 198, 26, .35); }
.q-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; direction: rtl; }
[dir="ltr"] .q-tools { direction: ltr; }
.hl-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: var(--font); font-weight: 700; font-size: .88rem;
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-text); transition: all .15s;
}
.hl-btn:hover { filter: brightness(1.15); }
.hl-btn.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: var(--on-gold); box-shadow: 0 0 22px -6px rgba(255, 198, 26, .9); }
.hl-btn.on .ic { fill: currentColor; }
.question.is-marked { --card-border: linear-gradient(140deg, rgba(255, 198, 26, .8), rgba(255, 198, 26, .2)); box-shadow: 0 0 40px -16px rgba(255, 198, 26, .6), var(--shadow); }
.question.is-marked .q-text { background: var(--warn-bg); padding: 10px 14px; border-radius: 12px; box-shadow: inset 4px 0 0 var(--gold); }
.review-hero .score-table b { font-size: 1.6rem; }
.review-group { margin-top: 16px; padding: 18px 20px; }
.review-group .topic-chips .tchip.static { color: var(--text); }
.review-group .topic-chips .tchip.static:hover { border-color: var(--gold); background: var(--warn-bg); }
.review-group .row > div { flex: 1; min-width: 180px; }
.review-group .row > .spacer { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .marquee-dup { display: none; }
}

/* ---------- Library: shared card/book design (Vesta-style, ITALYPIU palette) ---------- */
.lib-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin: 22px 0 6px; }
.lib-search { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; background: var(--input-bg); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 14px; min-width: 0; }
.lib-search .ic { color: var(--accent); flex: none; }
.lib-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; }
.lib-search input::placeholder { color: var(--muted); }
.lib-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; transition: .15s; }
.lib-pill .ic { width: 15px; height: 15px; }
.lib-pill:hover { color: var(--heading); }
.lib-pill.is-on { background: linear-gradient(180deg, #ffe48a, var(--gold)); color: var(--on-gold); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(255, 198, 26, .8); }
.lib-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .83rem; margin: 4px 2px 14px; }
.lib-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; background: var(--card-fill); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.lib-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.lib-card[hidden] { display: none; }
.lc-band { position: relative; display: block; padding: 14px 16px; min-height: 92px; background: linear-gradient(135deg, var(--c) 0%, #081a4a 92%); overflow: hidden; }
.lc-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 999px; padding: 5px 11px; font-size: .76rem; font-weight: 700; backdrop-filter: blur(4px); }
.lc-badge .ic { width: 15px; height: 15px; }
.lc-mark { position: absolute; inset-inline-start: -18px; bottom: -28px; color: #fff; opacity: .18; transform: rotate(-10deg); pointer-events: none; }
.lc-mark .ic { width: 104px; height: 104px; }
.lc-track { position: absolute; inset-inline-end: 16px; bottom: 14px; color: #fff; opacity: .85; font-size: .72rem; font-weight: 700; }
.lc-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; gap: 8px; }
.lc-name { color: var(--heading); font-size: 1rem; font-weight: 800; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: start; }
.lc-desc { color: var(--muted); font-size: .78rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: start; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.lc-chip { font-size: .72rem; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 8px; padding: 3px 8px; }
.lc-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lc-count { font-size: .75rem; color: var(--muted); }
.lc-go { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--gold); }
.lib-empty { margin-top: 6px; }
.lib-empty[hidden] { display: none; }

/* Book detail */
.lib-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; background: var(--card-fill); border: 1px solid var(--line); border-radius: 24px; padding: 22px; margin-top: 14px; }
.lh-cover { position: relative; width: 140px; min-height: 180px; border-radius: 16px; background: linear-gradient(150deg, var(--c), #081a4a); color: #fff; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; flex: none; box-shadow: var(--shadow-sm); }
.lh-icon .ic { width: 30px; height: 30px; }
.lh-track { font-size: .78rem; font-weight: 800; opacity: .9; }
.lh-watermark { position: absolute; inset-inline-start: -20px; bottom: -30px; opacity: .16; pointer-events: none; }
.lh-watermark .ic { width: 130px; height: 130px; }
.lh-main { flex: 1 1 420px; min-width: 0; }
.lh-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lh-main h1 { font-size: clamp(1.3rem, 2.6vw, 1.85rem); margin: 0 0 8px; color: var(--heading); text-align: start; line-height: 1.4; }
.lh-desc { font-size: .86rem; margin: 0 0 14px; max-width: 72ch; text-align: start; }
.lh-stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin-bottom: 14px; }
.lh-stats span { display: inline-flex; align-items: center; gap: 6px; }
.lh-stats .ic { width: 16px; height: 16px; color: var(--accent); }

.lib-split { display: flex; gap: 20px; align-items: flex-start; margin-top: 24px; flex-wrap: wrap; }
.lib-topics-wrap { flex: 1 1 520px; min-width: 0; }
.lib-topics { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.lib-topic { display: flex; gap: 12px; align-items: center; background: var(--card-fill); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: inherit; transition: .16s; }
.lib-topic:hover { border-color: var(--line-2); transform: translateY(-1px); }
.lt-num { width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.lt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lt-main b { color: var(--heading); font-size: .92rem; text-align: start; }
.lt-meta { color: var(--muted); font-size: .76rem; }
.lt-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.lt-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); }
.lt-go { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.lib-side { flex: 0 1 300px; min-width: 240px; display: flex; flex-direction: column; gap: 14px; }
.lib-side-card { background: var(--card-fill); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.lib-side-card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: .9rem; color: var(--heading); }
.lib-side-card p { margin: 0 0 12px; font-size: .78rem; color: var(--muted); text-align: start; line-height: 1.9; }
.lib-side-link { text-decoration: none; display: block; transition: .16s; }
.lib-side-link:hover { border-color: var(--line-2); }
.lib-side-link h3 { margin-bottom: 4px; }
.lib-side-link p { margin: 0; }

@media (max-width: 820px) {
  .lib-grid { grid-template-columns: 1fr; }
  .lib-head { padding: 16px; }
  .lh-cover { width: 100%; min-height: 92px; flex-direction: row; align-items: center; }
  .lh-watermark { display: none; }
  .lib-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
  .lib-pill { white-space: nowrap; }
}
