/* AI Studio — панель управления. Светлый стиль по образцу finam_bot: Inter, фон #f3f6f8, белые карточки, синий акцент, подсказки «?». */
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  --ink: #17212b; --muted: #72808b; --soft: #4a5a66; --line: #dfe7eb; --surface: #fff; --bg: #f3f6f8;
  --blue: #146ef5; --blue-soft: #edf5ff; --blue-line: #bed7ff;
  --green: #0da46b; --green-soft: #e9faf3;
  --red: #d84c50; --red-soft: #fff0f0;
  --orange: #c97a16; --orange-soft: #fff8e5;
  --violet: #7651c9;
  --radius: 14px; --radius-s: 10px;
  --shadow: 0 12px 34px #17212b08;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(circle at 85% -10%, #d9e9ff 0, transparent 36%), var(--bg);
  font-size: 15px; line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #9fc2f5; outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #ffffffcc; backdrop-filter: blur(8px); border-right: 1px solid var(--line); padding: 20px 14px 16px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 22px; }
.brand-mark { display: block; width: 38px; height: 38px; border-radius: 11px; object-fit: contain; flex: none; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.02em; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 2px; }
.nav a, .nav-foot a, .nav-foot button {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--soft); text-decoration: none; font-weight: 600; font-size: 14px; border: 0; background: none; width: 100%; text-align: left;
}
.nav a:hover, .nav-foot a:hover, .nav-foot button:hover { background: #eff4f7; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.nav svg, .nav-foot svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav a[aria-current="page"] .count { color: var(--blue); }
.nav-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.nav-foot .who { padding: 4px 12px 8px; font-size: 13px; color: var(--muted); }
.nav-foot .who b { color: var(--ink); }

.main { min-width: 0; padding: 0 32px 64px; max-width: 1360px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0; place-items: center; }
.menu-toggle svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; }
.top-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-left: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: #c5ced4; } .dot.warn { background: var(--orange); } .dot.bad { background: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--soft); }

.page-head { padding: 22px 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.025em; margin: 0; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 66ch; }

/* ---------- кнопки и бейджи ---------- */
.button { border: 0; border-radius: 10px; padding: 8px 15px; font-weight: 650; font-size: 13.5px; cursor: pointer; transition: transform .16s, box-shadow .16s, background .16s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px #17212b12; }
.button-primary { background: var(--blue); color: #fff; }
.button-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue-line); }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button-danger { background: var(--red-soft); color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #eff4f7; color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--orange-soft); color: var(--orange); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--blue); }

/* ---------- подсказка «?» ---------- */
.q {
  display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; margin-left: 2px; padding: 0;
  border: 1px solid #cdd8de; border-radius: 50%; background: #fff; color: var(--muted);
  font-size: 11px; font-weight: 800; line-height: 1; vertical-align: middle; position: relative; top: -1px;
}
.q:hover, .q[aria-expanded="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.tip {
  position: fixed; z-index: 50; max-width: 360px; padding: 12px 14px; white-space: pre-line; max-height: 80vh; overflow: hidden; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 13px; line-height: 1.5; font-weight: 500; box-shadow: 0 16px 40px #17212b33; pointer-events: none;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.show { opacity: 1; transform: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip span { display: block; margin-top: 6px; color: #b9c8d4; }

/* ---------- метрики (полоса из 1px-линий, как в finam_bot) ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.metrics > div { background: var(--surface); padding: 18px 20px; min-width: 0; }
.metrics .k { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.metrics strong { font-size: 22px; letter-spacing: -.03em; }
.metrics small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 20px 22px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; margin-bottom: 22px; }
.stack { display: grid; gap: 22px; align-content: start; }

/* ---------- видеокарта ---------- */
.vram { margin: 4px 0 6px; }
.vram-bar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: #eaf0f3; }
.vram-seg { min-width: 3px; transition: flex-basis .5s; }
.vram-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--soft); }
.vram-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.vram-nums { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.vram-nums strong { font-size: 28px; letter-spacing: -.03em; }
.vram-nums span { color: var(--muted); font-size: 13px; }

.mode { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.mode-tile { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px; display: grid; gap: 3px; align-content: start; transition: border-color .16s, background .16s; }
.mode-tile.on { border-color: var(--blue); background: var(--blue-soft); }
.mode-tile b { font-size: 15px; display: flex; align-items: center; gap: 4px; }
.mode-tile small { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-bottom: 10px; }
.mode-tile .button { justify-self: start; padding: 8px 13px; font-size: 13px; }
.note { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #f4f7fa; color: var(--soft); font-size: 13px; }
.note.warn { background: var(--orange-soft); color: #936b00; }
.note.bad { background: var(--red-soft); color: #b33138; }

/* ---------- обучение ---------- */
.train-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; margin-top: 12px; font-size: 14px; }
.train-row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: #eaf0f3; appearance: none; }
progress::-webkit-progress-bar { background: #eaf0f3; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--blue); }

/* ---------- цепочка производства ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); counter-reset: step; }
.pipeline li { position: relative; padding: 16px 14px 16px 0; counter-increment: step; }
.pipeline li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 12px; position: relative; z-index: 1; }
.pipeline li::after { content: ""; position: absolute; top: 29px; left: 26px; right: 0; height: 2px; background: var(--line); }
.pipeline li:last-child::after { display: none; }
.pipeline b { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.pipeline small { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12.5px; }

/* ---------- каталог сервисов ---------- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.service { display: flex; flex-direction: column; padding: 18px 20px; gap: 10px; }
.service-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.service h3 { margin: 0; font-size: 16.5px; letter-spacing: -.02em; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.service p { margin: 0; color: var(--soft); font-size: 14px; }
.service .use { color: var(--muted); font-size: 13px; }
.service-foot { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.service-foot .button { padding: 8px 13px; font-size: 13px; }
.service.is-off { background: #fafbfc; }
.service.is-off h3 { color: var(--soft); }
.section-title { display: flex; align-items: center; gap: 6px; margin: 34px 0 14px; font-size: 19px; letter-spacing: -.02em; }
.section-title small { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; }

.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cat-card { display: block; padding: 18px 20px; text-decoration: none; color: inherit; transition: border-color .16s, transform .16s; }
.cat-card:hover { border-color: var(--blue-line); transform: translateY(-1px); }
.cat-card h3 { margin: 10px 0 4px; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.cat-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.cat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); }
.cat-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cat-meta { margin-top: 12px; display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }

.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--orange-soft); font-size: 14px; }
.attention-list li span { color: var(--soft); font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; display: flex; align-items: center; gap: 10px; }

/* ---------- Strata чат ---------- */
.chat { display: grid; gap: 12px; }
.chat-log { max-height: 340px; overflow: auto; display: grid; gap: 10px; align-content: start; }
.msg { padding: 10px 13px; border-radius: 12px; background: #f4f7fa; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { background: var(--blue-soft); justify-self: end; max-width: 85%; }
.msg b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.chat form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
textarea, input[type=text], input[type=password] { width: 100%; border: 1px solid #cbd7df; border-radius: 10px; padding: 11px 14px; background: #fff; resize: vertical; }
textarea:focus, input:focus { border-color: var(--blue); outline: 3px solid #cfe2fd; outline-offset: 0; }

/* ---------- прочее ---------- */
.cmd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #f2f5f8; font-size: 13px; overflow-wrap: anywhere; }
.cmd code { flex: 1; user-select: all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row b { display: flex; align-items: center; gap: 4px; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; max-width: 52ch; }

dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 24px 80px rgba(20, 45, 70, .28); }
dialog::backdrop { background: rgba(12, 29, 48, .52); backdrop-filter: blur(4px); }
dialog form { padding: 28px 28px 24px; display: grid; gap: 14px; }
dialog h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
dialog p { margin: 0; color: var(--soft); font-size: 14px; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 360px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 16px 40px #17212b33; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth form { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; gap: 14px; box-shadow: 0 24px 80px rgba(20, 45, 70, .12); }
.auth h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -.03em; }
.auth label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.auth .err { color: var(--red); font-size: 13px; min-height: 18px; }

.skeleton { color: var(--muted); padding: 40px 0; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .pipeline li:nth-child(4)::after { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-102%); transition: transform .2s; background: #fff; box-shadow: 0 0 60px #17212b33; }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: grid; }
  .main { padding: 0 16px 48px; }
  .page-head h1 { font-size: 20px; }
  .mode { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline li::after { display: none; }
}
@media (max-width: 520px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div { padding: 14px; }
  .service-grid, .cat-cards { grid-template-columns: 1fr; }
  .chat form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ======================= кабинет: проекты, сцены, очередь, ассистент, бренд-книги ======================= */
.nav-group { margin: 16px 12px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav-group:first-child { margin-top: 4px; }
.banner { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); border: 1px solid var(--blue-line); color: #0b3d86; font-size: 14px; }
.banner p { margin: 0; } .banner p + p { margin-top: 4px; color: #2a548f; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 3px 9px; border-radius: 999px; background: #eff4f7; color: var(--soft); font-size: 12px; font-weight: 600; }
.row.left { justify-content: flex-start; } .row.wrap { flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; }
.crumbs { padding-top: 22px; font-size: 13px; } .crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--blue); }
.crumbs + .page-head { padding-top: 10px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.project-card { display: block; padding: 18px 20px; color: inherit; text-decoration: none; transition: border-color .16s, transform .16s; }
.project-card:hover { border-color: var(--blue-line); transform: translateY(-1px); }
.project-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-card h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.project-card .idea { margin: 12px 0; color: var(--soft); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.steps-mini { display: flex; gap: 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.empty-state { padding: 36px 28px; max-width: 640px; }
.empty-state h3 { margin: 0 0 8px; font-size: 20px; } .empty-state p { color: var(--soft); margin: 0 0 18px; }

dialog.wide { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
dialog form legend { font-size: 13px; font-weight: 600; color: var(--soft); padding: 0; margin-bottom: 8px; }
dialog form fieldset { border: 0; margin: 0; padding: 0; }
select { width: 100%; border: 1px solid #cbd7df; border-radius: 10px; padding: 10px 12px; background: #fff; }
select:focus { border-color: var(--blue); outline: 3px solid #cfe2fd; outline-offset: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.formats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.formats legend { grid-column: 1/-1; }
.fmt { position: relative; } .fmt input { position: absolute; opacity: 0; }
.fmt span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.fmt small { color: var(--muted); font-weight: 500; }
.fmt input:checked + span { border-color: var(--blue); background: var(--blue-soft); }
.fmt input:focus-visible + span { outline: 3px solid #9fc2f5; }
.mic.recording { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.mic { justify-self: start; }
.mic svg, .button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; counter-reset: s; }
.steps li { background: #fff; padding: 14px 16px; counter-increment: s; }
.steps li b { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.steps li b::before { content: counter(s); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; margin-right: 6px; }
.steps li small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.idea-card, .settings, .plan-card { padding: 18px 22px; margin-bottom: 22px; }
.idea-card h2, .plan-card h2, .final h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 4px; }
.idea-card h3 { margin: 14px 0 4px; font-size: 14px; color: var(--soft); } .idea-card p, .plan-card p { margin: 0; color: var(--soft); }
.settings label, .assistant label.inline, .scene label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.plan-card .row { margin-top: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.toolbar h2 { margin: 0; font-size: 19px; } .toolbar h2 small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.scenes { display: grid; gap: 16px; }
.scene { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; padding: 18px; }
.scene-media { display: grid; gap: 8px; align-content: start; }
.scene-media img, .scene-media video, .scene-media .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #eaf0f3; }
.scene-media.portrait img, .scene-media.portrait video, .scene-media.portrait .ph { aspect-ratio: 9 / 16; max-height: 420px; object-fit: contain; }
.scene-media.square img, .scene-media.square video, .scene-media.square .ph { aspect-ratio: 1; }
.scene-media .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.scene-media audio { width: 100%; height: 36px; }
.scene-body { display: grid; gap: 12px; min-width: 0; }
.scene-head { display: flex; align-items: center; gap: 10px; }
.scene-head .num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.scene-head input[type=text] { font-weight: 700; }
.scene-head .check { display: flex; align-items: center; gap: 6px; white-space: nowrap; margin-left: auto; font-weight: 600; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--red); border-color: var(--red); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scene-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.scene-actions .button { padding: 9px 13px; font-size: 13px; }
.scene-actions .dur { display: flex; align-items: center; gap: 6px; }
.scene-actions .dur select { width: 64px; padding: 8px; }
.jobline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); flex-wrap: wrap; }
.final { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 20px 24px; margin-top: 22px; align-items: start; }
.final-video { width: min(480px, 100%); border-radius: 12px; background: #000; display: block; margin-bottom: 10px; }
.final-video.portrait { width: 240px; }

.grid-2.even { grid-template-columns: 1fr 1fr; }
.lane { padding: 18px 22px; } .lane h3 { margin: 0 0 8px; font-size: 17px; display: flex; align-items: center; gap: 4px; }
.lane .state { margin: 0 0 12px; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; } .kv span { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 18px; border-bottom: 1px solid #eef2f4; vertical-align: top; } tbody tr:last-child td { border-bottom: 0; }
td.empty { text-align: center; padding: 24px; }

.assistant { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.roles { padding: 14px; display: grid; gap: 6px; }
.roles h3 { margin: 4px 8px 6px; font-size: 15px; }
.role { text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.role:hover { background: #f4f7fa; } .role.on { background: var(--blue-soft); border-color: var(--blue-line); }
.role small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.chatbox .card-head { align-items: flex-start; flex-wrap: wrap; }
.chat-log.tall { max-height: 52vh; min-height: 260px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }
.msg { position: relative; } .msg b small { font-weight: 500; margin-left: 6px; color: var(--muted); }
.msg .copy { display: block; margin-top: 8px; border: 0; background: none; color: var(--blue); font-size: 12.5px; padding: 0; font-weight: 600; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; } label.inline select { width: auto; padding: 7px 10px; }
.doclist { display: grid; gap: 10px; margin-bottom: 18px; }
.doc { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.doc small { color: var(--muted); margin-left: 8px; } .doc p { margin: 6px 0 0; color: var(--soft); font-size: 13.5px; white-space: pre-wrap; }
.doc-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; } .doc-form h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 4px; }
label.file { cursor: pointer; }

@media (max-width: 1100px) { .scene { grid-template-columns: 220px minmax(0, 1fr); } .assistant { grid-template-columns: 220px minmax(0, 1fr); } .grid-2.even { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .scene { grid-template-columns: 1fr; } .two, .form-row, .form-row.three { grid-template-columns: 1fr; } .steps { grid-template-columns: 1fr 1fr; }
  .assistant { grid-template-columns: 1fr; } .final { grid-template-columns: 1fr; } .scene-head .check { margin-left: 0; }
  .top-status .pill:not(:first-child) { display: none; }
}

/* подсказка «?» остаётся в строке подписи, поле уходит на следующую строку */
.settings label, .scene label:not(.check):not(.dur), dialog form label, .auth label { display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; row-gap: 6px; }
.settings label > :is(select, textarea, input), .scene label:not(.check):not(.dur) > :is(select, textarea, input), dialog form label > :is(select, textarea, input) { flex: 1 1 100%; }
.scene label.dur { display: flex; align-items: center; gap: 6px; } .scene label.check { display: flex; align-items: center; gap: 6px; }
.assistant label.inline, .chatbox label.inline { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px; }
.chatbox label.inline > select { flex: 0 0 auto; }
.package { padding: 18px 22px; margin-top: 22px; } .package .toolbar { margin-top: 0; }
.package details { border-top: 1px solid var(--line); padding: 10px 0; } .package summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.pf { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; padding: 8px 0; align-items: start; font-size: 14px; }
.pf span { color: var(--muted); font-size: 13px; } .pf p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf .copy { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 12.5px; padding: 0; }
.issues { margin: 10px 0 0; padding-left: 18px; font-size: 14px; } .issues em { color: var(--soft); font-style: normal; display: block; }
.muted { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .pf { grid-template-columns: 1fr; gap: 2px; } }

/* персонажи */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.char-card { display: block; color: inherit; text-decoration: none; overflow: hidden; transition: border-color .16s, transform .16s; }
.char-card:hover { border-color: var(--blue-line); transform: translateY(-1px); }
.char-pic img, .char-pic .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: #eaf0f3; color: var(--muted); }
.char-meta { padding: 14px 16px 16px; } .char-meta h3 { margin: 0 0 8px; font-size: 16px; }
.style-card { margin-top: 16px; padding: 14px 18px; } .style-card summary { cursor: pointer; font-weight: 700; }
.style-card textarea { margin: 12px 0; }
.char-detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.views { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.view { margin: 0; } .view img, .view .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #eaf0f3; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.view figcaption { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; font-size: 13px; font-weight: 600; }
.mini { border: 0; background: none; color: var(--blue); font-size: 12.5px; font-weight: 600; padding: 0; cursor: pointer; } .mini:disabled { opacity: .4; cursor: default; }
.sub { margin: 4px 0 10px; font-size: 14px; color: var(--soft); }
.passport { display: grid; gap: 12px; } .passport label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.outfits { display: grid; gap: 8px; } .outfits small { color: var(--muted); } .outfit { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
@media (max-width: 1100px) { .char-detail { grid-template-columns: 1fr; } }
.music { padding: 18px 22px; margin-top: 22px; } .music .toolbar { margin-top: 0; }
.music-form { display: grid; gap: 12px; } .music-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.tracks { display: grid; gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.track { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; } .track audio { height: 34px; max-width: 100%; }
.song-opt { display: block; } .song-opt span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.song-opt[hidden] { display: none; }
.autopilot { padding: 16px 22px; margin-bottom: 22px; } .autopilot .toolbar { margin: 0 0 10px; } .autopilot.attn { border-color: var(--orange); background: #fffdf6; }
.auto-steps { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0 0 12px; counter-reset: a; }
.auto-steps li { counter-increment: a; padding: 6px 12px; border-radius: 999px; background: #eff4f7; color: var(--muted); font-size: 13px; font-weight: 600; }
.auto-steps li::before { content: counter(a) ". "; } .auto-steps li.done { background: var(--green-soft); color: var(--green); } .auto-steps li.now { background: var(--blue-soft); color: var(--blue); }

/* ---------- проект-рабочая область ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; border-radius: 10px 10px 0 0; color: var(--soft); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.tab:hover { background: #fff8; color: var(--ink); }
.tab[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.tab-hint { margin: 12px 0 18px; color: var(--muted); font-size: 13px; max-width: 760px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--soft); padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip-btn.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.series-info p { margin: 0 0 8px; color: var(--soft); }
.table-wrap { overflow-x: auto; }
table.series { width: 100%; border-collapse: collapse; font-size: 14px; }
table.series th { text-align: left; padding: 10px 16px; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #fafcfd; }
table.series td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.series tr:last-child td { border-bottom: 0; }
.card + .card, .card + form.card { margin-top: 16px; }
.prompt { padding: 0; margin-bottom: 10px; }
.prompt summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.prompt summary::-webkit-details-marker { display: none; }
.prompt summary::before { content: "▸"; color: var(--muted); }
.prompt[open] summary::before { content: "▾"; }
.prompt > p, .prompt > textarea, .prompt > .row { margin-left: 18px; margin-right: 18px; }
.prompt > textarea { width: calc(100% - 36px); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.prompt > .row { padding-bottom: 16px; }
.trash-row, .model-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trash-row:last-child, .model-row:last-child { border-bottom: 0; }
.trash-row small, .model-row small { display: block; color: var(--muted); font-size: 12px; }
.model-row.top { align-items: flex-start; } .model-row p { margin: 6px 0 0; color: var(--soft); font-size: 13px; }
.add-model { margin-top: 14px; } .add-model summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.danger-zone { border-color: #f0c9ca; } .danger-zone h3 { margin: 0 0 6px; }
.checklist { margin: 4px 0 12px; font-size: 14px; } .checklist summary { cursor: pointer; font-weight: 600; } .checklist ul { margin: 8px 0 0; padding-left: 20px; color: var(--soft); }
.grid-2 > .card, .grid-2 > section.card { margin-top: 0; }

.net summary .muted { margin-left: auto; font-size: 12px; }
.net-steps { margin: 0 18px 12px 38px; padding: 0; color: var(--soft); font-size: 14px; } .net-steps li { margin: 6px 0; }
.net .cmd, .net > p, .net > .row { margin-left: 18px; margin-right: 18px; } .net > .row { padding-bottom: 16px; }
.card-body .net-steps { margin-left: 20px; }
.pill-link { text-decoration: none; color: var(--ink); border-color: #f0d9a8; background: #fffaf0; } .pill-link:hover { background: #fff3d6; }

/* ---------- процессор ---------- */
.cpu-map-title { margin-top: 22px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.cpu-map { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 10px; }
.cpu-group-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cpu-cores { display: flex; flex-wrap: wrap; gap: 6px; }
.cpu-core { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #f3f6f8; }
.cpu-thread { position: relative; width: 14px; height: 56px; background: #e6edf1; border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.cpu-thread span { position: absolute; left: 0; right: 0; top: 2px; text-align: center; font-size: 8px; color: #5a6a75; line-height: 1; pointer-events: none; }
.cpu-fill { width: 100%; border-radius: 4px; transition: height .4s; }
.cpu-fill.low { background: #0da46b; } .cpu-fill.mid { background: #e0a12c; } .cpu-fill.hot { background: #d84c50; }
.cpu-table td:nth-child(3) { width: 22%; } .mini-bar { height: 8px; background: #edf2f5; border-radius: 4px; overflow: hidden; } .mini-bar i { display: block; height: 100%; background: var(--blue); }
.cpu-procs { margin-top: 12px; } .cpu-procs summary { cursor: pointer; color: var(--blue); font-weight: 600; }

/* ---------- видеокарта и память ---------- */
.gstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.gstat { background: #f6f9fb; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.gstat small { color: var(--muted); font-size: 12px; } .gstat b { font-size: 18px; letter-spacing: -.02em; } .gstat em { font-style: normal; color: var(--muted); font-size: 12px; }
.mem-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.mem-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; } .mem-slot small { color: var(--muted); font-size: 11px; }
.mem-chip { width: 64px; height: 42px; border-radius: 6px; background: #eef3f6; border: 1px solid #d5dee3; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.mem-chip.wide { width: 180px; height: 34px; }
.mem-fill { width: 100%; display: flex; flex-direction: column-reverse; height: 100%; justify-content: flex-start; }
.mem-fill i { display: block; width: 100%; }
.dimms { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.dimm { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfc; }
.dimm b { display: block; } .dimm small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- ядра видеокарты ---------- */
.sm-head { margin-top: 10px; font-size: 22px; letter-spacing: -.02em; } .sm-head span { font-size: 14px; color: var(--muted); font-weight: 500; }
.sm-grid { display: grid; grid-template-columns: repeat(22, 1fr); gap: 4px; margin-top: 10px; max-width: 760px; }
.sm-tile { aspect-ratio: 1; border-radius: 4px; background: #e6edf1; border: 1px solid #d5dee3; transition: background .4s; }
.sm-tile.on { border-color: transparent; }
@media (max-width: 640px) { .sm-grid { grid-template-columns: repeat(11, 1fr); } }

/* ---------- планки оперативной памяти ---------- */
.vram-bar.cells { -webkit-mask-image: repeating-linear-gradient(90deg, #000 0, #000 calc(100% / var(--cells, 64) - 2px), transparent calc(100% / var(--cells, 64) - 2px), transparent calc(100% / var(--cells, 64))); mask-image: repeating-linear-gradient(90deg, #000 0, #000 calc(100% / var(--cells, 64) - 2px), transparent calc(100% / var(--cells, 64) - 2px), transparent calc(100% / var(--cells, 64))); }
.dimm2 { display: flex; flex-direction: column; gap: 6px; flex: 1 1 340px; max-width: 520px; }
.dimm2 small { color: var(--muted); font-size: 12px; }
.dimm2-pcb { background: linear-gradient(180deg, #22664a, #1b523b); border-radius: 8px 8px 4px 4px; padding: 8px 10px 0; position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.dimm2-top { display: flex; justify-content: space-between; gap: 10px; color: #e6f3ec; font-size: 12px; margin-bottom: 6px; } .dimm2-top b { font-weight: 700; }
.dimm2-chips { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.dimm2-chips .mem-chip.ic { width: 100%; height: 38px; border-radius: 3px; background: #2d3438; border: 1px solid #0f1417; }
.dimm2-chips .mem-chip.ic .mem-fill i { opacity: .95; }
.dimm2-pins { height: 14px; margin: 8px -10px 0; background: repeating-linear-gradient(90deg, #d9b45a 0 3px, transparent 3px 5px); position: relative; border-radius: 0 0 4px 4px; }
.dimm2-pins i { position: absolute; left: 58%; top: 0; bottom: 0; width: 7px; background: #1b523b; border-radius: 0 0 4px 4px; }

/* ---------- накопитель и сеть ---------- */
.spark { height: 64px; border-radius: 10px; background: #f6f9fb; border: 1px solid var(--line); overflow: hidden; margin: 8px 0 4px; } .spark svg { width: 100%; height: 100%; display: block; }
.spark.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.dot-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.tone-warn { color: #b9770e; } .tone-bad { color: #c2363b; }
.m2 { display: flex; align-items: stretch; margin-top: 12px; max-width: 760px; }
.m2-pins { width: 26px; background: repeating-linear-gradient(0deg, #d9b45a 0 3px, transparent 3px 5px); border-radius: 6px 0 0 6px; position: relative; } .m2-pins i { position: absolute; left: 0; right: 0; top: 46%; height: 9px; background: #2a3550; }
.m2-board { flex: 1; background: linear-gradient(180deg, #2a3a5c, #1f2c47); border-radius: 0 10px 10px 0; padding: 12px 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.m2-label { background: #f4f7fa; border-radius: 7px; padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 4px; } .m2-label b { font-size: 14px; } .m2-label span { color: var(--muted); font-size: 12px; }
.m2-label .vram-bar { margin-top: 4px; height: 16px; }
.net-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.net-tile { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #f9fbfc; display: flex; flex-direction: column; gap: 4px; } .net-tile.warn { border-color: #e7b45c; background: #fffaf0; }
.net-tile small { color: var(--muted); font-size: 12px; }
.net-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.net-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 6px; } .net-rates > div { display: flex; flex-direction: column; } .net-rates b { font-size: 19px; letter-spacing: -.02em; } .net-rates em { font-style: normal; color: var(--muted); font-size: 12px; }

/* ---------- подсветка по зонам ---------- */
.zones { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; padding-left: 10px; border-left: 3px solid var(--line); }
.zone-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; } .zone-row span { font-size: 14px; }
.zone-row .button { min-width: 112px; }

/* ---------- ряды плиток ---------- */
.gstats-row { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } .gstats-row .gstat { padding: 10px; } .gstats-row .gstat b { font-size: 17px; white-space: nowrap; }
@media (max-width: 1100px) { .gstats-row { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.service-grid > .card { margin-top: 0; }

/* ---------- режим «Авто» при создании ролика ---------- */
.auto-modes { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0 0 12px; } .auto-modes legend { padding: 0 6px; font-weight: 600; }
.auto-modes label.auto-opt { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; padding: 7px 4px; cursor: pointer; font-weight: 400; flex-wrap: nowrap; } .auto-modes .auto-opt input { margin: 4px 0 0; width: auto; flex: none; }
.auto-modes .auto-opt > span { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 0; }
.auto-opt b { display: block; font-size: 14px; } .auto-opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.auto-opt:has(input:checked) b { color: var(--blue); }

/* ---------- кадр и мини-ролик рядом, увеличение кадра ---------- */
.scene:has(.scene-media.pair) { grid-template-columns: minmax(440px, 600px) minmax(0, 1fr); }
.scene-media.pair { grid-template-columns: 1fr 1fr; gap: 10px; } .scene-media.pair figure { margin: 0; display: grid; gap: 4px; align-content: start; min-width: 0; }
.scene-media.pair figcaption { font-size: 12px; color: var(--muted); }
.scene-media.pair audio { grid-column: 1 / -1; }
.scene-media img.zoomable { cursor: zoom-in; }
.note-field { display: grid; gap: 6px; } .note-field textarea { border-color: #e7b45c; background: #fffdf6; }
dialog.lightbox { border: 0; padding: 0; background: #0d1318; border-radius: 14px; max-width: 96vw; max-height: 94vh; width: 96vw; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(10, 16, 22, .82); }
.lb-scroll { overflow: auto; max-height: 90vh; display: grid; place-items: center; }
.lb-scroll img { display: block; cursor: zoom-in; max-width: 94vw; max-height: 88vh; object-fit: contain; }
.lb-scroll img[data-zoom="1"] { max-width: none; max-height: none; width: auto; cursor: zoom-in; }
.lb-scroll img[data-zoom="2"] { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.lb-close { position: absolute; top: 8px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; cursor: pointer; }
.lb-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #cfd8de; font-size: 12.5px; pointer-events: none; }
@media (max-width: 1100px) { .scene:has(.scene-media.pair) { grid-template-columns: 1fr; } }

/* ---------- мастер нового проекта ---------- */
dialog form.wizard { min-width: min(720px, 92vw); }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.kind-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.kind-card:hover, .kind-card:focus-visible { border-color: var(--blue-line); background: var(--blue-soft); outline: none; }
.kind-card b { font-size: 15px; } .kind-card small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.kind-ico { width: 30px; height: 30px; color: var(--blue); } .kind-ico svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; }
fieldset.multi { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; } fieldset.multi legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.idea-full { white-space: pre-wrap; color: var(--soft); margin: 0 0 14px; }

/* ---------- готовый ролик: Shorts, обложка, субтитры ---------- */
.extras { margin-top: 16px; display: grid; gap: 12px; } .extras h3 { margin: 0; font-size: 15px; }
.extra-thumb { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .extra-thumb img { width: 320px; max-width: 100%; border-radius: 10px; display: block; }
.extra-shorts { display: flex; gap: 12px; flex-wrap: wrap; } .extra-shorts figure { margin: 0; width: 170px; } .extra-shorts video { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; background: #0d1318; object-fit: cover; }
.extra-shorts figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- мастер: всё помещается ---------- */
dialog.xwide { width: min(940px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog form.wizard { min-width: 0; }
.kind-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.kind-card { padding: 11px 12px; gap: 3px; min-width: 0; } .kind-card b { font-size: 14px; overflow-wrap: anywhere; } .kind-card small { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.kind-ico { width: 28px; height: 28px; margin-bottom: 2px; flex: none; } .kind-ico.small { width: 24px; height: 24px; display: inline-block; vertical-align: -5px; margin-right: 8px; }
.kind-ico svg { stroke-linecap: round; stroke-linejoin: round; }
.wiz-title { display: flex; align-items: center; }
.u-actions { white-space: nowrap; } .u-actions .button { padding: 5px 9px; font-size: 12.5px; } .u-actions .danger { color: #c2363b; }
td.detail { max-width: 420px; overflow-wrap: anywhere; color: var(--soft); font-size: 12.5px; }
.cred { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; align-items: center; margin: 6px 0; } .cred small { color: var(--muted); } .cred code { background: #f1f5f8; padding: 6px 9px; border-radius: 8px; overflow-wrap: anywhere; }
dialog:has(.wide-log) { width: min(980px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }

.u-actions { white-space: normal; } .u-actions .button { margin: 2px 2px 2px 0; }

/* таблицы «кто занимает …»: высота постоянная, лишние строки прокручиваются внутри блока, страница не дёргается */
.proc-scroll { height: 280px; overflow-y: auto; overflow-x: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; scrollbar-gutter: stable; }
.proc-scroll table.series th { position: sticky; top: 0; z-index: 1; }
.proc-scroll table.series tr:last-child td { border-bottom: 0; }

/* ---- 25.10.2026: карточки сервисов, ссылки, данные для входа, перенос текста в очереди ---- */
.service { gap: 12px; }
.svc-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.svc-tile { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-weight: 800; font-size: 16px; background: hsl(var(--h) 80% 94%); color: hsl(var(--h) 55% 36%); }
.svc-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc-link { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .16s, background .16s, transform .16s; }
a.svc-link:hover { border-color: var(--blue-line); background: var(--blue-soft); transform: translateY(-1px); }
.svc-link-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #eef3f6; color: var(--soft); }
.svc-link.web .svc-link-ic { background: var(--blue-soft); color: var(--blue); }
.svc-link.local .svc-link-ic { background: var(--green-soft); color: var(--green); }
.svc-link-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svc-link-t { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.svc-link-t small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.svc-link-t b { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-link-go { flex: none; color: var(--muted); display: grid; }
.svc-link-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svc-link.off { background: #fafbfc; color: var(--muted); border-style: dashed; }
.creds { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.creds > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 10px 12px; font-weight: 700; font-size: 13.5px; color: var(--ink); user-select: none; }
.creds > summary::-webkit-details-marker { display: none; }
.creds > summary > svg { width: 18px; height: 18px; fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.creds > summary .chev { margin-left: auto; display: grid; color: var(--muted); transition: transform .18s; }
.creds > summary .chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.creds[open] > summary .chev { transform: rotate(180deg); }
.creds[open] > summary { border-bottom: 1px solid var(--line); background: #fbfcfd; }
.creds-body { display: grid; gap: 8px; padding: 12px; }
.creds-note { margin: 0; color: var(--soft); font-size: 12.5px; line-height: 1.5; }
.cred { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cred > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.cred code { padding: 7px 9px; border-radius: 8px; background: #f3f6f8; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.cred-copy { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--blue-line); border-radius: 8px; background: #fff; color: var(--blue); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cred-copy:hover { background: var(--blue-soft); }
.cred-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-tile a.button { justify-self: start; padding: 8px 13px; font-size: 13px; text-decoration: none; }
.note a { color: inherit; font-weight: 700; }
.lane-why { display: block; margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--soft); overflow-wrap: anywhere; word-break: break-word; }
.lane { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .mode { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .svc-links { grid-template-columns: 1fr; } .cred { grid-template-columns: 1fr auto; } .cred > span { grid-column: 1 / -1; } }

.trash-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button-danger { background: #fff; color: var(--red); border: 1px solid #f3c6c6; display: inline-flex; align-items: center; gap: 6px; }
.button-danger:hover { background: var(--red-soft); }
.button-danger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- соцсети: группы, значки ---- */
.net-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.02em; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.net summary { gap: 12px; }
.net summary::before { display: none; }
.net-name { display: grid; min-width: 0; flex: 1 1 220px; line-height: 1.3; }
.net-name b { font-size: 15.5px; }
.net-name small { color: var(--muted); font-size: 12.5px; }
.net summary .badge { white-space: normal; }
.net[open] > summary { border-bottom: 1px solid var(--line); }
.net > ol, .net > .cmd, .net > p, .net > .row { margin-top: 12px; }
.net-group { margin-top: 26px; }
.net-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.net-group-head .section-title { margin: 0 0 8px; }
.net-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.net-sum .chip b { margin-left: 4px; }

/* ссылки в карточке сервиса: по одной в строку, адрес виден целиком */
.svc-links { grid-template-columns: 1fr; }
.svc-link { padding: 8px 10px; }
.svc-link-t { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 10px; }
.svc-link-t small { white-space: nowrap; min-width: 108px; }
.svc-link-t b { text-align: right; }

.cred { grid-template-columns: 54px minmax(0, 1fr) 34px; }
.cred-copy { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; }
.cred code { padding: 8px 10px; }

.svc-tile.has-icon { background: #fff; border: 1px solid var(--line); padding: 3px; width: 40px; height: 40px; border-radius: 12px; }
.svc-tile.has-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- версии и обновления ---- */
.svc-ver { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; display: grid; gap: 6px; }
.svc-ver.has-upd { border-color: #f0d9a8; background: #fffaf0; }
.svc-ver.off { background: #fafbfc; }
.svc-ver-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.svc-ver-main { display: grid; gap: 3px; min-width: 0; }
.ver-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ver-k { color: var(--muted); font-size: 12px; font-weight: 600; min-width: 62px; }
.ver-v { font-size: 14px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ver-line.new .ver-v { color: var(--orange); }
.ver-note { color: var(--muted); font-size: 12px; }
.svc-ver small { color: var(--muted); font-size: 12px; line-height: 1.45; } .svc-ver small.bad { color: var(--red); }
.upd-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: 13px; }
.upd-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.upd-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.upd-bar-t { display: grid; gap: 2px; } .upd-bar-t small { color: var(--muted); font-size: 12.5px; }
.upd-bar-act { display: flex; gap: 8px; flex-wrap: wrap; }
.upd-bar .button { display: inline-flex; align-items: center; gap: 7px; }
.upd-bar .button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(16, 32, 43, .45); display: grid; place-items: center; padding: 18px; }
.modal-card { width: min(680px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(16, 32, 43, .35); padding: 20px 22px; display: grid; gap: 14px; }
.modal-head { display: flex; align-items: center; gap: 14px; } .modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; } .modal-head p { margin: 2px 0 0; color: var(--soft); font-size: 14px; }
.upd-progress { height: 8px; border-radius: 99px; background: #e8eef2; overflow: hidden; }
#upd-fill { height: 100%; width: 0; border-radius: 99px; background: var(--blue); transition: width .5s ease; } #upd-fill.ok { background: var(--green); } #upd-fill.bad { background: var(--red); }
.upd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upd-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--soft); }
.upd-steps li i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; background: #eef3f6; color: var(--muted); }
.upd-steps li.ok i { background: var(--green-soft); color: var(--green); } .upd-steps li.error i { background: var(--red-soft); color: var(--red); }
.upd-steps li.running { color: var(--ink); font-weight: 700; } .upd-steps li.running i { background: var(--blue-soft); color: var(--blue); }
.upd-steps li.pending { opacity: .6; }
.upd-result { padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; } .upd-result.ok { background: var(--green-soft); color: #0b6b3a; } .upd-result.warn { background: var(--orange-soft); color: #8a4b00; } .upd-result.bad { background: var(--red-soft); color: #9b1c1c; }
.upd-logbox summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
.upd-log { margin: 0; max-height: 220px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: #0f1b24; color: #cfe3ee; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; }

[hidden] { display: none !important; }

/* Вкладка «Рост» */
.gr { display: grid; gap: 16px; }
.gr .card { margin: 0; }
.gr-run, .gr-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gr-run { justify-content: flex-start; }
.gr-pad { padding: 14px 22px 0; }
.gr-table td, .gr-table th { vertical-align: middle; }
.gr-table .num { text-align: right; white-space: nowrap; }
.gr-thumb { width: 96px; padding-right: 0; }
.gr-thumb img { width: 88px; height: 50px; object-fit: cover; border-radius: 6px; display: block; background: #eff4f7; }
.gr-ideas { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.gr-ideas li { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.gr-add { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.gr-add label { flex: 1 1 280px; }
.gr-settings > summary { cursor: pointer; list-style: none; }
.gr-settings > summary::-webkit-details-marker { display: none; }
.gr-settings[open] > summary { border-bottom: 1px solid var(--line); }
.gr .bad { color: var(--red); }

/* Внешние модели (API) и выбор модели в чате, 26.10.2026 */
.llm-list { display: grid; gap: 10px; }
.llm-prov { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.llm-prov summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.llm-prov summary::-webkit-details-marker { display: none; }
.llm-name { display: grid; gap: 2px; min-width: 0; } .llm-name small { color: var(--muted); font-size: 13px; }
.llm-body { display: grid; gap: 14px; padding: 4px 16px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.llm-body label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); }
.llm-models-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; } .llm-models-head input { max-width: 260px; }
.llm-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; max-height: 260px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.llm-models .check { display: flex; align-items: center; gap: 8px; font-weight: 500; word-break: break-all; } .llm-models [hidden] { display: none; }
.llm-limit { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.llm-limit small { display: block; max-width: 56ch; margin-top: 2px; } .llm-limit input { width: 160px; }
.chat-model { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); margin-bottom: 12px; }
.msg-meta { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.llm-routes { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; } .llm-routes h3 { margin: 0; font-size: 17px; }
.llm-route { display: grid; grid-template-columns: minmax(180px, 1fr) 3fr; gap: 12px; align-items: center; } .llm-route small { display: block; }
.llm-route-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.llm-lim { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; } .llm-lim input { width: 130px; }
.llm-models small { display: inline; margin-left: 2px; }
@media (max-width: 800px) { .llm-route, .llm-route-slots { grid-template-columns: 1fr; } }

/* ---- История запросов к моделям (history.js) ---- */
.hist-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(160px, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.hist-count { margin: 0 0 8px; font-size: 13px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.hist-item.open { border-color: var(--blue-line); }
.hist-head { display: grid; gap: 4px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; }
.hist-head:hover { background: #f8fafc; }
.hist-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.hist-when { color: var(--muted); font-variant-numeric: tabular-nums; } .hist-model { font-size: 13px; } .hist-role { color: var(--muted); font-size: 12.5px; }
.hist-q { font-weight: 600; overflow-wrap: anywhere; }
.hist-a { color: var(--soft); font-size: 13.5px; overflow-wrap: anywhere; } .hist-a.bad, .hist-text.bad { color: var(--red); }
.hist-body { display: grid; gap: 12px; padding: 4px 14px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.hist-block { display: grid; gap: 4px; } .hist-block small { color: var(--muted); font-weight: 600; }
.hist-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; background: #f4f7fa; border-radius: 10px; padding: 10px 13px; max-height: 420px; overflow: auto; }
.hist-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 800px) { .hist-filters { grid-template-columns: 1fr; } }
.project-service { max-width: 560px; margin-bottom: 22px; } .project-service .card { margin-top: 0; }
.chatbox .card-head .row.left { flex-wrap: wrap; } .chatbox label.inline > select { max-width: 300px; }
.hist .card-head .button { white-space: nowrap; }

/* ---- Настройки: пользователи, конструктор прав, журнал ---- */
.set-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.set-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.set-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.table-wrap tr.off td { opacity: .55; } .muted.block, small.block { display: block; }
.set-form { display: grid; gap: 14px; } .set-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); } .set-form label.check { display: flex; align-items: center; gap: 8px; }
.perm-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 16px; } .perm-bar label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--soft); }
.perm-groups { display: grid; gap: 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; min-width: 0; } .perm-group legend { font-weight: 700; padding: 0 6px; }
.perm-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .perm-all { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: 12.5px; padding: 0; }
.perm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.perm-item { display: flex; align-items: flex-start; gap: 9px; padding: 6px 8px; border-radius: 9px; font-size: 14px; } .perm-item:hover { background: #f6f9fb; } .perm-item.off { opacity: .55; }
.perm-item > span, .perm-item label span { display: grid; gap: 1px; } .perm-item small { color: var(--muted); font-size: 12.5px; font-weight: 400; } .perm-item input { margin-top: 3px; }
.perm-item.svc { display: grid; gap: 4px; } .perm-item.svc > label { display: flex; align-items: flex-start; gap: 9px; } .perm-item .creds-opt { display: flex; align-items: center; gap: 6px; margin-left: 26px; font-size: 12.5px; color: var(--soft); font-weight: 500; }
.perm-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 6px; } .perm-limits label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; } .perm-limits small { font-weight: 400; }
.set-save { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 22px 0 8px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0 10px; }
.jr-filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(200px, 2fr) auto; gap: 10px; margin-bottom: 10px; } .jr-chips { margin-bottom: 12px; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } .tpl { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.settings-link { display: flex; gap: 14px; align-items: center; padding: 16px 18px; text-decoration: none; color: inherit; } .settings-link h3 { margin: 0 0 2px; } .settings-link p { margin: 0; color: var(--muted); }
.empty-state p { max-width: 60ch; }
@media (max-width: 800px) { .jr-filters { grid-template-columns: 1fr; } }

/* ---------- Claude Code (переписки) ---------- */
.cc { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cc-side { padding: 14px; display: grid; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.cc-list { display: grid; gap: 6px; }
.cc-item { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; display: grid; gap: 2px; }
.cc-item:hover { background: #f8fafc; }
.cc-item.on { border-color: var(--blue-line); background: var(--blue-soft); }
.cc-item b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item small { color: var(--muted); font-size: 12px; }
.cc-main { padding: 0; display: grid; grid-template-rows: auto minmax(320px, 62vh) auto; overflow: hidden; }
.cc-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.cc-head { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(140px, 1fr) auto; gap: 10px; align-items: end; padding: 14px 16px 6px; }
.cc-head label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--soft); }
.cc-head input, .cc-head select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.cc-about { margin: 0; padding: 0 16px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.cc-msgs { overflow: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.cc-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.cc-msg { display: grid; gap: 6px; max-width: 880px; }
.cc-msg.user { justify-self: end; background: var(--blue-soft); border-radius: 12px; padding: 10px 14px; max-width: 80%; }
.cc-msg.claude { background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; }
.cc-msg small { color: var(--muted); font-size: 12px; }
.cc-who { font-size: 12px; font-weight: 700; color: var(--blue); }
.cc-body { overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.cc-body pre { background: #17212b; color: #e8eef3; border-radius: 9px; padding: 11px 13px; overflow: auto; font-size: 13px; margin: 8px 0; }
.cc-body code { background: #eef2f5; padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.cc-body pre code { background: none; padding: 0; }
.cc-body ul { margin: 6px 0; padding-left: 20px; }
.cc-h { display: block; margin-top: 8px; }
.cc-state { color: var(--muted); font-size: 13px; }
.cc-cursor { display: inline-block; width: 7px; height: 15px; background: var(--blue); margin-left: 2px; vertical-align: -2px; animation: cc-blink 1s steps(2) infinite; }
@keyframes cc-blink { 50% { opacity: 0; } }
.cc-tools { font-size: 13px; }
.cc-tools summary { cursor: pointer; color: var(--soft); }
.cc-tool { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 4px 0; }
.cc-tool small { flex-basis: 100%; color: var(--muted); }
.cc-tool code { font-size: 12px; overflow-wrap: anywhere; }
.cc-composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.cc-composer textarea { resize: vertical; min-height: 64px; max-height: 40vh; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 900px) { .cc { grid-template-columns: 1fr; } .cc-side { position: static; max-height: 240px; } .cc-head { grid-template-columns: 1fr 1fr; } .cc-msg.user { max-width: 94%; } }
.cc-msg .copy { justify-self: start; border: 0; background: none; padding: 0; color: var(--blue); font-size: 12.5px; font-weight: 600; }
.cc-msg .copy:hover { text-decoration: underline; }
.cc-empty { display: block; }
.cc-usage { padding: 16px 18px; margin-bottom: 16px; display: grid; gap: 12px; }
.cc-usage-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cc-usage-head h2 { margin: 0; font-size: 16px; }
.cc-wins { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cc-win { display: grid; gap: 5px; }
.cc-win-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cc-win-top span { color: var(--muted); }
.cc-win small { color: var(--muted); font-size: 12px; }
.cc-win-top strong { color: var(--text, #1b2733); font-size: 15px; }
.cc-bar { position: relative; height: 14px; border-radius: 7px; background: #e9eff3; overflow: hidden; }
.cc-bar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, transparent calc(25% - 1px), rgba(255,255,255,.9) 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), rgba(255,255,255,.9) 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), rgba(255,255,255,.9) 75%, transparent calc(75% + 1px)); }
.cc-bar i { display: block; height: 100%; min-width: 4px; border-radius: 7px; background: var(--green); transition: width .4s; }
.cc-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -2px; }
.cc-bar.warn i { background: var(--orange); } .cc-bar.bad i { background: var(--red); }
.cc-plan { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13.5px; padding-top: 10px; border-top: 1px solid var(--line); }
.cc-card { display: grid; gap: 10px; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.cc-card .cc-wins { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cc-card .cc-plan { padding-top: 8px; font-size: 12.5px; gap: 4px 14px; }
.auto-upd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.auto-upd select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.auto-note { color: var(--muted); }
.cc-bar i[style*="width:0%"] { min-width: 0; }

.spd-live { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 18px; align-items: center; }
.spd-now { display: grid; gap: 12px; } .spd-now > div { display: flex; flex-direction: column; }
.spd-now small { color: var(--muted); font-size: 12.5px; } .spd-now b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .spd-now em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.spd-chart .spark { height: 90px; }
@media (max-width: 760px) { .spd-live { grid-template-columns: 1fr; } }

/* ---- Claude Code: рабочая область (29.10.2026, второй проход) ---- */
.cc-ph { position: relative; }
.cc-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; } .cc-why { max-width: 56ch; font-size: 12.5px; }
.lim { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-weight: 600; font-size: 12.5px; color: var(--soft); }
.lim:hover, .lim[aria-expanded="true"] { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue); }
.lim-bar { width: 44px; height: 5px; border-radius: 3px; background: #e3e9ee; overflow: hidden; } .lim-bar b { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.lim.warn .lim-bar b { background: var(--orange); } .lim.bad .lim-bar b { background: var(--red); }
.cc-pop { position: absolute; right: 0; top: calc(100% - 4px); z-index: 40; width: min(780px, 100%); } .cc-pop .cc-usage { margin: 0; box-shadow: 0 22px 60px #17212b26; }
.ci { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ib { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; display: inline-grid; place-items: center; color: var(--soft); padding: 0; text-decoration: none; flex: none; transition: background .12s, color .12s; }
.ib:hover:not(:disabled) { background: #eaf0f4; color: var(--ink); } .ib.danger:hover:not(:disabled) { background: var(--red-soft); color: var(--red); } .ib.on { background: var(--blue-soft); color: var(--blue); } .ib.off { opacity: .35; }
.vr { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; } .sp { flex: 1; }
.sbtn { height: 30px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); white-space: nowrap; transition: background .12s, border-color .12s; }
.sbtn:hover:not(:disabled) { background: #f3f6f8; } .sbtn .ci { width: 15px; height: 15px; }
.sbtn.primary { background: var(--blue); border-color: var(--blue); color: #fff; } .sbtn.primary:hover:not(:disabled) { background: #0f5fd9; } .sbtn.wide { width: 100%; justify-content: center; }

.cx { display: grid; grid-template-columns: var(--w-side, 290px) 9px minmax(0, 1fr) 9px var(--w-chat, 440px); height: calc(100vh - 150px); min-height: 520px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.cx.noed { grid-template-columns: var(--w-side, 290px) 9px minmax(0, 1fr); } .cx.noed .cx-ed, .cx.noed .cx-split2 { display: none; }
.cx-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cx-side { background: #fafbfc; }
.cx-split { position: relative; cursor: col-resize; touch-action: none; } .cx-split::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: var(--line); transition: background .12s, width .12s, left .12s; }
.cx-split:hover::after, .cx-split.drag::after { background: var(--blue); width: 3px; left: 3px; }
body.col-resize, body.col-resize * { cursor: col-resize !important; user-select: none !important; }
.seg { display: flex; background: #e9eef2; border-radius: 10px; padding: 3px; gap: 2px; margin: 12px 12px 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; font-weight: 650; font-size: 13px; color: var(--soft); } .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #17212b1f; }
.cx-sidebody { overflow: auto; flex: 1; display: flex; flex-direction: column; min-height: 0; padding-bottom: 8px; }
.tr-tools { display: flex; align-items: center; gap: 1px; padding: 0 8px 8px; border-bottom: 1px solid var(--line); flex: none; }
.tr-list { padding: 6px; }
.tr-root { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 6px 8px 5px; cursor: pointer; border-radius: 7px; } .tr-root:hover { color: var(--ink); } .tr-root.on { background: var(--blue-soft); color: var(--blue); }
.tr { display: flex; align-items: center; gap: 3px; height: 29px; padding-right: 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.tr:hover { background: #edf1f4; } .tr.on { background: var(--blue-soft); color: #0b4fc0; }
.tr-ch { width: 16px; display: grid; place-items: center; color: var(--muted); flex: none; } .tr-ch .ci { width: 12px; height: 12px; transition: transform .15s; } .tr-ch.open .ci { transform: rotate(90deg); } .tr-ch.none .ci { display: none; }
.tr-ic .ci { width: 16px; height: 16px; color: #8ea0ad; } .tr-ic.dir .ci { color: #dba02f; } .tr-ic.proj .ci { color: var(--blue); }
.tr-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 2px; } .tr-n.proj { font-weight: 650; }
.tr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; } .tr-empty { color: var(--muted); font-size: 12px; height: 24px; display: flex; align-items: center; }
.tr-trash { margin: 4px 10px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; } .tr-trow { display: flex; justify-content: space-between; gap: 8px; align-items: center; } .tr-trow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad { padding: 6px 10px; }
.cg { padding: 2px 8px; } .cg-h { display: flex; align-items: center; gap: 2px; margin-top: 8px; } .cg-t { flex: 1; text-align: left; border: 0; background: none; font-weight: 700; font-size: 13px; padding: 5px 2px; display: flex; align-items: center; gap: 3px; min-width: 0; }
.cg-t small { color: var(--muted); font-weight: 500; margin-left: 2px; } .cg-new { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--soft); display: grid; place-items: center; } .cg-new:hover { background: #e4ebf0; color: var(--blue); } .cg-new .ci { width: 15px; height: 15px; }
.cx .cc-item { border: 0; background: transparent; border-radius: 9px; padding: 7px 10px; width: 100%; margin-top: 2px; } .cx .cc-item:hover { background: #edf1f4; } .cx .cc-item.on { background: var(--blue-soft); }
.cx .cc-item b { font-size: 13.5px; font-weight: 600; } .cx .cc-item small { font-size: 11.5px; }
.cx-sidebody > .sbtn.wide { margin: 0 10px 4px; width: calc(100% - 20px); }
.cx-sidebody > .pad { padding: 6px 14px; }

.ed-tabs { display: flex; background: #f3f5f8; border-bottom: 1px solid var(--line); padding: 8px 8px 0; gap: 3px; overflow-x: auto; flex: none; min-height: 40px; }
.ed-tab { display: flex; align-items: center; gap: 7px; padding: 7px 7px 7px 13px; border-radius: 9px 9px 0 0; cursor: pointer; font-size: 13px; white-space: nowrap; color: var(--soft); } .ed-tab:hover { background: #e9eef2; }
.ed-tab.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--blue); }
.ed-tab button { border: 0; background: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); padding: 0; } .ed-tab button:hover { background: #dde5eb; color: var(--red); } .ed-tab button .ci { width: 12px; height: 12px; }
.ed-dot { font-style: normal; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); font-size: 0; } .ed-dot.warn { background: var(--red); }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex: none; } .ed-path { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-ed .note { margin: 10px 14px 0; } .cx-ed .note .sbtn { height: 26px; font-size: 12.5px; margin: 4px 6px 0 0; }
.ed-wrap { flex: 1; min-height: 0; display: flex; background: #fff; }
.ed-gut, #ed-ta { margin: 0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 12px 0; }
.ed-gut { width: 48px; flex: none; text-align: right; padding-right: 10px; color: #a3b0ba; background: #fafbfc; border-right: 1px solid var(--line); overflow: hidden; user-select: none; }
#ed-ta { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; padding-left: 14px; padding-right: 14px; white-space: pre; overflow: auto; tab-size: 2; background: transparent; }
.ed-prev { flex: 1; overflow: auto; padding: 18px 24px; } .cx-ed .empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.cx-chat { background: #fff; }
.ch { display: flex; align-items: center; gap: 2px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--line); flex: none; }
.ch-title { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; font-weight: 650; font-size: 14.5px; background: transparent; text-overflow: ellipsis; } .ch-title:hover { border-color: var(--line); } .ch-title:focus { border-color: var(--blue-line); background: #fff; outline: 0; }
.ch-proj { display: inline-flex; align-items: center; margin: 0 6px; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 650; font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.cx-chat .cc-about { margin: 8px 12px 0; padding: 8px 12px; font-size: 12.5px; }
.cx-chat .cc-msgs { flex: 1; min-height: 0; padding: 16px 18px; gap: 14px; }
.cx .cc-msg.user { border-radius: 14px 14px 4px 14px; } .cx .cc-msg.claude { background: #f6f8fa; border: 0; border-radius: 14px 14px 14px 4px; padding: 12px 15px; }
.cmp { margin: 8px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 10px #17212b0d; display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s; flex: none; }
.cmp:focus-within { border-color: var(--blue-line); box-shadow: 0 0 0 3px #146ef51a; }
.cmp textarea { border: 0; outline: 0; resize: none; padding: 12px 14px 4px; min-height: 46px; max-height: 35vh; background: transparent; border-radius: 14px 14px 0 0; line-height: 1.5; }
.cmp-bar { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px 10px; }
.cc-ctl { display: flex; flex-wrap: wrap; gap: 5px; }
label.sel { display: inline-flex; align-items: center; background: #f0f3f6; border-radius: 8px; padding: 0 3px 0 9px; font-size: 12px; color: var(--muted); height: 28px; font-weight: 600; }
label.sel span { margin-right: 3px; } label.sel select { border: 0; background: transparent; font-size: 12.5px; font-weight: 650; color: var(--ink); padding: 0 2px; height: 26px; outline: 0; cursor: pointer; max-width: 140px; }
.send { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; padding: 0; transition: background .12s, transform .12s; } .send:hover { background: #0f5fd9; transform: translateY(-1px); }
.send .ci { width: 18px; height: 18px; stroke-width: 2.2; } .send.stop { background: var(--red); } .send.stop .ci { fill: currentColor; }
@media (max-width: 1100px) { .cx, .cx.noed { display: flex; flex-direction: column; height: auto; } .cx-split { display: none; } .cx-side { max-height: 320px; } .cx-ed { min-height: 380px; } .cx-chat { min-height: 560px; } }
.ed-bar .sp { display: none; } .ed-bar .ed-path { flex: 1; min-width: 0; }
label.sel span { font-size: 11.5px; }

/* ---- вложения ---- */
.att-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; } .att-row[hidden] { display: none; }
.att { display: flex; align-items: center; gap: 8px; max-width: 230px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fa; font-size: 12.5px; }
.att img { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; flex: none; } .att-ic { width: 34px; height: 34px; border-radius: 7px; background: #e8eef3; display: grid; place-items: center; color: var(--soft); flex: none; }
.att-n { display: grid; min-width: 0; line-height: 1.25; font-weight: 600; } .att-n { overflow: hidden; } .att-n small { color: var(--muted); font-weight: 500; font-size: 11px; }
.att-n::first-line { text-overflow: ellipsis; }
.att button { border: 0; background: none; width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; padding: 0; flex: none; } .att button:hover { background: #e1e8ee; color: var(--red); } .att button .ci { width: 12px; height: 12px; }
.att.error { border-color: #f1c4c6; background: var(--red-soft); } .att-err { color: var(--red); font-size: 14px; }
.att.uploading { opacity: .8; } .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #c8d6e2; border-top-color: var(--blue); animation: ccspin .8s linear infinite; flex: none; } @keyframes ccspin { to { transform: rotate(360deg); } }
.mf { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mf-img img { display: block; max-width: 180px; max-height: 140px; border-radius: 10px; object-fit: cover; border: 1px solid #cfe0f7; }
.mf-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: #fff; border: 1px solid #cfe0f7; font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; max-width: 220px; } .mf-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-chat.drop, .cx-side.drop { position: relative; } .cx-chat.drop::after, .cx-side.drop::after { content: "Отпустите файлы, чтобы прикрепить"; position: absolute; inset: 8px; z-index: 20; display: grid; place-items: center; border: 2px dashed var(--blue); border-radius: 14px; background: #edf5ffe6; color: var(--blue); font-weight: 700; font-size: 15px; pointer-events: none; }
.cx-side.drop::after { content: "Отпустите файлы: загрузятся в выбранную папку"; text-align: center; padding: 14px; font-size: 13.5px; }
.att-n b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---- Telegram-бот ---- */
.lim.tgb .okdot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); } .lim.tgb.on { color: var(--soft); }
.cc-pop-tg { width: min(560px, 100%); } .tg-card { padding: 18px 20px; display: grid; gap: 12px; } .tg-card h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; } .tg-card p { margin: 0; }
.tg-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; } .tg-steps code, .tg-card code { background: #eef2f5; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.tg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .tg-row input { flex: 1; min-width: 200px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; } .tg-row input:focus { outline: 0; border-color: var(--blue-line); box-shadow: 0 0 0 3px #146ef51a; }
.tg-row.sm { padding-top: 4px; } .tg-code { display: grid; gap: 8px; justify-items: start; font-size: 13.5px; }
.sbtn.danger { color: var(--red); } .sbtn.danger:hover:not(:disabled) { background: var(--red-soft); }

/* ---- инструменты Claude (MCP) ---- */
.cmp { position: relative; }
.mcp-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px #17212b26; padding: 6px; display: grid; gap: 2px; } .mcp-pop[hidden] { display: none; }
.mcp-head { padding: 8px 10px 4px; font-weight: 700; font-size: 13.5px; } .mcp-head small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.mcp-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; } .mcp-row:hover { background: #f1f5f8; } .mcp-row.dim { opacity: .62; }
.mcp-row input { margin-top: 3px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; } .mcp-row span { display: grid; gap: 2px; } .mcp-row b { font-size: 13.5px; } .mcp-row small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.mcpb { position: relative; } .mcpb .cnt { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---- история версий, просмотр HTML, быстрый поиск, расход по людям ---- */
.sbtn.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); }
.hist { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--line); max-height: 42%; min-height: 150px; background: #fafbfc; flex: none; }
.hist-list { overflow: auto; padding: 8px; display: grid; gap: 3px; align-content: start; border-right: 1px solid var(--line); } .hist-list small { padding: 4px; }
.hist-list button { border: 0; background: transparent; text-align: left; padding: 6px 9px; border-radius: 8px; font-size: 12.5px; } .hist-list button:hover { background: #edf1f4; } .hist-list button.on { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.hist-view { overflow: auto; display: flex; flex-direction: column; min-width: 0; } .hist-bar { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; position: sticky; top: 0; background: #fafbfc; border-bottom: 1px solid var(--line); z-index: 1; }
.dfs { font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 0; } .df { display: flex; gap: 8px; padding: 0 12px; white-space: pre-wrap; word-break: break-word; } .df i { width: 12px; flex: none; font-style: normal; color: var(--muted); }
.df.add { background: #e8f8ef; } .df.add i { color: var(--green); } .df.del { background: #fdeeee; } .df.del i { color: var(--red); } .df.gap { color: var(--muted); justify-content: center; background: #f1f4f7; }
.ed-frame { flex: 1; border: 0; width: 100%; background: #fff; min-height: 0; }
.pal { position: fixed; inset: 0; z-index: 80; background: #17212b55; display: grid; justify-items: center; align-items: start; padding-top: 12vh; backdrop-filter: blur(2px); }
.pal-box { width: min(640px, calc(100vw - 32px)); background: #fff; border-radius: 16px; box-shadow: 0 30px 80px #17212b44; overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.pal-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; } .pal-tabs button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--soft); } .pal-tabs button.on { background: var(--blue-soft); color: var(--blue); } .pal-tabs small { margin-left: auto; }
#pal-in { margin: 10px 12px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; font-size: 15px; outline: 0; } #pal-in:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px #146ef51a; }
.pal-list { overflow: auto; padding: 0 8px 8px; display: grid; gap: 2px; align-content: start; min-height: 80px; }
.pal-row { text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 8px 12px; display: grid; gap: 1px; } .pal-row b { font-size: 14px; font-weight: 600; } .pal-row small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row:hover, .pal-row.on { background: var(--blue-soft); } .pal-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13.5px; }
.pal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: #fafbfc; }
.cc-users { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); } .cc-users table { width: 100%; border-collapse: collapse; font-size: 12.5px; } .cc-users th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px 4px 0; } .cc-users td { padding: 5px 8px 5px 0; border-top: 1px solid #eef2f5; }
.hist-bar { flex-wrap: wrap; } .hist-bar small { font-size: 12px; } .hist-bar .sbtn { height: 28px; }

/* ---- переключатель (ползунок) ---- */
input.sw { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #cdd7de; position: relative; cursor: pointer; flex: none; margin: 0 0 0 12px; transition: background .15s; border: 0; vertical-align: middle; }
input.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #17212b40; transition: transform .15s; }
input.sw:checked { background: var(--green); } input.sw:checked::after { transform: translateX(18px); } input.sw:disabled { opacity: .45; cursor: not-allowed; } input.sw:focus-visible { outline: 3px solid #9fc2f5; outline-offset: 2px; }
.llm-state { display: inline-flex; align-items: center; }

/* ---- Аватар ---- */
.av-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; } .av-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 650; font-size: 13px; color: var(--soft); }
.av-tabs button.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue); } .av-tabs .av-new { display: inline-flex; align-items: center; gap: 6px; border-style: dashed; }
.av-name { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; } .av-name input { font-size: 18px; font-weight: 700; border: 1px solid transparent; border-radius: 9px; padding: 5px 10px; background: transparent; min-width: 220px; } .av-name input:hover { border-color: var(--line); } .av-name input:focus { outline: 0; border-color: var(--blue-line); background: #fff; }
.av-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; } .av-col { display: grid; gap: 16px; }
.av-card { padding: 16px 18px; display: grid; gap: 12px; } .av-card.drop { outline: 2px dashed var(--blue); outline-offset: -4px; background: #f3f8ff; }
.av-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .av-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; } .av-h { margin: 22px 0 10px; font-size: 15px; }
.av-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.av-ph { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #eef2f5; border: 2px solid transparent; } .av-ph.main { border-color: var(--blue); } .av-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-main { position: absolute; left: 6px; top: 6px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.av-ph-act { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 4px; padding: 6px; background: linear-gradient(transparent, #0008); opacity: 0; transition: opacity .15s; } .av-ph:hover .av-ph-act, .av-ph:focus-within .av-ph-act { opacity: 1; }
.av-ph-act button { border: 0; border-radius: 7px; background: #fffe; font-size: 11.5px; font-weight: 650; padding: 3px 8px; display: inline-flex; align-items: center; } .av-ph-act button .ci { width: 13px; height: 13px; }
.av-up { aspect-ratio: 3 / 4; border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 650; } .av-up:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.av-field { display: grid; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--soft); } .av-field select, .av-field textarea, .av-row input[type=password], .av-row input[type=number], .av-row input[type=text] { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 500; color: var(--ink); background: #fff; font-size: 14px; }
.av-field textarea { resize: vertical; min-height: 90px; line-height: 1.5; } .av-field.inline { display: inline-grid; } .av-field select:focus, .av-field textarea:focus { outline: 0; border-color: var(--blue-line); box-shadow: 0 0 0 3px #146ef51a; }
.av-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; } .av-row input[type=password] { flex: 1; min-width: 160px; } .av-row input[type=number] { width: 84px; }
.av-clone { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.av-seg { margin: 0 0 4px; } .av-seg small { font-weight: 500; color: var(--muted); }
.av-est { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: #f6f8fa; line-height: 1.5; } .warn-t { color: #8a5a0b; } .bad { color: var(--red); }
.av-confirm { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--orange-soft); } .av-confirm input { margin-top: 3px; accent-color: var(--orange); width: 16px; height: 16px; flex: none; }
.av-actions { display: flex; gap: 8px; } .av-actions .sbtn { height: 36px; padding: 0 16px; }
.av-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f5; border-radius: 8px; padding: 4px 4px 4px 10px; font-size: 12.5px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .av-chip button { border: 0; background: none; display: grid; place-items: center; padding: 2px; color: var(--muted); } .av-chip .ci { width: 12px; height: 12px; }
.av-admin { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; } .av-admin summary { cursor: pointer; font-weight: 650; color: var(--soft); margin-bottom: 8px; }
.av-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.av-vid { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; } .av-vid video { width: 100%; max-height: 420px; border-radius: 10px; background: #000; }
.av-vid-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; } .av-script { margin: 0; font-size: 13px; color: var(--soft); line-height: 1.45; } .av-prog { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
@media (max-width: 1000px) { .av-grid { grid-template-columns: 1fr; } }

/* ---- библиотека навыков ---- */
.lib-box { width: min(760px, calc(100vw - 32px)); } .lib-note { margin: 8px 14px 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.lib-box #lib-in { margin-top: 10px; }
.lib-row { display: flex !important; align-items: center; gap: 14px; justify-content: space-between; cursor: default; } .lib-row:hover { background: #f6f9fc; }
.lib-row span { display: grid; gap: 2px; min-width: 0; } .lib-row small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .lib-row em { font-style: normal; color: #8ea0ad; font-size: 11px; }
.lib-row .sbtn { flex: none; }
