/* Generated from the templates stylesheet by scripts/scope-css.py: edit public/t-src.css, then re-run. */
body.tpl {
  --bg: #171b20;
  --panel: #21262d;
  --inset: #1a1f25;
  --side: #262c34;
  --side-active: #1e2329;
  --border: #2f363e;
  --text: #e3e7eb;
  --muted: #95a0ab;
  --dim: #5f6973;
  --green: #3bb54a;
  --yellow: #e8d52a;
  --red: #ec3a55;
  --blue: #5aa0e8;
  --grey: #5f6973;
  --ink: #111418;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
body.tpl * { box-sizing: border-box; }
body.tpl, body.tpl { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); }
body.tpl a { color: var(--blue); text-decoration: none; }
body.tpl button, body.tpl input, body.tpl select, body.tpl textarea { font: inherit; color: inherit; }
body.tpl .mono { font-family: var(--mono); }
body.tpl .dim { color: var(--dim); }
body.tpl .muted { color: var(--muted); }
body.tpl .warn { color: var(--yellow); }
body.tpl .err { color: var(--red); }
body.tpl .ok { color: var(--green); }
body.tpl [hidden] { display: none !important; }
body.tpl .app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
body.tpl .sidebar { background: var(--side); display: flex; flex-direction: column; min-height: 0; }
body.tpl .brand { display: flex; align-items: center; gap: 8px; padding: 22px 18px; font-size: 15px; font-weight: 500; }
body.tpl .brand-mark { width: 20px; height: 20px; border-radius: 3px; background: var(--yellow); }
body.tpl .sidebar nav { display: flex; flex-direction: column; }
body.tpl .sidebar nav a { padding: 11px 18px; color: var(--muted); }
body.tpl .sidebar nav a:hover { color: var(--text); }
body.tpl .sidebar nav a.active { background: var(--side-active); color: var(--text); }
body.tpl .sidebar-foot { margin-top: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
body.tpl .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; background: var(--dim); }
body.tpl .dot.on { background: var(--green); }
body.tpl .dot.off { background: var(--red); }
body.tpl main { overflow: auto; padding: 18px; min-width: 0; }
body.tpl .page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 4px 14px; }
body.tpl .page-head h1 { margin: 0; font-size: 28px; font-weight: 300; }
body.tpl .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; display: flex; flex-direction: column; min-width: 0; }
body.tpl .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: var(--muted); font-size: 14px; font-weight: 300; }
body.tpl .panel-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.tpl .btn { border: 1px solid var(--border); background: var(--side); border-radius: 3px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
body.tpl .btn:hover { border-color: var(--muted); }
body.tpl .btn.primary { background: var(--blue); border-color: var(--blue); color: #0f1418; font-weight: 500; padding: 9px 18px; }
body.tpl .btn.primary:disabled { background: var(--side); border-color: var(--border); color: var(--dim); cursor: not-allowed; }
body.tpl .btn.small { padding: 3px 8px; font-size: 12px; }
body.tpl .btn.ghost { background: none; }
body.tpl .link { background: none; border: none; padding: 0; color: var(--blue); cursor: pointer; font-family: var(--mono); font-size: 12px; }
body.tpl .link:hover { text-decoration: underline; }
body.tpl .link.danger { color: var(--red); }
body.tpl .btn.danger { color: var(--red); }
body.tpl .input, body.tpl .select, body.tpl .textarea { background: var(--inset); border: 1px solid var(--border); border-radius: 3px; padding: 7px 10px; outline: none; min-width: 0; }
body.tpl .input:focus, body.tpl .select:focus, body.tpl .textarea:focus { border-color: var(--blue); }
body.tpl .textarea { resize: vertical; width: 100%; min-height: 64px; }
body.tpl .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
body.tpl .field > label { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
body.tpl .field > label .mono { font-size: 11px; color: var(--dim); }
body.tpl .chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 3px; background: var(--side); font-size: 12px; cursor: pointer; border: 1px solid transparent; }
body.tpl .chip.active { border-color: var(--blue); }
body.tpl .chip .x { color: var(--dim); }
body.tpl .chip .x:hover { color: var(--red); }
body.tpl .chip.add { background: none; border: 1px dashed var(--border); color: var(--muted); }
body.tpl .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
body.tpl .seg button { border: none; background: none; padding: 5px 12px; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 12px; }
body.tpl .seg button.on { background: var(--side); color: var(--text); }
body.tpl .toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--side); border: 1px solid var(--border); padding: 9px 14px; border-radius: 3px; z-index: 100; max-width: 80vw; }
body.tpl .toast.error { border-color: var(--red); color: #ffb3c0; }
body.tpl .run-grid { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 14px; align-items: start; }
body.tpl .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
body.tpl .shared-row { display: flex; flex-wrap: wrap; gap: 10px; }
body.tpl .shared-row .field { flex: 1 1 120px; }
body.tpl .shared-row .field.wide { flex: 2 1 220px; }
body.tpl .media-input { display: flex; gap: 6px; align-items: center; }
body.tpl .media-input .input { flex: 1; }
body.tpl .thumb { width: 36px; height: 24px; border-radius: 2px; object-fit: cover; background: var(--side); flex: none; }
body.tpl .models-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
body.tpl .models-row > .lbl { color: var(--dim); font-size: 12px; margin-right: 2px; }
body.tpl .empty { color: var(--dim); padding: 24px 14px; text-align: center; }
body.tpl .popover { position: absolute; z-index: 50; width: 520px; max-height: 460px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 3px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
body.tpl .popover-head { display: flex; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
body.tpl .popover-head .input { flex: 1; }
body.tpl .popover-list { overflow: auto; }
body.tpl .result { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; padding: 8px 10px; cursor: pointer; align-items: center; }
body.tpl .result:hover { background: var(--inset); }
body.tpl .result img, body.tpl .result .noimg { width: 40px; height: 40px; border-radius: 3px; object-fit: cover; background: var(--side); }
body.tpl .result .r-name { font-weight: 500; }
body.tpl .result .r-sub { font-family: var(--mono); font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .result .r-prov { font-family: var(--mono); font-size: 11px; color: var(--muted); }
body.tpl .popover-section { padding: 8px 10px 4px; font-size: 11px; color: var(--dim); font-family: var(--mono); text-transform: uppercase; }
body.tpl .tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 14px 10px; }
body.tpl .tabs:empty { display: none; }
body.tpl .tabs button { border: none; background: none; padding: 3px 8px; border-radius: 3px; color: var(--dim); font-family: var(--mono); font-size: 11px; cursor: pointer; }
body.tpl .tabs button.on { background: var(--side); color: var(--text); }
body.tpl .endpoint { font-family: var(--mono); font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.tpl .endpoint select { font-size: 12px; padding: 2px 6px; }
body.tpl .cli { display: flex; flex-direction: column; font-family: var(--mono); font-size: 12px; }
body.tpl .cli-row { display: grid; grid-template-columns: 172px 172px minmax(0, 1fr); align-items: center; padding: 5px 8px; gap: 8px; min-height: 32px; }
body.tpl .cli-row:nth-child(even) { background: var(--inset); }
body.tpl .cli-row.head { color: var(--dim); font-size: 10px; border-bottom: 1px solid var(--border); background: none !important; min-height: 0; }
body.tpl .cli-name { display: flex; align-items: center; gap: 6px; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .cli-name::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; }
body.tpl .cli-name.changed::before { background: var(--yellow); }
body.tpl .cli-name.req { color: #8cc4ff; }
body.tpl .cli-meta { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .cli-val { min-width: 0; display: flex; align-items: center; gap: 4px; }
body.tpl .cli-val .input, body.tpl .cli-val .select { width: 100%; padding: 3px 6px; font-family: var(--mono); font-size: 12px; }
body.tpl .cli-val .input.unset, body.tpl .cli-val .select.unset { color: var(--dim); }
body.tpl .cli-val .shared { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
body.tpl .cli-val .shared:hover { color: var(--muted); }
body.tpl .cli-row.missing .cli-name { color: var(--red); }
body.tpl .cli-json { grid-column: 1 / -1; }
body.tpl .cli-json .textarea { font-family: var(--mono); font-size: 12px; min-height: 90px; }
body.tpl .cli-foot { display: flex; gap: 16px; padding: 10px 8px 0; color: var(--dim); font-size: 11px; flex-wrap: wrap; }
body.tpl .notices { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 11px; padding: 6px 8px 0; }
body.tpl .runbar { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 14px; gap: 14px; }
body.tpl .runbar .total { font-family: var(--mono); font-size: 20px; font-weight: 500; }
body.tpl .runbar .breakdown { font-family: var(--mono); font-size: 11px; color: var(--dim); }
body.tpl .result-card { border: 1px solid; border-radius: 3px; overflow: hidden; }
body.tpl .result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; color: var(--ink); font-weight: 500; }
body.tpl .result-head .rh-status { font-family: var(--mono); font-size: 12px; }
body.tpl .result-body { display: flex; gap: 14px; padding: 12px; }
body.tpl .preview { width: 240px; height: 135px; flex: none; border: 1px solid var(--border); border-radius: 2px; background: #12161a; display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
body.tpl .preview video, body.tpl .preview img { width: 100%; height: 100%; object-fit: contain; background: #000; }
body.tpl .preview audio { width: 92%; }
body.tpl .metrics { display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 12px; min-width: 0; flex: 1; }
body.tpl .metric { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; }
body.tpl .metric .k { color: var(--dim); }
body.tpl .metric .v { overflow-wrap: anywhere; }
body.tpl .metric .v small { color: var(--dim); font-size: 11px; }
body.tpl .actions { display: flex; gap: 14px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
body.tpl .st-succeeded { --c: var(--green); }
body.tpl .st-queued, body.tpl .st-running, body.tpl .st-pending, body.tpl .st-finalizing { --c: var(--yellow); }
body.tpl .st-failed { --c: var(--red); }
body.tpl .st-canceled { --c: var(--grey); }
body.tpl .result-card { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
body.tpl .result-card .result-head { background: var(--c); }
body.tpl .result-card .result-body { background: color-mix(in srgb, var(--c) 5%, transparent); }
body.tpl .raw { margin: 0 12px 12px; padding: 10px; background: var(--inset); border: 1px solid var(--border); border-radius: 3px; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
body.tpl .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.tpl .table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 3px; }
body.tpl table.log { width: 100%; border-collapse: collapse; font-size: 12px; }
body.tpl table.log th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--dim); background: var(--side); padding: 8px 10px; position: sticky; top: 0; white-space: nowrap; }
body.tpl table.log td { padding: 9px 10px; border-top: 1px solid var(--border); white-space: nowrap; }
body.tpl table.log td.num { font-family: var(--mono); text-align: right; }
body.tpl table.log th.num { text-align: right; }
body.tpl table.log tr.row { cursor: pointer; }
body.tpl table.log tr.row:hover td { background: var(--inset); }
body.tpl table.log tr.sel td { background: color-mix(in srgb, var(--blue) 10%, transparent); }
body.tpl table.log td.status::before { content: '●'; margin-right: 6px; color: var(--c); }
body.tpl table.log tr.detail td { white-space: normal; background: var(--inset); }
body.tpl .detail-grid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 4px 0; }
body.tpl .detail-grid pre { margin: 0; font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }
body.tpl .log-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; color: var(--muted); }
body.tpl .models-grid { display: flex; flex-direction: column; gap: 14px; }
body.tpl .model-card .mc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; }
body.tpl .mc-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.tpl .mc-title b { font-weight: 500; font-size: 14px; }
body.tpl .mc-title span { font-family: var(--mono); font-size: 11px; color: var(--dim); }
body.tpl table.prices { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
body.tpl table.prices th { text-align: left; font-weight: 400; color: var(--dim); font-size: 10px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
body.tpl table.prices td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
body.tpl table.prices tr.future td { color: var(--dim); }
body.tpl table.prices tr.expired td { color: var(--dim); text-decoration: line-through; }
body.tpl .price-form { display: grid; grid-template-columns: 110px 100px 120px 90px 120px 120px 1fr auto; gap: 6px; align-items: center; }
body.tpl .price-form .input, body.tpl .price-form .select { padding: 4px 6px; font-family: var(--mono); font-size: 12px; width: 100%; }
body.tpl .keys { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
body.tpl .login { max-width: 360px; margin: 18vh auto; }
@media (max-width: 1180px) {
body.tpl .run-grid { grid-template-columns: 1fr; }


}
@media (max-width: 760px) {
body.tpl .app { grid-template-columns: 1fr; }
body.tpl .sidebar { flex-direction: row; align-items: center; }
body.tpl .sidebar nav { flex-direction: row; }
body.tpl .sidebar-foot { display: none; }
body.tpl .result-body { flex-direction: column; }
body.tpl .preview { width: 100%; height: auto; aspect-ratio: 16 / 9; }
body.tpl .cli-row { grid-template-columns: 130px 1fr; }
body.tpl .cli-meta { grid-column: 1 / -1; }
body.tpl .price-form { grid-template-columns: 1fr 1fr; }


}
body.tpl .brand-mark.t { background: var(--blue); }
body.tpl .head-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body.tpl .tmpl-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
body.tpl .st-done { --c: var(--green); }
body.tpl .st-stale { --c: #7a6f3a; }
body.tpl .st-none { --c: var(--border); }
body.tpl .st-partial, body.tpl .st-draft { --c: var(--grey); }
body.tpl .drop { border: 1px dashed var(--border); border-radius: 3px; padding: 14px; text-align: center; color: var(--dim); cursor: pointer; font-size: 12px; }
body.tpl .drop.over { border-color: var(--blue); color: var(--text); }
body.tpl .thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
body.tpl .tthumb { position: relative; width: 72px; }
body.tpl .tthumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); background: var(--inset); display: block; }
body.tpl .tthumb span { display: block; font-family: var(--mono); font-size: 10px; color: var(--dim); text-align: center; margin-top: 2px; }
body.tpl .tthumb button { position: absolute; top: 2px; right: 2px; border: none; background: rgba(0,0,0,.6); color: #fff; border-radius: 2px; width: 18px; height: 18px; cursor: pointer; line-height: 1; }
body.tpl .presets-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
body.tpl .pp { border: 1px solid var(--border); border-radius: 3px; padding: 0; background: var(--inset); cursor: pointer; text-align: left; overflow: hidden; }
body.tpl .pp img, body.tpl .pp .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--side); }
body.tpl .pp span { display: block; padding: 4px 6px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.tpl .pp.on { border-color: var(--blue); }
body.tpl .pp.on span { color: var(--text); }
body.tpl .stars { display: flex; gap: 2px; }
body.tpl .stars button { background: none; border: none; color: var(--dim); font-size: 18px; cursor: pointer; padding: 0 2px; line-height: 1; }
body.tpl .stars button.on { color: var(--yellow); }
body.tpl .kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 8px; font-family: var(--mono); font-size: 12px; }
body.tpl .kv .k { color: var(--dim); }
body.tpl .pipeline { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
body.tpl .step { border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); border-radius: 3px; overflow: hidden; background: var(--panel); }
body.tpl .step.st-none, body.tpl .step.st-stale { border-style: dashed; }
body.tpl .step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: color-mix(in srgb, var(--c) 22%, var(--panel)); }
body.tpl .step.st-done .step-head, body.tpl .step.st-running .step-head, body.tpl .step.st-failed .step-head { background: var(--c); color: var(--ink); }
body.tpl .step.st-done .step-head .dim, body.tpl .step.st-running .step-head .dim, body.tpl .step.st-failed .step-head .dim { color: rgba(17,20,24,.65); }
body.tpl .step-title { display: flex; align-items: baseline; gap: 10px; font-weight: 500; min-width: 0; }
body.tpl .step-title .mono { font-size: 11px; font-weight: 400; }
body.tpl .step-actions { display: flex; gap: 6px; align-items: center; flex: none; }
body.tpl .step-actions .btn { padding: 4px 10px; font-size: 12px; background: rgba(0,0,0,.15); border-color: rgba(0,0,0,.2); color: inherit; }
body.tpl .step.st-none .step-actions .btn, body.tpl .step.st-stale .step-actions .btn { background: var(--side); border-color: var(--border); }
body.tpl .step-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
body.tpl .step-meta { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--dim); align-items: center; }
body.tpl .step-meta b { color: var(--muted); font-weight: 400; }
body.tpl .subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
body.tpl .subtabs button { border: none; background: none; padding: 6px 10px; color: var(--dim); cursor: pointer; font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
body.tpl .subtabs button.on { color: var(--text); border-bottom-color: var(--blue); }
body.tpl .subtabs .spacer { flex: 1; }
body.tpl pre.out { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--inset); border: 1px solid var(--border); border-radius: 3px; padding: 12px; max-height: 560px; overflow: auto; }
body.tpl textarea.out-edit { font-family: var(--mono); font-size: 12px; line-height: 1.55; min-height: 420px; }
body.tpl .o-character { background: color-mix(in srgb, #b07cf0 22%, transparent); }
body.tpl .o-product { background: color-mix(in srgb, #e8a33a 20%, transparent); }
body.tpl .o-shots { background: color-mix(in srgb, var(--blue) 16%, transparent); }
body.tpl .o-dialogue { background: color-mix(in srgb, var(--green) 22%, transparent); }
body.tpl .o-frame { }
body.tpl .o-closing { background: color-mix(in srgb, var(--grey) 30%, transparent); }
body.tpl .legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--dim); align-items: center; }
body.tpl .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
body.tpl .checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 12px; }
body.tpl .checks li::before { content: '✓ '; color: var(--green); }
body.tpl .checks li.bad { color: var(--red); }
body.tpl .checks li.bad::before { content: '✗ '; color: var(--red); }
body.tpl .lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
body.tpl .lines li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; font-size: 12px; align-items: baseline; }
body.tpl .lines .when { font-family: var(--mono); color: var(--dim); }
body.tpl .lines .fit { font-family: var(--mono); color: var(--dim); font-size: 11px; }
body.tpl .lines .fit.over { color: var(--red); }
body.tpl .model-row { display: flex; gap: 14px; }
body.tpl .stale-note { font-size: 12px; color: #c9b85a; }
body.tpl .runall { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
body.tpl .tabsbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
body.tpl .tabsbar button { border: none; background: none; padding: 8px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
body.tpl .tabsbar button.on { color: var(--text); border-bottom-color: var(--blue); }
body.tpl .block { display: flex; flex-direction: column; gap: 8px; }
body.tpl .block-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
body.tpl .block-head b { font-weight: 500; }
body.tpl .block textarea { font-family: var(--mono); font-size: 12px; line-height: 1.55; min-height: 280px; }
body.tpl .block textarea.tall { min-height: 560px; }
body.tpl pre.diff { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--inset); border: 1px solid var(--border); border-radius: 3px; padding: 12px; max-height: 620px; overflow: auto; }
body.tpl pre.diff .same { color: var(--dim); }
body.tpl pre.diff ins { background: color-mix(in srgb, var(--green) 25%, transparent); text-decoration: none; }
body.tpl pre.diff del { background: color-mix(in srgb, var(--red) 25%, transparent); }
body.tpl .dirty-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); margin-left: 6px; }
body.tpl .json-edit { font-family: var(--mono); font-size: 12px; min-height: 220px; }
body.tpl .step-edit { border: 1px solid var(--border); border-radius: 3px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--inset); }
body.tpl .step-edit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body.tpl .step-edit-head .input { flex: 1; min-width: 140px; }
body.tpl .list-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); }
body.tpl .list-row:first-child { border-top: none; }
body.tpl .runs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
body.tpl .run-card { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; }
body.tpl .run-card:hover { border-color: var(--muted); }
body.tpl .run-card .media { aspect-ratio: 9 / 12; background: #000 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--dim); overflow: hidden; position: relative; }
body.tpl .run-card .media video, body.tpl .run-card .media img { width: 100%; height: 100%; object-fit: cover; }
body.tpl .run-card .media .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 2px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
body.tpl .run-card .media, body.tpl .run-card .info { cursor: pointer; }
body.tpl .run-card .info { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
body.tpl .run-card .info .row { display: flex; justify-content: space-between; gap: 8px; }
body.tpl .run-card .info .mono { font-size: 11px; color: var(--dim); }
body.tpl .preset-card { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 14px; }
body.tpl .preset-card .imgs { display: flex; flex-direction: column; gap: 8px; }
body.tpl .preset-card .imgs img, body.tpl .preset-card .imgs .noimg { width: 140px; aspect-ratio: 1; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); background: var(--inset); }
body.tpl .row-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
body.tpl .row-fields .field { flex: 1 1 140px; }
@media (max-width: 1100px) {
body.tpl .tmpl-grid { grid-template-columns: 1fr; }
 
}
@media (max-width: 760px) {
body.tpl .preset-card { grid-template-columns: 1fr; }
body.tpl .lines li { grid-template-columns: 1fr; }
 
}
body.tpl .scards { display: flex; flex-direction: column; gap: 0; }
body.tpl .scard { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
body.tpl .scard-rail { display: flex; flex-direction: column; align-items: center; position: relative; }
body.tpl .scard-rail::after { content: ''; position: absolute; top: 34px; bottom: -2px; width: 1px; background: var(--border); }
body.tpl .scard:last-of-type .scard-rail::after { display: none; }
body.tpl .scard-n { margin-top: 12px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--panel); }
body.tpl .scard-main { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; margin-bottom: 12px; min-width: 0; }
body.tpl .scard-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
body.tpl .scard-title { flex: 1; min-width: 120px; background: none; border-color: transparent; font-weight: 500; }
body.tpl .scard-title:hover { border-color: var(--border); }
body.tpl .scard-id { flex: 0 1 120px; font-size: 11px; color: var(--muted); }
body.tpl .kind-badge { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 2px; background: var(--side); color: var(--muted); white-space: nowrap; }
body.tpl .scard-head .btn.on { border-color: var(--blue); color: var(--blue); }
body.tpl .scard-issues { padding: 6px 12px 0; font-size: 11px; }
body.tpl .sf-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
body.tpl .sf-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
body.tpl .sf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
body.tpl .sf-row .sf { flex: 1 1 180px; }
body.tpl .sf-l { font-size: 11px; color: var(--muted); }
body.tpl .ref-text { display: flex; flex-direction: column; gap: 4px; }
body.tpl .ref-text .textarea { font-family: var(--mono); font-size: 12px; min-height: 0; }
body.tpl .ref-tools { display: flex; justify-content: flex-end; }
body.tpl .ref-select { font-size: 11px; padding: 3px 6px; max-width: 240px; }
body.tpl .cli.map .cli-row { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 220px); }
body.tpl .cli.map .cli-row.set .cli-name::before { background: var(--yellow); }
body.tpl .cli.map .cli-val { flex-wrap: wrap; }
body.tpl .cli.map .cli-val .input, body.tpl .cli.map .cli-val .select { flex: 1 1 140px; min-width: 0; font-size: 11px; padding: 3px 6px; }
body.tpl .list-ctl { display: flex; flex-direction: column; gap: 4px; width: 100%; }
body.tpl .list-item { display: flex; gap: 4px; }
body.tpl .scard-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: 44px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 3px; }
body.tpl .run-card .in-thumbs { display: flex; gap: 4px; }
body.tpl .run-card .in-thumbs img { width: 28px; height: 28px; object-fit: cover; border-radius: 2px; background: var(--side); }
body.tpl .run-card .one-line { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .run-card .qa { color: var(--muted); }
body.tpl .run-card .info .row.mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }
body.tpl .sprompts { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
body.tpl .sblock { border: 1px solid var(--border); border-radius: 3px; background: var(--inset); }
body.tpl .sblock-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px; flex-wrap: wrap; }
body.tpl .sblock-head .mono.dim { font-size: 11px; margin-left: auto; }
body.tpl .sblock-peek { padding: 0 10px 8px; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .sblock-text { border: none; border-top: 1px solid var(--border); border-radius: 0; min-height: 260px; max-height: 60vh; font-family: var(--mono); font-size: 12px; background: var(--panel); }
body.tpl .seg.small button { padding: 2px 8px; font-size: 11px; }
body.tpl .sf-line { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
body.tpl .kv { display: inline-flex; align-items: center; gap: 6px; }
body.tpl .kv-l { font-family: var(--mono); font-size: 11px; color: var(--dim); }
body.tpl .compact { max-width: 420px; padding: 3px 8px !important; font-size: 12px !important; }
body.tpl select.compact { width: auto !important; }
body.tpl .wiring { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 11px; }
body.tpl .wiring .sf-line { width: 100%; }
body.tpl .lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,12,.92); display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
body.tpl .lb-stage { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; min-height: 0; }
body.tpl .lb-stage video, body.tpl .lb-stage img { max-height: calc(100vh - 48px); max-width: calc(100% - 100px); border-radius: 3px; background: #000; }
body.tpl .lb-nav { background: none; border: none; color: var(--muted); font-size: 40px; cursor: pointer; padding: 0 8px; }
body.tpl .lb-nav:hover:not(:disabled) { color: var(--text); }
body.tpl .lb-nav:disabled { opacity: .15; cursor: default; }
body.tpl .lb-info { background: var(--panel); border-left: 1px solid var(--border); padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow: auto; font-size: 13px; }
body.tpl .lb-info .mono { font-size: 11px; }
body.tpl .lb-info .in-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
body.tpl .lb-info .in-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 2px; }
body.tpl .lb-actions { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
body.tpl .lb-actions .mono { margin-right: auto; }
@media (max-width: 800px) {
body.tpl .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
body.tpl .lb-info { border-left: none; border-top: 1px solid var(--border); }
 
}
body.tpl .input-row { display: flex; gap: 8px; align-items: stretch; }
body.tpl .input-row > .drop, body.tpl .input-row > .input { flex: 1; min-width: 0; }
body.tpl .lib-btn { white-space: nowrap; }
body.tpl .tthumb .tsave { left: 2px; right: auto; }
body.tpl .video-ref { display: flex; gap: 10px; align-items: flex-start; }
body.tpl .video-ref video { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 3px; background: #000; }
body.tpl .video-ref .actions { display: flex; flex-direction: column; gap: 6px; }
body.tpl .lib-shade { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 24px; }
body.tpl .lib-dialog { width: min(880px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
body.tpl .lib-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
body.tpl .lib-head .dim { font-size: 11px; }
body.tpl .lib-x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
body.tpl .lib-tools { display: flex; gap: 8px; padding: 10px 14px; }
body.tpl .lib-tools .input { flex: 1; }
body.tpl .lib-body { overflow: auto; padding: 0 14px 14px; flex: 1; min-height: 0; }
body.tpl .lib-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; }
body.tpl .lib-tag { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
body.tpl .lib-tag.on { color: var(--text); border-color: var(--blue); }
body.tpl .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
body.tpl .lib-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 3px; cursor: pointer; background: var(--inset); min-width: 0; }
body.tpl .lib-tile:hover { border-color: var(--muted); }
body.tpl .lib-tile.picked { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
body.tpl .lib-media { position: relative; aspect-ratio: 3 / 4; border-radius: 2px; overflow: hidden; background: #000; }
body.tpl .lib-media img, body.tpl .lib-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
body.tpl .lib-check { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: transparent; display: flex; align-items: center; justify-content: center; font-size: 12px; }
body.tpl .lib-tile.picked .lib-check { background: var(--blue); color: #0f1418; }
body.tpl .lib-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .lib-meta { font-family: var(--mono); font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .lib-edit { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, .55); border: none; color: #fff; border-radius: 2px; width: 22px; height: 22px; cursor: pointer; opacity: 0; }
body.tpl .lib-tile:hover .lib-edit { opacity: 1; }
body.tpl .lib-tile.editing { cursor: default; gap: 6px; }
body.tpl .lib-tile.editing .input { font-size: 12px; padding: 4px 6px; }
body.tpl .lib-edit-row { display: flex; gap: 6px; justify-content: flex-end; }
body.tpl .lib-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
body.tpl .lib-foot:empty { display: none; }
@media (max-width: 760px) {
body.tpl .lib-shade { padding: 0; align-items: stretch; bottom: auto; height: 100vh; height: 100dvh; }
body.tpl .lib-dialog { max-height: none; height: 100%; width: 100%; max-width: 100vw; border-radius: 0; border: none; min-width: 0; }
body.tpl .lib-head { flex-wrap: wrap; min-width: 0; }
body.tpl .lib-tools { flex-wrap: wrap; }
body.tpl .lib-tools .input { flex: 1 1 100%; }
body.tpl .lib-tools .btn { flex: 1; }
body.tpl .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.tpl .lib-edit { opacity: 1; }
body.tpl .lib-tools .input, body.tpl .lib-tile.editing .input { font-size: 16px; }
body.tpl .input-row { flex-wrap: wrap; }


}
body.tpl .lib-audio { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 28px; padding: 8px; }
body.tpl .lib-audio audio { width: 100%; height: 32px; }
body.tpl .step-inputs { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
body.tpl .fit-notes { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-family: var(--mono); }
body.tpl .step-inputs textarea { font-size: 12px; }
body.tpl .step-review { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
body.tpl .review-line { display: flex; gap: 6px; align-items: flex-start; }
body.tpl .review-line > span { font-family: var(--mono); width: 10px; padding-top: 5px; }
body.tpl .review-in { min-height: 0; resize: none; overflow: hidden; padding: 4px 8px; font-size: 12px; line-height: 1.4; }
body.tpl .try-list { display: flex; flex-direction: column; gap: 2px; }
body.tpl .try-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 3px; cursor: pointer; }
body.tpl .try-item:hover { background: var(--inset); }
body.tpl .try-item.off { opacity: .5; cursor: default; }
body.tpl .try-item input { margin-top: 3px; }
body.tpl .try-sub { font-size: 11px; }
body.tpl .variants { margin-top: 14px; }
body.tpl .variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
body.tpl .variant { border: 1px solid var(--border); border-radius: 3px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
body.tpl .variant.current { border-color: var(--blue); }
body.tpl .variant-head { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; min-width: 0; }
body.tpl .variant-head b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tpl .variant-media { background: #000; border-radius: 2px; aspect-ratio: 9 / 16; max-height: 360px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 12px; }
body.tpl .variant-media video, body.tpl .variant-media img { width: 100%; height: 100%; object-fit: contain; }
body.tpl .variant-text { margin: 0; max-height: 240px; overflow: auto; white-space: pre-wrap; font-size: 11px; background: var(--inset); padding: 6px; border-radius: 2px; }
body.tpl .variant-facts, body.tpl .variant-note { font-size: 11px; }
body.tpl .exp-tag { font-size: 11px; color: var(--blue); }
body.tpl .variant-media.empty { aspect-ratio: auto; min-height: 56px; background: var(--inset); }

