/* «Стили каналов» (channel-style-kit §Экраны 2–8) over app.css + content.css: the list, the channel form with its side
   column (check, preview, versions), the logo variants dialog, the run-start box and the image sets of the drawer.
   Local colours are named below; the rest comes from app.css :root. */
:root { --kt-sel: #e7ece9; }

/* list */
.kt-ch { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kt-chsw { flex: none; display: grid; grid-template-rows: 2fr 1fr 1fr; width: 24px; height: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.kt-chsw-none { border-style: dashed; border-color: var(--muted); }
.kt-logo-tile { position: relative; flex: none; display: inline-grid; }
.kt-logo-tile > * { grid-area: 1 / 1; }
.kt-logo-tile img { width: 100%; height: 100%; object-fit: contain; background: var(--paper); border-radius: inherit; }
.kt-logo-sm { width: 24px; height: 24px; border-radius: 4px; }
.kt-lockup .kt-logo-tile { width: 40px; height: 40px; border-radius: var(--radius); }
.kt-chtext { display: grid; gap: 2px; min-width: 0; }
.kt-chname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 650; }
.kt-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; font-weight: 400; }
.kt-meta { margin: 0; color: var(--muted); font-size: 13px; }
.kt-thumb { width: 45px; height: 60px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--tint); }
.kt-videobox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.kt-videobox label { display: grid; gap: 2px; flex: 1 1 280px; min-width: 0; }
.kt-videobox small { color: var(--muted); font-size: 12.5px; }
.kt-videobox .ct-sel { min-width: 220px; min-height: 40px; }

/* channel page */
.kt-page .page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kt-page > .msg { margin-bottom: 14px; }
.kt-main { display: grid; gap: 14px; min-width: 0; }
.kt-form { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.kt-form[disabled] .kt-in, .kt-form[disabled] .ct-sel, .kt-form[disabled] .seg-btn { cursor: not-allowed; }
.kt-sec { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.kt-sec > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 16px; cursor: pointer; list-style: none; }
.kt-sec > summary::-webkit-details-marker { display: none; }
/* a closed section keeps no boxes: Chrome only hides its content, and hidden fields would still count as layout */
.kt-page details:not([open]) > :not(summary) { display: none; }
.kt-sec > summary h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; }
.kt-sec > summary h2 small { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kt-sec > summary h2 svg.lucide { width: 16px; height: 16px; color: var(--ink-2); }
.kt-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.kt-sec[open] > summary .kt-chev { transform: rotate(180deg); }
.kt-sec > summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: var(--radius); }
.kt-body { display: grid; gap: 14px; padding: 4px 16px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.kt-fields { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.kt-fields[disabled] { opacity: .55; }
.kt-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; align-content: start; }
/* a long label or unit (a longer locale, a larger font) wraps inside its grid cell instead of widening it */
.kt-flabel label, .kt-field > .kt-unit { min-width: 0; overflow-wrap: anywhere; }
.kt-flabel .kt-src { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.kt-flabel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.kt-flabel label, .kt-lab { color: var(--ink); font-size: 13.5px; font-weight: 650; }
.kt-in { width: 100%; min-width: 0; min-height: 40px; padding: 0 10px; background: var(--paper); border: 1px solid var(--field); border-radius: var(--radius); font-size: 14px; color: var(--ink); }
textarea.kt-in { padding: 8px 10px; line-height: 1.5; resize: vertical; min-height: 76px; }
.kt-in:disabled { background: var(--tint); color: var(--muted); }
.kt-num { max-width: 120px; font-variant-numeric: tabular-nums; }
.kt-unit { color: var(--muted); font-size: 12px; }
.kt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kt-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kt-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.kt-color { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kt-color input[type="color"] { flex: none; width: 40px; height: 40px; padding: 2px; background: var(--paper); border: 1px solid var(--field); border-radius: var(--radius); cursor: pointer; }
.kt-swatch { flex: none; width: 40px; height: 40px; border: 1px solid var(--field); border-radius: var(--radius); }
.kt-src { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.kt-src-recommended { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-line); }
.kt-src-generated { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.kt-src-owner { color: var(--ink-2); background: var(--tint); }
.kt-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 10px; color: var(--ink-2); background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: var(--radius); font-size: 13px; }
.kt-rec > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.kt-rec svg.lucide { width: 15px; height: 15px; color: var(--blue); }
.kt-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-check { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.kt-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--green); }
.kt-check.is-off { color: var(--muted); background: var(--tint); border-style: dashed; cursor: not-allowed; }
.kt-plate { justify-self: start; }
.kt-rule { margin: 0; }
.kt-rule a, .kt-rec a { text-decoration: underline; }
/* a link split over two lines reads as two links and puts its focus centre on plain text */
.kt-rule a { white-space: nowrap; }
.kt-rule-hint, .kt-top { display: flex; gap: 6px; align-items: flex-start; margin-top: 0; }
.kt-rule-hint svg.lucide, .kt-top svg.lucide { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.kt-none { color: var(--muted); font-size: 13.5px; }
.kt-lockup { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kt-lockup-icon-top { flex-direction: column; align-items: flex-start; gap: 6px; }
.kt-lockup img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.kt-mono { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--ink-2); font-size: 20px; font-weight: 800; line-height: 1; }
.kt-mono-light { color: var(--paper); }
.kt-mono-dark { color: var(--ink); }
.kt-mono-sm { width: 24px; height: 24px; font-size: 13px; border-radius: 4px; }
/* name and tagline are one column next to the icon: the tagline sits under the name, never in a side column of its own */
.kt-lockup-text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.kt-lockup b { font-size: 20px; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; }
.kt-lockup small { display: block; font-size: 12.5px; opacity: .8; overflow-wrap: break-word; }
.kt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* the file input lies over its label button, transparent: the target and the focused box are the button itself, not a 1px sr-only input */
.kt-file { position: relative; cursor: pointer; }
.kt-file input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kt-file:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.kt-roles { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kt-roles li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kt-roles .kt-check { flex: 1 1 auto; justify-content: flex-start; }
.kt-roles .kt-check b { min-width: 16px; color: var(--muted); }
.kt-move { display: inline-flex; gap: 2px; }
.kt-move .icon-btn { border-color: var(--line); width: 40px; height: 40px; }
.kt-move .icon-btn:disabled { opacity: .35; }
.kt-badges { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kt-badge { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.kt-badge-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* side column */
.kt-side { gap: 14px; }
.kt-problems { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kt-problems li { display: grid; gap: 4px; font-size: 13.5px; }
.kt-problems li > span { overflow-wrap: anywhere; }
.kt-problems small { color: var(--muted); }
.kt-problems a, .kt-rules a { text-decoration: underline; }
.kt-rules { margin-top: 8px; font-size: 13px; }
.kt-rules summary { min-height: 32px; display: flex; align-items: center; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.kt-rules ul { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 18px; }
.kt-pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.kt-pick .btn { justify-self: start; }
.kt-gal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kt-gal figcaption small { display: block; color: var(--red); }
.kt-versions { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; max-height: 420px; overflow: auto; }
/* phone: the side column is the page bottom, a scroll box inside the page scroll hides buttons under its edge */
@media (max-width: 767px) { .kt-versions { max-height: none; overflow: visible; } }
.kt-versions li { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.kt-versions li.is-cur { border-color: var(--green-line); background: var(--green-soft); }
.kt-versions li > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.kt-versions small { color: var(--green); font-weight: 650; }
/* --muted is 4.46:1 on --green-soft: the secondary line of the current version takes --ink-2 */
.kt-versions li.is-cur .t-sku { color: var(--ink-2); }
.kt-versions p { overflow-wrap: anywhere; }
.kt-vbtns { display: flex; flex-wrap: wrap; gap: 6px; }

/* save actions in the page header (editor archetype): the draft mark, the note and «Сохранить версию» on row one, the
   secondary actions on row two; the answers that need room (conflict, errors) are a row under the header */
.kt-saveact { flex: 0 1 auto; display: grid; gap: 8px; min-width: 0; }
.kt-saverow { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.kt-saverow .kt-in { flex: 1 1 180px; min-width: 0; }
.kt-draft { flex: none; white-space: nowrap; }
.kt-draft.is-dirty { color: var(--amber); background: var(--amber-soft); }
.kt-draft.is-saved { color: var(--green); background: var(--green-soft); }
.kt-savemsgs { display: grid; gap: 8px; margin-bottom: 14px; }
.kt-errs { margin: 4px 0 0; padding-left: 18px; }
.kt-head-txt { flex: 1 1 360px; min-width: 0; }
/* tablet and up: the head and its two save rows are fixed tracks, not wrapping flex rows — longer words (another
   language, a bigger font) make a button or the draft mark two lines tall in place instead of moving the save block
   under the title or a button to a new row, which pushed the whole editor down (panel r2: CLS 0.2–0.27) */
@media (min-width: 768px) {
  .kt-editing > .page-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
  .kt-editing .kt-saverow:not(.kt-saverow-2) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .kt-editing .kt-saverow:not(.kt-saverow-2) .kt-in { min-width: 0; }
  .kt-editing .kt-saverow-2 { flex-wrap: nowrap; }
  .kt-editing .kt-draft { justify-self: start; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .kt-editing .kt-saveact .btn { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  /* the secondary actions keep one-line short labels in one row (full ones stay in aria-label): a shrinking button
     broke «Рекомендовать» mid-word (panel r6, 1440), a wrapping row moved the editor (CLS 0.28 at 768, text ×1.3) */
  .kt-editing .kt-saverow-2 .btn { flex: none; white-space: nowrap; overflow-wrap: normal; }
  .kt-editing .kt-saverow-2 .kt-long { display: none; }
}
/* wide screens: the save block is a column of its own beside the title */
@media (min-width: 1440px) {
  .kt-editing > .page-head { grid-template-columns: minmax(0, 1fr) 620px; }
}
/* under the title (768–1439) the secondary actions start at its left edge: a longer label moves only what follows it */
@media (min-width: 768px) and (max-width: 1439px) {
  .kt-editing .kt-saverow-2 { justify-content: flex-start; }
}
@media (min-width: 1024px) {
  /* the header with «Сохранить версию» stays on screen while the form scrolls; the stage column sticks under it */
  .kt-editing > .page-head { position: sticky; top: var(--top); z-index: var(--z-sticky); align-items: center; margin: 0 0 14px; padding: 10px 0; background: var(--canvas); border-bottom: 1px solid var(--line); }
  .kt-editing > .page-head h1 { font-size: 22px; }
  /* the note field keeps its whole placeholder beside the save button */
  .kt-editing .kt-saverow .kt-in { flex-basis: 260px; min-width: 15.5em; }
  /* a field reached by Tab scrolls clear of the sticky head */
  html:has(.kt-editing) { scroll-padding-top: calc(var(--top) + var(--kt-head-h, 0px) + 16px); }
  .kt-editing > .page-head .lede { margin-top: 4px; font-size: 14px; }
  .kt-saveact .btn { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
  .kt-saveact .kt-in { min-height: 34px; }
}

/* logo dialog */
.dlg.kt-wide { width: min(920px, calc(100vw - 32px)); }
.kt-tabs { margin-bottom: 14px; }
.kt-variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.kt-variant { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.kt-variant.is-on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
/* a longer button label wraps inside the card instead of widening it past its column (768, text x1.3) */
.kt-variant .btn { max-width: 100%; white-space: normal; text-align: left; }
.kt-variant p { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
/* the plates stack: each is the card's full width, so the lockup (icon + name) reads at slide size and is never cut */
.kt-vpics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.kt-vpic { margin: 0; display: grid; place-items: center; min-height: 150px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 4px; }
/* the slide header lockup (kit-lockup.mjs::lockupHtml) in slide pixels, zoomed by paintLockups to fit the plate whole */
.kt-vlock { line-height: 1.1; }
.kt-vlock .lockup { max-width: none; overflow: visible; }
.kt-vlock .logo { display: block; flex: none; width: auto; max-width: none; }
.kt-vlock .logo-name { overflow: visible; }
.kt-vpic-none { grid-column: 1 / -1; gap: 4px; color: var(--muted); background: var(--tint); font-size: 12px; }
.kt-gen + .kt-gen { margin-top: 14px; }
.kt-gen h3 { margin-bottom: 8px; font-size: 14px; }
.kt-gen h3 small { color: var(--muted); font-weight: 500; }
.kt-ask { display: grid; gap: 6px; }
.kt-ask label { font-size: 13.5px; font-weight: 650; }
.kt-askrow { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-askrow .kt-in { flex: 1 1 260px; }

/* screen 1, 6, 7 */
.ct-chcard .kt-cardline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--ink-2); font-size: 13px; }
.ct-chcard .kt-cardline svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.ct-chcard .kt-cardline a { margin-left: auto; color: var(--green); font-weight: 650; text-decoration: underline; }
.ct-chcard .kt-cardline.is-bad { color: var(--red); font-weight: 650; }
.ct-chcard .kt-cardline.is-bad svg.lucide { color: var(--red); }
.sec-head .btn-sm svg.lucide { width: 15px; height: 15px; }
.kt-runlist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kt-runlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.kt-rname { flex: 1 1 100px; min-width: 0; overflow-wrap: anywhere; }
.kt-runlist a { color: var(--green); text-decoration: underline; }
.kt-sets { margin-top: 10px; font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.kt-default { margin-top: 12px; }
.kt-accept { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; font-weight: 650; cursor: pointer; }
.kt-accept-hint { margin: 0 0 0 35px; } /* checkbox margin 4 + 20 + 3 + gap 8: the hint starts at the label text */
.kt-accept input { flex: none; width: 20px; height: 20px; accent-color: var(--green); }
.kt-set + .kt-set { margin-top: 14px; }
.kt-sethead { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; font-size: 13.5px; font-weight: 650; }
.kt-setch { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1279px) {
  .kt-side { position: static; }
  .kt-gal { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  /* 16 px fields: iOS does not zoom into them */
  .kt-page input, .kt-page select, .kt-page textarea, .kt-wide input { font-size: 16px; }
  .kt-side > *, .kt-body { min-width: 0; overflow-wrap: anywhere; }
  .kt-side .btn, .kt-body .btn { white-space: normal; height: auto; min-height: 44px; }
  .kt-grid, .kt-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kt-colors { grid-template-columns: minmax(0, 1fr); }
  .kt-gal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kt-num { max-width: none; }
  .kt-saveact { flex: 1 1 100%; }
  .kt-saverow { justify-content: flex-start; }
  .kt-saverow .btn, .kt-saverow .kt-in { flex: 1 1 auto; min-height: 44px; }
  .kt-check, .kt-move .icon-btn { min-height: 44px; }
  .kt-move .icon-btn { width: 44px; height: 44px; }
  .kt-videobox .ct-sel { min-width: 0; width: 100%; }
  /* the wide dialog becomes the same full-width bottom sheet as every .dlg on a phone (app.css) */
  .dlg.kt-wide { width: 100vw; }
  /* its buttons and the wish field are phone tap targets (DESIGN.md: 44 px on mobile), «Готово» included */
  .dlg.kt-wide .btn { white-space: normal; height: auto; min-height: 44px; }
  .dlg.kt-wide .kt-in { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .kt-chev { transition: none; } }
.kt-field .ct-sel { min-width: 0; width: 100%; }
.kt-chname a { display: inline-flex; align-items: center; min-height: 28px; }
/* headers wrap only between words; a status mark wraps inside its cell instead of widening the table */
.kt-list thead th { white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.kt-list .kt-chcell { width: 100%; }
/* tablet and small laptop: the marketplace is already in the channel sign (ЯМ / WB / Ozon), its column goes first */
@media (max-width: 767px) {
  /* phone: a card of three lines — the channel cell and its open button side by side, no slide thumbnail */
  .kt-list thead { display: none; }
  .kt-list tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .kt-list .kt-col-thumb { display: none; }
  .kt-list .col-open .btn { min-width: 44px; min-height: 44px; padding: 0 10px; }
  .kt-list .col-open .kt-open-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .kt-list .mark { white-space: normal; }
}
/* 320: the chips take the full card width under the name row, «рекомендованный» does not fit beside two tiles */
@media (max-width: 359px) {
  .kt-ch { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; }
  .kt-chtext, .kt-chname { display: contents; }
  .kt-chips, .kt-meta { grid-column: 1 / -1; }
}

/* the recommendation state in the lede: «подобрал», «подбирает…» and «готовы» in one cell, the tallest sets the height */
.kt-rec-stack { display: grid; }
.kt-rec-txt { grid-area: 1 / 1; }
.kt-rec-txt[data-off] { visibility: hidden; }
.kt-rec-txt .spin { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }

/* ---- live preview (style-live-preview.md, editor archetype): the form rail left, the preview stage right ---- */
.kl-layout { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.kl-rail { display: grid; gap: 14px; min-width: 0; }
/* the right column stays in view while the form scrolls: the save bar on top, the stage fills the rest of the screen.
   Its height counts from where the column is now (--kl-y, kept by kit-live-stage.mjs: its resting place at scroll 0,
   the sticky top once stuck), so the stage and its controls end on screen at any scroll; the slide gives way */
/* --kt-head-h: the height of the sticky page header (kit-live-stage.mjs), the column sticks under it */
/* --kl-room: at the end of the page the column ends with the form rail (kit-live-stage.mjs placeColumn) */
.kl-col { position: sticky; top: calc(var(--top) + var(--kt-head-h, 0px) + 12px); z-index: 1; display: flex; flex-direction: column; height: var(--kl-room, calc(100svh - var(--kl-y, calc(var(--top) + 16px)) - 12px)); min-width: 0; }
.kl-slot { flex: 1 1 auto; display: flex; min-height: 0; }
/* where the stage waits during a page render: laid out (its frames keep their size), out of sight */
.kl-park { position: fixed; left: -10000px; top: 0; height: 600px; visibility: hidden; pointer-events: none; }
.kl-park:empty { height: 0; }
.kl-park > .kl-stage { height: 100%; }
.kl-stage { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.kl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.kl-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 650; }
.kl-head h2 svg.lucide { width: 16px; height: 16px; color: var(--ink-2); }
.kl-tabs .seg-btn svg.lucide { width: 15px; height: 15px; }
/* «рисую…» (and the viewer's version tag) take the rest of the head row, always there: their text never moves the slides */
.kl-meta { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; min-height: 26px; white-space: nowrap; }
.kl-state:empty { display: none; }
.kl-state.is-dirty { color: var(--amber); background: var(--amber-soft); }
.kl-status { color: var(--muted); font-size: 13px; }
/* thin progress line: the old picture stays visible under it while the new one is drawn */
.kl-bar { flex: none; height: 2px; margin: -5px 0 -5px; border-radius: 1px; background: transparent; overflow: hidden; }
.kl-stage.is-busy .kl-bar { background: linear-gradient(90deg, transparent 0 30%, var(--green) 30% 60%, transparent 60%) 0 0 / 200% 100% var(--line-2); animation: kl-run 1.1s linear infinite; }
@keyframes kl-run { to { background-position: -200% 0; } }
/* the product line and its pick form: two fixed columns (the name wraps in its own, the form keeps its width) — a longer
   name or longer words never move the form to a row of its own; the row holds the form's height from the first paint,
   so the arriving source does not push the slide down (panel r2 CLS) */
.kl-src { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; min-height: 36px; }
.kl-src > .kl-line { gap: 0 8px; min-width: 0; }
.kl-src > .kl-pick { grid-column: 2; }
.kl-kind { display: flex; flex: none; }
.kl-kind:empty, .kl-chip-line { display: none; }
.kl-src > .kl-line > .kl-chip { flex: none; }
/* the full name is shown (wrapped, never cut); the reason takes its own short line */
.kl-src > .kl-line > .kl-why { flex: 1 1 100%; line-height: 1.35; }
.kl-src > .msg { grid-column: 1 / -1; }
.kl-src:empty, .kl-msgs:empty { display: none; }
.kl-head, .kl-bar { flex: none; }
.kl-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 13.5px; }
.kl-line .spin { margin-right: 4px; }
.kl-name { min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.kl-why { color: var(--muted); font-size: 12.5px; }
.kl-chip-sample { color: var(--blue); background: var(--blue-soft); }
/* one row while it fits: the id field gives way, the buttons keep their words; the field's error is a line under it */
.kl-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kl-pick .kt-in { flex: 1 1 140px; min-width: 7em; max-width: 144px; min-height: 34px; }
.kl-pick .kt-in[aria-invalid="true"] { border-color: var(--red); }
.kl-pick .btn { flex: none; white-space: nowrap; }
.kl-piderr { flex: 1 1 100%; margin: 0; }
/* tablet and up: the form is fixed tracks too — the field keeps its width, a longer button label wraps inside the
   button instead of moving it under the field (text x1.3 run: the slide under it jumped 100+ px) */
@media (min-width: 768px) {
  .kl-pick { display: grid; grid-template-columns: 150px auto auto; justify-content: start; }
  .kl-pick .kt-in { width: 150px; max-width: none; }
  .kl-pick .btn { min-width: 0; white-space: normal; line-height: 1.2; text-align: left; }
  .kl-piderr { grid-column: 1 / -1; }
  /* the head row: the title and the tabs keep their words; the busy text has its room kept, so it never moves them */
  .kl-head h2, .kl-tabs { flex: none; }
}
/* wide stage (1280 and up): one head row always — a longer tab label wraps inside its tab, the row never breaks */
@media (min-width: 1280px) {
  .kl-head { flex-wrap: nowrap; }
  .kl-tabs { flex: 0 1 auto; min-width: 0; }
  .kl-tabs .seg-btn { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
}
/* «рисую…/обновляется…» is a spinner on screen (the text stays for screen readers, role=status): it takes 16 px, never
   lands on the tabs or the source chip (panel r2) and never moves them; the thin bar under the head shows the same */
.kl-status { position: relative; flex: none; width: 16px; height: 16px; overflow: hidden; color: transparent; font-size: 1px; }
.kl-stage.is-busy .kl-status::before { content: ''; position: absolute; inset: 1px; border: 2px solid #c9d4cf; border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
/* long messages scroll inside: the slides and the video controls under them stay on screen */
.kl-msgs { flex: none; display: grid; gap: 8px; max-height: 30%; min-height: 0; overflow-y: auto; }
.kl-msgs .msg { padding: 8px 12px; font-size: 13.5px; }

/* the slides and the video share one dark lightbox: white slides keep their edge on it */
.kl-body { position: relative; flex: 1 1 auto; display: grid; min-height: 0; padding: 10px; background: var(--graphite); border-radius: var(--radius); }
.kl-pane { grid-area: 1 / 1; display: grid; gap: 12px; min-width: 0; min-height: 0; }
/* an inactive pane keeps its layout (the slide frames stay readable for the video), it is just not seen */
.kl-pane[data-off] { visibility: hidden; pointer-events: none; }
.kl-pane-slides { grid-template-rows: minmax(0, 1fr) auto; }
.kl-pane-video { grid-template-rows: minmax(0, 1fr) auto; }
.kl-view { container-type: size; display: grid; place-items: center; min-height: 0; }
.kl-canvas { position: relative; width: min(100cqw, 100cqh * 3 / 4); aspect-ratio: 3 / 4; margin: 0; }
/* the big slide and its caption row under it: the caption never lies on the slide */
.kl-fig { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; min-width: 0; min-height: 0; margin: 0; }
.kl-capline { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 16px; min-height: 20px; color: var(--paper); font-size: 12.5px; }
.kl-cap { font-weight: 650; }
.kl-ym { display: inline-flex; align-items: center; gap: 6px; }
.kl-ym:empty { display: none; }
.kl-ym svg.lucide { flex: none; width: 14px; height: 14px; }
/* the slide box is the rendered page and nothing else: no corners, no fill, nothing laid on it (owner 2026-10-15) */
.kl-fit { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; }
.kl-frame { position: absolute; left: 0; top: 0; width: 1200px; height: 1600px; border: 0; transform-origin: 0 0; transform: scale(var(--k, .1)); pointer-events: none; }
.kl-frame.is-pending { visibility: hidden; }
.kl-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 72px)); justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kl-th { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.kl-thbox { position: relative; width: 100%; }
.kl-thbtn { position: absolute; inset: 0; padding: 0; background: transparent; border: 0; cursor: pointer; }
.kl-thbtn:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.kl-num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: var(--paper); background: var(--graphite); border-radius: 3px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kl-th .kl-fit { outline: 2px solid transparent; outline-offset: 2px; }
.kl-th.is-on .kl-fit { outline-color: var(--paper); }
.kl-th.is-on .kl-num { color: var(--ink); background: var(--paper); }
/* number and «изменено» under the thumb, never on the picture */
.kl-thlab { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 4px; min-width: 0; }
.kl-mark { display: none; padding: 0 3px; color: var(--blue); background: var(--blue-soft); border: 1px solid var(--blue-line); border-radius: 4px; font-size: 11px; font-weight: 650; white-space: nowrap; pointer-events: none; }
.kl-th.is-marked .kl-fit { outline: 2px solid var(--blue-line); }
/* for its 2.5 s the mark takes the number's place in the same 20 px row: the strip does not jump */
.kl-th.is-marked .kl-mark { display: inline-grid; place-items: center; height: 20px; }
.kl-th.is-marked .kl-num { display: none; }
.kl-player { position: absolute; inset: 0; overflow: hidden; }
.kl-vnote { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; color: var(--ink); background: var(--paper); border-radius: var(--radius); font-size: 13px; }
.kl-vnote:empty { display: none; }
.kl-vnote.is-error { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-line); }
.kl-vnote > span:not(.spin) { flex: 1 1 160px; min-width: 0; }
.kl-vnote svg.lucide { flex: none; width: 16px; height: 16px; }
.kl-vctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--paper); }
.kl-play { min-width: 96px; }
.kl-time { font-size: 13px; font-variant-numeric: tabular-nums; }
/* the thin track keeps a 24px hit area (44px on a phone) */
.kl-seek { flex: 1 1 140px; min-width: 0; height: 24px; margin: 0; accent-color: var(--green-line); cursor: pointer; }
.kl-seek:disabled { cursor: default; }
.kl-modes { margin-left: auto; }

/* the sticky column (1024 and up): the strip stands beside the big slide, its thumbs shrink to the frame height (each
   row a size container, the thumb a 3:4 box inside it); below 64 px a row they stop, the strip scrolls and a fade at its
   bottom says there is more (.has-more, kit-live-stage.mjs) */
@media (min-width: 1024px) {
  /* the source line and the product form share one row above the slide (≥480px slide at 1440×900): the long
     «Показать на моём товаре» goes without its icon here, the field is just wide enough for its placeholder */
  .kl-pick .kt-in { flex-basis: 150px; max-width: 150px; }
  .kl-pick #kl-pick > svg { display: none; }
  /* tighter rows above the slide: it keeps ≥480 px at 1440×900 under the two-row save block */
  .kl-stage { gap: 6px; }
  .kl-bar { margin: -4px 0; }
  .kt-saveact { gap: 6px; }
  .kl-pane-slides { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 84px; }
  .kl-pane-slides > .kl-fig { grid-area: 1 / 1; }
  .kl-thumbs { grid-area: 1 / 2; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(88px, 1fr); gap: 12px; min-height: 0; overflow-y: auto; padding: 10px 4px;
    /* a thumb reached by Tab scrolls clear of the «more» fade, the last one to the very end (fade off) */
    scroll-padding-block: 10px 40px; }
  .kl-th { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
  .kl-thbox { container-type: size; display: grid; place-items: center; height: 100%; min-height: 0; }
  .kl-thbox .kl-fit, .kl-thbox .kl-thbtn { width: min(100cqw, 100cqh * 3 / 4); height: min(100cqw * 4 / 3, 100cqh); }
  .kl-thbox .kl-thbtn { margin: auto; }
  .kl-pane-slides::after { content: ''; grid-area: 1 / 2; align-self: end; height: 40px; background: linear-gradient(transparent, var(--graphite)); pointer-events: none; visibility: hidden; }
  .kl-pane-slides.has-more::after { visibility: visible; }
}
@media (min-width: 1920px) {
  .kl-pane-slides { grid-template-columns: minmax(0, 1fr) 112px; }
}
/* tablet and small laptop: the stage is too narrow for the name beside the form — the form is a row under the name;
   the line holds two rows (name + reason) from the first paint, so the arriving source does not push the slide down */
@media (min-width: 768px) and (max-width: 1279px) {
  .kl-src { grid-template-columns: minmax(0, 1fr); }
  .kl-src > .kl-pick { grid-column: 1; }
}
@media (min-width: 768px) {
  .kl-src > .kl-line { min-height: 37px; }
}
/* small laptop: a narrower form rail leaves the stage room for its head row and the slide */
@media (min-width: 1024px) and (max-width: 1279px) {
  .kl-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
  .kl-head h2 svg.lucide, .kl-tabs .seg-btn svg.lucide { display: none; }
  /* the head row has no room for the source chip here: it stands in front of the name */
  .kl-kind { display: none; }
  .kl-chip-line { display: inline-flex; }
  .kl-pane-slides { grid-template-columns: minmax(0, 1fr) 64px; }
  .kl-layout .kt-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* tablet and phone: one column — the preview first, then the form, the save bar at the end as before */
@media (max-width: 1023px) {
  .kl-layout { grid-template-columns: minmax(0, 1fr); }
  .kl-col { display: contents; }
  .kl-slot { order: -1; display: block; }
  /* before the stage is placed its slot already holds the stage height: nothing under it jumps on mount */
  .kl-slot:empty { min-height: calc(clamp(420px, 72svh, 760px) + 170px); }
  .kl-stage { height: auto; }
  .kl-body { height: clamp(420px, 72svh, 760px); }
}
@media (max-width: 767px) {
  .kl-stage { padding: 10px; }
  .kl-body { padding: 8px; }
  .kl-thumbs { gap: 8px; }
  /* head: the title, the source chip and the busy mark on row one, the two tabs a full row of their own — so «обновляется…»
     never lands on the chip (panel r2) and longer words do not push the chip to a third row. The busy text stays for
     screen readers (role=status); on screen it is a spinner, the thin bar under the head shows the same */
  .kl-head h2 { order: 0; }
  .kl-kind { order: 1; }
  .kl-meta { order: 2; flex: 1 0 auto; }
  .kl-tabs { order: 3; flex: 1 1 100%; }
  .kl-tabs .seg-btn { flex: 1 1 0; justify-content: center; }
  .kl-tabs .seg-btn svg.lucide { display: none; }
  .kl-pick .kt-in { max-width: none; }
  .kl-pick .btn { flex: 1 1 auto; }
  .kl-pick .btn, .kl-vctl .btn, .kl-tabs .seg-btn { min-height: 44px; }
  .kl-pick .kt-in { min-height: 44px; }
  .kl-seek { height: 44px; }
  .kl-modes { margin-left: 0; }
}
/* phone (editor archetype): the preview right under the title. «Сохранить версию» with the draft mark and the note is a
   bar fixed at the bottom of the screen; the secondary actions stay a compact block under the title */
@media (max-width: 767px) {
  .kt-editing .kt-saverow:not(.kt-saverow-2) { position: fixed; z-index: var(--z-sticky); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; padding: 8px 16px max(8px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  /* the note keeps its whole placeholder on a row of its own; the draft mark sits beside the button it explains */
  .kt-editing .kt-saverow:not(.kt-saverow-2) .kt-in { grid-area: 1 / 1 / 2 / 3; }
  .kt-editing .kt-saverow:not(.kt-saverow-2) .kt-draft { grid-area: 2 / 1; justify-self: start; display: block; max-width: 100%; padding-block: 4px; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .kt-editing .kt-saverow:not(.kt-saverow-2) .btn { grid-area: 2 / 2; }
  .kt-editing { padding-bottom: 128px; }
  html:has(.kt-editing) { scroll-padding-bottom: 136px; }
  body:has(.kt-editing) .toasts { bottom: 136px; }
  /* the secondary actions: two fixed columns, «Рекомендовать» on a row of its own — a longer word wraps inside its
     button, it never moves a button to a new row */
  .kt-editing .kt-saverow-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 6px; }
  .kt-editing .kt-saverow-2 [data-action="kt-recommend"] { grid-column: 1 / -1; }
  .kt-editing .kt-saverow-2 .btn { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  .kt-long { display: none; }
  /* the own-product form goes under the slides: the product line stays over them, the slide starts higher */
  .kl-src { display: contents; }
  .kl-src > .kl-line, .kl-src > .kl-pick, .kl-src > .msg { flex: none; }
  .kl-src > .kl-pick { order: 1; }
}
@media (prefers-reduced-motion: reduce) { .kl-stage.is-busy .kl-bar { animation: none; background: var(--green-line); } .kl-stage.is-busy .kl-status::before { animation: none; } }
