/* ============================================================
   RiskLab — design system
   Palette: deep navy + gold on warm paper, inspired by the
   RiskHub infographic set the project is built from.
   ============================================================ */

:root {
  --navy-950: #05101f;
  --navy-900: #071a30;
  --navy-800: #0b2545;
  --navy-700: #123258;
  --navy-600: #1b4373;

  --gold: #c9a227;
  --gold-2: #e0b93f;
  --gold-soft: #f3e7c3;
  --gold-wash: #fbf5e4;

  --cream: #f6f1e6;
  --paper: #fffdf8;
  --paper-2: #fbf8f0;
  --line: #e6ddcb;
  --line-strong: #d8ccb3;

  --ink: #14223a;
  --ink-soft: #2c3a52;
  --muted: #65718a;
  --muted-2: #8b94a7;

  --blue: #2e6f9e;
  --green: #2f7d5b;
  --amber: #b7791f;
  --red: #b23a3a;
  --purple: #6b5b95;
  --steel: #3b7f96;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .05);
  --shadow: 0 1px 2px rgba(11, 37, 69, .05), 0 14px 34px -22px rgba(11, 37, 69, .45);
  --shadow-lg: 0 2px 4px rgba(11, 37, 69, .06), 0 32px 70px -30px rgba(11, 37, 69, .5);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 268px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(900px 420px at 88% -8%, rgba(201, 162, 39, .13), transparent 70%),
    radial-gradient(760px 520px at -10% 0%, rgba(46, 111, 158, .07), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

::selection { background: rgba(201, 162, 39, .28); }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--blue); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--navy-800); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
img, svg { max-width: 100%; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--navy-800); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- shell ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a2140 0%, #071a30 46%, #05101f 100%);
  color: rgba(255, 255, 255, .78);
  border-right: 1px solid rgba(255, 255, 255, .06);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(420px 240px at 10% 0%, rgba(201, 162, 39, .16), transparent 65%),
    radial-gradient(360px 300px at 100% 100%, rgba(46, 111, 158, .18), transparent 70%);
}
.sidebar > * { position: relative; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 26px 22px 22px; color: #fff;
}
.brand:hover { color: #fff; }
.brand__mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--gold-2), var(--gold));
  color: var(--navy-900);
  font-family: var(--serif); font-size: 25px; font-weight: 700;
  border-radius: 11px;
  box-shadow: 0 8px 20px -8px rgba(201, 162, 39, .7);
}
.brand__mark--sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 17px; border-radius: 8px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-family: var(--serif); font-size: 20px; letter-spacing: .16em; font-weight: 600; }
.brand__text small { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-top: 3px; }

.nav { padding: 4px 12px 18px; flex: 1; }
.nav > a { display: flex; align-items: center; gap: 11px; padding: 10px 10px; margin: 2px 0; border-radius: 9px; color: rgba(255, 255, 255, .78); font-size: 13.5px; font-weight: 500; transition: background .18s, color .18s; }
.nav > a:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav > a.is-active { background: rgba(201, 162, 39, .14); color: #fff; }

.nav-cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 10px 7px; background: none; border: 0; color: rgba(255, 255, 255, .5); font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; cursor: pointer; text-align: left; }
.nav-cat:hover { color: rgba(255, 255, 255, .8); }
.nav-cat__count { font-size: 9.5px; background: rgba(201, 162, 39, .13); color: var(--gold-2); border-radius: 10px; padding: 1px 7px; letter-spacing: 0; }
.nav-cat__chev { width: 12px; height: 12px; margin-left: auto; display: grid; place-items: center; opacity: .55; transition: transform .2s; }
.nav-cat__chev svg { width: 12px; height: 12px; }
.is-open > .nav-cat .nav-cat__chev, .is-open > .nav-sub-cat .nav-cat__chev { transform: rotate(90deg); opacity: .9; }

.nav-sub { display: none; padding: 2px 0 8px; }
.nav-group.is-open > .nav-sub { display: block; }
.nav-sub a { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px 7px 22px; margin: 1px 0; border-radius: 9px; color: rgba(255, 255, 255, .68); font-size: 12.5px; font-weight: 500; transition: background .18s, color .18s; }
.nav-sub a:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-sub a.is-active { background: rgba(201, 162, 39, .14); color: #fff; }
.nav-sub a.is-active::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav-sub a em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; color: rgba(201, 162, 39, .9); background: rgba(201, 162, 39, .12); padding: 1px 7px; border-radius: 20px; }

.nav-sub-group { margin: 1px 0; }
.nav-sub-cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px 7px 22px; background: none; border: 0; color: rgba(255, 255, 255, .62); font-family: var(--sans); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; border-radius: 9px; }
.nav-sub-cat:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-sub-cat .nav-cat__chev { margin-left: auto; width: 10px; height: 10px; }
.nav-sub-cat .nav-cat__chev svg { width: 10px; height: 10px; }
.nav-sub-sub { display: none; padding: 1px 0 5px; margin-left: 24px; border-left: 1px solid rgba(255, 255, 255, .1); }
.nav-sub-group.is-open > .nav-sub-sub { display: block; }
.nav-sub-sub a { padding: 6px 10px 6px 16px; font-size: 12px; }
.nav-sub-sub a.is-active::before { left: 4px; }

.sidebar__foot { padding: 14px 16px 22px; }
.mini-card {
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .04);
  border-radius: 12px; padding: 13px 14px;
}
.mini-card__eyebrow {
  display: block; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-2); margin-bottom: 5px; font-weight: 700;
}
.mini-card p { font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, .55); }

.shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 62px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 34px;
  background: rgba(246, 241, 230, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 204, 179, .55);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.crumb span { letter-spacing: .04em; }
.crumb i { font-style: normal; color: var(--muted-2); }
.crumb strong { color: var(--navy-700); font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  color: var(--navy-700); background: rgba(255, 253, 248, .8);
  border: 1px solid var(--line); border-radius: 30px; padding: 5px 12px;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 125, 91, .14); }

.lang-sel {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--navy-700); cursor: pointer; outline: none;
}
.lang-sel:focus { border-color: var(--gold); }

.prof-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.prof-row__name { width: 130px; flex: 0 0 130px; font-size: 13px; font-weight: 600; color: var(--navy-800); }

.icon-btn {
  width: 38px; height: 38px; display: none; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  color: var(--navy-800); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }

.view {
  width: 100%; max-width: 1240px;
  margin: 0 auto;
  padding: 40px 44px 84px;
  flex: 1;
  outline: none;
}
.view > .page { animation: pageIn .38s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- typography helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--gold); border-radius: 2px; }

.page-head { margin-bottom: 34px; max-width: 880px; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 45px); margin-bottom: 14px; }
.page-head .lead { font-size: 16.5px; line-height: 1.62; color: var(--muted); max-width: 760px; }
.page-head .lead strong { color: var(--ink-soft); font-weight: 600; }

.section { margin-top: 52px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(22px, 2.3vw, 28px); }
.section-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.section-head .link { font-size: 12.5px; font-weight: 600; color: var(--amber); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.section-head .link:hover { color: var(--navy-700); }

.kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.small { font-size: 12.5px; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gold { color: var(--amber); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--navy-900); box-shadow: 0 8px 18px -10px rgba(201, 162, 39, .8); }
.btn--gold:hover { color: var(--navy-950); filter: brightness(1.04); }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--navy:hover { background: var(--navy-700); color: #fff; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn--outline { background: var(--paper); border-color: var(--line-strong); color: var(--navy-700); }
.btn--outline:hover { border-color: var(--gold); color: var(--navy-800); background: var(--gold-wash); }
.btn--sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
.btn--block { width: 100%; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 40px; align-items: center;
  background: linear-gradient(135deg, #0b2545 0%, #081c35 55%, #061426 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 46px 46px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 26px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 300px at 78% 12%, rgba(201, 162, 39, .18), transparent 65%),
    radial-gradient(420px 380px at 100% 110%, rgba(46, 111, 158, .28), transparent 70%);
}
.hero::after {
  content: "Σ"; position: absolute; right: -26px; bottom: -90px;
  font-family: var(--serif); font-size: 340px; line-height: 1;
  color: rgba(255, 255, 255, .035); pointer-events: none;
}
.hero > * { position: relative; }
.hero .eyebrow { color: var(--gold-2); }
.hero .eyebrow::before { background: var(--gold-2); }
.hero h1 { color: #fff; font-size: clamp(32px, 3.9vw, 50px); line-height: 1.06; margin-bottom: 16px; }
.hero h1 em { font-style: italic; color: var(--gold-2); }
.hero p { color: rgba(255, 255, 255, .72); font-size: 15.5px; line-height: 1.65; max-width: 540px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; font-size: 11.5px; color: rgba(255,255,255,.5); letter-spacing: .03em; }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.hero-card {
  background: rgba(255, 253, 248, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 22px 22px 18px;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.hero-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hero-card__label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 600; }
.hero-card__badge { font-size: 10px; font-weight: 700; color: var(--navy-950); background: var(--gold-2); border-radius: 20px; padding: 3px 9px; letter-spacing: .04em; }
.hero-card__formula {
  font-family: var(--serif); font-size: 24px; color: #fff; text-align: center;
  padding: 16px 8px; border-top: 1px solid rgba(255,255,255,.09); border-bottom: 1px solid rgba(255,255,255,.09);
  margin-bottom: 12px;
}
.hero-card__formula sub { font-size: .6em; }
.hero-card__chart { margin: 4px -4px 0; }
.hero-card__chart svg { width: 100%; height: auto; display: block; }
.hero-card__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 10.5px; color: rgba(255,255,255,.45); }
.hero-card__foot b { color: rgba(255,255,255,.78); font-weight: 600; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat__num { font-family: var(--serif); font-size: 30px; color: var(--navy-800); line-height: 1; }
.stat__num span { font-size: 17px; color: var(--gold); }
.stat__label { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- grids & cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

[hidden] { display: none !important; }

.input-mini {
  width: 64px; border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 4px 6px; font-family: var(--mono); font-size: 11.5px;
  text-align: right; background: #fff; color: var(--ink); outline: none;
}
.input-mini:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,162,39,.14); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  position: relative;
}
.card--pad-lg { padding: 28px; }
.card--flat { box-shadow: none; }
.card--navy { background: linear-gradient(150deg, var(--navy-800), var(--navy-950)); border-color: transparent; color: rgba(255,255,255,.75); }
.card--navy h3, .card--navy h4 { color: #fff; }

.card--link { display: block; color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); color: inherit; }

.module-card { display: flex; flex-direction: column; min-height: 210px; }
.module-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__icon {
  width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
  border-radius: 11px; background: var(--gold-wash); color: var(--amber);
  border: 1px solid rgba(201, 162, 39, .22);
}
.card__icon svg { width: 20px; height: 20px; }
.card__icon--blue { background: rgba(46,111,158,.09); color: var(--blue); border-color: rgba(46,111,158,.18); }
.card__icon--green { background: rgba(47,125,91,.09); color: var(--green); border-color: rgba(47,125,91,.18); }
.card__icon--purple { background: rgba(107,91,149,.09); color: var(--purple); border-color: rgba(107,91,149,.18); }
.card__icon--red { background: rgba(178,58,58,.08); color: var(--red); border-color: rgba(178,58,58,.16); }
.card__index { font-family: var(--serif); font-size: 13px; color: var(--muted-2); letter-spacing: .08em; }
.module-card h3 { font-size: 19px; margin-bottom: 7px; }
.module-card p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.module-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.module-card__arrow { margin-top: auto; padding-top: 16px; font-size: 12px; font-weight: 600; color: var(--amber); display: flex; align-items: center; gap: 5px; }
.module-card__arrow svg { width: 14px; height: 14px; flex: 0 0 14px; transition: transform .18s; }
.card--link:hover .module-card__arrow svg { transform: translateX(3px); }

.tag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px;
  background: var(--paper-2); color: var(--muted); border: 1px solid var(--line);
}
.tag--blue { background: rgba(46,111,158,.07); color: var(--blue); border-color: rgba(46,111,158,.16); }
.tag--green { background: rgba(47,125,91,.07); color: var(--green); border-color: rgba(47,125,91,.16); }
.tag--gold { background: rgba(201,162,39,.09); color: #8a6d12; border-color: rgba(201,162,39,.25); }
.tag--purple { background: rgba(107,91,149,.07); color: var(--purple); border-color: rgba(107,91,149,.16); }
.tag--red { background: rgba(178,58,58,.06); color: var(--red); border-color: rgba(178,58,58,.16); }

/* ---------- learning path ---------- */
.path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.path__step { padding: 24px 22px; border-right: 1px solid var(--line); position: relative; }
.path__step:last-child { border-right: 0; }
.path__n { font-family: var(--serif); font-size: 12px; color: var(--gold); letter-spacing: .12em; }
.path__step h4 { font-size: 16.5px; margin: 8px 0 6px; }
.path__step p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.path__step::after { content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 0; background: var(--gold); transition: width .3s; }
.path__step:hover::after { width: 100%; }

/* ---------- callouts ---------- */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--gold-wash); border: 1px solid rgba(201, 162, 39, .25);
  border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 16px 18px;
}
.callout__ico { flex: 0 0 auto; color: var(--amber); margin-top: 2px; }
.callout__ico svg { width: 19px; height: 19px; }
.callout p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.callout strong { color: var(--navy-800); }
.callout--blue { background: rgba(46,111,158,.055); border-color: rgba(46,111,158,.18); border-left-color: var(--blue); }
.callout--blue .callout__ico { color: var(--blue); }
.callout--red { background: rgba(178,58,58,.05); border-color: rgba(178,58,58,.16); border-left-color: var(--red); }
.callout--red .callout__ico { color: var(--red); }
.callout--green { background: rgba(47,125,91,.05); border-color: rgba(47,125,91,.16); border-left-color: var(--green); }
.callout--green .callout__ico { color: var(--green); }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-2); }
.search input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--paper); font-family: var(--sans); font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 30px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--gold); color: var(--navy-700); }
.chip.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.toolbar__count { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }

/* ---------- formulas ---------- */
.formula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.formula-card { display: flex; flex-direction: column; scroll-margin-top: 80px; }
.formula-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.num-badge {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--navy-800); color: var(--gold-2);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.formula-card__head .tag { margin-left: auto; }
.formula-card h3 { font-size: 20px; margin-bottom: 12px; }
.formula-card h3 small { display: block; font-family: var(--sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); margin-top: 4px; font-weight: 600; }

.formula-box {
  background: linear-gradient(180deg, #fcf9f1, #f9f4e7);
  border: 1px solid #ece2cd; border-radius: 10px;
  padding: 20px 16px;
  font-family: var(--serif);
  font-size: 20px; color: var(--navy-900);
  text-align: center; overflow-x: auto;
  line-height: 1.5;
  margin-bottom: 14px;
}
.formula-box--dark {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); color: #fff;
}
.formula-box sub, .formula-box sup { font-size: .58em; }
.formula-box .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .9em; margin: 0 3px; }
.formula-box .frac .num { border-bottom: 1px solid currentColor; padding: 0 .35em .08em; line-height: 1.15; }
.formula-box .frac .den { padding: .08em .35em 0; line-height: 1.15; }
.formula-box .op { padding: 0 .12em; color: var(--muted); }

.formula-card__desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.formula-card__vars { font-size: 11.5px; color: var(--muted-2); line-height: 1.55; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.formula-card__use { font-size: 12.5px; color: var(--ink-soft); margin-top: 12px; }
.formula-card__use b { color: var(--amber); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 3px; }
.formula-card__actions { margin-top: 16px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(5, 16, 31, .55); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative; width: 100%; max-width: 660px; max-height: 90vh; overflow-y: auto;
  background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
body.modal-open { overflow: hidden; }
.modal__head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.modal__head h3 { font-size: 22px; }
.modal__head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal__close {
  margin-left: auto; width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted);
}
.modal__close:hover { background: var(--paper-2); color: var(--ink); }
.modal__close svg { width: 16px; height: 16px; }
.modal__body { padding: 20px 24px 26px; }

.calc-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field__control { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.field__control:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.14); }
.field__control input, .field__control select {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 9px 11px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.field__unit { display: grid; place-items: center; padding: 0 11px; font-size: 11px; color: var(--muted-2); background: var(--paper-2); border-left: 1px solid var(--line); white-space: nowrap; }

.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.result {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px;
}
.result--accent { background: var(--gold-wash); border-color: rgba(201,162,39,.3); }
.result__label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.result__value { font-family: var(--mono); font-size: 19px; color: var(--navy-800); margin-top: 4px; font-weight: 500; }
.result--accent .result__value { color: #8a6d12; }
.calc-note { font-size: 11.5px; color: var(--muted); margin-top: 14px; line-height: 1.55; }
.calc-note b { color: var(--ink-soft); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 11px 14px;
  background: var(--paper-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px 14px; border-bottom: 1px solid rgba(230,221,203,.6); color: var(--ink-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.is-active td { background: var(--gold-wash); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 11.5px; }
table.data tfoot td { font-weight: 700; color: var(--navy-800); background: var(--paper-2); border-top: 1px solid var(--line); }

/* ---------- badges / zones ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 20px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--green { background: rgba(47,125,91,.1); color: #22694a; }
.badge--yellow { background: rgba(183,121,31,.12); color: #8a5a10; }
.badge--red { background: rgba(178,58,58,.1); color: #9c2f2f; }
.badge--blue { background: rgba(46,111,158,.09); color: #245c84; }
.badge--muted { background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); }
.badge--muted::before { display: none; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; }
.seg__btn {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  padding: 7px 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--paper); color: var(--navy-800); box-shadow: var(--shadow-sm); }

/* ---------- charts ---------- */
.chart-card { padding: 22px 22px 16px; }
.chart-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.chart-card__head h3 { font-size: 17px; }
.chart-card__head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend__swatch--dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 2px; }
.legend__swatch--box { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- GRC ---------- */
.grc-layout { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 22px; align-items: start; }
.grc-diagram { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); position: sticky; top: 84px; }
.grc-diagram svg { width: 100%; height: auto; display: block; }
.ring { cursor: pointer; transition: opacity .2s, stroke-width .2s; }
.ring:hover { opacity: .92; }
.grc-label { cursor: pointer; }
.grc-label rect { transition: fill .18s, stroke .18s; }
.grc-label text { font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; pointer-events: none; }
.grc-label:hover rect { fill: #fff; }
.grc-detail { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); min-height: 420px; }
.grc-detail__num { font-family: var(--serif); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.grc-detail h2 { font-size: 28px; margin: 8px 0 6px; }
.grc-detail__q { font-size: 14px; font-style: italic; color: var(--muted); margin-bottom: 16px; }
.grc-detail__desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.grc-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.grc-item { font-size: 11px; padding: 4px 9px; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft); }
.grc-detail__foot { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.grc-detail__foot b { color: var(--ink-soft); }
.grc-questions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 22px; }
.grc-q { padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; text-align: left; font-family: var(--sans); transition: all .15s; }
.grc-q:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.grc-q.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
.grc-q__n { font-family: var(--serif); font-size: 11px; color: var(--muted-2); }
.grc-q__t { font-size: 12px; font-weight: 600; color: var(--navy-800); margin-top: 5px; line-height: 1.35; }

/* ---------- generic lists ---------- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 24px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 13px; height: 13px;
  border-radius: 50%; background: rgba(47,125,91,.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5 8l4-4.4' fill='none' stroke='%232f7d5b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 11px; background-repeat: no-repeat; background-position: center;
}
.check-list--gold li::before {
  background-color: rgba(201,162,39,.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5 8l4-4.4' fill='none' stroke='%23b7791f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.steps { counter-reset: step; display: grid; gap: 12px; }
.step { position: relative; padding-left: 38px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--navy-800); color: var(--gold-2);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}
.step h4 { font-size: 14px; margin-bottom: 3px; }
.step p { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 24px; overflow-x: auto; }
.tab {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 11px 16px 12px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .15s;
}
.tab:hover { color: var(--navy-700); }
.tab.is-active { color: var(--navy-800); border-bottom-color: var(--gold); }
.tab-panel[hidden] { display: none; }

/* ---------- comparison ---------- */
.compare-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.compare-head h3 { font-size: 21px; }
.compare-q { display: inline-block; font-size: 12px; font-weight: 600; color: var(--amber); background: var(--gold-wash); border: 1px solid rgba(201,162,39,.28); padding: 5px 10px; border-radius: 6px; margin-bottom: 14px; }
.compare-formula { font-family: var(--serif); font-size: 18px; text-align: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; padding: 16px 10px; margin-bottom: 16px; color: var(--navy-900); overflow-x: auto; }

/* ---------- backtesting ---------- */
.bt-top { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: stretch; }
.bt-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bt-stat { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; }
.bt-stat__l { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.bt-stat__v { font-family: var(--mono); font-size: 22px; color: var(--navy-800); margin-top: 3px; }
.bt-stat__v small { font-size: 11px; color: var(--muted-2); font-family: var(--sans); }
.zone-strip { display: flex; gap: 3px; margin-top: 10px; }
.zone-strip i { height: 5px; flex: 1; border-radius: 3px; opacity: .28; }
.zone-strip i.on { opacity: 1; }

/* ---------- time series ---------- */
.ts-concepts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.concept { padding: 20px; }
.concept__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.concept__n { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.concept h3 { font-size: 17px; }
.concept ul { margin: 0; padding-left: 17px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.concept li::marker { color: var(--gold); }

/* ---------- merton ---------- */
.merton-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 22px; align-items: start; }
.balance { display: flex; align-items: flex-end; justify-content: center; gap: 26px; padding: 26px 0 8px; }
.balance__side { text-align: center; }
.balance__plate { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-2); padding: 9px 16px; font-size: 12px; font-weight: 600; color: var(--navy-800); }
.balance__label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 7px; }
.balance__eq { font-family: var(--serif); font-size: 15px; color: var(--amber); margin-bottom: 14px; text-align: center; }
.balance__stand { width: 3px; height: 74px; background: var(--line-strong); border-radius: 2px; }
.balance__beam { width: 120px; height: 3px; background: var(--navy-700); border-radius: 2px; margin: 0 auto 0; }

/* ---------- python ---------- */
.lib-card { display: flex; flex-direction: column; }
.lib-card__mark {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  background: var(--navy-800); color: var(--gold-2); margin-bottom: 14px;
}
.lib-card h3 { font-size: 18px; margin-bottom: 4px; }
.lib-card__use { font-size: 11px; color: var(--muted-2); letter-spacing: .03em; margin-bottom: 10px; }
.lib-card p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.repo-card { display: flex; flex-direction: column; padding: 20px; }
.repo-card__top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.repo-card__top svg { width: 17px; height: 17px; color: var(--navy-700); }
.repo-card h3 { font-size: 17.5px; }
.repo-card__url { font-family: var(--mono); font-size: 10.5px; color: var(--blue); word-break: break-all; margin-bottom: 9px; }
.repo-card p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.repo-card__best { margin-top: auto; padding-top: 12px; font-size: 10.5px; color: var(--muted-2); border-top: 1px dashed var(--line); margin-top: 12px; }
.repo-card__best b { color: var(--ink-soft); }

.project-row { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px dashed var(--line); }
.project-row:last-child { border-bottom: 0; padding-bottom: 0; }
.project-row:first-child { padding-top: 0; }
.project-row__ico {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px;
  display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line);
  color: var(--navy-700);
}
.project-row__ico svg { width: 17px; height: 17px; }
.project-row h4 { font-size: 14px; margin-bottom: 2px; }
.project-row p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- resources ---------- */
.book { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.book:last-child { border-bottom: 0; }
.book__cover {
  width: 62px; height: 90px; flex: 0 0 62px; border-radius: 4px;
  background: linear-gradient(150deg, var(--navy-700), var(--navy-950));
  color: var(--gold-2); display: flex; flex-direction: column; justify-content: space-between;
  padding: 9px 8px; font-family: var(--serif); font-size: 9.5px; line-height: 1.2;
  box-shadow: 4px 5px 0 rgba(11,37,69,.12);
  border-left: 3px solid var(--gold);
}
.book__cover b { font-weight: 600; }
.book__cover span { font-family: var(--mono); font-size: 7px; color: rgba(255,255,255,.45); }
.book h4 { font-size: 15px; margin-bottom: 2px; }
.book__author { font-size: 11px; color: var(--muted-2); margin-bottom: 6px; }
.book p { font-size: 12px; color: var(--muted); line-height: 1.5; }

.video-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.video-row:last-child { border-bottom: 0; }
.video-row__n { font-family: var(--mono); font-size: 11px; color: var(--gold); width: 22px; flex: 0 0 22px; padding-top: 2px; }
.video-row h4 { font-size: 13.5px; margin-bottom: 2px; }
.video-row p { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.video-row__by { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }
.video-row a { color: var(--navy-700); }

/* ---------- career ---------- */
.qa { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.qa + .qa { margin-top: 10px; }
.qa summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; font-size: 13.5px; font-weight: 600; color: var(--navy-800);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; margin-left: auto; font-family: var(--serif); font-size: 20px; color: var(--gold); transition: transform .2s; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa__n { font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.qa__body { padding: 0 18px 18px 50px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.qa__body b { color: var(--ink-soft); }

.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.ba:last-child { border-bottom: 0; }
.ba__label { grid-column: 1 / -1; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-bottom: 2px; }
.ba__cell { padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.ba__cell--before { background: rgba(178,58,58,.045); border: 1px solid rgba(178,58,58,.14); color: #7d4444; }
.ba__cell--after { background: rgba(47,125,91,.05); border: 1px solid rgba(47,125,91,.16); color: #2c5f4a; }
.ba__cell b { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; opacity: .75; }
.ba__arrow { color: var(--gold); font-size: 16px; }

/* ---------- quiz ---------- */
.quiz { max-width: 760px; }
.quiz__bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.quiz__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 4px; transition: width .3s; }
.quiz__meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.quiz h2 { font-size: 24px; margin-bottom: 20px; }
.quiz__options { display: grid; gap: 9px; }
.quiz__option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 16px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--paper); font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
  cursor: pointer; transition: all .15s;
}
.quiz__option:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-wash); }
.quiz__option:disabled { cursor: default; }
.quiz__option span.letter {
  width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-strong); font-size: 10px; font-weight: 700; color: var(--muted);
}
.quiz__option.is-correct { border-color: var(--green); background: rgba(47,125,91,.07); }
.quiz__option.is-correct span.letter { background: var(--green); border-color: var(--green); color: #fff; }
.quiz__option.is-wrong { border-color: var(--red); background: rgba(178,58,58,.05); }
.quiz__option.is-wrong span.letter { background: var(--red); border-color: var(--red); color: #fff; }
.quiz__feedback { margin-top: 16px; padding: 14px 16px; border-radius: 9px; font-size: 12.5px; line-height: 1.6; }
.quiz__feedback--ok { background: rgba(47,125,91,.07); border: 1px solid rgba(47,125,91,.18); color: #2c5f4a; }
.quiz__feedback--no { background: rgba(178,58,58,.05); border: 1px solid rgba(178,58,58,.16); color: #7d4444; }
.quiz__feedback b { display: block; margin-bottom: 3px; }
.quiz__actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.quiz__result { text-align: center; padding: 20px 0 6px; }
.quiz__score { font-family: var(--serif); font-size: 64px; color: var(--navy-800); line-height: 1; }
.quiz__score small { font-size: 24px; color: var(--muted-2); }
.quiz__result h2 { margin: 10px 0 8px; }
.quiz__result p { color: var(--muted); font-size: 13.5px; max-width: 480px; margin: 0 auto; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-strong); padding: 26px 44px 34px; max-width: 1240px; margin: 0 auto; width: 100%; }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 9px; color: var(--navy-800); }
.footer__brand strong { font-family: var(--serif); letter-spacing: .14em; font-size: 13px; }
.footer p { font-size: 11.5px; color: var(--muted-2); }
.footer__note { margin-top: 10px; max-width: 760px; line-height: 1.55; }

/* ---------- amaliy lab ---------- */
.lesson { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 30px 32px; margin-bottom: 26px; scroll-margin-top: 84px; position: relative; overflow: hidden; }
.lesson::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--gold), transparent 60%); }
.lesson__head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.lesson__titles { flex: 1; min-width: 0; }
.lesson__titles h2 { font-size: clamp(21px, 2.2vw, 27px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lesson__titles p { font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 720px; }
.num-badge--lg { width: 40px; height: 40px; flex: 0 0 40px; font-size: 15px; border-radius: 12px; }
.lesson__repo { white-space: nowrap; }
.lesson__grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 28px; align-items: start; }
.lesson__left, .lesson__right { min-width: 0; }
.lesson__what { font-size: 13px; color: var(--ink-soft); line-height: 1.65; margin-bottom: 14px; }
.demo-title { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.demo-title svg { width: 17px; height: 17px; color: var(--amber); flex: 0 0 17px; }

.code-block { border: 1px solid #122a48; border-radius: 12px; overflow: hidden; background: #0a1c33; box-shadow: var(--shadow); }
.code-block__head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #0e2340; border-bottom: 1px solid rgba(255,255,255,.07); }
.code-block__dots { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.code-block__dots i { width: 9px; height: 9px; border-radius: 50%; background: #2c466e; }
.code-block__dots i:first-child { background: #d96a6a; }
.code-block__dots i:nth-child(2) { background: #d9b96a; }
.code-block__dots i:last-child { background: #6ac47f; }
.code-block__name { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.75); }
.code-block__pkg { font-family: var(--mono); font-size: 10px; color: rgba(255,255,255,.42); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-block__copy { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); background: transparent; border-radius: 7px; color: rgba(255,255,255,.65); cursor: pointer; transition: all .15s; flex: 0 0 28px; }
.code-block__copy:hover { background: rgba(255,255,255,.08); color: #fff; }
.code-block__copy svg { width: 14px; height: 14px; }
pre.code { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.65; color: #dbe6f5; }
pre.code code { font-family: inherit; }
.tok-kw { color: #7fa7e8; font-weight: 600; }
.tok-str { color: #9ed4a0; }
.tok-com { color: #6b7f9e; font-style: italic; }
.tok-num { color: #e8c97a; }

.wbar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--paper-2); }
.wbar span { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; transition: width .3s ease; }
.wbar span i { font-style: normal; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); border-radius: var(--radius-lg); padding: 30px 34px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.05); color: inherit; position: relative; overflow: hidden; }
.cta-banner::after { content: "Σ"; position: absolute; right: -10px; bottom: -70px; font-family: var(--serif); font-size: 240px; line-height: 1; color: rgba(255,255,255,.04); pointer-events: none; }
.cta-banner:hover { color: inherit; }
.cta-banner .btn { position: relative; }

.repo-card__lesson { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; font-weight: 600; color: var(--amber); display: inline-flex; align-items: center; gap: 5px; }
.repo-card__lesson svg { width: 13px; height: 13px; }
.repo-card__lesson:hover { color: var(--navy-700); }

.console-area { width: 100%; min-height: 248px; resize: vertical; border: 1px solid #122a48; border-top: 0; border-radius: 0 0 12px 12px; background: #0a1c33; color: #dbe6f5; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; padding: 16px 18px; outline: none; box-sizing: border-box; }
.console-area:focus { box-shadow: 0 0 0 3px rgba(46,111,158,.35); }
.console-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.console-out { margin: 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); white-space: pre-wrap; min-height: 130px; max-height: 300px; overflow: auto; }

.road-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.road-progress .quiz__bar { flex: 1; margin: 0; }
.road-progress > span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.road-item { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; background: var(--paper-2); cursor: pointer; transition: all .15s; }
.road-item:hover { border-color: var(--gold); }
.road-item input { display: none; }
.road-item__box { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: all .15s; background: #fff; }
.road-item__box svg { width: 13px; height: 13px; }
.road-item input:checked ~ .road-item__box,
.road-item input:checked + .road-item__box { background: var(--green); border-color: var(--green); color: #fff; }
.road-item__body { flex: 1; min-width: 0; }
.road-item__body b { font-size: 13px; color: var(--navy-800); display: block; }
.road-item__body small { font-size: 11.5px; color: var(--muted); }
.road-item__link { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 8px; color: var(--amber); border: 1px solid var(--line); background: #fff; }
.road-item__link svg { width: 14px; height: 14px; }
.road-item__link:hover { background: var(--gold-wash); }

.check-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; margin-bottom: 14px; user-select: none; }
.check-toggle input { display: none; }
.check-toggle__box { width: 34px; height: 20px; border-radius: 20px; background: var(--line-strong); position: relative; transition: background .18s; flex: 0 0 34px; }
.check-toggle__box::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.check-toggle input:checked + .check-toggle__box { background: var(--green); }
.check-toggle input:checked + .check-toggle__box::after { transform: translateX(13px); }

.range-row { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.range-row input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--line-strong)); outline: none; }
.range-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--navy-800); border: 2.5px solid var(--gold); cursor: pointer; box-shadow: 0 2px 6px rgba(11,37,69,.3); }
.range-row input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--navy-800); border: 2.5px solid var(--gold); cursor: pointer; }

/* SVG ikonkalar sarlavhalarda kichik bo'lishi kerak */
h2 svg, h3 svg, h4 svg { width: 16px; height: 16px; vertical-align: middle; margin-right: 6px; flex-shrink: 0; }
.section-head svg, .demo-title svg { width: 16px; height: 16px; flex-shrink: 0; }
.card > h3 svg, .card > h2 svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- darslik sahifalari ---------- */
.read-progress { position: fixed; top: 62px; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .1s linear; }

.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: -10px 0 22px; }
.lesson-toc { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 26px; }
.lesson-toc a { font-size: 12px; font-weight: 600; color: var(--navy-700); background: var(--paper); border: 1px solid var(--line); padding: 7px 12px; border-radius: 20px; transition: all .15s; }
.lesson-toc a:hover { border-color: var(--gold); color: var(--navy-800); }

.flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.flash { perspective: 900px; cursor: pointer; outline: none; }
.flash:focus-visible .flash__inner { box-shadow: 0 0 0 3px rgba(201,162,39,.3); }
.flash__inner { position: relative; width: 100%; min-height: 158px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.3,1); border-radius: 12px; }
.flash.is-flipped .flash__inner { transform: rotateY(180deg); }
.flash__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12px; border: 1px solid var(--line); padding: 16px 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 9px; box-shadow: var(--shadow-sm); }
.flash__front { background: linear-gradient(160deg, #fcf9f1, #f6efdd); }
.flash__front b { font-family: var(--serif); font-size: 17.5px; color: var(--navy-800); line-height: 1.25; }
.flash__back { background: linear-gradient(150deg, var(--navy-700), var(--navy-950)); transform: rotateY(180deg); border-color: transparent; }
.flash__label { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }
.flash__back .flash__label { color: rgba(255,255,255,.5); }
.flash__hint { font-size: 10.5px; color: var(--amber); font-weight: 600; }
.flash__back p { font-size: 12.5px; line-height: 1.55; color: rgba(255,255,255,.88); }

.task { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); margin-bottom: 10px; overflow: hidden; }
.task summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 15px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.task summary::-webkit-details-marker { display: none; }
.task summary::before { content: "✎"; color: var(--gold); font-size: 16px; }
.task summary::after { content: "+"; margin-left: auto; font-family: var(--serif); font-size: 20px; color: var(--gold); transition: transform .2s; }
.task[open] summary::after { transform: rotate(45deg); }
.task__answer { margin: 0 18px 16px; padding: 12px 14px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; background: var(--gold-wash); border: 1px solid rgba(201,162,39,.22); border-radius: 8px; }
.task__answer b { color: #8a6d12; }

.lesson-section { padding: 18px 0; border-bottom: 1px dashed var(--line); scroll-margin-top: 80px; }
.lesson-section:last-child { border-bottom: 0; padding-bottom: 0; }
.lesson-section h3 { display: flex; align-items: center; gap: 12px; font-size: 19px; margin-bottom: 10px; }
.lesson-section p { font-size: 14px; color: var(--ink-soft); line-height: 1.7; max-width: 820px; }

/* ---------- mock imtihon ---------- */
.mock-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mock-timer { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--navy-800); background: var(--gold-wash); border: 1px solid rgba(201,162,39,.3); padding: 8px 16px; border-radius: 10px; }
.mock-timer svg { width: 17px; height: 17px; color: var(--amber); }
.mock-timer--low { background: rgba(178,58,58,.08); border-color: rgba(178,58,58,.3); color: #9c2f2f; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.mock-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.mock-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-pal { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.mock-pal:hover { border-color: var(--gold); color: var(--navy-800); }
.mock-pal.is-done { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.mock-pal.is-cur { outline: 2px solid var(--gold); outline-offset: 2px; }
.mock-pal.is-flag { box-shadow: inset 0 -4px 0 var(--amber); }
.quiz__option.is-picked { border-color: var(--navy-700); background: var(--gold-wash); }
.quiz__option.is-picked span.letter { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.mock-review__item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.mock-review__item:last-child { border-bottom: 0; }
.mock-review__item .badge { flex: 0 0 auto; height: 24px; }
.mt-24 { margin-top: 24px; }

/* ---------- sertifikatlar ---------- */
.tag--steel { background: rgba(59,127,150,.08); color: #2c6577; border-color: rgba(59,127,150,.2); }

.cert-format { margin-top: 4px; }
.cert-format .bt-stat { border-radius: 10px; }

.cert-progress { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.cert-progress .quiz__bar { flex: 1; margin: 0; min-width: 120px; }

.topic { padding: 18px; }
.topic--done { border-color: rgba(47,125,91,.35); background: linear-gradient(180deg, rgba(47,125,91,.03), var(--paper)); }
.topic__check { display: flex; gap: 13px; align-items: flex-start; }
.topic__check input { display: none; }
.topic__check .road-item__box { margin-top: 2px; }
.topic__check input:checked + .road-item__box { background: var(--green); border-color: var(--green); color: #fff; }
.topic__meta { flex: 1; min-width: 0; }
.topic__meta h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.3; }
.topic__bar { height: 6px; border-radius: 4px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 7px; }
.topic__bar i { display: block; height: 100%; border-radius: 4px; opacity: .85; }
.topic__w { font-size: 10.5px; color: var(--muted-2); font-weight: 600; letter-spacing: .04em; }

.cert-card { display: flex; flex-direction: column; min-height: 230px; padding: 20px; }
.cert-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cert-card h3 { font-size: 19px; margin-bottom: 4px; }
.cert-card__tag { font-size: 12px; color: var(--amber); font-weight: 600; margin-bottom: 12px; }
.cert-card .check-list { font-size: 11.5px; }

.steps--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- investitsiya loyihalari ---------- */
.proj-add { display: grid; grid-template-columns: 2fr 2.4fr 1fr auto; gap: 12px; align-items: end; }
.proj-add .field { margin: 0; }
.proj-del { border-color: var(--line); color: var(--muted-2); }
.proj-del:hover { color: var(--red); border-color: rgba(178,58,58,.4); }
.proj-del svg { width: 13px; height: 13px; }

/* ---------- o'qish sozlamalari ---------- */
.read-settings { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; padding: 16px; }
.read-settings[hidden] { display: none; }
.read-settings__panel { max-width: 480px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 40px rgba(11,37,69,.25); padding: 20px; }
.read-settings__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.read-settings__head b { font-family: var(--serif); font-size: 19px; color: var(--navy-800); }
.read-settings__row { margin-bottom: 16px; }
.read-settings__label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.read-settings__fs { display: flex; align-items: center; gap: 12px; }
.rs-fs-btn { width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper-2); font-family: var(--sans); font-size: 24px; font-weight: 600; color: var(--navy-800); cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.rs-fs-btn:hover { border-color: var(--gold); background: var(--gold-wash); font-size: 28px; }
.rs-fs-btn:active { transform: scale(.92); }
.rs-fs-value { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--navy-800); min-width: 48px; text-align: center; }
.read-settings__theme { display: flex; gap: 8px; }
.rs-theme { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); cursor: pointer; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.rs-theme:hover { border-color: var(--gold); }
.rs-theme.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.rs-theme__swatch { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-family: var(--serif); font-size: 16px; font-weight: 700; border: 1px solid var(--line); }
.rs-theme span:last-child { font-size: 10.5px; }

/* Temalar */
body[data-theme="sepia"] { background: #f4ecd8; }
body[data-theme="sepia"] .view { color: #4a3c2a; }
body[data-theme="sepia"] .card, body[data-theme="sepia"] .table-wrap { background: #faf5e8; border-color: #d4c9b0; }
body[data-theme="sepia"] .formula-box { background: #f0e8d0; border-color: #d4c9b0; }
body[data-theme="sepia"] h1, body[data-theme="sepia"] h2, body[data-theme="sepia"] h3, body[data-theme="sepia"] h4 { color: #3d3020; }
body[data-theme="sepia"] .page-head .lead { color: #6b5d48; }
body[data-theme="sepia"] .sidebar { background: #3d3020; }
body[data-theme="sepia"] .topbar { background: rgba(244,236,216,.9); border-bottom-color: #d4c9b0; }
body[data-theme="sepia"] .code-block { background: #2c2418; }
body[data-theme="sepia"] .flash__front { background: #f0e8d0; }

body[data-theme="dark"] { background: #0d1117; }
body[data-theme="dark"] .view { color: #c9d1d9; }
body[data-theme="dark"] .card, body[data-theme="dark"] .table-wrap { background: #161b22; border-color: #30363d; }
body[data-theme="dark"] h1, body[data-theme="dark"] h2, body[data-theme="dark"] h3, body[data-theme="dark"] h4 { color: #f0f6fc; }
body[data-theme="dark"] .page-head .lead { color: #8b949e; }
body[data-theme="dark"] .formula-box { background: #1c2128; border-color: #30363d; color: #f0f6fc; }
body[data-theme="dark"] .sidebar { background: #0d1117; border-right-color: #30363d; }
body[data-theme="dark"] .topbar { background: rgba(13,17,23,.9); border-bottom-color: #30363d; }
body[data-theme="dark"] .crumb { color: #8b949e; }
body[data-theme="dark"] .crumb strong { color: #f0f6fc; }
body[data-theme="dark"] .code-block { background: #161b22; border-color: #30363d; }
body[data-theme="dark"] .code-block__head { background: #1c2128; border-bottom-color: #30363d; }
body[data-theme="dark"] pre.code { color: #c9d1d9; }
body[data-theme="dark"] .callout { background: #1c2128; border-color: #30363d; }
body[data-theme="dark"] .callout p { color: #c9d1d9; }
body[data-theme="dark"] .result { background: #1c2128; border-color: #30363d; }
body[data-theme="dark"] .result__value { color: #f0f6fc; }
body[data-theme="dark"] .result__label { color: #8b949e; }
body[data-theme="dark"] .result--accent { background: #2d1f0e; border-color: rgba(201,162,39,.3); }
body[data-theme="dark"] .result--accent .result__value { color: #e0b93f; }
body[data-theme="dark"] .field__control { border-color: #30363d; background: #0d1117; }
body[data-theme="dark"] .field__control input, body[data-theme="dark"] .field__control select { color: #f0f6fc; }
body[data-theme="dark"] .field__unit { background: #161b22; border-left-color: #30363d; color: #8b949e; }
body[data-theme="dark"] .task { background: #161b22; border-color: #30363d; }
body[data-theme="dark"] .task__answer { background: #1c2128; border-color: #30363d; color: #c9d1d9; }
body[data-theme="dark"] .flash__front { background: #1c2128; border-color: #30363d; }
body[data-theme="dark"] .flash__front b { color: #f0f6fc; }
body[data-theme="dark"] .flash__label { color: #8b949e; }
body[data-theme="dark"] .search input { background: #161b22; border-color: #30363d; color: #f0f6fc; }
body[data-theme="dark"] .chip { border-color: #30363d; color: #8b949e; }
body[data-theme="dark"] .chip.is-active { background: #c9a227; color: #0d1117; border-color: #c9a227; }
body[data-theme="dark"] .footer { border-top-color: #30363d; }
body[data-theme="dark"] .footer p { color: #8b949e; }
body[data-theme="dark"] .footer__brand strong { color: #f0f6fc; }
body[data-theme="dark"] .btn--outline { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body[data-theme="dark"] .btn--gold { color: #0d1117; }
body[data-theme="dark"] .quiz__option { background: #161b22; border-color: #30363d; color: #c9d1d9; }
body[data-theme="dark"] .quiz__option.is-picked { background: #2d1f0e; border-color: #c9a227; }
body[data-theme="dark"] .quiz__feedback--ok { background: #0d2818; border-color: #1f4d33; color: #7ee787; }
body[data-theme="dark"] .quiz__feedback--no { background: #2d0f0f; border-color: #4d1a1a; color: #ff7b72; }
body[data-theme="dark"] .lesson-section p { color: #c9d1d9; }
body[data-theme="dark"] .lesson-section h3 { color: #f0f6fc; }
body[data-theme="dark"] .formula-card__desc { color: #c9d1d9; }
body[data-theme="dark"] .small { color: #8b949e; }
body[data-theme="dark"] .calc-note { color: #8b949e; }
body[data-theme="dark"] .rs-fs-btn { background: #161b22; border-color: #30363d; color: #f0f6fc; }
body[data-theme="dark"] .rs-fs-value { color: #f0f6fc; }
body[data-theme="dark"] .read-settings__panel { background: #161b22; border-color: #30363d; }
body[data-theme="dark"] .read-settings__head b { color: #f0f6fc; }
body[data-theme="dark"] .check-list li { color: #c9d1d9; }
body[data-theme="dark"] .stat { background: #161b22; border-color: #30363d; }
body[data-theme="dark"] .stat__label { color: #8b949e; }
body[data-theme="dark"] .stat__num { color: #f0f6fc; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 38px; }
  .hero-card { max-width: 520px; }
  .grc-layout { grid-template-columns: 1fr; }
  .grc-diagram { position: static; max-width: 560px; margin: 0 auto; width: 100%; }
  .grc-questions { grid-template-columns: repeat(3, 1fr); }
  .bt-top { grid-template-columns: 1fr; }
  .merton-grid { grid-template-columns: 1fr; }
  .lesson__grid { grid-template-columns: 1fr; gap: 22px; }
  .lesson { padding: 24px 22px; }
  .lesson__repo { display: none; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .path { grid-template-columns: repeat(2, 1fr); }
  .path__step:nth-child(2) { border-right: 0; }
  .path__step:nth-child(1), .path__step:nth-child(2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .26s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .shell { margin-left: 0; }
  .icon-btn.menu-btn { display: grid; }
  .topbar { padding: 0 20px; }
  .view { padding: 28px 22px 64px; }
  .backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(5,16,31,.45); backdrop-filter: blur(2px); }
  .backdrop[hidden] { display: none; }
  .footer { padding: 24px 22px 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .view { padding: 22px 16px 56px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__right .pill { display: none; }
  .crumb span, .crumb i { display: none; }
  .hero { padding: 28px 22px; border-radius: 16px; }
  .hero h1 { font-size: 31px; }
  .hero p { font-size: 14px; }
  .hero__meta { gap: 12px; font-size: 10.5px; }
  .grid--2, .grid--3, .grid--4, .grid--5, .formula-grid, .ts-concepts, .calc-form, .result-grid, .bt-stats, .steps--two { grid-template-columns: 1fr; }
  .proj-add { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat__num { font-size: 25px; }
  .path { grid-template-columns: 1fr; }
  .path__step { border-right: 0; border-bottom: 1px solid var(--line); }
  .path__step:last-child { border-bottom: 0; }
  .grc-questions { grid-template-columns: 1fr 1fr; }
  .grc-detail { padding: 20px; }
  .ba { grid-template-columns: 1fr; }
  .ba__arrow { display: none; }
  .section { margin-top: 38px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { max-height: 94vh; border-radius: 16px 16px 0 0; }
  .footer__row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .toolbar__count { display: none; }
  .search { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .sidebar, .topbar, .footer, .btn, .seg, .toolbar { display: none !important; }
  .shell { margin-left: 0; }
  .view { max-width: none; padding: 0; }
  body { background: #fff; }
}
