/* Slothicus HUD — минимализм.

   Почти чёрный фон, текст и тонкие линии. Никаких подложек, теней,
   градиентов и стекла: блоки разделяются воздухом и волосяными линиями.
   Один акцент (лаванда) — только у активного и главного. Всё живое
   движение — в 3D-чертежах (scene.js) и коротких проявлениях текста. */

:root {
  --bg: #08090c;
  --bg-float: #111217;
  --surface: rgba(255, 255, 255, .03);
  --surface-2: rgba(255, 255, 255, .05);
  --surface-3: rgba(255, 255, 255, .08);
  --field: rgba(255, 255, 255, .025);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .11);
  --line-3: rgba(255, 255, 255, .18);

  --text: #e9eaee;
  --text-2: #9b9ea9;
  --text-3: #676a75;

  --acc: #aaa3ff;
  --acc-strong: #bdb7ff;
  --acc-ink: #121025;
  --acc-soft: rgba(170, 163, 255, .1);
  --acc-line: rgba(170, 163, 255, .38);

  --ok: #56c596;
  --ok-soft: rgba(86, 197, 150, .1);
  --bad: #ec6a6f;
  --bad-soft: rgba(236, 106, 111, .1);
  --wait: #d9b15f;
  --wait-soft: rgba(217, 177, 95, .1);

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 16px 40px -16px rgba(0, 0, 0, .85);
  --side-w: 228px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); color-scheme: dark; }
body { min-height: 100dvh; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); letter-spacing: -.003em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-app { overflow: hidden; }
html.lp-snap { scroll-snap-type: y proximity; }
[hidden] { display: none !important; }
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-strong); }
button, input, textarea, select { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
.spacer, .grow { flex: 1; }
.only-mobile { display: none !important; }
.mark { flex: none; color: var(--text); }

/* ================= Элементы ================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 0 12px;
  border-radius: var(--r); white-space: nowrap; cursor: pointer; text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 1.1; color: var(--text);
  background: transparent; border: 1px solid var(--line-2); transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); color: #fff; }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { min-height: 42px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--acc); border-color: transparent; color: var(--acc-ink); font-weight: 600; }
.btn-primary:hover { background: var(--acc-strong); border-color: transparent; color: var(--acc-ink); }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: transparent; border-color: transparent; color: var(--text); }
.expand { align-self: flex-start; min-height: 0; padding: 0; border: 0; background: none; font-size: 12.5px; color: var(--text-3); }
.expand:hover { background: none; color: var(--text); }

.icon-btn { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--r); cursor: pointer; background: transparent; color: var(--text-3); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line-2); }
.pulse { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

input[type="text"], input[type="search"], input[type="number"], textarea, select {
  height: 34px; padding: 0 11px; border-radius: var(--r); outline: none; font-size: 13.5px; color: var(--text);
  background: var(--field); border: 1px solid var(--line-2); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 11px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, textarea:hover, select:hover { border-color: var(--line-3); }
input:focus, textarea:focus, select:focus { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }
select { cursor: pointer; }
select option { background: var(--bg-float); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 500; color: var(--text-2); border: 1px solid var(--line-2); }
.badge:empty { display: none; }
.badge-override { color: var(--acc); border-color: var(--acc-line); }
.hint { margin-bottom: 14px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }
.warn { color: var(--wait); }
.ok { color: var(--ok); }

.rv { opacity: 0; transform: translateY(8px); }
.rv.in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ================= Главная ================= */

.landing { position: relative; }
.lp-canvas { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; pointer-events: none; }

.lp-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 64px; padding: 0 max(24px, 5vw);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid transparent; transition: background .3s, border-color .3s;
}
.lp-nav.scrolled { background: rgba(8, 9, 12, .86); border-bottom-color: var(--line); }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.lp-brand:hover { color: #fff; }
.lp-signin { padding: 7px 14px; border-radius: var(--r); font-size: 13px; font-weight: 500; color: var(--text); border: 1px solid var(--line-2); transition: border-color .15s, background .15s; }
.lp-signin:hover { color: #fff; border-color: var(--line-3); background: var(--surface-2); }

/* Указатель разделов справа */
.lp-index { position: fixed; right: max(18px, 2.4vw); top: 50%; z-index: 20; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.lp-index button { display: flex; align-items: center; gap: 10px; padding: 3px 0; border: 0; background: none; cursor: pointer; color: var(--text-3); font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.lp-index span { opacity: 0; transform: translateX(6px); transition: opacity .25s var(--ease), transform .25s var(--ease), color .2s; }
.lp-index i { width: 14px; height: 1px; background: currentColor; transition: width .35s var(--ease), background .25s; }
.lp-index button:hover { color: var(--text-2); }
.lp-index button:hover span, .lp-index button.is-on span { opacity: 1; transform: none; }
.lp-index button.is-on { color: var(--text); }
.lp-index button.is-on i { width: 30px; background: var(--acc); }

.lp-sections { position: relative; z-index: 1; }
.lp-sec { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 96px max(24px, 8vw) 72px; scroll-snap-align: start; }
.lp-copy { max-width: 480px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.lp-js .lp-copy > * { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.lp-js .lp-sec.is-active .lp-copy > * { opacity: 1; transform: none; }
.lp-sec.is-active .lp-copy > :nth-child(2) { transition-delay: .06s; }
.lp-sec.is-active .lp-copy > :nth-child(3) { transition-delay: .12s; }
.lp-sec.is-active .lp-copy > :nth-child(4) { transition-delay: .18s; }
.lp-sec.is-active .lp-copy > :nth-child(5) { transition-delay: .24s; }
.lp-eyebrow { display: flex; gap: 12px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.lp-eyebrow b { font-weight: 500; color: var(--acc); }
.lp-title { font-size: clamp(38px, 4.9vw, 68px); font-weight: 600; line-height: 1.02; letter-spacing: -.045em; }
.lp-title span { color: var(--text-3); }
.lp-copy h2 { font-size: clamp(30px, 3.4vw, 48px); font-weight: 600; line-height: 1.06; letter-spacing: -.04em; }
.lp-copy > p:not(.lp-eyebrow):not(.lp-note) { font-size: clamp(14.5px, 1.1vw, 16px); line-height: 1.7; color: var(--text-2); }
.lp-lead { max-width: 440px; }
#lp0 .lp-copy { max-width: 620px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lp-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); transition: opacity .4s; }
.lp-cue::after { content: ""; display: block; width: 1px; height: 26px; margin: 10px auto 0; background: var(--text-3); transform-origin: top; animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.lp-cue.is-gone { opacity: 0; }
.lp-final { justify-content: center; align-items: flex-end; text-align: center; padding-bottom: 15vh; }
.lp-final .lp-copy { align-items: center; max-width: 520px; }
.lp-note { font-size: 12px; color: var(--text-3); }
.lp-foot { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font: 500 11px/1 var(--mono); color: var(--text-3); }

/* ================= Панель ================= */

.app { position: relative; height: 100dvh; display: grid; grid-template-columns: var(--side-w) 1fr; transition: grid-template-columns .3s var(--ease); }

/* Главное меню */
.side { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 14px 10px 12px; overflow-y: auto; overflow-x: hidden; background: var(--bg); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 6px; }
.brand-name { font-size: 13.5px; font-weight: 600; }
.brand-sub { display: none; }
.side-collapse { margin-left: auto; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group + .side-group { padding-top: 12px; border-top: 1px solid var(--line); }
.side-label { display: none; }

.profiles { display: flex; gap: 14px; padding: 0 8px; }
.profiles button { position: relative; padding: 4px 0; border: 0; cursor: pointer; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--text-3); transition: color .15s; }
.profiles button:hover { color: var(--text-2); }
.profiles button.is-active { color: var(--text); }
.profiles button.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--acc); }

.tabs { position: relative; display: flex; flex-direction: column; gap: 1px; }
.tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 8px; border: 0; border-radius: var(--r); cursor: pointer; text-align: left; text-decoration: none; white-space: nowrap; background: transparent; font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: color .12s, background .12s; }
.tab svg { flex: none; width: 16px; height: 16px; color: var(--text-3); transition: color .12s; }
.tab > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab.is-active { color: var(--text); }
.tab.is-active svg { color: var(--acc); }
.tabs:not(.has-glider) .tab.is-active { background: var(--surface-2); }
.tab-glider { position: absolute; left: 0; right: 0; top: 0; z-index: 0; border-radius: var(--r); pointer-events: none; background: var(--surface-2); transition: transform .3s var(--ease), height .3s var(--ease), opacity .2s; }
.tab-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 9px; font: 500 10.5px/1 var(--mono); color: var(--wait); background: var(--wait-soft); }
.tab-key { margin-left: auto; opacity: 0; transition: opacity .15s; }
.tab:hover .tab-key { opacity: 1; }
.tab-badge:not([hidden]) + .tab-key { display: none; }
.tab-arrow { margin-left: auto; font-size: 12px; color: var(--text-3); }
.tab-roles svg { color: var(--acc); }
.tab-new { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; font-size: 0; background: var(--acc); }

.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.avatar-ring { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: var(--text); background: var(--surface-3); }
.side-user { min-width: 0; }
.user { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* Свёрнутое меню */
.app.side-mini { --side-w: 60px; }
.app.side-mini .side-brand > div, .app.side-mini .profiles, .app.side-mini .tab > span, .app.side-mini .tab-key,
.app.side-mini .side-user, .app.side-mini .side-foot .spacer { display: none; }
.app.side-mini .side-brand { flex-direction: column; gap: 10px; padding: 0; }
.app.side-mini .side-collapse { margin: 0; transform: scaleX(-1); }
.app.side-mini .tab { justify-content: center; padding: 8px; }
.app.side-mini .tab .tab-badge:not([hidden]) { position: absolute; top: 4px; right: 4px; display: block; width: 6px; min-width: 6px; height: 6px; padding: 0; font-size: 0; background: var(--wait); }
.app.side-mini .tab-new { position: absolute; top: 6px; right: 8px; display: block; }
.app.side-mini .side-foot { flex-direction: column; padding-inline: 0; }

/* Верхняя строка: заголовок появляется, когда шапка раздела уехала */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { position: relative; z-index: 5; min-height: 52px; padding: 0 32px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid transparent; transition: border-color .25s; }
.topbar.is-condensed { border-bottom-color: var(--line); }
.page-head { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.page-title { font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity .25s var(--ease), transform .3s var(--ease); }
.topbar.is-condensed .page-title { opacity: 1; transform: none; }
.page-sub { display: none; }
.cmdk-trigger { flex: none; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 10px; white-space: nowrap; border-radius: var(--r); cursor: pointer; font-size: 12.5px; color: var(--text-3); background: transparent; border: 1px solid var(--line-2); transition: border-color .15s, color .15s; }
.cmdk-trigger:hover { color: var(--text-2); border-color: var(--line-3); }
.cmdk-trigger span { margin-right: 20px; }
.scroll-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; }
.scroll-bar i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--acc); opacity: .5; }

.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 32px 72px; }

/* Шапка раздела с чертежом */
.page-hero { position: relative; max-width: 1080px; min-height: 260px; margin: 0 auto; padding: 24px 0 30px; display: flex; align-items: flex-end; }
.page-hero-copy { position: relative; z-index: 1; max-width: 54%; display: flex; flex-direction: column; gap: 8px; }
.page-hero-title { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -.035em; }
.page-hero-sub { max-width: 460px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.page-hero-title.swap, .page-hero-sub.swap { animation: fadeUp .5s var(--ease); }
.panel-scene {
  position: absolute; right: -32px; top: 0; width: min(52%, 560px); height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 78%, transparent);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 78%, transparent);
}

.view { display: none; }
.view.is-active { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 1080px; margin: 0 auto; animation: fadeUp .35s var(--ease); }

/* Статистика — строка чисел */
.stats { display: flex; flex-wrap: wrap; gap: 10px 44px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.stats:empty { display: none; }
.stat { min-width: 90px; }
.stat-v { font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-k { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.stat.ok .stat-k::before, .stat.bad .stat-k::before, .stat.wait .stat-k::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stat.ok .stat-k { color: var(--ok); }
.stat.bad .stat-k { color: var(--bad); }
.stat.wait .stat-k { color: var(--wait); }

/* Поиск и фильтры */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar.sticky { position: sticky; top: 0; z-index: 4; margin: -8px 0; padding: 8px 0; background: var(--bg); }
.search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.search input[type] { width: 100%; padding-left: 32px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.seg button { padding: 5px 10px; border: 0; border-radius: var(--r); cursor: pointer; background: transparent; font-size: 12.5px; font-weight: 500; color: var(--text-3); transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.is-active { color: var(--text); background: var(--surface-2); }

/* Блоки: без коробок, только воздух и линии */
.panel { position: relative; }
.view > .panel + .panel { padding-top: 22px; border-top: 1px solid var(--line); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.panel-title svg { color: var(--text-3); }

/* Лента: строки через тонкую линию */
.feed { display: flex; flex-direction: column; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.card-head, .card-top, .card-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-top { justify-content: space-between; }
.card-num { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); color: var(--text-2); }
.card-num::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.card.v-correct .card-num::before { background: var(--ok); }
.card.v-incorrect .card-num::before { background: var(--bad); }
.card.v-pending .card-num::before { background: var(--wait); }
.card-meta { font-size: 12px; color: var(--text-3); }
.card-meta a { color: var(--text-2); }
.card-meta a:hover { color: var(--acc); }
.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.card-q { font-size: 14.5px; font-weight: 500; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.card-a { font-size: 13.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-block { padding-left: 14px; border-left: 1px solid var(--line-2); }
.card-block h4, .builtin h4 { margin-bottom: 8px; font-size: 11.5px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.reasoning { font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; color: var(--text-2); }
.sources { display: flex; flex-wrap: wrap; gap: 5px; }
.source { padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; color: var(--text-2); border: 1px solid var(--line-2); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vote.is-mine[data-vote="approve"] { color: var(--ok); border-color: rgba(86, 197, 150, .4); background: var(--ok-soft); }
.vote.is-mine[data-vote="reject"] { color: var(--bad); border-color: rgba(236, 106, 111, .4); background: var(--bad-soft); }
.case-link { font-size: 13px; }
.case-card > .btn { align-self: flex-start; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px 0; }
.pages-info { font: 500 12px/1 var(--mono); color: var(--text-3); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.skel { display: flex; flex-direction: column; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.skel span { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--surface), var(--surface-3), var(--surface)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.errors { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--r); font-size: 13px; color: #f3b9bc; background: var(--bad-soft); border: 1px solid rgba(236, 106, 111, .3); }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

/* Промпт */
.prompt-layout { display: grid; grid-template-columns: 1fr 240px; gap: 22px; }
.editor { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--field); border: 1px solid var(--line-2); transition: border-color .15s; }
.editor:focus-within { border-color: var(--acc-line); }
.editor textarea { min-height: 62vh; padding: 16px 18px; border: 0; border-radius: 0; background: transparent; box-shadow: none !important; font: 12.5px/1.75 var(--mono); color: var(--text); }
.editor-foot { padding: 7px 12px; text-align: right; font: 11.5px/1 var(--mono); color: var(--text-3); border-top: 1px solid var(--line); }
.history { display: flex; flex-direction: column; gap: 2px; max-height: 66vh; overflow-y: auto; }
.history h3 { margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.hver { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hver time { font: 500 12px/1.3 var(--mono); color: var(--text); }
.hver span { font-size: 11.5px; color: var(--text-3); }
.hver button { align-self: flex-start; margin-top: 3px; padding: 0; border: 0; cursor: pointer; background: none; font-size: 12px; color: var(--acc); }
.hver button:hover { color: var(--acc-strong); }

/* Документы */
.collection-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.collection-hero h2 { font-size: 16px; }
.collection-hero p { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.collection-user { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12px; color: var(--text-3); }
.collection-user span:last-child { color: var(--text-2); }
.collection-zoom { display: inline-flex; align-items: center; gap: 2px; }
.collection-zoom button { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; background: transparent; font-size: 15px; color: var(--text-2); }
.collection-zoom button:hover { color: var(--text); border-color: var(--line-3); }
.collection-zoom span { min-width: 44px; text-align: center; font: 11.5px/1 var(--mono); color: var(--text-3); }
.doc-tree { font-size: 1rem; }
.doc-root { display: flex; flex-direction: column; gap: 6px; }
.doc-node { --k: var(--text-3); display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; text-align: left; font-size: .86em; color: var(--text); background: transparent; transition: color .15s, padding .2s var(--ease); }
.doc-node:hover { color: #fff; padding-left: 8px; }
.doc-node i { flex: none; font: normal 11px/1 var(--mono); color: var(--text-3); }
.doc-node-blue, .doc-branch-blue .doc-node { --k: #8ea2ff; }
.doc-node-green, .doc-branch-green .doc-node { --k: var(--ok); }
.doc-node-brown, .doc-branch-brown .doc-node { --k: var(--wait); }
.doc-node-violet, .doc-branch-violet .doc-node { --k: var(--acc); }
.doc-node.is-root { display: none; }
.doc-node.is-parent { justify-content: flex-start; gap: 8px; margin-top: 16px; padding: 2px; cursor: default; border: 0; font-size: .74em; font-weight: 500; letter-spacing: .05em; color: var(--text-3); }
.doc-node.is-parent::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--k); }
.doc-node.is-parent:hover { padding-left: 2px; color: var(--text-3); }
.doc-branch { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 28px; }
.doc-viewer { position: fixed !important; z-index: 80; inset: 6vh max(16px, 10vw); display: flex; flex-direction: column; padding: 18px; border-radius: var(--r-lg); background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .65), var(--shadow); animation: fadeUp .25s var(--ease); }
.doc-text { flex: 1; margin: 0; padding: 16px; overflow: auto; border-radius: var(--r); white-space: pre-wrap; word-break: break-word; font: 12.5px/1.75 var(--mono); color: var(--text-2); background: var(--field); border: 1px solid var(--line); }
.cases-progress pre { max-height: 200px; margin: 0; padding: 10px; overflow: auto; border-radius: var(--r); font-size: 12px; white-space: pre-wrap; color: var(--text-2); background: var(--field); }

/* Правила */
.probe-row { display: flex; gap: 8px; }
.probe-row input { flex: 1; }
.probe-out { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.probe-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.probe-line .k { color: var(--text-3); }
#customRules, #builtinRules { display: flex; flex-direction: column; }
.rule { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rule.is-disabled { opacity: .45; }
.rule-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rule-kind { font: 500 11px/1 var(--mono); color: var(--text-2); }
.rule-kind::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; vertical-align: middle; background: var(--text-3); }
.rule-kind.syn::before { background: var(--acc); }
.rule-kind.guard::before { background: var(--wait); }
.rule pre { margin: 0; padding: 8px 10px; border-radius: var(--r); font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--text-2); background: var(--field); }
.rule-field { display: flex; flex-direction: column; gap: 5px; }
.rule-field label { font-size: 12px; color: var(--text-3); }
.rule-field input, .rule-field textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; }
.builtin summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.builtin summary::-webkit-details-marker { display: none; }
.builtin summary::before { content: "›"; display: inline-grid; place-items: center; width: 16px; color: var(--text-3); transition: transform .25s var(--ease); }
.builtin[open] summary::before { transform: rotate(90deg); }
.builtin summary code { font-size: 12px; color: var(--text-3); }
.builtin[open] summary { margin-bottom: 12px; }
.builtin h4 { margin-top: 12px; }

/* Тосты */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { position: relative; max-width: 360px; padding: 10px 14px 10px 28px; pointer-events: auto; border-radius: var(--r-lg); font-size: 13px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: fadeUp .25s var(--ease); }
.toast::before { content: ""; position: absolute; left: 12px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.toast.err::before { background: var(--bad); }
.toast.leaving { animation: fadeOut .2s var(--ease) forwards; }

/* Палитра команд */
.cmdk { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding-top: 14vh; background: rgba(0, 0, 0, .6); animation: fadeIn .15s var(--ease); }
.cmdk.leaving { animation: fadeOut .15s var(--ease) forwards; }
.cmdk-box { width: min(560px, calc(100% - 32px)); overflow: hidden; border-radius: 14px; background: var(--bg-float); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: fadeUp .2s var(--ease); }
.cmdk.leaving .cmdk-box { animation: none; }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 15px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.cmdk-input { flex: 1; height: auto !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 14.5px !important; }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 5px; }
.cmdk-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r); cursor: pointer; text-align: left; background: transparent; font-size: 13.5px; color: var(--text-2); }
.cmdk-item.is-sel { color: var(--text); background: var(--surface-3); }
.cmdk-ic { display: grid; place-items: center; flex: none; width: 24px; height: 24px; color: var(--text-3); }
.cmdk-ic svg { width: 15px; height: 15px; }
.cmdk-item.is-sel .cmdk-ic { color: var(--acc); }
.cmdk-label { flex: 1; }
.cmdk-hint { font-size: 11.5px; color: var(--text-3); }
.cmdk-empty { padding: 28px; text-align: center; color: var(--text-3); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--line); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }

.side-scrim { display: none; }

/* ================= Адаптив ================= */

@media (max-width: 1200px) {
  .prompt-layout { grid-template-columns: 1fr; }
  .history { max-height: none; }
}
@media (max-width: 900px) {
  .lp-index { display: none; }
  .lp-sec { align-items: flex-end; padding: 72px 22px 10vh; }
  .lp-copy { max-width: none; padding-top: 40px; background: linear-gradient(to bottom, transparent, var(--bg) 40px); }
  .lp-final .lp-copy { background: none; }
  .cmdk-trigger span, .cmdk-trigger kbd { display: none; }
  .cmdk-trigger { padding: 0 9px; }

  .app, .app.side-mini { grid-template-columns: 1fr; --side-w: 260px; }
  .only-mobile { display: inline-grid !important; }
  .side-collapse { display: none; }
  .side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(270px, 84vw); transform: translateX(-100%); transition: transform .3s var(--ease); }
  .app.side-open .side { transform: none; box-shadow: var(--shadow); }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .app.side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 14px; }
  .scroll { padding: 0 16px 60px; }
  .page-hero { min-height: 190px; }
  .page-hero-copy { max-width: 58%; }
  .panel-scene { right: -16px; width: 50%; }
  .doc-viewer { inset: 10px; }
}
@media (max-width: 560px) {
  .stats { gap: 10px 28px; }
  .toolbar .seg { width: 100%; }
  .page-hero { min-height: 170px; }
  .page-hero-copy { max-width: 62%; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .lp-js .lp-copy > * { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.no-webgl .lp-canvas, .no-webgl .panel-scene { display: none; }
