/* Layout: одна колонка до 760px, «приложение» с липкой шапкой и нижней навигацией.
   Палитра — фирменный FESHAN: глубокий чёрный, тёмно-бордовый, неоновый красный, белый текст, зелёный для успеха. */
:root {
  --bg: #070304;
  --bg-2: #0f0507;
  --burg: #1d080d;
  --burg-2: #2b0b13;
  --burg-3: #3d0f1b;
  --line: rgba(255, 70, 92, .16);
  --line-2: rgba(255, 70, 92, .32);
  --red: #ff2a45;
  --red-2: #d7102c;
  --red-glow: rgba(255, 42, 69, .45);
  --text: #fbf4f5;
  --muted: #b8a2a7;
  --dim: #7c666b;
  --green: #1fd17c;
  --green-bg: rgba(31, 209, 124, .12);
  --bad-bg: rgba(255, 42, 69, .12);
  --amber: #ffb547;
  --f-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 18px;
  --r-s: 12px;
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg);
}
.bgfx {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(215, 16, 44, .20), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(90, 10, 25, .35), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
a { color: var(--red); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .9em; padding-left: 1.25em; }
li { margin: .25em 0; }
li::marker { color: var(--red); }

/* ---------- каркас ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px));
}
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(7, 3, 4, 0));
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--red), var(--red-2));
  box-shadow: 0 0 18px var(--red-glow);
  font-family: var(--f-display); font-weight: 800; font-size: 16px; color: #fff;
}
.brand-t { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-t small { display: block; color: var(--red); font-size: 10px; letter-spacing: .28em; font-weight: 600; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--burg); border: 1px solid var(--line); color: var(--text);
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn[hidden] { display: none !important; }

.nav {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: rgba(10, 4, 6, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.nav button {
  min-width: 0; background: none; border: 0; padding: 6px 1px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  transition: color .2s, background .2s;
}
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--text); }
.nav button.on svg { color: var(--red); filter: drop-shadow(0 0 6px var(--red-glow)); }

.view { animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- общие элементы ---------- */
.eyebrow { font-family: var(--f-display); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.h2 { font-family: var(--f-display); font-size: 19px; font-weight: 700; letter-spacing: .01em; line-height: 1.25; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.sec { margin-top: 30px; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card {
  background: linear-gradient(160deg, var(--burg) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; text-align: center; line-height: 1.25;
  transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.98); }
.btn-p { background: linear-gradient(135deg, var(--red), var(--red-2)); color: #fff; box-shadow: 0 6px 24px var(--red-glow); }
.btn-p:hover { box-shadow: 0 8px 32px var(--red-glow); }
.btn-g { background: var(--burg-2); color: var(--text); border-color: var(--line-2); }
.btn-g:hover { border-color: var(--red); }
.btn-ok { background: var(--green); color: #04140b; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn-s { min-height: 38px; padding: 8px 14px; font-size: 13.5px; border-radius: 11px; }
.btn-w { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > .btn { flex: 1 1 200px; }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red-2), var(--red)); box-shadow: 0 0 12px var(--red-glow); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.g i { background: var(--green); box-shadow: 0 0 10px rgba(31, 209, 124, .4); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: rgba(255, 255, 255, .06); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--bad-bg); color: var(--red); }
.pill svg { width: 13px; height: 13px; }

/* ---------- герой ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; border: 1px solid var(--line-2);
  background: radial-gradient(120% 90% at 100% 0%, var(--burg-3) 0%, var(--burg) 45%, var(--bg-2) 100%);
  box-shadow: 0 0 0 1px rgba(255, 42, 69, .05), 0 20px 60px rgba(215, 16, 44, .14), inset 0 0 40px rgba(255, 42, 69, .06);
  margin-top: 6px;
}
.hero { isolation: isolate; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; z-index: 0; }
.hero-in { position: relative; z-index: 1; padding: 26px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hero-in::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 3, 5, .92) 0%, rgba(10, 3, 5, .72) 55%, rgba(10, 3, 5, .25) 100%); z-index: -1; }
.hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 7.4vw, 42px); line-height: 1.02; letter-spacing: -.01em; }
.hero h1 span { display: block; color: var(--red); text-shadow: 0 0 22px var(--red-glow); }
.hero .sub { font-size: 16px; color: var(--muted); max-width: 30ch; margin: 0; }
.hero .row { margin-top: 6px; }
.hero .btn-stats { flex: 0 1 auto; }
.free-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(10, 3, 5, .6); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; }
.free-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- прогресс ---------- */
.prog { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 108px; height: 108px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .tr { stroke: rgba(255, 255, 255, .07); }
.ring .fg { stroke: var(--red); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--red-glow)); transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring.g .fg { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(31, 209, 124, .5)); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.ring b small { display: block; font-family: var(--f-body); font-size: 10.5px; color: var(--muted); font-weight: 600; text-align: center; margin-top: -4px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; min-width: 0; }
.stat { min-width: 0; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); }
.stat b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-l { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.last-l .ic { width: 24px; height: 24px; flex: none; }
.last-l .ic svg { width: 24px; height: 24px; display: block; }
.last-l .txt { flex: 1; min-width: 0; }
.last-l .txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-l .txt span { font-size: 12px; color: var(--muted); }

/* ---------- блоки и карточки уроков ---------- */
.block-h { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.block-n { font-family: var(--f-display); font-size: 30px; font-weight: 800; color: transparent; -webkit-text-stroke: 1.2px var(--red); line-height: 1; flex: none; }
.block-h .t { flex: 1; min-width: 0; }
.block-h .t span { font-size: 12.5px; color: var(--muted); }
.block-h .bar { margin-top: 8px; }
.lgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .lgrid { grid-template-columns: 1fr 1fr; } }
.lcard {
  position: relative; display: flex; gap: 14px; align-items: center; text-align: left; width: 100%;
  padding: 14px; border-radius: 16px;
  background: linear-gradient(150deg, var(--burg) 0%, rgba(15, 5, 7, .9) 100%);
  border: 1px solid var(--line);
  transition: transform .18s, border-color .2s, box-shadow .2s;
}
.lcard:hover { border-color: var(--line-2); box-shadow: 0 0 22px rgba(255, 42, 69, .14); transform: translateY(-1px); }
.lcard .ic {
  width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, var(--burg-3), var(--burg));
  border: 1px solid var(--line-2); color: var(--red);
}
.lcard .ic svg { width: 24px; height: 24px; }
.lcard.done .ic { color: var(--green); border-color: rgba(31, 209, 124, .35); }
.lcard .bd { flex: 1; min-width: 0; }
.lcard .num { font-family: var(--f-mono); font-size: 11px; color: var(--dim); letter-spacing: .06em; }
.lcard .tt { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.lcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lcard.exam { border-color: var(--line-2); background: linear-gradient(150deg, var(--burg-3) 0%, var(--burg) 100%); }

/* ---------- VIP ---------- */
.vip {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 22px 20px;
  border: 1px solid rgba(255, 42, 69, .55);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 42, 69, .28) 0%, transparent 55%),
    linear-gradient(160deg, var(--burg-3) 0%, var(--burg) 60%, var(--bg-2) 100%);
  box-shadow: 0 0 40px rgba(255, 42, 69, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.vip::after {
  content: ""; position: absolute; top: -40%; left: -60%; width: 50%; height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  transform: rotate(20deg); animation: shine 6s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.vip h3 { font-family: var(--f-display); font-size: 18px; line-height: 1.3; margin-bottom: 10px; }
.vip p { color: #e8d6d9; position: relative; z-index: 1; }
.vip .btn { position: relative; z-index: 1; margin-top: 6px; }
.vip-list { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; position: relative; z-index: 1; }
.vip-list li { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.35; }
.vip-list li svg { width: 16px; height: 16px; color: var(--red); flex: none; margin-top: 1px; }
@media (max-width: 420px) { .vip-list { grid-template-columns: 1fr; } }
.vip.small { padding: 18px; border-radius: 18px; }
.vip.small h3 { font-size: 15.5px; }
.vip.big { padding: 26px 20px; text-align: center; }
.vip.big h3 { font-size: 21px; }
.vip.big .btn { width: 100%; font-size: 16px; min-height: 54px; }
.crown { font-size: 30px; line-height: 1; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 12px rgba(255, 181, 71, .5)); }

/* ---------- достижения ---------- */
.ach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ach div { text-align: center; padding: 12px 4px 10px; border-radius: 14px; background: var(--burg); border: 1px solid var(--line); min-width: 0; }
.ach svg { width: 26px; height: 26px; color: var(--dim); }
.ach b { display: block; font-size: 10.5px; line-height: 1.25; margin-top: 6px; color: var(--dim); font-weight: 700; }
.ach .got { border-color: var(--line-2); background: radial-gradient(circle at 50% 0%, var(--burg-3), var(--burg)); }
.ach .got svg { color: var(--red); filter: drop-shadow(0 0 6px var(--red-glow)); }
.ach .got b { color: var(--text); }
@media (max-width: 340px) { .ach { grid-template-columns: repeat(2, 1fr); } }

/* ---------- урок ---------- */
.readbar { position: fixed; z-index: 26; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 3px; }
.readbar i { display: block; height: 100%; width: 0; background: var(--red); box-shadow: 0 0 10px var(--red); }
.lhead { padding: 10px 0 6px; }
.lhead h1 { font-family: var(--f-display); font-size: clamp(24px, 6.6vw, 34px); line-height: 1.12; margin: 8px 0 12px; }
.lhead .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.intro { font-size: 16.5px; color: #eadbdd; border-left: 2px solid var(--red); padding-left: 14px; }
.lsec { margin-top: 28px; }
.lsec h2 { font-family: var(--f-display); font-size: 17.5px; font-weight: 700; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.lsec h2 em { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--red); font-weight: 500; }
.lsec p, .lsec li { color: #eadfe1; }
.lsec b { color: #fff; }
.formula {
  font-family: var(--f-mono); font-size: 14.5px; padding: 12px 14px; margin: 4px 0 14px;
  border-radius: 12px; background: rgba(255, 42, 69, .07); border: 1px dashed var(--line-2); color: #fff;
  overflow-x: auto;
}
.note, .warn { padding: 12px 14px; border-radius: 12px; margin: 10px 0 14px; font-size: 14.5px; }
.note { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.warn { background: var(--bad-bg); border: 1px solid rgba(255, 42, 69, .35); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chips span { padding: 5px 10px; border-radius: 10px; background: var(--burg-2); border: 1px solid var(--line); font-size: 13px; }
.tbl { overflow-x: auto; margin: 6px 0 14px; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 300px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: rgba(255, 42, 69, .05); }
tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }
.fig { margin: 8px 0 16px; padding: 10px 8px 6px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px 6px 2px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair .fig { margin: 8px 0; }
.pair.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .pair, .pair.three { grid-template-columns: 1fr; } }
.anat { margin: 6px 0 14px; padding: 10px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.anat svg { width: 100%; height: auto; display: block; }
svg .cu { fill: var(--green); stroke: var(--green); }
svg .cd { fill: var(--red); stroke: var(--red); }
svg .wk { stroke-width: 1.4; }
svg .bd { stroke-width: 0; }
svg .ln { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linejoin: round; }
svg .pth { fill: none; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .7; }
svg .lv { stroke: var(--red); stroke-width: 1.4; stroke-dasharray: 6 5; opacity: .9; }
svg .zn { fill: rgba(255, 42, 69, .14); stroke: rgba(255, 42, 69, .4); stroke-width: 1; }
svg .zn.g { fill: rgba(31, 209, 124, .12); stroke: rgba(31, 209, 124, .4); }
svg .lvt { fill: var(--muted); font: 600 11.5px var(--f-body); }
svg .lbt { fill: #fff; font: 700 12.5px var(--f-body); }
svg .lbt.muted { fill: var(--muted); font-weight: 600; }
svg .grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
svg text { paint-order: stroke; stroke: rgba(7, 3, 4, .85); stroke-width: 3px; stroke-linejoin: round; }
.pair .bad, .pair .good { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.pair .bad { background: var(--bad-bg); border: 1px solid rgba(255, 42, 69, .3); }
.pair .good { background: var(--green-bg); border: 1px solid rgba(31, 209, 124, .3); }
.pair .bad b { color: var(--red); } .pair .good b { color: var(--green); }
.pair .bad p, .pair .good p { margin: 4px 0 0; }

.boxed { margin-top: 28px; }
.ex { border-left: 3px solid var(--red); }
.terms { display: grid; gap: 8px; margin: 0; }
.terms div { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.terms div:last-child { border-bottom: 0; }
.terms dt { font-weight: 800; color: #fff; }
.terms dd { margin: 0; color: #e2d3d6; }
@media (max-width: 420px) { .terms div { grid-template-columns: 1fr; gap: 2px; } }
.remember { background: linear-gradient(150deg, rgba(255, 42, 69, .14), rgba(29, 8, 13, .9)); border-color: var(--line-2); }
.remember ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.remember li { display: flex; gap: 10px; margin: 0; font-weight: 600; }
.remember li svg { width: 20px; height: 20px; color: var(--red); flex: none; margin-top: 2px; }

/* ---------- тесты ---------- */
.quiz-q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.quiz-q h4 { margin: 0 0 10px; font-size: 15.5px; line-height: 1.4; display: flex; gap: 10px; }
.quiz-q h4 span { font-family: var(--f-mono); color: var(--red); font-size: 13px; flex: none; padding-top: 2px; }
.opts { display: grid; gap: 8px; }
.opt {
  text-align: left; padding: 12px 14px; border-radius: 12px; min-height: 46px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .09);
  font-size: 14.5px; line-height: 1.4; transition: border-color .15s, background .15s;
  display: flex; gap: 10px; align-items: flex-start;
}
.opt::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; margin-top: 2px; }
.opt:hover:not([disabled]) { border-color: var(--line-2); background: rgba(255, 42, 69, .06); }
.opt.sel { border-color: var(--red); background: rgba(255, 42, 69, .1); }
.opt.sel::before { border-color: var(--red); background: radial-gradient(circle, var(--red) 45%, transparent 50%); }
.opt.ok { border-color: var(--green); background: var(--green-bg); }
.opt.ok::before { border-color: var(--green); background: radial-gradient(circle, var(--green) 45%, transparent 50%); }
.opt.no { border-color: var(--red); background: var(--bad-bg); }
.opt.no::before { border-color: var(--red); background: radial-gradient(circle, var(--red) 45%, transparent 50%); }
.opt[disabled] { cursor: default; }
.expl { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: rgba(255, 255, 255, .04); }
.expl b.g { color: var(--green); } .expl b.r { color: var(--red); }
.qres { margin-top: 14px; padding: 14px; border-radius: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qres.ok { background: var(--green-bg); border: 1px solid rgba(31, 209, 124, .35); }
.qres.mid { background: var(--bad-bg); border: 1px solid rgba(255, 42, 69, .3); }
.qres .big { font-family: var(--f-display); font-size: 24px; font-weight: 700; }
.qres.ok .big { color: var(--green); }
.qres .txt { flex: 1; min-width: 160px; font-size: 14px; }

.lfoot { margin-top: 22px; display: grid; gap: 10px; }
.lfoot .hint { font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- виджеты ---------- */
.widget { margin-top: 28px; border-color: var(--line-2); }
.widget .h2 { font-size: 16px; display: flex; gap: 10px; align-items: center; }
.widget .h2 svg { width: 22px; height: 22px; color: var(--red); flex: none; }
.widget .lead { font-size: 13.5px; color: var(--muted); margin: 6px 0 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input[type=number], .field input[type=text], .field textarea, .search input {
  width: 100%; padding: 11px 12px; border-radius: 11px; background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line-2); color: var(--text); font-size: 15px; min-width: 0;
  font-family: var(--f-mono);
}
.field textarea { font-family: var(--f-body); resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 42, 69, .15); }
input[type=range] { width: 100%; accent-color: var(--red); height: 26px; }
.rng { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.rng label { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; }
.rng output { font-family: var(--f-mono); font-weight: 700; min-width: 64px; text-align: right; }
.outs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.out { padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); min-width: 0; }
.out span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.out b { display: block; font-family: var(--f-mono); font-size: 18px; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.out b.g { color: var(--green); } .out b.r { color: var(--red); }
.out small { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.verdict { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.verdict.g { background: var(--green-bg); border: 1px solid rgba(31, 209, 124, .3); }
.verdict.r { background: var(--bad-bg); border: 1px solid rgba(255, 42, 69, .3); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); font-family: var(--f-mono); }
.seg button.on { background: var(--red); color: #fff; box-shadow: 0 0 14px var(--red-glow); }
.sub-h { font-weight: 800; font-size: 14px; margin: 20px 0 8px; }
.wbar { position: relative; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .06); margin: 12px 0 4px; overflow: hidden; }
.wbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; transition: width .4s; }
.wbar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; box-shadow: 0 0 8px #fff; }
.wlegend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
tr.bust td { color: var(--red); }
tr.bust td:first-child::after { content: " ✕"; }

.sort-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sort-item:last-child { border-bottom: 0; }
.sort-item p { margin: 0 0 8px; font-weight: 600; font-size: 14.5px; }
.sort-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-btns button { padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); font-size: 13px; font-weight: 700; }
.sort-btns button.ok { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.sort-btns button.no { border-color: var(--red); background: var(--bad-bg); color: var(--red); }
.sort-btns button[disabled] { cursor: default; }

.sess-tl { position: relative; margin: 14px 0 4px; }
.sess-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.sess-row span { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sess-row span i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.sess-row span i.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sess-track { position: relative; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.sess-track b { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--red-2), var(--red)); opacity: .55; }
.sess-track b.on { opacity: 1; box-shadow: 0 0 12px var(--red-glow); }
.sess-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; box-shadow: 0 0 8px #fff; z-index: 2; }
.sess-axis { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.sess-axis div { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10.5px; color: var(--dim); }
.clock { display: flex; flex-wrap: wrap; gap: 10px; }
.clock .out { flex: 1 1 140px; }

.plan-out { margin-top: 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line-2); }
.checks { display: grid; gap: 8px; margin-top: 8px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .08); font-size: 14px; cursor: pointer; }
.checks input { accent-color: var(--green); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }

/* ---------- списки, поиск, словарь ---------- */
.search { position: relative; margin: 6px 0 16px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 40px; font-family: var(--f-body); }
.gl { display: grid; gap: 8px; }
.gl div { padding: 12px 14px; border-radius: 14px; background: var(--burg); border: 1px solid var(--line); }
.gl b { display: block; color: #fff; }
.gl span { font-size: 14px; color: #e2d3d6; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { padding: 14px; border-radius: 16px; background: var(--burg); border: 1px solid var(--line); }
.tile span { display: block; font-size: 12px; color: var(--muted); }
.tile b { font-family: var(--f-display); font-size: 22px; font-weight: 700; display: block; margin-top: 4px; }

/* ---------- экзамен ---------- */
.exam-top { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.exam-top .bar { flex: 1; }
.exam-q { font-family: var(--f-display); font-size: 18px; line-height: 1.35; margin: 4px 0 16px; font-weight: 600; }
.review { display: grid; gap: 10px; }
.review .card { padding: 14px; }
.review p { margin: 4px 0; font-size: 14px; }
.review .y { color: var(--red); } .review .c { color: var(--green); }
.finish-hero { text-align: center; padding: 26px 18px; }
.finish-hero .ring { margin: 6px auto 14px; width: 140px; height: 140px; }
.finish-hero .ring b { font-size: 28px; }
.finish-hero h1 { font-family: var(--f-display); font-size: 24px; margin-bottom: 8px; }

/* ---------- модальные окна и уведомления ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .25s ease both;
}
.modal-in { width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; border-radius: 24px; padding: 24px 20px; background: linear-gradient(170deg, var(--burg-2), var(--bg-2)); border: 1px solid var(--line-2); box-shadow: 0 0 60px rgba(255, 42, 69, .25); text-align: center; animation: pop .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.modal-in .big-ic { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.modal-in h2 { font-family: var(--f-display); font-size: 20px; margin-bottom: 10px; }
.modal-in .vip { text-align: left; margin: 16px 0 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: min(92vw, 380px);
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--burg-3), var(--burg)); border: 1px solid var(--red);
  box-shadow: 0 10px 40px rgba(255, 42, 69, .35); animation: toastIn .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.toast svg { width: 30px; height: 30px; color: var(--red); flex: none; }
.toast b { display: block; font-size: 13px; color: var(--red); letter-spacing: .04em; }
.toast span { font-weight: 700; font-size: 14.5px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } }

.disc { margin-top: 30px; font-size: 12px; color: var(--dim); text-align: center; line-height: 1.5; }

/* ---------- Блок 4: Chart Challenge ---------- */
.gcard { display: grid; grid-template-columns: 1fr; width: 100%; text-align: left; padding: 0; overflow: hidden; border-radius: 18px; border: 1px solid var(--line-2); background: linear-gradient(160deg, var(--burg-3), var(--burg) 55%, var(--bg-2)); box-shadow: 0 0 30px rgba(255, 42, 69, .12); transition: transform .18s, box-shadow .2s; }
.gcard:hover { transform: translateY(-1px); box-shadow: 0 0 36px rgba(255, 42, 69, .22); }
.gc-chart { display: block; padding: 10px 10px 0; opacity: .9; }
.gc-chart .gsvg { max-height: 150px; }
.gc-bd { display: block; padding: 12px 16px 16px; min-width: 0; }
.gc-bd .num { font-family: var(--f-mono); font-size: 11px; color: var(--red); letter-spacing: .06em; }
.gc-bd .tt { display: block; font-family: var(--f-display); font-weight: 700; font-size: 17px; margin-top: 2px; }
.gc-bd .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gsvg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.gsvg .ax { fill: var(--dim); font: 500 10.5px var(--f-mono); stroke: none; }
.gsvg .axl { stroke: rgba(255, 255, 255, .1); }
.gsvg .fut { fill: rgba(255, 42, 69, .05); stroke: rgba(255, 42, 69, .45); stroke-dasharray: 5 5; }
.gsvg .futq { fill: var(--red); font: 800 34px var(--f-display); opacity: .8; animation: qpulse 2s ease-in-out infinite; }
.gsvg .futt { fill: var(--muted); font: 600 11px var(--f-body); }
@keyframes qpulse { 50% { opacity: .35; } }
.gsvg .nowl { stroke: rgba(255, 255, 255, .45); stroke-dasharray: 3 4; }
.gsvg .wm { fill: rgba(255, 255, 255, .28); font: 700 8.5px var(--f-body); letter-spacing: .12em; stroke: none; }
.gsvg .zl circle { fill: var(--red); }
.gsvg .zl text { fill: #fff; font: 800 12px var(--f-body); stroke: none; }
.gsvg .zl.sm text { font-size: 10.5px; }
.gsvg .lvt.hl { fill: #fff; }
.gsvg .lbt.st { font-size: 10.5px; fill: #ffd2d8; }
.gsvg .lbt.mk { fill: #fff; }
.gsvg .fvg { stroke-width: 1; stroke-dasharray: 4 3; }
.gsvg .fvg.bull { fill: rgba(31, 209, 124, .18); stroke: var(--green); }
.gsvg .fvg.bear { fill: rgba(255, 42, 69, .2); stroke: var(--red); }
.gsvg .spn { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .5); stroke-dasharray: 4 4; }
.gsvg .hit { fill: transparent; cursor: pointer; }
.gsvg .hit:hover { fill: rgba(255, 255, 255, .05); }
.gsvg .hit.on { fill: rgba(255, 42, 69, .22); }
.gsvg .hit.good { fill: rgba(31, 209, 124, .22); }
.gsvg .hit.bad { fill: rgba(255, 42, 69, .25); }
.gsvg .cdl, .gsvg text, .gsvg .lv, .gsvg .zn, .gsvg .fvg, .gsvg .spn, .gsvg .zl { pointer-events: none; }
.gsvg .cdl.nw { transform-box: fill-box; transform-origin: center bottom; animation: cdIn .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.gsvg .cdl.fu .bd, .gsvg .cdl.fu .wk { filter: drop-shadow(0 0 3px currentColor); }
@keyframes cdIn { from { opacity: 0; transform: scaleY(.2); } }
.gchart { margin: 12px 0 14px; padding: 8px 6px 4px; border-radius: 16px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.gchart.flash-ok { animation: flOk 1.2s ease; }
.gchart.flash-no { animation: flNo .6s ease; }
@keyframes flOk { 0%, 60% { border-color: var(--green); box-shadow: 0 0 30px rgba(31, 209, 124, .35); } }
@keyframes flNo { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); border-color: var(--red); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.gmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.pill.lv1 { color: var(--green); background: var(--green-bg); }
.pill.lv2 { color: var(--amber); background: rgba(255, 181, 71, .12); }
.pill.lv3 { color: var(--red); background: var(--bad-bg); }
.gtitle { font-family: var(--f-display); font-size: 21px; line-height: 1.2; margin: 12px 0 4px; }
.gq-goal { font-size: 13.5px; margin: 4px 0 0; }
.gq { font-weight: 700; font-size: 15.5px; margin: 0 0 12px; }
.opts.dirs { grid-template-columns: 1fr 1fr; }
.opts.dirs .opt::before { display: none; }
.opts.dirs .opt { justify-content: center; text-align: center; font-weight: 700; }
@media (max-width: 340px) { .opts.dirs { grid-template-columns: 1fr; } }
.ghint-b { margin-top: 12px; }
.ghint { animation: fade .3s ease both; }
.gres { position: relative; display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 16px; animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.gres.still { animation: none; }
.gres.ok { background: var(--green-bg); border: 1px solid rgba(31, 209, 124, .45); }
.gres.no { background: var(--bad-bg); border: 1px solid rgba(255, 42, 69, .45); }
.gres .gres-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 20px; color: #fff; }
.gres.ok .gres-ic { background: var(--green); box-shadow: 0 0 18px rgba(31, 209, 124, .6); }
.gres.no .gres-ic { background: var(--red); box-shadow: 0 0 18px var(--red-glow); }
.gres b { display: block; }
.gres span { font-size: 13.5px; color: var(--muted); }
.gres .gplus { position: absolute; right: 16px; top: 50%; font-family: var(--f-display); font-weight: 800; font-size: 22px; color: var(--green) !important; animation: plus 1.2s ease both; }
@keyframes plus { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 30% { opacity: 1; transform: translateY(-50%) scale(1.15); } 100% { opacity: 1; transform: translateY(-50%) scale(1); } }
.grev { margin-top: 14px; }
.grev h4 { margin: 14px 0 4px; font-size: 14px; color: #fff; }
.grev p { margin: 0; font-size: 14.5px; color: #e2d3d6; }
.glist { display: grid; gap: 8px; }
.glist > div { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--burg); border: 1px solid var(--line); }
.glist b { flex: 1; min-width: 0; font-size: 14.5px; }
.gnum { color: var(--red); font-size: 12px; }
.theory summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.theory summary::-webkit-details-marker { display: none; }
.theory summary::after { content: "+"; font: 700 20px var(--f-mono); color: var(--red); }
.theory[open] summary::after { content: "−"; }
.vip-mini { padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); background: rgba(255, 42, 69, .05); font-size: 13.5px; color: var(--muted); }
.vip-mini a { color: var(--red); font-weight: 700; text-decoration: none; white-space: nowrap; }
.topics { display: grid; gap: 8px; }
.tp { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--burg); }
.tp > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.tp > span svg { width: 17px; height: 17px; }
.tp.ok > span { background: var(--green-bg); color: var(--green); }
.tp.no > span { background: var(--bad-bg); color: var(--red); }
.tp > div { flex: 1; min-width: 0; }
.tp b { display: block; font-size: 14.5px; }
.tp small { color: var(--muted); font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
