/* Экран «Создать» (F3): CSS прототипа `visualization.html` 114–311 и 505–574 (0002 `05` §3, `13` §1), под
   `#scr-create`. Три колонки 312 / ≥ 440 / 348 на large (284 / 400 / 300 при < 1280), две на medium (результаты —
   лентой снизу), одна на compact («Создать» закреплена над нижней панелью). Без `style=""` — CSP `style-src 'self'`. */

#scr-create { margin: -16px; display: grid; grid-template-columns: 312px minmax(440px, 1fr) 348px; height: calc(100vh - 57px); min-height: 560px; }
#scr-create [hidden] { display: none !important; }
/* Prototype798: уведомления результата остаются над строкой «Создать». */
#scr-create .toasts { bottom: calc(92px + var(--safe-b)); }
#scr-create .ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#scr-create .slot .sb .ico, #scr-create .jcard .ph .ico { stroke: var(--g5); stroke-width: 1.6; }
#scr-create .prompt-card .card-h { flex-wrap: nowrap; }
#scr-create .card-h .grow { min-width: 0; }
#scr-create > h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
#scr-create .pane { overflow: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
#scr-create kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 5px; color: var(--ink-2); background: var(--surface-2); line-height: 1.3; }
#scr-create .btn.primary kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); }
#scr-create .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#scr-create .grow { flex: 1 1 auto; }

/* параметры */
#scr-create .params { border-right: 1px solid var(--rule); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 18px; }
#scr-create .params .group { display: flex; flex-direction: column; gap: 6px; }
#scr-create .params .group > .lbl { display: flex; align-items: center; justify-content: space-between; }
#scr-create .params .group > .lbl .val { font-weight: 500; color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }
#scr-create .seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface-2); }
#scr-create .seg button { flex: 1; min-height: calc(var(--ctl) - 8px); border: 0; background: transparent; cursor: pointer; padding: 2px 8px; border-radius: 7px; white-space: nowrap; color: var(--ink-2); font: inherit; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; transition: background var(--dur), color var(--dur), box-shadow var(--dur); }
#scr-create .seg button:hover:not(:disabled) { color: var(--ink); }
#scr-create .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
#scr-create .seg button:disabled { color: var(--g5); cursor: not-allowed; text-decoration: line-through; text-decoration-color: var(--g5); }
#scr-create .seg button .sub { display: block; font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 1px; }
#scr-create .seg button[aria-pressed="true"] .sub { color: var(--accent); }
#scr-create .seg.tall button { min-height: 42px; }
#scr-create .seg.row button { flex-direction: row; gap: 6px; }
#scr-create .seg .ico { width: 16px; height: 16px; }
#scr-create .modelbtn { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: var(--r-card); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow-1); transition: border-color var(--dur), box-shadow var(--dur); }
#scr-create .modelbtn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
#scr-create .modelbtn .nm { font-weight: 600; display: flex; align-items: center; gap: 6px; }
#scr-create .modelbtn .id { grid-column: 1 / 2; }
#scr-create .modelbtn .pr { grid-column: 2; grid-row: 1 / 3; align-self: center; text-align: right; }
#scr-create .fmtrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#scr-create .fmt { border: 1px solid var(--rule-2); border-radius: 10px; background: var(--surface); padding: 10px 6px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; font-size: 12px; color: var(--ink-2); min-height: var(--tap); transition: border-color var(--dur), background var(--dur); }
#scr-create .fmt .name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scr-create .fmt .ratio { font-size: 10.5px; }
#scr-create .fmt:hover:not(:disabled) { border-color: var(--g5); }
#scr-create .fmt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
#scr-create .fmt:disabled { opacity: .4; cursor: not-allowed; }
#scr-create .fmt .shape { border: 1.5px solid currentColor; border-radius: 3px; display: block; }
#scr-create .fmt .shape.v { width: 12.6px; height: 21px; }
#scr-create .fmt .shape.h { width: 22.4px; height: 12.6px; }
#scr-create .fmt .shape.s { width: 16.8px; height: 16.8px; }
#scr-create select { height: var(--ctl); border: 1px solid var(--rule-2); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; width: 100%; }
#scr-create .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#scr-create .stepper { display: flex; align-items: center; border: 1px solid var(--rule-2); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); height: var(--ctl); }
#scr-create .stepper button { width: var(--ctl); height: 100%; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--ink-2); }
#scr-create .stepper button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
#scr-create .stepper button:disabled { opacity: .35; cursor: not-allowed; }
#scr-create .stepper output { flex: 1; text-align: center; font-family: var(--mono); font-weight: 600; }
#scr-create .switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; -webkit-user-select: none; min-height: var(--ctl); }
#scr-create .switch .knob { width: 40px; height: 24px; border-radius: 12px; background: var(--g4); position: relative; flex: none; border: 0; padding: 0; cursor: pointer; transition: background var(--dur); }
#scr-create .switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left var(--dur) var(--ease); }
#scr-create .switch .knob[aria-checked="true"] { background: var(--accent); }
#scr-create .switch .knob[aria-checked="true"]::after { left: 19px; }
#scr-create .switch .knob:disabled { opacity: .55; cursor: not-allowed; }
#scr-create details.adv { border-top: 1px solid var(--rule-soft); padding-top: 10px; }
#scr-create details.adv > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; min-height: var(--ctl); padding: 0 4px; border-radius: 8px; }
#scr-create details.adv > summary::-webkit-details-marker { display: none; }
#scr-create details.adv > summary:hover { background: var(--surface-2); }
#scr-create details.adv > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); margin-left: 4px; transition: transform var(--dur); }
#scr-create details.adv[open] > summary::before { transform: rotate(45deg); }
#scr-create details.adv .inner { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
#scr-create .adv textarea, #scr-create .adv input[type=number] { width: 100%; border: 1px solid var(--rule-2); border-radius: var(--r-ctl); padding: 8px 10px; font: inherit; background: var(--surface); color: var(--ink); }
#scr-create .adv .seedrow { display: flex; gap: 6px; }
#scr-create .adv .seedrow input { flex: 1; min-width: 0; height: var(--ctl); }
#scr-create .kv2 { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 13px; }
#scr-create .kv2 > :nth-child(odd) { color: var(--ink-3); }

/* середина: промпт, входы, проблемы, строка итога */
#scr-create .compose { display: flex; flex-direction: column; min-height: 0; background: var(--bg); position: relative; }
#scr-create .compose-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 14px; }
#scr-create .prompt-card { border-color: var(--rule-2); }
#scr-create .prompt-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
#scr-create #prompt { width: 100%; min-height: 132px; border: 0; box-shadow: none; background: transparent; padding: 4px 2px; font: inherit; font-size: 15px; line-height: 1.55; resize: vertical; color: var(--ink); outline: none; }
#scr-create .prompt-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; border-top: 1px solid var(--rule-soft); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
#scr-create .prompt-foot .tip { margin-left: auto; }
#scr-create .struct { display: grid; grid-template-columns: 130px 1fr; gap: 8px 10px; align-items: center; }
#scr-create .struct label { font-size: 13px; color: var(--ink-2); }
#scr-create .struct input { height: var(--ctl); border: 1px solid var(--rule-2); border-radius: var(--r-ctl); padding: 0 10px; font: inherit; background: var(--surface); color: var(--ink); }
#scr-create .inputs-b { display: flex; flex-direction: column; gap: 12px; }
#scr-create .slots { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
#scr-create .slot { width: 156px; border: 1.5px dashed var(--rule-2); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; overflow: hidden; position: relative; transition: border-color var(--dur), background var(--dur), transform var(--dur); }
#scr-create .slot.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.02); }
#scr-create .slot .sh { font-size: 12px; font-weight: 600; padding: 8px 10px 4px; display: flex; justify-content: space-between; gap: 4px; color: var(--ink-2); }
#scr-create .slot .sh .opt { font-weight: 400; color: var(--ink-3); }
#scr-create .slot .sb { height: 96px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; padding: 6px; text-align: center; color: var(--ink-3); font-size: 12px; line-height: 1.3; }
#scr-create .slot .sb .ico { width: 22px; height: 22px; }
#scr-create .slot .sb img { max-width: 100%; max-height: 100%; border-radius: 6px; display: block; }
#scr-create .slot .sf { display: flex; gap: 2px; padding: 4px 6px 6px; justify-content: center; }
#scr-create .slot.filled { border-style: solid; box-shadow: var(--shadow-1); }
#scr-create .slot .warnline { font-size: 11px; color: var(--warn); padding: 0 10px 4px; font-weight: 600; }
#scr-create .slot.small { width: 118px; }
#scr-create .slot.small .sb { height: 74px; }
#scr-create .slot.disabled { opacity: .55; border-style: dotted; }
#scr-create .slot .seg { margin: 0 8px 4px; }
#scr-create .slot .seg button { min-height: 26px; font-size: 12px; }
#scr-create .slot-sep { width: 1px; background: var(--rule); margin: 6px 2px; align-self: stretch; }
#scr-create .slots .more { align-self: center; }
#scr-create .modeline { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#scr-create .issues { display: flex; flex-direction: column; gap: 6px; }
#scr-create .issue { font-size: 13px; padding: 9px 12px; border-radius: 10px; display: flex; gap: 8px; align-items: center; border: 1px solid transparent; }
#scr-create .issue > span:first-child { font-weight: 600; flex: none; }
#scr-create .issue.err { background: var(--err-tint); color: var(--err); }
#scr-create .issue.warn { background: var(--warn-tint); color: var(--warn); }
#scr-create .issue.info { background: var(--surface); color: var(--ink-2); border-color: var(--rule); }
#scr-create .issue button { margin-left: auto; flex: none; }
#scr-create .submitbar { border-top: 1px solid var(--rule); background: var(--surface); padding: 12px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
#scr-create .est { display: flex; flex-direction: column; min-width: 96px; flex: 1 1 120px; }
#scr-create .est .sum { font-size: 22px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; white-space: nowrap; }
#scr-create .est .how { font-size: 12px; color: var(--ink-3); }
#scr-create .acctsel { flex: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; max-width: 250px; }
#scr-create .acctsel .lbl { margin: 0; font-size: 11.5px; }
#scr-create #payInfo { justify-content: flex-start; padding: 0 4px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; height: 26px; }
#scr-create #estAfter.neg { color: var(--err); }
#scr-create .submitbar .btn.primary { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 11px; flex: none; gap: 6px; }

/* результаты сеанса */
#scr-create .feed { border-left: 1px solid var(--rule); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
#scr-create .feed-h { padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); display: flex; align-items: center; gap: 8px; min-height: 52px; }
#scr-create .feed-h h2 { font-size: 14px; margin: 0; }
#scr-create .feed-h .all { margin-left: auto; }
#scr-create .feed-list { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
#scr-create .empty { color: var(--ink-3); text-align: center; padding: 36px 12px; font-size: 13px; }
#scr-create .empty .ico { width: 36px; height: 36px; display: block; margin: 0 auto 10px; }
#scr-create .jcard { border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--surface); overflow: hidden; flex: none; transition: box-shadow var(--dur), border-color var(--dur); }
#scr-create .jcard:hover { box-shadow: var(--shadow-2); border-color: var(--rule-2); }
#scr-create .jcard .thumb { position: relative; background: var(--surface-3); display: flex; align-items: center; justify-content: center; height: 170px; overflow: hidden; }
#scr-create .jcard .thumb img { max-width: 100%; max-height: 170px; display: block; }
#scr-create .jcard .thumb .ph { color: var(--ink-2); font-size: 12px; text-align: center; padding: 10px; max-width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: center; }
#scr-create .jcard .thumb .more { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.62); color: #fff; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 6px; }
#scr-create .jcard .jb { padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 4px; }
#scr-create .jcard .jt { display: flex; gap: 6px; align-items: center; }
#scr-create .jcard .jt .jid { margin-left: auto; }
#scr-create .jcard .ja { display: flex; gap: 2px; padding: 4px 6px 6px; border-top: 1px solid var(--rule-soft); flex-wrap: wrap; align-items: center; }
#scr-create .jcard .ja .details { margin-left: auto; }
#scr-create .spin { width: 18px; height: 18px; border: 2px solid var(--rule-2); border-top-color: var(--accent); border-radius: 50%; animation: vmb-spin .9s linear infinite; display: inline-block; }
#scr-create .pbar { display: block; flex: none; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; position: relative; }
#scr-create .pbar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 40%; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, color-mix(in srgb, var(--accent) 55%, transparent) 10px 16px); background-size: 26px 100%; animation: vmb-march 1.2s linear infinite; }
#scr-create .state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
#scr-create .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--g5); }
#scr-create .state.s-submitting, #scr-create .state.s-running, #scr-create .state.s-downloading { background: var(--accent-tint); color: var(--accent); }
#scr-create .state.s-submitting::before, #scr-create .state.s-running::before, #scr-create .state.s-downloading::before { background: var(--accent); animation: vmb-pulse 1.2s infinite; }
#scr-create .state.s-retry_wait, #scr-create .state.s-blocked { background: var(--warn-tint); color: var(--warn); }
#scr-create .state.s-retry_wait::before, #scr-create .state.s-blocked::before { background: var(--warn); }
#scr-create .state.s-succeeded { background: var(--ok-tint); color: var(--ok); }
#scr-create .state.s-succeeded::before { background: var(--ok); }
#scr-create .state.s-failed { background: var(--err-tint); color: var(--err); }
#scr-create .state.s-failed::before { background: var(--err); }
#scr-create .errbox { font-size: 12px; background: var(--err-tint); color: var(--err); border-radius: 8px; padding: 6px 9px; }
@keyframes vmb-spin { to { transform: rotate(360deg); } }
@keyframes vmb-march { from { background-position: 0 0; } to { background-position: 26px 0; } }
@keyframes vmb-pulse { 50% { opacity: .35; } }

/* окна экрана */
.mlist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.mlist h3 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 8px 0 2px; text-transform: none; }
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); min-height: var(--tap); }
.mrow:hover { border-color: var(--accent); }
.mrow[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); }
.mrow .nm { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.mrow .pr { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.libgrid button { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface-3); padding: 4px; cursor: pointer; height: 96px; display: flex; align-items: center; justify-content: center; overflow: hidden; font: inherit; font-size: 12px; color: var(--ink-2); }
.libgrid button:hover { border-color: var(--accent); }
.libgrid img { max-width: 100%; max-height: 100%; display: block; }

/* medium 600–1023: параметры 280 px + промпт; результаты — лентой внизу */
@media (max-width: 1279.98px) {
  #scr-create { grid-template-columns: 284px minmax(400px, 1fr) 300px; }
  #scr-create .submitbar { flex-wrap: wrap; row-gap: 8px; }
}
@media (max-width: 1023.98px) {
  #scr-create { grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: 1fr auto; }
  #scr-create .params { grid-row: 1 / 3; }
  #scr-create .feed { grid-column: 2; grid-row: 2; border-left: 0; border-top: 1px solid var(--rule); max-height: 240px; }
  #scr-create .feed-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 10px 12px; gap: 10px; }
  #scr-create .feed .jcard { width: 236px; }
  #scr-create .feed .jcard .thumb { height: 96px; }
  #scr-create .feed .jcard .thumb img { max-height: 96px; }
  #scr-create .submitbar { flex-wrap: wrap; }
}
/* compact < 600: одна колонка, «Создать» над нижней панелью */
@media (max-width: 599.98px) {
  #scr-create .toasts { bottom: calc(208px + var(--safe-b)); }
  #scr-create { display: flex; flex-direction: column; height: auto; margin: -16px -16px 0; padding-bottom: 120px; }
  #scr-create .params { border-right: 0; border-bottom: 1px solid var(--rule); padding: 14px; gap: 16px; }
  #scr-create .pane { overflow: visible; }
  #scr-create .compose-scroll { padding: 12px 12px 8px; overflow: visible; }
  #scr-create .feed { border-left: 0; border-top: 1px solid var(--rule); }
  #scr-create .feed-list { flex-direction: column; overflow: visible; }
  #scr-create .feed .jcard { width: auto; }
  #scr-create .feed .jcard .thumb { height: 160px; }
  #scr-create .feed .jcard .thumb img { max-height: 160px; }
  #scr-create .submitbar { position: fixed; left: 0; right: 0; bottom: calc(60px + var(--safe-b)); z-index: 4; padding: 10px 12px; gap: 10px; box-shadow: 0 -8px 24px rgba(11,15,20,.08); }
  #scr-create .submitbar .acctsel { display: none; }
  #scr-create .submitbar .btn.primary { flex: 1 1 auto; }
  #scr-create .submitbar .est .sum { font-size: 20px; }
  #scr-create .seg button { min-height: 40px; }
  #scr-create .fmt { padding: 8px 4px 6px; }
  #scr-create .fmt .name { font-size: 11px; }
  #scr-create .slots { gap: 8px; }
  #scr-create .slot { width: calc(50% - 4px); }
  #scr-create .slot.small { width: calc(33.333% - 6px); }
  #scr-create .slot-sep { display: none; }
  #scr-create .switch .knob { width: 48px; height: 28px; }
  #scr-create .switch .knob::after { width: 22px; height: 22px; }
  #scr-create .switch .knob[aria-checked="true"]::after { left: 23px; }
}
/* Реальные байты XMLHttpRequest.upload; нативный progress поддерживает неопределённый total. */
.upload-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; }
.upload-status[hidden] { display: none; }
.upload-status progress { flex: 1; min-width: 100px; accent-color: var(--live); }
#scr-create .jcard .thumb video { display: block; width: 100%; height: 100%; object-fit: contain; }
.create-player { display: block; width: 100%; max-height: 65vh; background: var(--surface-3); }
#scr-create .job-times summary { cursor: pointer; }
#scr-create .job-times time { overflow-wrap: anywhere; }
