:root {
  --bg: #f4f3ef; --card: #fff; --ink: #1d1c1a; --mute: #6b6862; --line: #e3e0d8; --accent: #e8551e; --accent-ink: #fff;
  --ok: #1f8a4c; --warn: #b26a00; --bad: #c0362c; --soft: #faf8f3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151413; --card: #1f1e1c; --ink: #f1efe9; --mute: #a29e95; --line: #34322e; --accent: #ff6a33; --soft: #262421; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; display: grid; grid-template-columns: 380px 1fr; min-height: 100vh; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 0 0 12px; }
/* Полос прокрутки не видно (Alex, 16.11.2026: мешала и у колонки, и у страницы); прокрутка тачпадом/колесом/клавишами работает.
   Левая колонка стоит на месте, пока листается ролик; не влезает по высоте — листается сама. */
html, .side { scrollbar-width: none; }
html::-webkit-scrollbar, .side::-webkit-scrollbar { display: none; }
.side { border-right: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 14px; height: 100vh; position: sticky; top: 0; overflow: auto; }
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand b { font-size: 20px; }
.brand span { color: var(--mute); font-size: 12px; }
.account { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.devices { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.devices li span { overflow-wrap: anywhere; min-width: 0; }
.devices li button { flex-shrink: 0; font-size: 12px; }
#devicesBox a { color: var(--accent); }
.account a { color: var(--accent); }
.client-help { font-size: 13px; margin-bottom: 14px; }
.client-help ol { margin: 10px 0; padding-left: 20px; }
.client-help li { margin: 8px 0; }
.client-help pre { font-size: 12px; overflow-wrap: anywhere; }
.device-secret { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.device-secret .field { margin-top: 10px; }
.device-secret .row { flex-wrap: wrap; }
body.login-page { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin-bottom: 8px; }
.login-card form { margin-top: 20px; }
.login-card button { width: 100%; }
body.settings-page { display: block; padding: 24px 16px; }
.settings-card { max-width: 660px; margin: 0 auto; }
.settings-card a { color: var(--accent); }
.settings-card fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-card h2 { margin: 22px 0 8px; }
.settings-card .field { margin-top: 12px; }
.settings-card code { overflow-wrap: anywhere; }
.settings-notice { margin: 0; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mute); margin-bottom: 12px; flex: 1; }
textarea, input, select { font: inherit; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: flex; gap: 10px; }
.row.end { justify-content: flex-end; margin-top: 10px; }
.seg { display: flex; gap: 6px; }
.seg label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 7px 0; cursor: pointer; color: var(--ink); background: var(--soft); position: relative; }
/* Скрытая радиокнопка: 1×1 внутри своей ячейки — иначе width:100% от правила полей выносит её за край боковой панели и та прокручивается вбок. */
.seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--mute); margin: -4px 0 14px; }
.check input { width: auto; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 7px 12px; font-weight: 500; }
button.danger { color: var(--bad); }
#go { width: 100%; }
.err { color: var(--bad); font-size: 13px; margin: 10px 0 0; white-space: pre-wrap; }
.list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list li button { all: unset; display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.list li button:hover, .list li button.on { background: var(--soft); }
.list li button.on { box-shadow: inset 3px 0 0 var(--accent); }
.list .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .s { font-size: 12px; color: var(--mute); }
main { padding: 24px 28px; max-width: 1100px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.empty { margin: auto; max-width: 520px; text-align: center; color: var(--mute); }
.empty h1 { color: var(--ink); margin-bottom: 10px; }
.jobhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.jobhead h1 { overflow-wrap: anywhere; }
.meta { color: var(--mute); font-size: 13px; margin: 4px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); }
.badge.running, .badge.queued { color: var(--warn); }
.badge.done { color: var(--ok); }
.badge.error { color: var(--bad); }
.player video { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; display: block; }
.versions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; }
.versions button { padding: 5px 10px; font-weight: 500; }
.versions button.ghost.on { border-color: var(--accent); color: var(--accent); }
.versions a { color: var(--accent); }
.progress { height: 28px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 25%, transparent); transition: width .5s; }
.progress span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 13px; }
/* Время по шагам: цвета шагов — одни на полосе и в списке. */
:root { --t-queue: #b9b4aa; --t-script: #4f7fd9; --t-media: #9b62cf; --t-code: var(--accent); --t-check: #23917f; --t-render: #4a463f; }
@media (prefers-color-scheme: dark) { :root { --t-queue: #6f6a61; --t-render: #d6d1c7; } }
.ttotal { margin: 0 0 10px; font-size: 14px; }
.ttotal b { font-size: 20px; margin-right: 6px; }
.tbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--soft); gap: 2px; }
.tbar i { display: block; min-width: 3px; }
.tsteps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tsteps li { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.tsteps li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); align-self: center; }
.tsteps .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.tsteps .v small { color: var(--mute); font-weight: 400; margin-left: 6px; }
.tsteps .d { grid-column: 2 / -1; color: var(--mute); font-size: 12px; }
.tsteps li.now { font-weight: 600; }
.tsteps li.now .d::after { content: " · идёт сейчас"; color: var(--warn); }
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stills figure { margin: 0; }
.stills img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; background: #000; }
.stills figcaption { font-size: 11px; color: var(--mute); margin-top: 2px; }
details summary { cursor: pointer; font-weight: 600; }
pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; margin: 12px 0 0; max-height: 420px; overflow: auto; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow: auto; }
.feed li { font-size: 14px; }
.feed .text { white-space: pre-wrap; background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.feed .tool { color: var(--mute); font-size: 13px; padding-left: 4px; }
.feed .tool::before { content: "▸ "; color: var(--accent); }
.feed .tool.fail { color: var(--bad); }
.feed .warn { color: var(--warn); font-size: 13px; }
.feed .sys { color: var(--mute); font-size: 12px; text-align: center; }
.feed .end { font-weight: 600; }
.limits { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.limits span { display: inline-flex; gap: 6px; align-items: center; }
.limits button { padding: 2px 8px; font-size: 12px; }
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
  .jobhead { flex-direction: column; }
}
