/* Автомонтаж — экран креатора в стилистике «LK Kreator» (Figma дизайнера Харизмы, 10.11).
   Значения сняты из SVG-выгрузки Figma (docs/design/lk-kreator): цвета, радиусы, тень и «стеклянная» обводка.
   Иконки — только из той же выгрузки (web/icons), красятся маской в цвет текста. */
@font-face { font-family: "UiInter"; src: url("/assets/fonts/inter/Inter%5Bopsz,wght%5D.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #F7FBFF;            /* frame: white + #E1EFFE 25 % */
  --panel: #F1F8FF;         /* main panel over the frame */
  --ink: #14283F; --ink-2: #19314F; --mute: #7389A3; --mute-2: #708298; --line: #E2EBF6;
  --acc: #007AFF; --acc-dim: #7FBCFF; --acc-soft: rgba(0, 122, 255, .1);
  --ok-bg: #C9ECDE; --ok: #02772E; --bad: #B84650; --bad-soft: rgba(184, 70, 80, .08); --warn: #D18A00;
  --track: #DFE0E7; --nav-on: rgba(230, 231, 245, .48); --btn2: rgba(227, 235, 245, .8);
  --glass: rgba(255, 255, 255, .48);
  --glass-edge: linear-gradient(155deg, rgba(255,255,255,.95), rgba(255,255,255,.25) 50%, rgba(255,255,255,.7));
  --shadow: 0 10px 32px -4px rgba(41, 77, 140, .12), inset 0 1px 2px rgba(255, 255, 255, .8);
  --r-card: 28px; --r-field: 20px; --r-thumb: 16px; --r-chip: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "UiInter", "Segoe UI", system-ui, sans-serif;
  --fast: 100ms; --mid: 200ms;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; font-weight: 400; line-height: 1.2; color: var(--ink-2); letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 500; color: var(--ink-2); line-height: 1.25; }
h3 { font-size: 16px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
a { color: inherit; text-decoration: none; }
small, .hint { font-size: 13px; color: var(--mute); }
.label { font-size: 13px; color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* icons from Figma, tinted with the text colour */
.ic { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-sm { width: 14px; height: 14px; }
.flip { transform: scaleX(-1); }
.tile { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--acc); color: #fff; display: flex; align-items: center; justify-content: center; }

/* glass surface: translucent white, blurred backdrop, light diagonal edge, soft blue shadow */
.glass { position: relative; background: var(--glass); border-radius: var(--r-card); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--glass-edge); pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* layout: sidebar + rounded main panel */
.lk { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lk-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 38px 20px 40px; }
.lk-brand { display: flex; flex-direction: column; gap: 4px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.lk-brand img { display: block; width: 136px; height: 26px; margin-left: -2px; }
.lk-brand span { font-size: 13px; color: var(--mute); }
.lk-nav { display: flex; flex-direction: column; gap: 16px; }
.lk-nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 45px; padding: 0 17px; border-radius: 22.5px; font-weight: 500; color: var(--ink); transition: background var(--fast), color var(--fast); }
.lk-nav a .ic { color: var(--acc); }
.lk-nav a:hover { background: var(--nav-on); }
.lk-nav a.on { background: var(--nav-on); color: var(--acc); box-shadow: var(--shadow); }
.lk-out { margin-top: auto; padding: 0 16px; font-weight: 500; font-size: 15px; color: var(--ink); opacity: .55; }
.lk-out:hover { opacity: 1; }
.lk-main { min-width: 0; background: var(--panel); border-radius: var(--r-card) 0 0 var(--r-card); padding: 48px 52px 80px; }
.lk-tabbar { display: none; }
.lk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.lk-sub { margin-top: 14px; font-size: 14px; color: var(--mute); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mute); margin-bottom: 14px; }
.back:hover { color: var(--acc); }
.lk-col { max-width: 760px; display: flex; flex-direction: column; gap: 24px; }

/* buttons */
.btn { font: inherit; font-size: 15px; font-weight: 500; height: 50px; padding: 0 26px; border: 0; border-radius: 25px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  position: relative; transition: transform var(--fast), background var(--fast), opacity var(--fast); white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.pri { background: var(--acc); color: #fff; box-shadow: 0 10px 32px -4px rgba(41, 77, 140, .12), inset 0 1px 2px rgba(255,255,255,.35); }
.btn.pri:hover:not(:disabled) { background: #0A6FE6; }
.btn.pri:disabled { background: var(--acc-dim); cursor: not-allowed; }
.btn.sec { background: var(--btn2); color: var(--ink); box-shadow: var(--shadow); height: 48px; }
.btn.sec:hover:not(:disabled) { background: rgba(214, 226, 240, .9); }
.btn.sec:disabled { opacity: .5; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn .spin { width: 18px; height: 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cards & fields */
.card { padding: 22px 21px; display: flex; flex-direction: column; gap: 16px; }
.num { display: inline-flex; width: 26px; height: 26px; border-radius: 9px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 600; align-items: center; justify-content: center; }
.field { width: 100%; font: inherit; font-size: 15px; color: var(--ink); border: 1px solid transparent; border-radius: var(--r-field); padding: 14px 16px; background: rgba(255,255,255,.48); box-shadow: var(--shadow); resize: vertical; outline: none; transition: border-color var(--fast), background var(--fast); }
.field::placeholder { color: var(--mute-2); }
.field:focus { background: #fff; border-color: rgba(0, 122, 255, .35); }
.field.bad { border-color: var(--bad); }
.err { font-size: 14px; color: var(--bad); }
.drop { position: relative; display: block; border-radius: var(--r-field); background: rgba(255,255,255,.48); box-shadow: var(--shadow); cursor: pointer; border: 1px dashed transparent; transition: border-color var(--fast), background var(--fast); }
.drop:hover, .drop.over { border-color: rgba(0, 122, 255, .45); background: #fff; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-in { min-height: 120px; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 22px; }
.drop-in > span, .drop-file > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.drop-in b, .drop-file b { font-weight: 500; color: var(--ink-2); }
.drop-file { display: flex; align-items: center; gap: 16px; padding: 14px; }
.drop-file video { width: 68px; height: 110px; object-fit: cover; border-radius: var(--r-thumb); background: #000; flex: none; }
.drop-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-file u { font-size: 13px; color: var(--acc); text-decoration: none; margin-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.seg button, .chips button { font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; border: 0; background: rgba(255,255,255,.7); box-shadow: var(--shadow); transition: background var(--fast), color var(--fast); }
.seg button { height: 48px; border-radius: 24px; }
.seg button:hover, .chips button:hover { background: #fff; }
.seg button.on, .chips button.on { background: var(--acc-soft); color: var(--acc); box-shadow: inset 0 0 0 1px rgba(0, 122, 255, .25); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.style { font: inherit; text-align: left; color: var(--ink); cursor: pointer; border: 0; background: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.style .im { display: block; aspect-ratio: 9 / 16; border-radius: var(--r-thumb); overflow: hidden; background: #000; box-shadow: 0 0 0 2px transparent; transition: box-shadow var(--fast); }
.style .im img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; }
.style span:last-child { font-size: 14px; padding: 0 2px; }
.style.on .im { box-shadow: 0 0 0 3px var(--acc); }
.style.on span:last-child { color: var(--acc); font-weight: 500; }
.notes summary { cursor: pointer; font-size: 14px; color: var(--acc); list-style: none; }
.notes summary::-webkit-details-marker { display: none; }
.notes .field { margin-top: 12px; }
.go { display: flex; flex-direction: column; gap: 12px; }
/* queue banner (only through gate.py, /gate/queue) */
.qbar { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qline { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.qline span { min-width: 0; overflow-wrap: anywhere; }
.qbar .hint { padding-left: 20px; overflow-wrap: anywhere; }
.qdot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.qbar.warn .qdot { background: var(--warn); box-shadow: 0 0 0 3px rgba(209, 138, 0, .18); }
.qbar.bad .qdot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.qbar.bad .qline { color: var(--bad); }
.drop.closed { opacity: .5; cursor: not-allowed; }
.drop.closed input { cursor: not-allowed; }
.drop.closed:hover { border-color: transparent; background: rgba(255,255,255,.48); }
.track { height: 5px; border-radius: 2.5px; background: var(--track); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 2.5px; background: var(--acc); transition: width var(--mid); }
.upload { display: flex; flex-direction: column; gap: 8px; }

/* chips (status) */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--r-chip); font-size: 12px; font-weight: 500; white-space: nowrap; background: rgba(223, 224, 231, .6); color: var(--mute-2); }
.chip.act { background: var(--acc); color: #fff; }
.chip.run { background: var(--acc-soft); color: var(--acc); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }

/* list */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 24px; }
.vcard { display: flex; gap: 18px; padding: 18px; align-items: stretch; transition: transform var(--mid); }
.vcard:hover { transform: translateY(-2px); }
.thumb { flex: none; width: 84px; height: 134px; border-radius: var(--r-thumb); overflow: hidden; background: linear-gradient(160deg, #CFDEF0, #E3EBF5); }
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.vcard-t { font-size: 17px; color: var(--ink-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vcard .btn { margin-top: auto; align-self: flex-start; height: 42px; padding: 0 22px; font-size: 14px; }
.empty-card { padding: 22px 21px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.empty-card .btn { align-self: flex-start; min-width: 300px; }

/* job: steps (the «3 шага» tiles of the design) */
.steps-card { margin-bottom: 24px; gap: 12px; }
.steps-head { display: flex; flex-direction: column; gap: 6px; }
.steps-now { font-size: 18px; color: var(--ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-field); background: rgba(255,255,255,.48); box-shadow: var(--shadow); min-width: 0; }
.steps li .num { flex: none; display: inline-flex; width: 32px; height: 32px; border-radius: 10px; }
.steps li b { display: block; font-weight: 500; font-size: 15px; color: var(--ink-2); }
.steps li small { display: block; font-size: 13px; }
.steps li.done .num { background: var(--ok-bg); color: var(--ok); }
.steps li.now b, .steps li.you b { color: var(--acc); }
.steps li.now .num, .steps li.you .num { background: var(--acc); color: #fff; }
.steps li.now, .steps li.you { background: rgba(225, 239, 254, .7); box-shadow: inset 0 0 0 1px rgba(0, 122, 255, .18), var(--shadow); }
.steps li.stop .num { background: var(--bad-soft); color: var(--bad); }
.steps li.stop b { color: var(--bad); }

.job { display: flex; gap: 26px; align-items: flex-start; }
.player { flex: none; width: 360px; padding: 12px; position: sticky; top: 24px; }
.player video, .player-empty { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-field); background: #000; object-fit: contain; }
.player-empty { display: flex; align-items: center; justify-content: center; color: #9FB0C4; font-size: 14px; background: #0E1622; }
.job-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
#jBody { display: flex; flex-direction: column; gap: 24px; }
.now-line { display: flex; align-items: center; gap: 14px; }
.now-line .ic { width: 26px; height: 26px; color: var(--acc); animation: spin 1s linear infinite; }
.now-line b { font-weight: 500; font-size: 18px; color: var(--ink-2); display: block; }
.warn { border-radius: 14px; padding: 12px 14px; font-size: 14px; background: var(--bad-soft); color: var(--bad); }
/* remarks of the checks: «0:29  слово «быть» может обрываться на стыке» — the time jumps the player there */
.spots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.spots li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.tchip { flex: none; min-width: 46px; height: 26px; border-radius: var(--r-chip); padding: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums;
  background: var(--acc-soft); color: var(--acc); border: 0; cursor: pointer; transition: background var(--fast); }
.tchip:hover { background: rgba(0, 122, 255, .18); }
.tchip.none { display: inline-block; background: transparent; cursor: default; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 36px; border-radius: 18px; padding: 0 14px; font-size: 14px; }
.more { padding: 18px 21px; gap: 0; }
.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--ink-2); }
.more summary::-webkit-details-marker { display: none; }
.more summary .ic { color: var(--acc); transition: transform var(--mid); }
.more[open] summary .ic { transform: rotate(180deg); }
.more[open] summary { margin-bottom: 12px; }
.more ul { margin: 6px 0 12px; padding-left: 18px; font-size: 14px; color: var(--mute); } .more li.bad { color: var(--bad); }
.more a { color: var(--acc); font-size: 14px; }
.more-err { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.stages { border-collapse: collapse; margin: 4px 0 12px; width: 100%; max-width: 440px; font-size: 14px; }
.stages td { padding: 5px 10px 5px 0; color: var(--mute); border-bottom: 1px solid var(--line); }
.stages tr.running td { color: var(--acc); } .stages tr.error td { color: var(--bad); }
.stages td:nth-child(2), .stages td:nth-child(3) { text-align: right; white-space: nowrap; width: 64px; }
.empty { padding: 40px; text-align: center; color: var(--mute); grid-column: 1 / -1; }

/* tablet: steps 2×2 */
@media (max-width: 1180px) { .steps { grid-template-columns: repeat(2, 1fr); } .player { width: 300px; } }
@media (max-width: 1040px) {                          /* narrow laptop window: the side column would shrink to a strip — stack it under the player */
  .lk-main { padding: 36px 28px 80px; }
  .job { flex-direction: column; align-items: stretch; }
  .player { width: 100%; max-width: min(380px, 36vh); align-self: center; position: static; }   /* the whole 9:16 frame plus the next card fit on one screen */
  .job[data-state="running"] .job-side, .job[data-state="queued"] .job-side, .job[data-state="uploading"] .job-side { order: -1; }   /* while waiting: «what now · N min left» first */
}
/* phone: no sidebar, bottom tab bar like the mobile frames; columns stack */
@media (max-width: 760px) {
  .lk { display: block; }
  .lk-side { display: none; }
  .lk-main { border-radius: 0; padding: 28px 16px 120px; min-height: 100vh; }
  h1 { font-size: 26px; }
  .lk-head { margin-bottom: 22px; }
  .lk-head .btn { display: none; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .job { flex-direction: column; }
  .player { width: 100%; max-width: min(380px, 36vh); align-self: center; position: static; }   /* the whole 9:16 frame plus the next card fit on one screen */
  .seg { grid-template-columns: repeat(2, 1fr); }
  .steps li { padding: 12px; }
  .empty-card .btn { min-width: 0; width: 100%; }
  .lk-tabbar { display: flex; position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(344px, calc(100% - 32px)); height: 60px; padding: 8px;
    border-radius: 30px; background: rgba(255,255,255,.45); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 10; gap: 6px; }
  .lk-tabbar a { flex: 1; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-2); }
  .lk-tabbar a .ic { color: var(--acc); width: 18px; height: 18px; }
  .lk-tabbar a.on { background: #E6E7F5; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
