/* ============================================================
   gradeai — Курс «ИИ с нуля»
   Brand: navy #054274 · green #46B76B · white
   Type:  Unbounded (display) · Golos Text (body)
   ============================================================ */

:root {
  --navy:      #054274;
  --navy-700:  #0a4f88;
  --navy-900:  #042d4f;
  --green:     #46B76B;
  --green-600: #36a35b;
  --green-100: #e4f4ea;
  --ink:       #16242f;
  --muted:     #5d7180;
  --line:      #dfe3e0;
  --paper:     #f5f4ef;
  --card:      #ffffff;
  --warn:      #c2410c;
  --warn-bg:   #fdf2ec;

  /* semantic text tokens — flip in dark mode */
  --heading:   #054274;   /* headings & text-accent (was hardcoded var(--navy)) */
  --body:      #36505f;   /* soft body copy */
  --surface-2: #fbfbf9;   /* zebra rows / inset bg */
  --field-bg:  #fcfcfb;   /* input backgrounds */
  --hover:     #ecefec;   /* nav/list hover */
  --info-bg:   #eaf1f8;   /* blue-tint callout/result */
  --info-bd:   #cfe0f0;
  --dots:      rgba(5,66,116,.05);
  --topbar-bg: rgba(245,244,239,.82);

  --r:    18px;
  --r-sm: 12px;
  --shadow:    0 1px 2px rgba(5,66,116,.06), 0 12px 28px -12px rgba(5,66,116,.18);
  --shadow-lg: 0 30px 70px -30px rgba(5,66,116,.45);

  --font-disp: "Unbounded", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;

  color-scheme: light;
}

/* ============================================================
   DARK THEME — brand "night-navy". Driven by [data-theme]; the
   no-JS @media block below mirrors it for prefers-color-scheme.
   ============================================================ */
:root[data-theme="dark"] {
  --navy:      #3f86c7;   /* brand brightened so surfaces/borders read on dark */
  --navy-700:  #4f93d0;
  --navy-900:  #0a2030;
  --green:     #46B76B;
  --green-600: #5cc77f;   /* lighter for accent text/links on dark */
  --green-100: rgba(70,183,107,.16);
  --ink:       #e8eef2;
  --muted:     #93a7b4;
  --line:      #243845;
  --paper:     #0c1a26;
  --card:      #14242f;
  --warn:      #f6a86a;
  --warn-bg:   rgba(246,138,60,.12);

  --heading:   #e8eef2;
  --body:      #c4d2db;
  --surface-2: rgba(255,255,255,.03);
  --field-bg:  #0f1f2b;
  --hover:     rgba(255,255,255,.06);
  --info-bg:   rgba(63,134,199,.14);
  --info-bd:   rgba(63,134,199,.32);
  --dots:      rgba(255,255,255,.035);
  --topbar-bg: rgba(12,26,38,.82);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 28px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -30px rgba(0,0,0,.8);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #3f86c7; --navy-700: #4f93d0; --navy-900: #0a2030;
    --green: #46B76B; --green-600: #5cc77f; --green-100: rgba(70,183,107,.16);
    --ink: #e8eef2; --muted: #93a7b4; --line: #243845;
    --paper: #0c1a26; --card: #14242f; --warn: #f6a86a; --warn-bg: rgba(246,138,60,.12);
    --heading: #e8eef2; --body: #c4d2db; --surface-2: rgba(255,255,255,.03);
    --field-bg: #0f1f2b; --hover: rgba(255,255,255,.06);
    --info-bg: rgba(63,134,199,.14); --info-bd: rgba(63,134,199,.32);
    --dots: rgba(255,255,255,.035); --topbar-bg: rgba(12,26,38,.82);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 30px 70px -30px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, var(--dots) 1px, transparent 0);
  background-size: 22px 22px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-disp);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0;
}

::selection { background: var(--green); color: #04261a; }

/* ---------- shared chrome ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none; font-family: var(--font-disp);
  font-weight: 700; letter-spacing: -.02em; color: var(--heading);
}
.brand img { width: auto; height: 64px; display: block; }
.brand span { font-size: 19px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.topbar .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #06351f; }
.btn-primary:hover { background: var(--green-600); color: #fff; box-shadow: 0 12px 26px -12px rgba(70,183,107,.8); }
.btn-green { background: var(--green); color: #04261a; }
.btn-green:hover { background: var(--green-600); box-shadow: 0 10px 24px -10px rgba(70,183,107,.6); }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--heading); }
.btn-ghost:hover { border-color: var(--heading); }
.btn-sm { padding: 8px 15px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }

/* ============================================================
   LANDING
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  padding: 86px 0 70px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 80% at 88% 8%, rgba(70,183,107,.16), transparent 60%),
    radial-gradient(50% 70% at 8% 92%, rgba(5,66,116,.10), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-600);
  background: var(--green-100); border: 1px solid #c9e9d4;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 26px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hero h1 {
  font-size: clamp(42px, 7.5vw, 92px);
  letter-spacing: -.03em; max-width: 14ch;
}
.hero h1 .accent { color: var(--green-600); }
.hero p.lead {
  margin: 26px 0 0; font-size: clamp(17px, 2vw, 21px);
  color: var(--muted); max-width: 56ch;
}
.hero .cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }

.stats {
  margin-top: 64px; display: grid; gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.stat b { font-family: var(--font-disp); font-size: 34px; color: var(--heading); display: block; line-height: 1; }
.stat span { font-size: 14px; color: var(--muted); display: block; margin-top: 8px; }

/* section heading */
.section { padding: 76px 0; }
.section-head { margin-bottom: 44px; max-width: 60ch; }
.section-head .tag {
  font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-600); display: block; margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 46px); }
.section-head p { color: var(--muted); font-size: 18px; margin: 16px 0 0; }

/* myth cards */
.myths { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.myth {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 28px 26px 26px; box-shadow: var(--shadow);
  overflow: hidden;
}
.myth::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(var(--green), var(--green-600));
}
.myth .n { font-family: var(--font-disp); font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.myth .bad {
  margin: 14px 0 18px; font-family: var(--font-disp); font-weight: 600;
  font-size: 21px; color: var(--heading); text-decoration: line-through; text-decoration-color: #cdd6db;
}
.myth .arrow { color: var(--green-600); font-weight: 700; }
.myth .good { font-size: 16px; color: var(--ink); }

/* lessons grid */
.lessons { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.lcard {
  display: flex; gap: 20px; align-items: flex-start; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 24px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.lcard:hover { transform: translateY(-3px); border-color: var(--heading); box-shadow: var(--shadow-lg); }
.lcard .num {
  font-family: var(--font-disp); font-weight: 700; font-size: 26px;
  color: var(--green-600); min-width: 46px;
}
.lcard h3 { font-size: 19px; color: var(--heading); }
.lcard p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* steps */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: var(--shadow); }
.step .k { font-family: var(--font-disp); font-size: 40px; color: var(--green); line-height: 1; }
.step h3 { margin: 14px 0 8px; font-size: 19px; color: var(--heading); }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

/* prize band */
.band {
  margin-top: 8px; background: var(--navy); color: #fff; border-radius: 26px;
  padding: 52px 48px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 120% at 90% 0%, rgba(70,183,107,.32), transparent 55%);
}
.band .inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.band .ico { font-size: 56px; }
.band h2 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); }
.band p { color: rgba(255,255,255,.8); margin: 12px 0 0; max-width: 52ch; }
.band .prize {
  margin-left: auto; text-align: right;
}
.band .prize b { font-family: var(--font-disp); font-size: 46px; color: var(--green); display: block; line-height: 1; }
.band .prize span { color: rgba(255,255,255,.75); font-size: 14px; }

.foot { padding: 46px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* ============================================================
   COURSE APP
   ============================================================ */
.app { display: grid; grid-template-columns: 300px 1fr; align-items: start; }

/* progress in topbar */
.progress-mini { display: flex; align-items: center; gap: 12px; }
.progress-mini .track { width: 130px; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-mini .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--green-600)); border-radius: 999px; transition: width .4s ease; }
.progress-mini .pct { font-family: var(--font-disp); font-weight: 600; font-size: 14px; color: var(--heading); min-width: 38px; }

/* sidebar */
.side {
  position: sticky; top: 66px; align-self: start;
  height: calc(100vh - 66px); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 26px 18px 40px;
}
.side .side-title { font-family: var(--font-disp); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 12px; margin-bottom: 14px; }
.navlist { list-style: none; margin: 0; padding: 0; }
.navlist a {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  padding: 11px 12px; border-radius: 12px; color: var(--ink); font-size: 15px;
  transition: background .15s ease, color .15s ease;
}
.navlist a:hover { background: var(--hover); }
.navlist a.active { background: var(--navy); color: #fff; }
.navlist a.active .kx { color: var(--green); }
.navlist a .kx { font-family: var(--font-disp); font-weight: 700; font-size: 13px; color: var(--muted); min-width: 24px; }
.navlist a .check {
  margin-left: auto; width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center; flex: none;
}
.navlist a.done .check { background: var(--green); border-color: var(--green); }
.navlist a.done .check svg { width: 11px; height: 11px; color: #fff; }
.navlist a.active .check { border-color: rgba(255,255,255,.4); }

/* main column */
.main { padding: 40px clamp(24px, 4vw, 64px) 90px; max-width: 880px; }

.lesson-head { margin-bottom: 8px; }
.lesson-head .kx { font-family: var(--font-disp); font-weight: 700; font-size: 15px; color: var(--green-600); letter-spacing: .06em; }
.lesson-head h1 { font-size: clamp(30px, 4.6vw, 50px); margin-top: 10px; color: var(--heading); }

.sec { margin-top: 46px; }
.sec-name {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-disp); font-weight: 600; font-size: 14px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--heading);
  padding-bottom: 12px; border-bottom: 2px solid var(--green); margin-bottom: 22px;
}

/* blocks */
.blk { margin: 18px 0; }
.blk.text { font-size: 17px; }
.blk.lead { font-size: 21px; color: var(--ink); font-weight: 500; line-height: 1.5; }
.blk ul, .blk ol { margin: 14px 0; padding-left: 0; list-style: none; }
.blk ul li, .blk ol li { position: relative; padding: 7px 0 7px 32px; font-size: 16.5px; }
.blk ul li::before { content: ""; position: absolute; left: 6px; top: 16px; width: 8px; height: 8px; border-radius: 2px; background: var(--green); transform: rotate(45deg); }
.blk ol { counter-reset: oli; }
.blk ol li { counter-increment: oli; }
.blk ol li::before {
  content: counter(oli); position: absolute; left: 0; top: 6px;
  width: 23px; height: 23px; border-radius: 50%; background: var(--navy); color: #fff;
  font-family: var(--font-disp); font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

/* myths inside lesson */
.blk .mythrow {
  display: flex; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px dashed var(--line);
}
.blk .mythrow:last-child { border-bottom: 0; }
.blk .mythrow .m { font-family: var(--font-disp); font-weight: 600; color: var(--heading); flex: 1; }
.blk .mythrow .r { flex: 1.4; color: var(--ink); }
.blk .mythrow .ar { color: var(--green-600); font-weight: 700; }

/* callouts */
.callout { border-radius: var(--r); padding: 20px 22px; display: flex; gap: 14px; align-items: flex-start; }
.callout .ic { font-size: 22px; line-height: 1.2; flex: none; }
.callout .ct b { display: block; margin-bottom: 4px; font-family: var(--font-disp); font-weight: 600; font-size: 15px; }
.callout.tip  { background: var(--green-100); border: 1px solid #c9e9d4; }
.callout.goal { background: var(--info-bg); border: 1px solid var(--info-bd); }
.callout.warn { background: var(--warn-bg); border: 1px solid #f5d9c8; }
.callout.warn .ct, .callout.warn b { color: var(--warn); }
.callout.quote { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--green); font-family: var(--font-disp); font-weight: 500; font-size: 19px; color: var(--heading); line-height: 1.4; }

/* prompt good/bad */
.prompt2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.prompt2 .pc { border-radius: var(--r); padding: 18px 20px; border: 1px solid var(--line); background: var(--card); }
.prompt2 .pc .lbl { font-family: var(--font-disp); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.prompt2 .bad  { border-color: #f0d4c6; background: #fdf4ef; }
.prompt2 .bad .lbl { color: var(--warn); }
.prompt2 .good { border-color: #c9e9d4; background: var(--green-100); }
.prompt2 .good .lbl { color: var(--green-600); }
.prompt2 .pc p { margin: 0; font-size: 15.5px; }

/* reveal (эталонные ответы) */
details.reveal { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
details.reveal > summary { cursor: pointer; list-style: none; padding: 16px 20px; font-family: var(--font-disp); font-weight: 600; font-size: 15px; color: var(--heading); display: flex; align-items: center; gap: 10px; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal > summary::before { content: "▸"; color: var(--green-600); transition: transform .2s ease; }
details.reveal[open] > summary::before { transform: rotate(90deg); }
details.reveal[open] > summary { border-bottom: 1px solid var(--line); }
.reveal-body { padding: 18px 20px; display: grid; gap: 12px; }
.reveal-body .prompt2 { margin: 0; }

/* table */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.matrix { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
table.matrix th { background: var(--navy); color: #fff; text-align: left; padding: 13px 16px; font-family: var(--font-disp); font-weight: 600; font-size: 13px; letter-spacing: .04em; }
table.matrix td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }
table.matrix tr:nth-child(even) td { background: var(--surface-2); }

/* portal button block */
.portalblk { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.portalblk .pi { width: 42px; height: 42px; border-radius: 12px; background: var(--green-100); display: grid; place-items: center; flex: none; }
.portalblk .pi svg { width: 22px; height: 22px; color: var(--green-600); }
.portalblk .ph { flex: 1; }
.portalblk .ph .t { font-weight: 600; color: var(--heading); }
.portalblk .ph .h { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* task field */
.task { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.task .qlabel { display: flex; align-items: flex-start; gap: 12px; font-weight: 600; color: var(--heading); font-size: 16.5px; white-space: pre-line; }
.task .qlabel .pen { color: var(--green-600); flex: none; margin-top: 2px; }
.task textarea {
  width: 100%; margin-top: 14px; resize: vertical; min-height: 84px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 13px 15px;
  font-family: var(--font-body); font-size: 15.5px; color: var(--ink); background: var(--field-bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.task textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(70,183,107,.14); background: var(--card); }
.task .saved { font-size: 13px; color: var(--green-600); margin-top: 8px; height: 16px; opacity: 0; transition: opacity .2s; }
.task .saved.show { opacity: 1; }

/* yes/no self-test */
.yesno .yn-item { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.yesno .yn-item:last-of-type { border-bottom: 0; }
.yesno .yn-item .q { flex: 1; font-size: 16px; }
.yn-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.yn-toggle button { border: 0; background: var(--card); padding: 8px 18px; font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.yn-toggle button.on-yes { background: var(--green); color: #04261a; }
.yn-toggle button.on-no  { background: var(--navy); color: #fff; }
.yn-result { margin-top: 18px; padding: 16px 20px; border-radius: var(--r); background: var(--info-bg); border: 1px solid var(--info-bd); font-weight: 600; color: var(--heading); display: none; }
.yn-result.show { display: block; }
.yn-result .score { font-family: var(--font-disp); font-size: 28px; color: var(--green-600); }

/* checklist builder */
.checklist .cl-group { margin-bottom: 18px; }
.checklist .cl-group h4 { font-family: var(--font-disp); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.checklist .cl-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; cursor: pointer; background: var(--card); transition: border-color .15s, background .15s; }
.checklist .cl-item:hover { border-color: var(--green); }
.checklist .cl-item.on { border-color: var(--green); background: var(--green-100); }
.checklist .cl-item .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; margin-top: 1px; }
.checklist .cl-item.on .box { background: var(--green); border-color: var(--green); }
.checklist .cl-item.on .box svg { width: 13px; height: 13px; color: #fff; }
.checklist .cl-item span { font-size: 15.5px; }

/* classify */
.classify .cf-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.classify .cf-item .q { flex: 1; font-size: 16px; min-width: 180px; }
.classify .cf-note { width: 100%; font-size: 14px; color: var(--green-600); padding-left: 2px; display: none; }
.classify .cf-note.show { display: block; }

/* lesson nav */
.lnav { margin-top: 56px; display: flex; gap: 14px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 26px; }
.lnav a { text-decoration: none; }
.complete-bar { margin-top: 40px; background: var(--card); border: 1px dashed var(--green); border-radius: var(--r); padding: 22px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.complete-bar .t { flex: 1; min-width: 220px; }
.complete-bar .t b { font-family: var(--font-disp); color: var(--heading); font-size: 18px; }
.complete-bar .t p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- NOTES / конспект ---------- */
.notes-head { margin-bottom: 30px; }
.notes-head h1 { font-size: clamp(30px, 4.6vw, 50px); color: var(--heading); }
.notes-head p { color: var(--muted); font-size: 18px; margin-top: 12px; }
.notes-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 36px; }
.note-mod { margin-bottom: 30px; }
.note-mod > h2 { font-family: var(--font-disp); font-size: 22px; color: var(--heading); padding-bottom: 8px; border-bottom: 2px solid var(--green); margin-bottom: 16px; }
.note-q { margin: 14px 0; }
.note-q .nq { font-weight: 600; color: var(--heading); white-space: pre-line; }
.note-q .na { margin-top: 4px; white-space: pre-line; background: var(--surface-2); border-left: 3px solid var(--green); padding: 8px 14px; border-radius: 0 8px 8px 0; }
.note-q .na.empty { color: var(--muted); font-style: italic; border-left-color: var(--line); }
.note-empty { color: var(--muted); font-style: italic; }

dialog.modal { border: 0; border-radius: var(--r); padding: 0; max-width: 480px; width: 92%; box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(4,45,79,.42); backdrop-filter: blur(3px); }
dialog.modal .md-body { padding: 28px 30px; }
dialog.modal h3 { color: var(--heading); font-size: 22px; }
dialog.modal p { color: var(--muted); margin: 12px 0 18px; }
dialog.modal label { font-weight: 600; font-size: 14px; color: var(--heading); display: block; margin-bottom: 6px; }
dialog.modal input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px; font-family: var(--font-body); font-size: 15px; margin-bottom: 16px; }
dialog.modal input:focus { outline: none; border-color: var(--green); }
dialog.modal .md-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* mobile sidebar toggle */
.menu-btn { display: none; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; color: var(--heading); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stats, .myths, .lessons, .steps { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 66px; left: 0; bottom: 0; width: 280px; z-index: 60;
    background: var(--paper); transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .side.open { transform: none; }
  .menu-btn { display: grid; place-items: center; }
  .prompt2 { grid-template-columns: 1fr; }
  .band .prize { margin-left: 0; text-align: left; }
}
@media (max-width: 560px) {
  .stats, .myths, .lessons, .steps { grid-template-columns: 1fr; }
  .hero { padding: 54px 0 44px; }
  .progress-mini .track { display: none; }
}

/* ---------- print (конспект → PDF) ---------- */
@media print {
  body { background: #fff; }
  .topbar, .side, .notes-actions, .menu-btn, .foot, .lnav, .complete-bar { display: none !important; }
  .app { display: block; }
  .main { max-width: none; padding: 0; }
  .note-q .na { background: #fff; }
}

/* ============================================================
   Corporate login + course access gating (auth.js)
   ============================================================ */
.auth-slot { display: flex; align-items: center; gap: 10px; }
.auth-user {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: 14px; font-weight: 600; color: var(--heading); max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auth-user .auth-co { color: var(--muted); font-weight: 500; }
.auth-badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.auth-ok { background: var(--green-100); color: #2c8a4e; }
.auth-no { background: var(--warn-bg); color: #c2410c; }

/* sidebar locked lessons */
.navlist a.locked { opacity: .72; }
.navlist a.locked .check { filter: grayscale(1); }

/* paywall (locked lesson body) */
.paywall {
  text-align: center; max-width: 560px; margin: 24px auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 44px 32px; box-shadow: 0 12px 28px -16px rgba(5,66,116,.25);
}
.paywall .pw-lock { font-size: 44px; margin-bottom: 8px; }
.paywall h2 { font-size: 24px; color: var(--heading); margin-bottom: 12px; }
.paywall p { color: var(--muted); font-size: 16px; }
.paywall .pw-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0 16px; }
.paywall .pw-note { font-size: 14px; }
.paywall .pw-note a { color: var(--green); font-weight: 600; }

/* landing lesson cards: demo / locked tags */
.demo-tag {
  font-size: 11px; font-weight: 700; vertical-align: middle;
  background: var(--green-100); color: #2c8a4e; border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}
.lock-tag { font-size: 13px; vertical-align: middle; margin-left: 4px; }
.lcard-locked { position: relative; }
.lcard-locked::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(5,66,116,.015) 10px, rgba(5,66,116,.015) 20px);
  pointer-events: none;
}

@media (max-width: 560px) {
  .auth-user { max-width: 120px; }
  .auth-user .auth-co { display: none; }
}

/* ---- sidebar group separator ---- */
.nav-group {
  margin: 16px 8px 4px; padding-top: 12px; border-top: 1px solid var(--line);
  font-family: var(--font-disp); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
#navlist li:first-child.nav-group { border-top: 0; margin-top: 0; padding-top: 0; }

/* ---- sidebar "back to courses" link ---- */
.nav-back { margin: 0 0 10px; }
.nav-back a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.nav-back a:hover { background: var(--hover); color: var(--heading); }
.nav-back svg { width: 16px; height: 16px; }

/* ---- steps block (numbered instructions) ---- */
.blk.steps { display: flex; flex-direction: column; margin: 18px 0; }
.blk.steps .step { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.blk.steps .step:last-child { padding-bottom: 0; }
.blk.steps .step:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line);
}
.blk.steps .step-n {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 999px;
  background: var(--navy); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.blk.steps .step-b { padding-top: 4px; min-width: 0; }
.blk.steps .step-t { font-weight: 600; color: var(--heading); margin-bottom: 2px; }
.blk.steps .step-d { color: var(--ink); line-height: 1.5; }

/* ---- schema block (UI wireframe) ---- */
.blk.schema { margin: 20px 0; }
.blk.schema .schema-t { font-weight: 600; color: var(--heading); margin-bottom: 8px; }
.blk.schema .wf {
  display: grid; grid-template-columns: 100px 1fr; gap: 8px;
  background: var(--info-bg); border: 2px solid var(--navy); border-radius: 14px; padding: 8px;
}
.blk.schema .wf.has-coach { grid-template-columns: 100px 1fr 84px; }
.blk.schema .wf-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.blk.schema .wz {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 10px;
  min-height: 46px; display: flex; align-items: center;
}
.blk.schema .wz-sidebar, .blk.schema .wz-coach { min-height: 168px; align-items: flex-start; }
.blk.schema .wz-main { min-height: 116px; align-items: flex-start; }
.blk.schema .wz-h {
  display: block; font-size: 13px; line-height: 1.7; color: var(--ink);
}
.blk.schema .wz-l { color: var(--muted); margin-left: 4px; }
.blk.schema .wz-ph {
  display: block; width: 60%; height: 8px; border-radius: 999px; background: var(--line);
}
.blk.schema .zn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700; vertical-align: middle;
}
.blk.schema .schema-legend {
  margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px;
}
.blk.schema .schema-legend li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
@media (max-width: 640px) {
  .blk.schema .wf, .blk.schema .wf.has-coach { grid-template-columns: 1fr; }
  .blk.schema .wz-sidebar, .blk.schema .wz-coach { min-height: 60px; }
}

/* ---- builder block (prompt constructor) ---- */
.blk.builder { margin: 20px 0; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--card); }
.blk.builder .builder-t { font-weight: 600; color: var(--heading); margin-bottom: 12px; }
.blk.builder .builder-fields { display: grid; gap: 10px; }
.blk.builder .builder-field { display: grid; gap: 4px; }
.blk.builder .bf-l { font-size: 13px; font-weight: 600; color: var(--muted); }
.blk.builder textarea, .blk.builder select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); resize: vertical;
}
.blk.builder textarea:focus, .blk.builder select:focus { outline: none; border-color: var(--green); }
.blk.builder .builder-out { margin-top: 14px; border: 1.5px dashed var(--green); border-radius: 10px; background: var(--green-100); }
.blk.builder .bo-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--green-600); }
.blk.builder .bo-copy { border: 1px solid var(--green); background: var(--card); color: var(--green-600); border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.blk.builder .bo-copy:hover { background: var(--green); color: #fff; }
.blk.builder .bo-pre { margin: 0; padding: 0 12px 12px; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.5; color: var(--ink); }

/* ---- quiz block (single-choice) ---- */
.blk.quiz { margin: 18px 0; }
.blk.quiz .quiz-q { margin: 0 0 16px; }
.blk.quiz .qq { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.blk.quiz .qq-opts { display: flex; flex-direction: column; gap: 8px; }
.blk.quiz .qq-opts button {
  text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s;
}
.blk.quiz .qq-opts button:hover { border-color: var(--green); }
.blk.quiz .qq-opts button.correct { border-color: var(--green); background: var(--green-100); color: var(--green-600); font-weight: 600; }
.blk.quiz .qq-opts button.wrong { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.blk.quiz .qq-note { font-size: 14px; margin-top: 6px; line-height: 1.4; max-height: 0; overflow: hidden; opacity: 0; transition: opacity .2s, max-height .2s; }
.blk.quiz .qq-note.show { opacity: 1; max-height: 240px; }
.blk.quiz .quiz-result { margin-top: 6px; font-size: 15px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.blk.quiz .quiz-result.show { opacity: 1; }

/* ---- rank block (order the steps) ---- */
.blk.rank { margin: 18px 0; }
.blk.rank .rank-list { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: rk; display: flex; flex-direction: column; gap: 8px; }
.blk.rank .rank-item { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); counter-increment: rk; }
.blk.rank .rank-item::before { content: counter(rk); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.blk.rank .rank-item.ok { border-color: var(--green); background: var(--green-100); }
.blk.rank .rank-item.no { border-color: var(--warn); background: var(--warn-bg); }
.blk.rank .ri-txt { flex: 1; min-width: 0; }
.blk.rank .ri-btns { display: flex; gap: 4px; flex: none; }
.blk.rank .ri-btns button { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; cursor: pointer; color: var(--heading); font-size: 12px; line-height: 1; }
.blk.rank .ri-btns button:hover:not(:disabled) { border-color: var(--green); background: var(--green-100); }
.blk.rank .ri-btns button:disabled { opacity: .35; cursor: default; }
.blk.rank .rank-actions { display: flex; align-items: center; gap: 12px; }
.blk.rank .rank-check { border: 0; background: var(--navy); color: #fff; border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.blk.rank .rank-check:hover { background: var(--navy-900); }
.blk.rank .rank-result { font-size: 15px; color: var(--muted); }
.blk.quiz .score, .blk.rank .score { font-weight: 700; color: var(--heading); }

/* ============================================================
   THEME TOGGLE (sun/moon) — shared chrome
   ============================================================ */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--card); border: 1.5px solid var(--line); color: var(--heading);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover { border-color: var(--navy); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* theme-aware logo: dark-navy mark on light, light mark on dark */
.brand .lg-dark { display: none; }
:root[data-theme="dark"] .brand .lg-light { display: none; }
:root[data-theme="dark"] .brand .lg-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .lg-light { display: none; }
  :root:not([data-theme="light"]) .brand .lg-dark { display: block; }
}

/* ============================================================
   MY COURSES dashboard (courses.html)
   ============================================================ */
.courses-page { padding: 56px 0 96px; min-height: 60vh; }
.courses-head { margin-bottom: 36px; }
.courses-head .kx {
  font-family: var(--font-disp); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--green-600);
}
.courses-head h1 { font-size: clamp(30px, 4.6vw, 50px); color: var(--heading); margin-top: 10px; }
.courses-head p { color: var(--muted); font-size: 18px; margin-top: 14px; max-width: 60ch; }

.course-cards {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.course-card {
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 26px 24px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.course-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(var(--green), var(--green-600));
  opacity: 0; transition: opacity .2s ease;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--navy); box-shadow: var(--shadow-lg); }
.course-card:hover::after { opacity: 1; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-kicker {
  font-family: var(--font-disp); font-weight: 700; font-size: 12.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--green-600);
}
.cc-badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 11px;
}
.cc-badge.done { background: var(--green-100); color: var(--green-600); }
.cc-badge.progress { background: var(--info-bg); color: var(--navy); }
.cc-badge.new { background: var(--green-100); color: var(--green-600); }
.course-card h3 { font-size: 23px; color: var(--heading); margin: 12px 0 0; line-height: 1.15; }
.cc-desc { color: var(--muted); font-size: 15px; margin: 12px 0 0; flex: 1; }
.cc-meta { display: flex; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.cc-meta b { color: var(--heading); font-family: var(--font-disp); font-weight: 700; }

.cc-progress { margin-top: 20px; }
.cc-progress .cc-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cc-progress .cc-fill { height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--green-600)); transition: width .6s ease; }
.cc-progress .cc-pct { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.cc-progress .cc-pct b { color: var(--green-600); font-family: var(--font-disp); }
.cc-cta { margin-top: 22px; }
.cc-cta .btn { width: 100%; }

/* not-authenticated gate on courses.html */
.courses-gate {
  text-align: center; max-width: 560px; margin: 30px auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 48px 32px; box-shadow: var(--shadow);
}
.courses-gate .cg-ico { font-size: 46px; margin-bottom: 10px; }
.courses-gate h2 { font-size: 24px; color: var(--heading); margin-bottom: 12px; }
.courses-gate p { color: var(--muted); font-size: 16px; }
.courses-gate .cg-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ============================================================
   DARK-MODE residual fixes for light literals
   ============================================================ */
:root[data-theme="dark"] .prompt2 .bad { background: rgba(246,138,60,.10); border-color: rgba(246,138,60,.30); }
:root[data-theme="dark"] .prompt2 .good { border-color: rgba(70,183,107,.30); }
:root[data-theme="dark"] .callout.tip { border-color: rgba(70,183,107,.30); }
:root[data-theme="dark"] .callout.warn { border-color: rgba(246,138,60,.30); }
:root[data-theme="dark"] .myth .bad { text-decoration-color: var(--line); }
:root[data-theme="dark"] .blk.builder .builder-out { background: rgba(70,183,107,.10); }
:root[data-theme="dark"] .blk.builder textarea,
:root[data-theme="dark"] .blk.builder select { background: var(--field-bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prompt2 .bad { background: rgba(246,138,60,.10); border-color: rgba(246,138,60,.30); }
  :root:not([data-theme="light"]) .prompt2 .good { border-color: rgba(70,183,107,.30); }
  :root:not([data-theme="light"]) .callout.tip { border-color: rgba(70,183,107,.30); }
  :root:not([data-theme="light"]) .callout.warn { border-color: rgba(246,138,60,.30); }
  :root:not([data-theme="light"]) .myth .bad { text-decoration-color: var(--line); }
  :root:not([data-theme="light"]) .blk.builder .builder-out { background: rgba(70,183,107,.10); }
  :root:not([data-theme="light"]) .blk.builder textarea,
  :root:not([data-theme="light"]) .blk.builder select { background: var(--field-bg); }
}

@media (max-width: 560px) {
  .course-cards { grid-template-columns: 1fr; }
}
