:root {
  --bg: #0e1122;
  --bg2: #141833;
  --panel: #1a1f3d;
  --panel2: #242a52;
  --line: #333a6b;
  --text: #eef0ff;
  --muted: #bcc1e6;
  --accent: #7c9cff;
  --accent2: #ffb86b;
  --good: #5ee3a1;
  --bad: #ff6b8a;
  --violet: #c38bff;
  --radius: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #2a2160 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}
b { color: #fff; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.sec { padding: 90px 16px; border-bottom: 1px solid #ffffff0d; }
.sec:nth-of-type(even) { background: #ffffff04; }
.wrap { max-width: 1040px; margin: 0 auto; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.num {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: #0e1122;
}
h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.08; margin: 8px 0 18px; }
h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; margin: 0; }
h3 { margin: 0 0 8px; font-size: 22px; }
.lead { font-size: 20px; color: #d7dbf7; max-width: 860px; }
.lead.center, .center { text-align: center; margin-left: auto; margin-right: auto; }
.lead.big { font-size: 24px; }
.kicker { color: var(--accent2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; margin: 0; }
.grad { background: linear-gradient(90deg, var(--accent), var(--violet), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hint { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.w-caption { color: var(--muted); font-size: 15px; margin: 12px 0 8px; }

.widget {
  background: linear-gradient(180deg, var(--panel), #171b38);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 22px;
  box-shadow: 0 20px 50px #0006;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); cursor: pointer; text-decoration: none;
  font-size: 16px; font-weight: 600; transition: background .2s, transform .1s;
}
.btn:hover { background: #2f3668; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #6f8dff, #9b7bff); border-color: transparent; color: #0b0e20; }
.btn.small { padding: 8px 12px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip-btn {
  border: 1px solid var(--line); background: #ffffff0a; border-radius: 999px; padding: 4px 12px;
  margin: 4px 4px 0 0; cursor: pointer; font-size: 15px;
}
.chip-btn:hover { background: #ffffff18; }

input[type=text], input:not([type]), .wide {
  font: inherit; font-size: 22px; color: var(--text); background: #0d1029; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; outline: none; width: 100%;
}
input:focus { border-color: var(--accent); }

details.more { margin-top: 18px; color: var(--muted); }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.more p { max-width: 860px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: #0d1029; padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.seg-btn { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 16px; }
.seg-btn.active { background: var(--panel2); color: #fff; box-shadow: 0 0 0 1px var(--accent) inset; }

/* ---------- nav ---------- */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--violet)); z-index: 50; }
#nav { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 40; }
#nav a { width: 12px; height: 12px; border-radius: 50%; background: #ffffff30; position: relative; display: block; transition: background .2s, transform .2s; }
#nav a.active { background: var(--accent); transform: scale(1.3); }
#nav a span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: var(--panel2); padding: 3px 10px; border-radius: 8px; font-size: 13px; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#nav a:hover span { opacity: 1; }
@media (max-width: 900px) { #nav { display: none; } }

/* ---------- hero ---------- */
.hero { min-height: 92vh; display: flex; align-items: center; }
.hero-chat { max-width: 640px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.msg { padding: 12px 16px; border-radius: 16px; margin: 8px 0; max-width: 90%; width: fit-content; }
.msg.user { background: #2d3570; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.bot { background: #0d1029; border: 1px solid var(--line); border-bottom-left-radius: 4px; min-height: 48px; min-width: 60px; }
.tk { display: inline; border-radius: 4px; transition: background 1.2s; }
.tk.new { background: #7c9cff55; }

/* ---------- bars ---------- */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar {
  display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 12px;
  background: transparent; border: 0; padding: 4px 8px; border-radius: 10px; text-align: left; width: 100%;
}
button.bar { cursor: pointer; }
button.bar:hover { background: #ffffff0d; }
.bar-w { font-weight: 600; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 22px; background: #0d1029; border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width .45s ease; }
.bar-p { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.bar.hl { background: #ffb86b22; box-shadow: 0 0 0 2px var(--accent2) inset; }
.bar.hl .bar-fill { background: linear-gradient(90deg, var(--accent2), #ff8f6b); }
.bar.other .bar-fill { background: #4a5190; }
.bar.other .bar-w { color: var(--muted); font-weight: 400; font-size: 16px; }
.bars.small .bar { grid-template-columns: 110px 1fr 48px; }
.bars.small .bar-w { font-size: 16px; }
.bars.small .bar-track { height: 14px; }
.nw-msg { color: var(--muted); padding: 10px 4px; }

/* ---------- next word ---------- */
.nw-input-row { display: flex; gap: 10px; }
.nw-input-row input { flex: 1; }

/* ---------- tokens ---------- */
.tok-out { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 10px; min-height: 60px; }
.tok {
  display: inline-flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 9px;
  font-size: 22px; font-weight: 600; color: #0b0e20; animation: pop .35s ease both;
}
.tok small { font-size: 12px; font-weight: 500; opacity: .75; display: none; }
.show-ids .tok small { display: block; }
.tok.gap { margin-left: 10px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.tok-stats { color: var(--muted); font-size: 16px; }
.tok-stats b { color: var(--accent2); font-size: 20px; }
.switch { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); cursor: pointer; font-size: 16px; }

/* ---------- embeddings ---------- */
.emb { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
@media (max-width: 800px) { .emb { grid-template-columns: 1fr; } }
#emb-svg { width: 100%; height: auto; background: #0d1029; border-radius: 14px; border: 1px solid var(--line); }
.emb-word { cursor: pointer; }
.emb-word circle { transition: r .25s, opacity .3s; }
.emb-word text { font-size: 17px; fill: #e6e9ff; font-weight: 600; paint-order: stroke; stroke: #0d1029; stroke-width: 4px; transition: opacity .3s; }
.emb-word.dim { opacity: .3; }
.emb-word.sel circle { r: 10; }
.emb-word.sel text { fill: #fff; font-size: 20px; }
.emb-link { stroke: #fff; stroke-width: 2; stroke-dasharray: 5 5; opacity: .55; }
.emb-arrow { stroke-width: 4; fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.emb-group { font-size: 13px; fill: #8a90bf; letter-spacing: .08em; text-transform: uppercase; }
.emb-info { background: #0d1029; border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-height: 230px; margin-bottom: 12px; font-size: 16px; }
.emb-info h4 { margin: 0 0 6px; font-size: 22px; }
.vec { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 8px 0; }
.vec span { height: 22px; border-radius: 4px; }
.vec-nums { font-family: Consolas, monospace; font-size: 13px; color: var(--muted); }
.emb-result { font-size: 20px; color: var(--accent2); font-weight: 700; }

/* ---------- attention ---------- */
.attn-scroll { overflow-x: auto; margin-top: 10px; }
.attn-box { position: relative; padding-top: 170px; width: max-content; min-width: 100%; }
#attn-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.attn-row { display: flex; gap: 10px; padding: 0 6px 6px; }
.attn-tok { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; border: 0; background: none; padding: 0; }
.attn-tok .w {
  font-size: 22px; font-weight: 600; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0d1029; transition: background .3s, box-shadow .3s;
}
.attn-tok.sel .w { box-shadow: 0 0 0 3px var(--accent2); background: #ffb86b30; }
.attn-tok.future .w { opacity: .35; border-style: dashed; }
.attn-tok .pc { font-size: 14px; color: var(--muted); min-height: 20px; font-variant-numeric: tabular-nums; }
.attn-list, .attn-hint-narrow { display: none; margin-top: 6px; }
.attn-path { fill: none; stroke: var(--accent); stroke-linecap: round; transition: opacity .4s; }
.attn-label { fill: #fff; font-size: 14px; font-weight: 700; }

/* ---------- layers ---------- */
.layers { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
@media (max-width: 860px) { .layers { grid-template-columns: 1fr; } }
.tower { display: flex; flex-direction: column-reverse; gap: 8px; }
.layer {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #0d1029;
  transition: background .4s, box-shadow .4s, opacity .4s; opacity: .55;
}
.layer.on { opacity: 1; background: #232a5c; box-shadow: 0 0 0 2px var(--accent), 0 0 30px #7c9cff55; }
.layer.done { opacity: .85; }
.layer-name { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.layer-toks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.layer-toks span { font-size: 14px; padding: 2px 6px; border-radius: 6px; background: #ffffff10; transition: background .4s; }
.layer-toks span.key { background: var(--accent2); color: #0b0e20; font-weight: 700; }
.layer-toks span.rel { background: #7c9cff66; }
.layer-dots { text-align: center; color: var(--muted); font-size: 18px; line-height: 1; }
.layer-card {
  background: #0d1029; border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-height: 170px;
}
.layer-card h4 { margin: 0 0 6px; color: var(--accent2); font-size: 18px; }
.layer-card p { margin: 0; font-size: 19px; }
.layer-card.flash { animation: flash .5s ease; }
@keyframes flash { from { transform: translateY(6px); opacity: .2; } to { transform: none; opacity: 1; } }
.layer-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hl-word { color: var(--accent2); }

/* ---------- probs ---------- */
.sentence { font-size: 28px; margin: 0 0 14px; font-weight: 600; }
.blank { display: inline-block; min-width: 110px; border-bottom: 3px dashed var(--accent2); color: var(--accent2); text-align: center; }
.blank.pop { animation: pop .4s ease; }
.temp-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.temp-row input[type=range] { flex: 1; min-width: 200px; accent-color: var(--accent2); height: 28px; }
.temp-mood { color: var(--accent2); font-weight: 600; min-width: 240px; }
.pr-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pr-history { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-history span { background: #ffffff12; border-radius: 8px; padding: 3px 10px; font-size: 16px; animation: pop .3s ease both; }
.pr-history span.rare { background: #ff6b8a40; }

/* ---------- generation ---------- */
.gen-text { font-size: 30px; font-weight: 600; min-height: 96px; line-height: 1.5; }
.gen-text .w { display: inline-block; margin-right: .28em; }
.gen-text .w.new { color: var(--accent2); animation: pop .4s ease both; }
.gen-text .caret { display: inline-block; width: 3px; height: 1em; background: var(--accent); vertical-align: -0.1em; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.gen-cycle { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin: 14px 0; }
@media (max-width: 760px) { .gen-cycle { grid-template-columns: 1fr; } }
.cyc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cyc-step { padding: 8px 12px; border-radius: 10px; background: #0d1029; border: 1px solid var(--line); font-size: 16px; transition: background .25s, box-shadow .25s; }
.cyc-step.on { background: #7c9cff40; box-shadow: 0 0 0 2px var(--accent); }
.cyc-arr { color: var(--muted); font-size: 20px; }
.gen-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- training ---------- */
.train { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 860px) { .train { grid-template-columns: 1fr; } }
.train-examples { display: flex; flex-direction: column; gap: 10px; }
.tex { background: #0d1029; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: box-shadow .3s; }
.tex.active { box-shadow: 0 0 0 2px var(--accent2); }
.tex-q { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.tex-q .ans { color: var(--good); }
.tex .bars { gap: 3px; }
.tex .bar { grid-template-columns: 96px 1fr 46px; padding: 1px 4px; }
.tex .bar-w { font-size: 15px; font-weight: 500; }
.tex .bar-track { height: 12px; }
.tex .bar.correct .bar-fill { background: linear-gradient(90deg, #3bc98a, var(--good)); }
.tex .bar.correct .bar-w { color: var(--good); font-weight: 700; }
.train-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.knobs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.knob { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3a4280, #161a3a); border: 1px solid var(--line); position: relative; }
.knob i { position: absolute; left: 50%; top: 10%; width: 3px; height: 40%; margin-left: -1.5px; background: var(--accent2); border-radius: 2px; transform-origin: 50% 100%; transition: transform .45s ease; }
#loss-svg { width: 100%; height: 110px; background: #0d1029; border: 1px solid var(--line); border-radius: 12px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; } }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.fact b { font-size: 26px; color: var(--accent2); }
.fact span { color: var(--muted); font-size: 16px; }

/* ---------- assistant ---------- */
.chat { margin-top: 12px; }
.chat .msg.bot { width: auto; max-width: 100%; }
.warn { border-color: #ff6b8a66; }
.hallu-badge { display: none; margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: #ff6b8a26; color: #ffd0da; font-weight: 600; }
.hallu-badge.show { display: block; animation: pop .4s ease both; }

/* ---------- summary ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 28px 0 22px; }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
.pipe {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px; position: relative;
  transition: transform .3s, box-shadow .3s, background .3s;
}
.pipe:hover { transform: translateY(-3px); }
.pipe i { font-style: normal; font-size: 30px; }
.pipe b { font-size: 19px; }
.pipe span { color: var(--muted); font-size: 15px; line-height: 1.35; }
.pipe.on { background: #2a3270; box-shadow: 0 0 0 2px var(--accent2), 0 10px 30px #0008; transform: translateY(-6px); }

/* ---------- video / presentation mode ---------- */
#caption, #cursor, #video-ctrls { display: none; }
html.video { scroll-behavior: auto; }
html.video body { overflow: hidden; background-attachment: scroll; }
html.video #nav, html.video #progress, html.video .long { display: none !important; }
html.video .sec { display: none; height: 100vh; padding: 30px 48px 168px; border: 0; background: transparent; }
html.video .sec.active { display: flex; align-items: center; animation: secIn .7s ease both; }
html.video .wrap { width: 100%; max-width: 1180px; }
html.video .widget { margin-top: 16px; padding: 18px 22px; }
html.video .lead { font-size: 21px; margin: 10px 0 0; max-width: 1060px; }
html.video h2 { font-size: 38px; }
@keyframes secIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html.video #caption {
  display: block; position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: min(1100px, 92vw); text-align: center; font-size: 25px; line-height: 1.35; font-weight: 600;
  background: #070918e6; border: 1px solid #ffffff22; border-radius: 16px; padding: 14px 24px; z-index: 60;
  min-height: 56px; transition: opacity .3s;
}
html.video #caption:empty { opacity: 0; }
html.video #cursor { display: block; position: fixed; left: 640px; top: 120vh; z-index: 70; pointer-events: none; transition: left .7s cubic-bezier(.5,0,.3,1), top .7s cubic-bezier(.5,0,.3,1); filter: drop-shadow(0 3px 6px #000a); }
#cursor.click::after { content: ""; position: absolute; left: -14px; top: -14px; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--accent2); animation: ripple .5s ease-out both; }
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
html.video:not(.rec) #video-ctrls { display: flex; gap: 8px; position: fixed; top: 14px; right: 14px; z-index: 95; transition: opacity .4s; }
#video-ctrls button { background: #000a; color: #fff; border: 1px solid #fff3; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 15px; }
#video-ctrls button[hidden] { display: none; }
#video-ctrls button[aria-pressed="true"] { background: #7c9cff; color: #0b0e20; }
/* во время просмотра кнопки приглушены, чтобы не мешать кадру */
html.playing #video-ctrls { opacity: .3; }
html.playing #video-ctrls:hover, html.playing #video-ctrls:focus-within { opacity: 1; }
html.video input { caret-color: var(--accent); }
html.video .hero { min-height: 0; }
html.video .hero h1 { font-size: 64px; }

/* compact layouts inside the 1280×720 video frame */
html.video .emb-info { min-height: 0; }
html.video #emb-svg { max-height: 430px; }
html.video .train-side .knobs { gap: 6px; }
html.video .train .tex { padding: 8px 12px; }
html.video .train .tex-q { font-size: 17px; margin-bottom: 2px; }
html.video #training .facts, html.video .train .tex:nth-child(3) { display: none; }
html.video .probs .bars { gap: 1px; }
html.video .probs .bar { padding: 2px 8px; }
html.video .probs .bar-track { height: 18px; }
html.video .probs .sentence { margin-bottom: 6px; }
html.video #assistant .widget { margin-top: 12px; }
html.video #assistant .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
html.video #assistant .sec-head, html.video #assistant .lead { grid-column: 1 / -1; }
html.video #assistant .warn .hint { display: none; }
html.video #hallu-ask { display: none; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .sec { padding: 60px 16px; }
  .widget { padding: 16px; }
  .bar { grid-template-columns: 96px 1fr 44px; gap: 8px; }
  .bar-w { font-size: 16px; }
  .sentence { font-size: 22px; }
  .gen-text { font-size: 22px; }
}

/* ---------- правки после ревью ---------- */
.tok.still { animation: none; }
button.bar:disabled { cursor: default; }
button.bar:disabled:hover { background: transparent; }
.layer-name { display: flex; justify-content: space-between; gap: 8px; }
.layer-note { color: var(--good); text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 0; transition: opacity .4s; }
.layer.on .layer-note, .layer.done .layer-note { opacity: 1; }
.layer.on .layer-toks span:not(.key):not(.rel) { background: #ffffff1c; }
.emb-map { overflow-x: auto; border-radius: 14px; }
#start-video { display: none; }
html.video:not(.rec) #start-video {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 90; background: #0e1122d9; border: 0; cursor: pointer;
  color: #fff; font-size: 28px; font-weight: 700;
}
#start-video span { padding: 18px 34px; border-radius: 18px; background: linear-gradient(135deg, #6f8dff, #9b7bff); color: #0b0e20; }
#start-video small { display: block; font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 14px; text-align: center; }
html.video #training .lead { display: none; }
html.video #training .widget { margin-top: 20px; }
html.video .attn-box { padding-top: 150px; }
/* без субтитров место под ними внизу кадра не нужно */
html.video.nosubs #caption { display: none; }
html.video.nosubs .sec { padding-bottom: 40px; }
/* окно меньше кадра: кадр 1280×720 масштабируется целиком (letterbox) */
html.video.fit body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #05060f; }
html.video.fit .sec.active { flex: none; width: 1280px; height: 720px; zoom: var(--fit); overflow: hidden;
  background: radial-gradient(1200px 600px at 80% -10%, #2a2160 0%, transparent 60%), var(--bg); }

.rotate-hint, .fs-hint { display: none !important; }
@media (orientation: portrait) and (max-width: 900px) { html:not(.can-fs) .rotate-hint { display: block !important; color: var(--accent2) !important; } }
@media (pointer: coarse) { html.can-fs .fs-hint { display: block !important; color: var(--accent2) !important; } }
html.native .fs-hint { display: block !important; color: var(--accent2) !important; }
html.native .rotate-hint { display: none !important; }
/* режим iPhone: записанный ролик; пока он не играет, видео спрятано под стартовым экраном */
#native-video { position: fixed; inset: 0; width: 100%; height: 100%; background: #000; z-index: 85; display: none; }
html.native.playing #native-video { display: block; }
html.native.playing #start-video { display: none; }
@media (max-width: 600px) {
  html.video:not(.rec) #video-ctrls { top: 8px; right: 8px; gap: 6px; }
  #video-ctrls button { padding: 6px 10px; font-size: 13px; }
  html.video.fit #caption { font-size: 15px; bottom: 8px; padding: 8px 12px; }
}
@media (max-width: 600px) {
  .attn-box { padding-top: 0; width: auto; }
  #attn-svg { display: none; }
  .attn-row { flex-wrap: wrap; gap: 8px 6px; padding: 0; }
  .attn-tok .w { font-size: 18px; padding: 8px 10px; }
  .attn-tok .pc { display: none; }
  .attn-list, .attn-hint-narrow { display: block; }
  .attn-hint-wide { display: none; }
  .attn-list .bar { grid-template-columns: 1fr 1.2fr 44px; min-height: 0; }
  .attn-list .bar-w { white-space: normal; font-size: 15px; }
  .grad { white-space: nowrap; }
  .gen-cycle { gap: 12px; }
  .cyc-step { padding: 6px 9px; font-size: 14px; }
  .tex .bar { grid-template-columns: 82px 1fr 42px; }
  .chip-btn, .seg-btn, .btn.small, button.bar { min-height: 44px; }
  .layer-btns .btn.small { min-width: 48px; justify-content: center; }
  details.more summary { padding: 10px 0; }
  .switch input { width: 22px; height: 22px; }
}
