/* Тёмный пульт, как в роликах: цвет означает функцию (питание жёлтое, датчики голубые, логика фиолетовая, готово зелёное). Одна колонка под телефон, нижняя навигация. */
:root {
  --ink: #07080A;
  --panel: #0F1115;
  --raise: #161920;
  --line: rgba(245, 244, 240, 0.1);
  --line-strong: rgba(245, 244, 240, 0.2);
  --fg: #F5F4F0;
  --dim: rgba(245, 244, 240, 0.62);
  --faint: rgba(245, 244, 240, 0.38);
  --power: #FFD23F;
  --sense: #57C7FF;
  --decide: #B49CFF;
  --act: #FF6B2C;
  --done: #5FD3A2;
  --sans: 'Inter Tight', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* manipulation: без приближения по двойному тапу (на iPhone оно застревало над 3D, которое забирает жесты); щипок остаётся. */
html, body { background: var(--ink); color: var(--fg); touch-action: manipulation; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(88px + env(safe-area-inset-bottom, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--power); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; }
.app { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding-top: 18px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: 30px; font-weight: 750; line-height: 1.08; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.muted { color: var(--dim); }
.small { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Шапка экрана */
.top { display: flex; align-items: center; gap: 12px; }
.top .back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--raise); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.02em; font-size: 18px; }
.brand-mark { width: 26px; height: 26px; }

/* Поверхности */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.task { background: linear-gradient(160deg, #1b1a10 0%, var(--panel) 55%); border-color: rgba(255, 210, 63, 0.28); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--dim); white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }
.chip.ok { color: var(--done); border-color: rgba(95, 211, 162, 0.4); }
.chip.warn { color: var(--power); border-color: rgba(255, 210, 63, 0.4); }
.chip.open { color: var(--act); border-color: rgba(255, 107, 44, 0.4); }
.chip.info { color: var(--sense); border-color: rgba(87, 199, 255, 0.4); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 650; background: var(--fg); color: var(--ink); }
.btn.ghost { background: var(--raise); color: var(--fg); border: 1px solid var(--line); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.bar { height: 6px; border-radius: 3px; background: rgba(245, 244, 240, 0.1); overflow: hidden; }
.bar > b { display: block; height: 100%; background: var(--power); border-radius: 3px; }

/* Поиск */
.search { display: flex; align-items: center; gap: 10px; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; min-height: 50px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--fg); font: inherit; font-size: 16px; outline: none; }
.results { display: flex; flex-direction: column; }
.result { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.result:focus-visible { outline-offset: -2px; }
.result-snippet { display: block; margin-top: 4px; }
.result:last-child { border-bottom: 0; }
.kind { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; flex: none; }
.k-op { background: rgba(255, 210, 63, 0.14); color: var(--power); }
.k-th { background: rgba(87, 199, 255, 0.14); color: var(--sense); }
.k-eq { background: rgba(180, 156, 255, 0.14); color: var(--decide); }
.k-term { background: rgba(245, 244, 240, 0.08); color: var(--fg); }

/* Списки уроков */
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: 13.5px; color: var(--dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--faint); }
.dot.ok { background: var(--done); border-color: var(--done); }
.dot.half { background: linear-gradient(90deg, var(--power) 50%, transparent 50%); border-color: var(--power); }
/* Маршрут новичка на главной: номер шага, текущий подсвечен, будущие участки приглушены. */
.pstep-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--dim); box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.pstep-n.now { color: var(--ink); background: var(--power); box-shadow: none; }
.pstep-n.done { color: var(--ink); background: var(--done); box-shadow: none; }
.pstep.now .t { color: var(--power); }
.pstep.later { opacity: 0.55; }

/* Видео */
.player { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 90% at 70% 20%, #1d2230 0%, #0a0c10 70%); border: 1px solid var(--line); }
.player canvas { width: 100%; height: 100%; display: block; }
.player .cap { position: absolute; left: 0; right: 0; bottom: 44px; text-align: center; font-size: 13px; padding: 0 12px; text-shadow: 0 2px 10px #000; }
.player .ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; display: flex; gap: 10px; align-items: center; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.scrub { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); position: relative; }
.scrub b { position: absolute; inset: 0 auto 0 0; background: var(--power); border-radius: 2px; }
.scrub span { position: absolute; top: -3px; width: 2px; height: 10px; background: rgba(255,255,255,.6); }
.chapters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chapter { flex: none; padding: 8px 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); font-size: 13.5px; text-align: left; }
.chapter.on { border-color: var(--power); }
.chapter .mono { color: var(--dim); font-size: 12px; display: block; }

/* Шаги */
.steps { counter-reset: s; display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; border: 1.5px solid var(--line-strong); color: var(--dim); }
.step.now .n { border-color: var(--power); color: var(--power); }
.step.done .n { background: var(--done); border-color: var(--done); color: var(--ink); }
.step.done .txt { color: var(--dim); }
.term { display: inline; color: var(--sense); border-bottom: 1px dashed rgba(87, 199, 255, 0.6); font-weight: 560; }

/* Симулятор блока питания */
.psu-wrap { display: flex; flex-direction: column; gap: 12px; }
.psu { width: 100%; max-width: 420px; margin: 0 auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.psu .hit { cursor: pointer; }
.psu-blink { animation: psu-blink 0.9s steps(1, end) infinite; }
@keyframes psu-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .psu-blink { animation: none; } }
.turn { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.turn .btn { min-height: 52px; }
.hint { font-size: 14px; color: var(--dim); text-align: center; min-height: 2.9em; }
.hint b { color: var(--fg); }

/* 3D и графики */
.stage { position: relative; height: 320px; border-radius: 12px; overflow: hidden; background: radial-gradient(90% 80% at 50% 30%, #181c26 0%, #08090c 75%); border: 1px solid var(--line); touch-action: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .tip { position: absolute; left: 12px; top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); pointer-events: none; }
.gyro { display: flex; flex-direction: column; gap: 10px; }
.g-row { display: grid; grid-template-columns: 112px 1fr 76px; gap: 10px; align-items: center; font-size: 14px; }
.g-row .val { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.g-track { height: 10px; border-radius: 5px; background: rgba(245, 244, 240, 0.08); position: relative; overflow: hidden; }
.g-track::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.g-track b { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.insight { border-radius: 12px; padding: 12px 14px; background: rgba(87, 199, 255, 0.08); border: 1px solid rgba(87, 199, 255, 0.3); font-size: 14.5px; transition: opacity .3s; }
.axes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.axes .btn { flex-direction: column; gap: 0; min-height: 56px; line-height: 1.15; }
.axes .btn small { font-family: var(--mono); font-size: 11px; color: var(--dim); font-weight: 500; }
.def { border-left: 3px solid var(--sense); padding-left: 12px; }
.quiz .opt { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.quiz .opt.right { border-color: var(--done); background: rgba(95, 211, 162, 0.1); }
.quiz .opt.wrong { border-color: var(--act); background: rgba(255, 107, 44, 0.08); }
.quiz .why { font-size: 14px; color: var(--dim); }
input[type=range] { width: 100%; accent-color: var(--power); }
.ohm svg { width: 100%; height: auto; display: block; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.readout div { background: var(--raise); border-radius: 12px; padding: 10px; text-align: center; }
.readout b { display: block; font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.readout span { font-size: 12px; color: var(--dim); }

/* Каталог */
.spec { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec td:first-child { color: var(--dim); width: 42%; padding-right: 10px; }
.spec tr:last-child td { border-bottom: 0; }
.eq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.eq { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.eq .t { font-weight: 650; line-height: 1.2; }

/* Нижний лист */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet.on { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-in { max-width: 560px; margin: 0 auto; background: #12151b; border: 1px solid var(--line-strong); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: 78vh; overflow: auto; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 4px; }
textarea { width: 100%; min-height: 90px; background: var(--raise); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; resize: vertical; }

/* Навигация */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(9, 10, 13, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.nav-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--faint); text-decoration: none; padding: 6px 0; }
.nav a.on { color: var(--fg); }
.nav svg { width: 22px; height: 22px; }
.view { display: none; flex-direction: column; gap: 20px; }
.view.on { display: flex; }
.proto { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Пилот: вход, админка, видео ---- */
.auth { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; color: var(--dim); }
.field input, .field select { min-height: 50px; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font: inherit; padding: 0 14px; }
.error { color: var(--act); font-size: 14px; min-height: 1.4em; }
video.player-video { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; display: block; }
/* Субтитры в ролики не вшиты: их показывает плеер, в стиле роликов. В полноэкранном режиме iOS рисует их по-своему. */
video.player-video::cue { font-family: var(--sans); font-weight: 500; color: #F5F4F0; background: rgba(8, 9, 12, 0.72); line-height: 1.3; }
.rule { border-radius: 12px; padding: 12px 14px; background: rgba(255, 210, 63, 0.08); border: 1px solid rgba(255, 210, 63, 0.3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip { padding: 7px 12px; border-radius: 999px; background: rgba(87, 199, 255, 0.1); border: 1px solid rgba(87, 199, 255, 0.35); color: var(--sense); font-size: 14px; font-weight: 560; }
.person { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.mini { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.link-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; color: var(--fg); }
.fb { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fb:last-child { border-bottom: 0; }
.nav-in.five { grid-template-columns: repeat(5, 1fr); }
.offline { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 40; background: var(--act); color: var(--ink); font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 999px; }

/* ---------- Знакомство с птицей (первый вход) ---------- */
.intro { position: fixed; inset: 0; z-index: 25; background: #0b0d12; overflow: hidden; }
.intro-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.intro-view { position: absolute; inset: 0; touch-action: none; }
.intro-view canvas { display: block; width: 100%; height: 100%; }
.intro-fail { padding: 30vh 24px 0; text-align: center; }
.intro-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; display: flex; align-items: center; gap: 12px; }
.intro-brand { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.intro-dots { display: flex; gap: 6px; margin-left: auto; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: #2a3044; transition: background .3s, transform .3s; }
.intro-dots i.done { background: #5b6680; }
.intro-dots i.now { background: var(--power); transform: scale(1.35); }
.intro-skip { font-size: 13px; color: var(--dim); padding: 8px 4px 8px 8px; }
/* Версия птицы: ASCENT или MAX */
.intro-ver { display: flex; border: 1px solid #2a3044; border-radius: 999px; padding: 2px; flex: none; }
.intro-ver button { font: 600 11px/1 var(--mono, monospace); letter-spacing: 0.06em; color: var(--dim); padding: 7px 10px; border-radius: 999px; min-height: 28px; }
.intro-ver button[aria-pressed="true"] { background: #e9ecf2; color: #0b0d12; }
@media (max-width: 560px) { .intro-brand { display: none; } .intro-dots { gap: 4px; } .intro-dots i { width: 5px; height: 5px; } }
.intro-sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 560px); padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; max-height: calc(100% - 64px - env(safe-area-inset-top, 0px));
  background: rgba(18, 21, 27, 0.95); border-top: 1px solid var(--line-strong); border-radius: 20px 20px 0 0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.intro-sheet > :not(.intro-text) { flex: none; }
.intro-sheet h1 { font-size: 24px; margin: 6px 0 8px; }
.intro-text { margin: 0; font-size: 16px; line-height: 1.45; min-height: 3em; }
.intro:not(.intro-lite) .intro-text { min-height: 0; overflow-y: auto; }
.intro:not(.intro-lite) .intro-text-compact { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.intro-hint { margin: 10px 0 0; font-size: 13px; color: var(--dim); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 0 18px; }
.intro-mode, .intro-details { margin-top: 4px; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.intro-buttons { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }
.intro-buttons .btn:disabled { opacity: .35; }
.intro-tip { position: absolute; left: 50%; top: calc(48px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -6px); width: min(calc(100% - 32px), 420px); padding: 12px 14px; border-radius: 14px;
  background: rgba(10, 12, 17, 0.92); border: 1px solid var(--power); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.intro-tip.show { opacity: 1; transform: translate(-50%, 0); }
.intro-tip b { display: block; color: var(--power); font-size: 15px; margin-bottom: 3px; }
.intro-tip span { font-size: 14px; line-height: 1.4; }
@media (min-width: 900px) {
  .intro-sheet { left: auto; right: 24px; bottom: 24px; transform: none; width: 400px; border: 1px solid var(--line-strong); border-radius: 20px; }
}
@media (max-width: 560px) {
  .intro:not(.intro-lite) .intro-sheet { padding: 13px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .intro:not(.intro-lite) .intro-text-compact { -webkit-line-clamp: 2; }
  .intro:not(.intro-lite) .intro-buttons { margin-top: 10px; }
}

/* Экраны «как пользоваться»: птица гаснет на фоне, сверху иллюстрация экрана. */
.intro-view { transition: opacity .4s; }
.intro.touring .intro-view, .touring .intro-view { opacity: .22; }
.intro-ui { position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(calc(100% - 32px), 420px); pointer-events: none; }
.intro-ui:empty { display: none; }
.intro-ui .card { display: flex; flex-direction: column; gap: 10px; animation: rise .35s ease-out; }
.intro-ui .chip { align-self: flex-start; }
.intro.intro-lite { overflow-y: auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.intro-lite .intro-top { position: static; flex-wrap: wrap; }
.intro-lite .intro-view { position: static; touch-action: auto; opacity: 1; }
.intro-lite .intro-fail { width: min(100%, 560px); margin: 14px auto 0; padding: 0 18px; text-align: left; font-size: 14px; }
.intro-lite .intro-sheet, .intro-lite .intro-ui { position: static; transform: none; width: min(100%, 560px); max-height: none; margin: 0 auto; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.intro-lite .intro-ui { padding: 14px 18px 0; }
.intro-lite .intro-ui .card { animation: none; }
.intro-lite .intro-text { font-size: 18px; line-height: 1.55; }
@media (max-width: 360px) { .intro-dots { display: none; } .intro-skip { margin-left: auto; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.term-svg { width: 100%; height: auto; display: block; }

/* ---------- Справочник ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg button { padding: 10px 8px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--dim); }
.seg button span { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-left: 4px; }
.seg button.on { background: var(--raise); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg button.on span { color: var(--power); }
#ref-body { display: flex; flex-direction: column; gap: 22px; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dev { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 124px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; transition: border-color .15s, transform .1s; }
.dev:active { transform: scale(.98); }
.dev:hover { border-color: var(--line-strong); }
.dev-ic { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(87, 199, 255, .1); color: var(--sense); margin-bottom: 8px; }
.dev-ic svg { width: 22px; height: 22px; }
.dev-ic i { position: absolute; right: -10px; top: -6px; font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: var(--power); color: var(--ink); }
.dev-t { display: block; font-weight: 650; font-size: 15px; line-height: 1.2; }
.dev-s { display: block; font-size: 13px; color: var(--dim); line-height: 1.3; margin-top: 2px; }
.th { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; }
.soon { padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.soon p { margin: 6px 0 0; color: var(--faint); font-size: 14px; line-height: 1.5; }

/* ---------- 3D-модель устройства ---------- */
.d3-stage { position: relative; height: min(82vw, 380px); margin: 0 -6px; border-radius: 12px; background: radial-gradient(120% 90% at 50% 35%, #1a1f2b 0%, #0d0f14 70%); touch-action: none; overflow: hidden; }
.d3-stage canvas { display: block; width: 100%; height: 100%; }
.pins-dev { grid-template-columns: repeat(3, 1fr); }
.pins-stage { height: min(88vw, 400px); }
.pins-wires { display: flex; flex-wrap: wrap; gap: 6px; }
.pins-wires button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 13px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--fg); }
.pins-wires button i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); flex: none; }
.pins-wires button.on { border-color: var(--power); background: rgba(212, 255, 58, .12); }
.pins-wires button.ok { color: var(--dim); border-color: rgba(95, 211, 162, .45); }
.pins-wires button b { font-family: var(--mono); font-size: 12px; color: var(--done); }
.d3-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.d3-views { display: flex; gap: 6px; }
.d3-views button { flex: 1; padding: 9px 6px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--dim); }
.d3-views button.on { color: var(--fg); border-color: var(--power); }
.d3-tip { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 210, 63, .06); border: 1px solid rgba(255, 210, 63, .25); min-height: 70px; }
.d3-tip b { color: var(--power); font-size: 15px; }
.d3-tip span { font-size: 14.5px; line-height: 1.45; }
.d3-tip .btn { align-self: flex-start; margin-top: 6px; }
.d3-list summary { cursor: pointer; font-weight: 600; font-size: 14.5px; padding: 4px 0; color: var(--dim); }
.d3-list div { display: flex; flex-direction: column; margin-top: 6px; }
.d3-list button { text-align: left; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
@keyframes blink { 50% { opacity: 0.25; } }
.ohm input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--power); flex: none; }

/* Статус «ждёт наставника»: нейтральный, не тревожный */
.chip.wait { color: var(--dim); border-style: dashed; border-color: rgba(245, 244, 240, 0.35); }
.kind svg { display: block; }
/* Поиск прячет остальное */
.app.searching .hide-search { display: none; }
/* Шаги с отметкой */
.step .btn.small[disabled] { opacity: 0.45; }
.gate { border: 1px solid rgba(255, 107, 44, 0.45); background: rgba(255, 107, 44, 0.06); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gate-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gate-opts .opt { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
/* Режим у стола */
.bench { position: fixed; inset: 0; z-index: 30; background: var(--ink); display: flex; flex-direction: column; gap: 18px; overflow: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.bench-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bench-x { width: 48px; height: 48px; border-radius: 14px; background: var(--raise); font-size: 20px; flex: none; }
.bench-prog { height: 6px; background: var(--raise); border-radius: 3px; overflow: hidden; }
.bench-prog b { display: block; height: 100%; background: var(--done); transition: width .3s; }
.bench-n { font-family: var(--mono); color: var(--dim); font-size: 14px; }
.bench-txt { font-size: 24px; line-height: 1.38; flex: 1; }
.bench-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.bench-nav.one { grid-template-columns: 1fr; }
.bench-nav .btn { min-height: 64px; font-size: 18px; }
.rubric { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.rubric input { width: 20px; height: 20px; accent-color: var(--done); flex: none; margin-top: 1px; }
.gate .opt.right { border-color: var(--done); background: rgba(95, 211, 162, 0.1); }

/* Неактивная кнопка заметно бледнее: старший смены видит, что сначала нужна рубрика. */
.btn:disabled { opacity: .4; cursor: not-allowed; }
