/* GenVidImg — cada trabajo se lee como una hoja de llamado: papel, tinta, resaltador y pestañas de revisión. */

@font-face { font-family: 'Noto Sans GVI'; src: url('/fonts/NotoSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans GVI'; src: url('/fonts/NotoSans-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex Mono GVI'; src: url('/fonts/ui/IBMPlexMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono GVI'; src: url('/fonts/ui/IBMPlexMono-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  /* Papel y tinta */
  --paper: #fbfaf7;
  --paper-2: #f3f1ec;
  --card: #ffffff;
  --ink: #16181a;
  --ink-2: #44433f;  /* 9,6:1 sobre papel */
  --ink-3: #64635d;  /* 5,9:1 sobre papel */
  --rule: #e3e0d8;
  --rule-2: #b9b6ad;
  /* Resaltador: solo la acción principal y el lugar actual */
  --hl: #f7e463;
  --hl-hover: #f0d834;
  --hl-soft: #fdf6c7;
  /* Pestañas de revisión (estado) */
  --run-bg: #dbe8f7; --run: #1f4f8a;
  --ok-bg: #dcf0e1;  --ok: #1d6337;
  --bad-bg: #f8dde6; --bad: #8a2343;
  --wait-bg: #ebe9e2; --wait: #4f4e49;
  --warn: #7a5200;
  --err: #a3261b;
  /* Forma */
  --r: 3px;
  --sans: 'Noto Sans GVI', 'Noto Sans', system-ui, sans-serif;
  --mono: 'Plex Mono GVI', ui-monospace, 'DejaVu Sans Mono', monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html, body { background: var(--paper); color: var(--ink); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-2) transparent; }
body { margin: 0; font: 400 15px/1.5 var(--sans); caret-color: var(--ink); }
::selection { background: var(--hl); color: var(--ink); }
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--hl); color: var(--ink); padding: 8px 12px; font-weight: 700; }
.skip:focus { left: 8px; }
.tabular { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 28px; height: 28px; }

/* ================================================================== Estructura */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; outline: none; }
main > .view { max-width: 1320px; }

.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; background: var(--ink); color: #e9e7e1; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; text-decoration: none; }
.brand-mark { width: 22px; height: 16px; border-radius: 2px; background: linear-gradient(90deg, #fff 0 60%, var(--hl) 60%); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.side-create { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; margin-bottom: 14px; border-radius: var(--r); background: var(--hl); color: var(--ink); font-weight: 700; text-decoration: none; }
.side-create:hover { background: var(--hl-hover); }
.side-create[aria-current="page"] { box-shadow: inset 0 0 0 2px #fff; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--r); color: #c9c6be; text-decoration: none; font-weight: 700; }
.side-item:hover { background: rgb(255 255 255 / .07); color: #fff; }
.side-item[aria-current="page"] { background: var(--hl); color: var(--ink); }
.side-item[aria-current="page"] .side-live { color: var(--run); }
.side-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--mono); color: #b8d3f2; }
.side-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8fb8e8; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.side :focus-visible { outline-color: var(--hl); }
.key-chip { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; color: #bdbab2; font-size: 13px; cursor: pointer; text-align: left; }
.key-chip:hover { color: #fff; }

.view-head { display: grid; gap: 6px; padding-bottom: 14px; margin-bottom: 24px; border-bottom: 2px solid var(--ink); }
.view-head-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head-row > div { display: grid; gap: 6px; }
h1 { font-size: 26px; font-weight: 700; outline: none; }
.lede { color: var(--ink-2); max-width: 68ch; }

/* ================================================================== Controles */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--card); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.1; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--hl); }
.btn-primary:hover { background: var(--hl-hover); }
.btn-ghost { border-color: var(--rule-2); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-small .icon { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.is-busy { cursor: progress; background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); background-size: 200% 100%; animation: busy 1.1s linear infinite; }
.btn.is-suggested { background: var(--hl); border-color: var(--ink); }
@keyframes busy { to { background-position: -200% 0; } }
label.btn { position: relative; }
label.btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--paper-2); border-color: var(--rule); color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.icon-btn .icon { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: start; }
.field-row > .field { flex: 1 1 200px; }
.field-row > .field-grow { flex: 3 1 320px; }
.field-row > .field-num, .field-num { flex: 0 1 170px; }
.field-label { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 13px; padding: 0; }
.optional { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.count { margin-left: auto; font: 400 12px var(--mono); color: var(--ink-3); }
.count.is-over { color: var(--err); font-weight: 700; }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--card); font-size: 15px; line-height: 1.35;
}
input[type="number"] { font-family: var(--mono); }
textarea { resize: vertical; min-height: 64px; }
select { cursor: pointer; }
input:hover, select:hover, textarea:hover { border-color: #8f8c84; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
::placeholder { color: #807e77; opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }
input[type="range"] { accent-color: var(--ink); width: 100%; }
.is-invalid { border-color: var(--err) !important; }
.field-error { color: var(--err); font-size: 13px; font-weight: 700; }
.note, .hint { font-size: 13px; color: var(--ink-3); max-width: 75ch; }
.note.is-warn { color: var(--warn); }
.note a { color: var(--ink); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--card); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 14px; font-size: 14px; font-weight: 700; border-left: 1px solid var(--rule); }
.segmented label:first-child span { border-left: 0; }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented label:focus-within { outline: 2px solid var(--ink); outline-offset: -4px; }
.segmented-small span { padding: 6px 12px; font-size: 13px; }
.seg-field { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }

.bar { height: 6px; background: #e6e3db; overflow: hidden; border-radius: 1px; }
.bar-fill { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .45s var(--ease); }

/* Pestañas de revisión: el estado es un color de papel con su palabra. */
.tab { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--wait-bg); color: var(--wait); transition: background-color .3s, color .3s; }
.tab[data-tone="run"] { background: var(--run-bg); color: var(--run); }
.tab[data-tone="ok"] { background: var(--ok-bg); color: var(--ok); }
.tab[data-tone="bad"] { background: var(--bad-bg); color: var(--bad); }
.job-no { font: 700 13px var(--mono); letter-spacing: .02em; color: var(--ink); }

.empty { list-style: none; padding: 28px 0; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.empty strong { color: var(--ink); }
.skeleton-row { list-style: none; height: 64px; margin: 8px 0; border-radius: var(--r); background: linear-gradient(90deg, var(--paper-2), #ebe8e1, var(--paper-2)) 0 0 / 200% 100%; animation: busy 1.3s linear infinite; }
.more { display: flex; justify-content: center; margin-top: 18px; }
.callout { display: flex; gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r); font-size: 14px; }
.callout .icon { margin-top: 2px; }
.callout-ok { background: var(--ok-bg); color: var(--ok); }
.callout-err { background: var(--bad-bg); color: var(--bad); }
.callout-info { background: var(--run-bg); color: var(--run); }
.error-list { margin: 6px 0 0; padding-left: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.preview-title { font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview-table th, .preview-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rule); }
.preview-table th { font-size: 12px; color: var(--ink-3); }
.preview-table td:first-child { font-family: var(--mono); }

/* ================================================================== Nuevo video */

.new-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.steps { display: grid; min-width: 0; }
.step { border: 0; margin: 0; padding: 22px 0 26px; border-top: 1px solid var(--rule); display: grid; gap: 14px; min-width: 0; }
.step:first-child { border-top: 0; padding-top: 0; }
.step-title { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; font-size: 18px; font-weight: 700; }
.step-title + * { clear: both; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--ink); border-radius: 2px; font: 700 13px var(--mono); transition: background-color .2s, color .2s; }
.step.is-complete .step-n { background: var(--ink); color: #fff; }

.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 1px dashed #8f8c84; border-radius: var(--r); background: var(--card); text-align: center; cursor: pointer; transition: background-color .15s, border-color .15s; }
.drop:hover, .drop.is-dragover { border-color: var(--ink); background: var(--hl-soft); }
.drop:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.drop[aria-busy="true"] { border-style: solid; }
.drop-main { font-weight: 700; }
.drop-sub { font-size: 13px; color: var(--ink-3); }
.drop-compact { grid-template-columns: auto 1fr; justify-items: start; text-align: left; padding: 12px 14px; column-gap: 10px; }
.drop-compact .icon { grid-row: span 2; align-self: center; }

.subhead { font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.subhead-count { font: 400 13px var(--mono); color: var(--ink-3); }

.media-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.media-grid-wide { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.media-grid > .empty { grid-column: 1 / -1; padding: 14px 0; }
.media-card { position: relative; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); min-width: 0; }
.media-card.is-principal { box-shadow: inset 0 0 0 2px var(--ink); border-color: var(--ink); }
.media-card.is-picked { background: var(--hl-soft); }
.media-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%; margin-bottom: 4px; padding: 0; border: 0; border-radius: 2px; background: #ecebe6; color: var(--ink-3); overflow: hidden; cursor: zoom-in; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-duration { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 2px; background: rgb(22 24 26 / .78); color: #fff; font: 400 11px var(--mono); }
.media-order:not(:empty) { position: absolute; top: 10px; left: 10px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 4px; border-radius: 2px; background: var(--hl); color: var(--ink); font: 700 12px var(--mono); }
.media-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.media-action.is-primary { background: var(--hl); border-color: var(--ink); color: var(--ink); }
.media-use { flex: 1; }
.upload-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upload { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.upload-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.upload-pct { font-family: var(--mono); color: var(--ink-3); }
.upload.is-error { border-color: var(--bad); background: var(--bad-bg); }
.upload.is-error .upload-pct { color: var(--bad); font-family: var(--sans); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.chevron { width: 16px; height: 16px; transition: transform .2s var(--ease); }
details[open] > summary .chevron { transform: rotate(90deg); }
.library > summary, .advanced > summary { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; padding: 4px 0; }
.library[open] { display: grid; gap: 12px; }
.advanced { border-top: 1px dashed var(--rule-2); padding-top: 12px; }
.advanced-body { display: grid; gap: 18px; padding-top: 14px; }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice, .mode-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--card); cursor: pointer; transition: background-color .15s, border-color .15s; }
.choice input, .mode-card input { grid-row: span 2; margin-top: 3px; }
.choice:hover, .mode-card:hover { border-color: var(--ink); }
.choice:has(input:checked), .mode-card:has(input:checked) { border-color: var(--ink); background: var(--hl-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-name, .mode-name { font-weight: 700; }
.choice-desc, .mode-desc { font-size: 13px; color: var(--ink-2); }
.classic { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.mode-card { padding: 10px 12px; }
.mode-fields { display: grid; gap: 14px; }

.analysis { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); }
.analysis-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.analysis-kicker, .direction-kicker { font-size: 12px; font-weight: 700; color: var(--ink-3); min-width: 96px; }
.analysis-subject { font-size: 14px; }
.analysis-subject.is-muted { color: var(--ink-3); font-weight: 400; }
.analysis-tag { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 2px; background: var(--wait-bg); color: var(--wait); }
.analysis-palette { display: inline-flex; gap: 4px; }
.analysis-swatch { width: 18px; height: 18px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18); }
.analysis-how, .analysis-wait { font-size: 12px; color: var(--ink-3); }

.ideas-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.ideas-title { font-size: 15px; font-weight: 700; }
.ideas-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ideas { display: grid; gap: 10px; }
.ideas-head { font-size: 13px; color: var(--ink-2); padding: 8px 0; }
.ideas.is-stale .idea-grid { opacity: .55; }
.idea-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); transition: opacity .2s; }
.idea { display: grid; gap: 8px; align-content: start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); transition: border-color .15s, opacity .2s; }
.idea.is-locked { border-color: var(--ink); }
.idea.is-busy { opacity: .55; pointer-events: none; }
.idea-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idea-title { font-size: 14px; font-weight: 700; margin-right: 2px; }
.idea-tools { margin-left: auto; display: inline-flex; }
.style-chip, .source-chip, .format-chip, .player-version { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 2px; font-size: 12px; font-weight: 700; background: var(--wait-bg); color: var(--wait); white-space: nowrap; }
.style-chip.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-2); color: var(--ink-3); }
.source-chip.is-groq { background: var(--run-bg); color: var(--run); }
.source-chip.is-user { background: var(--hl-soft); color: #5c4d00; }
.format-chip.is-silent { background: var(--paper-2); color: var(--ink-3); }
.idea-why { font-size: 13px; color: var(--ink-2); }
.idea-check { font-size: 13px; color: var(--warn); }
.idea-fieldwrap { display: grid; gap: 4px; }
.idea-label { display: flex; align-items: baseline; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.idea-field { min-height: 36px !important; font-size: 14px !important; }
textarea.idea-field { min-height: 56px !important; }
.idea-words { display: flex; flex-wrap: wrap; gap: 4px; }
.word { padding: 2px 7px; border: 1px solid var(--rule-2); border-radius: 2px; background: var(--card); font-size: 12px; cursor: pointer; }
.word:hover { border-color: var(--ink); }
.word[aria-pressed="true"] { background: var(--hl); border-color: var(--ink); font-weight: 700; }
.idea-foot { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.idea-font-label { display: grid; gap: 4px; flex: 1 1 140px; }
.idea-font { min-height: 32px !important; font-size: 13px !important; padding: 4px 8px !important; }
.idea-versions-note { font-size: 12px; }
.idea-versions-details > summary { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; }
.idea-version-list, .idea-versions-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.idea-version { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); font-size: 13px; }
.idea-version-kicker { font: 700 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.idea-version-text { display: grid; gap: 2px; }
.idea-version-cta { color: var(--ink-3); }
.idea-versions-actions { margin-top: 8px; }
.player-badge { justify-self: start; display: inline-block; padding: 1px 6px; border-radius: 2px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.direction { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); align-content: start; }
.direction-title { font-size: 15px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.direction-line { display: grid; gap: 2px; font-size: 13px; }
.direction-line > span:not(.direction-kicker) { overflow-wrap: anywhere; }
.direction-styles, .direction-media { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.direction-media-item { font-family: var(--mono); font-size: 12px; }
.direction-media-how { font-size: 12px; color: var(--ink-3); }
.direction-warnings, .direction-notes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.direction-notes .is-warn, .direction-warnings li { color: var(--warn); }

.formats { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.format-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.format-choice { display: flex; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); cursor: pointer; }
.format-choice:has(input:checked) { border-color: var(--ink); }
.format-choice input { margin-top: 3px; }
.format-text { display: grid; }
.format-name { font-size: 13px; font-weight: 700; }
.format-desc { font-size: 12px; color: var(--ink-3); }
.pro-panel { border: 1px solid var(--rule); border-radius: var(--r); margin: 0; padding: 12px 14px; display: grid; gap: 10px; background: var(--card); }
.pro-panel > legend { padding: 0 6px; }

.track-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.track-list > .empty { padding: 4px 0; font-size: 14px; }
.track { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); cursor: pointer; }
.track:hover { border-color: var(--ink); }
.track:has(input:checked) { border-color: var(--ink); background: var(--hl-soft); }
.track-text { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.track-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-meta { font: 400 12px var(--mono); color: var(--ink-3); }
.track-order:not(:empty) { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 2px; background: var(--ink); color: #fff; font: 700 12px var(--mono); }
#volume-out { font-family: var(--mono); font-weight: 400; }

.summary { position: sticky; top: 24px; display: grid; gap: 14px; padding: 18px 20px 20px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--card); }
.summary h2 { font-size: 15px; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.summary-list { margin: 0; display: grid; }
.summary-list > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.summary-list dt { font-size: 13px; color: var(--ink-3); }
.summary-list dd { margin: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.summary-count { display: flex; align-items: baseline; gap: 8px; }
.summary-count strong { font: 700 44px/1 var(--mono); letter-spacing: -.02em; }
.summary-count span { font-weight: 700; color: var(--ink-2); }
.summary-count.is-blocked strong { color: var(--ink-3); }
.why { font-size: 13px; color: var(--ink-2); }

/* ================================================================== Material */

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.toolbar-gap { flex: 1; }
[data-view="material"] { position: relative; }
[data-view="material"].is-dragover::after { content: 'Suelta los archivos para subirlos'; position: absolute; inset: -8px; display: grid; place-items: center; border: 2px dashed var(--ink); border-radius: var(--r); background: rgb(253 246 199 / .9); font-weight: 700; font-size: 18px; pointer-events: none; z-index: 5; }
[data-view="material"] > .upload-queue { margin-bottom: 14px; }

/* ================================================================== Hojas: Videos y Proyectos */

.sheet { margin-top: -10px; }
.sheet-head, .batch-row { display: grid; grid-template-columns: 64px 52px minmax(0, 1fr) 170px 110px minmax(150px, auto); align-items: center; gap: 12px; }
.sheet-head-sets, .set-row { grid-template-columns: 64px minmax(0, 1fr) 100px 110px minmax(110px, auto); }
.sheet-head { padding: 10px 8px; border-bottom: 1px solid var(--ink); font-size: 12px; font-weight: 700; color: var(--ink-3); }
.batch-list { list-style: none; margin: 0; padding: 0; }
.batch-row { min-height: 76px; padding: 8px; border-bottom: 1px solid var(--rule); transition: background-color .15s; }
.batch-row:hover { background: var(--card); }
.batch-cover { width: 40px; height: 60px; border-radius: 2px; overflow: hidden; background: #e6e3db; display: grid; place-items: center; color: var(--ink-3); }
.batch-cover-img { width: 100%; height: 100%; object-fit: cover; }
.batch-main { display: grid; gap: 2px; min-width: 0; }
.batch-name { font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-name:hover { text-decoration: underline; }
.batch-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-progress { display: grid; gap: 5px; }
.batch-count { font: 700 13px var(--mono); }
.batch-failed { font-size: 12px; color: var(--bad); font-weight: 700; }
.batch-actions-cell { display: flex; justify-content: flex-end; }
.batch-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.batch-list > .empty { padding: 32px 8px; }

/* ================================================================== Un pedido y un proyecto */

.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.back .icon { width: 16px; height: 16px; }
.lote-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.lote-titles { display: grid; gap: 8px; min-width: 0; }
.lote-titles h1 { overflow-wrap: anywhere; }
.lote-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ink-3); }
.lote-brief { font-size: 14px; color: var(--ink-2); max-width: 80ch; }
.lote-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.album-status { display: grid; gap: 8px; margin-bottom: 22px; max-width: 760px; }
.album-count { font-size: 15px; color: var(--ink-2); }
.album-count strong { font: 700 24px var(--mono); color: var(--ink); }
#lote-total { font-family: var(--mono); font-weight: 700; color: var(--ink); }
#lote-bar { height: 10px; }
.status-note { font-size: 13px; color: var(--ink-2); }
.status-note.is-error { color: var(--err); font-weight: 700; }
.lote-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.lote-body:has(> .lote-direction[hidden]) { grid-template-columns: minmax(0, 1fr); }
.lote-main { display: grid; gap: 14px; min-width: 0; }
.lote-direction { position: sticky; top: 24px; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.idea-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--card); cursor: pointer; font-size: 13px; }
.idea-chip:hover { border-color: var(--ink); }
.idea-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.idea-chip-hook { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idea-chip-count { font: 400 12px var(--mono); opacity: .8; }
.idea-chip-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; }

.album, .set-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.slot { display: grid; gap: 6px; align-content: start; min-width: 0; }
.slot.is-fresh { animation: settle .36s var(--ease); }
@keyframes settle { from { opacity: .3; transform: translateY(4px); } }
.sticker { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: var(--r); background: #1b1c1e; overflow: hidden; cursor: pointer; }
.sticker-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.sticker:hover .sticker-img { transform: scale(1.03); }
.sticker-fallback { display: grid; place-items: center; height: 100%; color: #8f8c84; }
.sticker-number, .slot-number, .set-number { font: 700 12px var(--mono); }
.sticker-number, .set-number { position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 2px; background: var(--paper); color: var(--ink); }
.sticker-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgb(22 24 26 / .72); color: #fff; opacity: 0; transition: opacity .2s; }
.sticker-play .icon { fill: currentColor; width: 20px; height: 20px; margin-left: 2px; }
.sticker:hover .sticker-play, .sticker:focus-visible .sticker-play { opacity: 1; }
.slot-tools a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-decoration: none; }
.slot-tools a:hover { text-decoration: underline; }
.slot-tools .icon { width: 16px; height: 16px; }
.slot-caption { font-size: 12px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-frame { aspect-ratio: 9 / 16; display: grid; place-content: center; justify-items: center; gap: 6px; border: 1px dashed var(--rule-2); border-radius: var(--r); background: var(--paper-2); transition: background-color .3s, border-color .3s; }
.slot-number { font-size: 18px; color: var(--ink-3); }
.slot-state { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.slot[data-status="processing"] .slot-frame { background: var(--run-bg); border-color: #9fbfe4; border-style: solid; }
.slot[data-status="processing"] .slot-state, .slot[data-status="processing"] .slot-number { color: var(--run); }
.slot[data-status="failed"] .slot-frame { background: var(--bad-bg); border-color: #e3a9bb; border-style: solid; }
.slot[data-status="failed"] .slot-state, .slot[data-status="failed"] .slot-number { color: var(--bad); }

.set-card { display: grid; gap: 8px; align-content: start; padding: 6px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.set-poster { position: relative; aspect-ratio: 9 / 16; border-radius: 2px; overflow: hidden; background: #1b1c1e; }
.set-poster img { width: 100%; height: 100%; object-fit: contain; }
.set-poster img.is-missing { visibility: hidden; }
.set-info { display: flex; min-height: 24px; }
.set-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 700; background: var(--wait-bg); color: var(--wait); }
.set-badge.is-distinct { background: var(--ok-bg); color: var(--ok); }
.set-actions { display: grid; gap: 6px; }
.set-style { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-state { justify-content: center; height: 32px; }
/* Lo que decidió la idea en cada video: ficha corta, datos en mono. */
.set-direction { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 0; padding: 6px 0 2px; border-top: 1px solid var(--rule); font-size: 12px; line-height: 1.35; }
.set-direction dt { color: var(--ink-3); font-weight: 700; }
.set-direction dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.set-ideas { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.set-ideas li { display: flex; gap: 8px; align-items: baseline; }
.set-idea-n { flex: none; font: 700 12px/1 var(--mono); color: var(--ink-3); }
.set-ideas q { color: var(--ink); }
.build-row { align-items: end; }

/* ================================================================== Diálogos y avisos */

dialog { border: 1px solid var(--ink); border-radius: var(--r); padding: 20px; background: var(--card); color: var(--ink); max-height: 92dvh; overflow: auto; box-shadow: 0 12px 40px rgb(22 24 26 / .22); }
dialog::backdrop { background: rgb(22 24 26 / .55); }
dialog[open] { animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.dialog-actions-stack { display: grid; justify-content: stretch; }
.player { width: min(460px, 94vw); }
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.player-head h2 { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.player video { width: 100%; max-height: 64dvh; aspect-ratio: 9 / 16; background: #000; border-radius: 2px; margin: 0 auto; }
.player-detail { display: grid; gap: 8px; margin-top: 12px; font-size: 13px; }
.player-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.player-tags { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.player-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.player-act { display: grid; gap: 2px; padding: 8px 10px; border-left: 1px solid var(--ink); background: var(--paper-2); }
.player-act-kicker { font: 700 11px var(--mono); color: var(--ink-3); }
.player-act-text { font-size: 14px; }
.player-act.is-silent .player-act-text { color: var(--ink-3); }
mark { background: var(--hl); color: var(--ink); padding: 0 2px; }
.player-design, .player-images { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--ink-2); }
.player-kicker { font-weight: 700; color: var(--ink-3); }
.media-preview { width: min(760px, 94vw); }
.media-preview-stage { display: grid; place-items: center; max-height: 66dvh; max-width: 100%; margin: 0 auto; background: #1b1c1e; border-radius: 2px; overflow: hidden; }
.media-preview-stage img, .media-preview-stage video { width: 100%; height: 100%; max-height: 66dvh; object-fit: contain; }
.media-preview-wait { color: #e9e7e1; padding: 32px 20px; text-align: center; font-size: 14px; }
.note-dialog, .key-dialog { width: min(460px, 92vw); }
.note-dialog form, .key-dialog form { display: grid; gap: 10px; }
.key-dialog p { font-size: 14px; color: var(--ink-2); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 12px 12px 14px; border-radius: var(--r); background: var(--ink); color: #f3f1ec; font-size: 14px; animation: rise .22s var(--ease); }
.toast .icon { margin-top: 1px; color: var(--hl); }
.toast.is-error { background: var(--err); color: #fff; }
.toast.is-error .icon { color: #fff; }
.toast button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.toast > button { opacity: .8; }
.toast > button:hover { opacity: 1; }
.toast-action { font-weight: 700; text-decoration: underline; color: var(--hl) !important; }
.toast.is-error .toast-action { color: #fff !important; }
.toast .code { display: block; margin-top: 4px; font: 400 12px var(--mono); opacity: .8; }

/* ================================================================== Teléfono y tableta */

@media (max-width: 1100px) {
  .new-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .lote-body { grid-template-columns: minmax(0, 1fr); }
  .lote-direction { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; }
  .brand { display: none; }
  .side-create { margin: 0; width: 44px; min-height: 44px; padding: 0; flex: none; }
  .side-create-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .side-list { display: flex; gap: 2px; }
  .side-item { min-height: 44px; padding: 0 10px; white-space: nowrap; }
  .side-item .icon { display: none; }
  .side-live { margin-left: 4px; }
  .key-chip { margin: 0 0 0 auto; white-space: nowrap; }
  .key-chip span { display: none; }
  main { padding: 20px 16px 120px; }
  .new-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: sticky; bottom: 0; top: auto; z-index: 10; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 12px 16px; margin: 0 -16px; border-width: 2px 0 0; border-radius: 0; }
  .summary h2, .summary-list { display: none; }
  .summary-count strong { font-size: 30px; }
  .summary .btn-block { grid-column: 2; grid-row: 1; }
  .summary .why { grid-column: 1 / -1; }
  .sheet-head { display: none; }
  .batch-row, .set-row { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: 'cover main status' 'cover prog prog' 'no actions actions'; gap: 6px 12px; padding: 12px 4px; }
  .set-row { grid-template-areas: 'no main status' 'no count actions'; grid-template-columns: 52px minmax(0, 1fr) auto; }
  .batch-row .job-no { grid-area: no; font-size: 12px; color: var(--ink-3); align-self: center; }
  .batch-cover { grid-area: cover; }
  .batch-main { grid-area: main; }
  .batch-progress { grid-area: prog; }
  .batch-status { grid-area: status; }
  .batch-actions-cell { grid-area: actions; }
  .set-row .batch-count { grid-area: count; }
  .view-head-row > .btn, .view-head-row > label.btn { width: 100%; }
}
@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .album, .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .media-grid, .media-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idea-grid { grid-template-columns: minmax(0, 1fr); }
  .lote-actions, .lote-actions .btn { width: 100%; }
  .segmented { display: flex; }
  .segmented label { flex: 1; text-align: center; }
}

/* Dedo en vez de mouse: todo objetivo táctil llega a 44 px. */
@media (pointer: coarse), (max-width: 900px) {
  .btn, .btn-small { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .back { min-height: 44px; margin-bottom: 4px; }
  .idea-chip { min-height: 44px; }
  .library > summary, .advanced > summary { min-height: 44px; }
  .word { min-height: 36px; padding: 4px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ================================================================== Editor (#/editor/<id>)
 * Oscuro (para juzgar el color del video), cuatro paneles y a pantalla completa: material a la
 * izquierda, vista previa al centro, propiedades a la derecha y la línea de tiempo abajo. */

body.is-editing { background: #111214; }
body.is-editing .shell { grid-template-columns: minmax(0, 1fr); }
body.is-editing .side { display: none; }
body.is-editing main { padding: 0; }
body.is-editing main > .view { max-width: none; }
.ed { font-size: 14px; }
.ed .icon { width: 16px; height: 16px; }
.ed-back { text-decoration: none; }
.ed-panel-title { font-weight: 700; }
.ed :focus-visible { outline-color: var(--hl); }
.ed-transport .icon { width: 18px; height: 18px; }
.editor-view { color-scheme: dark; }
.ed {
  --ed-bg: #111214; --ed-panel: #18191c; --ed-raise: #232428; --ed-line: #2f3035; --ed-ink: #ecebe6; --ed-ink-2: #a9a8a1;
  --ed-accent: #f7e463; --ed-accent-ink: #16181a; --ed-clip: #2b5c86; --ed-clip-img: #6a5a2a; --ed-clip-audio: #2f6b47; --ed-play: #f7e463;
  display: grid; gap: 1px; background: var(--ed-line); color: var(--ed-ink);
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr) minmax(13rem, 17rem);
  grid-template-rows: auto auto minmax(0, 1fr) clamp(12rem, 32vh, 20rem);
  grid-template-areas: 'bar bar bar' 'conflict conflict conflict' 'bin stage inspector' 'tl tl tl';
  height: 100dvh; min-height: 34rem;
}
.ed > * { background: var(--ed-bg); min-width: 0; min-height: 0; }
.ed-bar { grid-area: bar; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: var(--ed-panel); }
.ed-back { color: var(--ed-ink-2); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; }
.ed-back:hover { background: var(--ed-raise); color: var(--ed-ink); }
.ed-title { font-size: var(--step-0); font-weight: 700; margin: 0; outline: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-save { font-size: 0.8125rem; color: var(--ed-ink-2); }
.ed-save.is-dirty { color: #f7e463; }
.ed-save.is-error { color: #ff8a80; }
.ed-bar-gap { flex: 1; }
.ed-export-state { font-size: 0.8125rem; color: var(--ed-ink-2); }
.ed-download { color: var(--ed-accent); font-weight: 700; }
.ed-conflict { grid-area: conflict; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.625rem 0.75rem; background: #4a1d1a; color: #ffe1dd; font-size: 0.875rem; }
.ed-conflict span { flex: 1 1 20rem; }
.ed-btn {
  display: inline-flex; align-items: center; gap: 0.375rem; border: 0; border-radius: 3px; cursor: pointer;
  padding: 0.4rem 0.7rem; font: inherit; font-size: 0.8125rem; font-weight: 700; background: var(--ed-raise); color: var(--ed-ink);
}
.ed-btn:hover:not(:disabled) { background: #2c3337; }
.ed-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ed-btn:focus-visible, .ed-icon:focus-visible { outline: 2px solid var(--ed-accent); outline-offset: 2px; }
.ed-btn-primary { background: var(--ed-accent); color: var(--ed-accent-ink); }
.ed-btn-primary:hover:not(:disabled) { background: #f2db3a; }
.ed-btn-small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.ed-btn kbd { font: inherit; font-size: 0.6875rem; font-weight: 400; color: var(--ed-ink-2); border: 1px solid var(--ed-line); border-radius: 4px; padding: 0 0.25rem; }
.ed-btn .icon { width: 1rem; height: 1rem; }
.ed-icon {
  display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--ed-ink); font: inherit; font-size: 0.9375rem;
}
.ed-icon:hover { background: var(--ed-raise); }
.ed-panel { padding: 0.75rem; overflow: auto; background: var(--ed-panel); }
.ed-panel-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ed-ink-2); margin: 0 0 0.625rem; }
.ed-bin { grid-area: bin; }
.ed-inspector { grid-area: inspector; }
.ed-hint { color: var(--ed-ink-2); font-size: 0.8125rem; list-style: none; }
.ed-assets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.ed-asset { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 0.5rem; align-items: center; padding: 0.25rem; border-radius: 6px; }
.ed-asset:hover { background: var(--ed-raise); }
.ed-asset-thumb { grid-row: span 2; width: 2.75rem; height: 2.75rem; border-radius: 4px; background: #000; overflow: hidden; display: block; }
.ed-asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-asset-name { font-size: 0.8125rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-asset-meta { font-size: 0.75rem; color: var(--ed-ink-2); }
.ed-asset-add { grid-row: 1 / span 2; grid-column: 3; }
.ed-library { margin-top: 0.75rem; }
.ed-library summary { cursor: pointer; font-size: 0.8125rem; color: var(--ed-ink-2); margin-bottom: 0.5rem; }
.ed-stage { grid-area: stage; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #08090a; }
.ed-canvas-box { position: relative; min-height: 0; overflow: hidden; }
/* Absoluto dentro de una caja con tamaño: el lienzo se achica sin perder su proporción. */
.ed-canvas-box canvas { position: absolute; inset: 0.75rem; margin: auto; max-width: calc(100% - 1.5rem); max-height: calc(100% - 1.5rem); background: #000; box-shadow: 0 0 0 1px var(--ed-line); }
.ed-transport { display: flex; align-items: center; justify-content: center; gap: 0.25rem; padding: 0.375rem; background: var(--ed-panel); }
.ed-play { background: var(--ed-accent); color: var(--ed-accent-ink); min-width: 2.5rem; }
.ed-play:hover { background: #f2db3a; }
.ed-play .icon { fill: currentColor; }
.ed-play.is-playing .icon { fill: none; stroke-width: 2.5; }
.ed-timecode { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 0.75rem; font-size: 0.9375rem; }
.ed-duration { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ed-ink-2); font-size: 0.875rem; }
.ed-props { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.75rem; margin: 0 0 0.75rem; font-size: 0.8125rem; }
.ed-props dt { color: var(--ed-ink-2); }
.ed-props dd { margin: 0; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.ed-field { display: grid; gap: 0.25rem; margin: 0.75rem 0 0.25rem; font-size: 0.8125rem; color: var(--ed-ink-2); }
.ed-field select, .ed-field input[type='range'] { width: 100%; accent-color: var(--ed-accent); }
.ed-field select { background: var(--ed-raise); color: var(--ed-ink); border: 1px solid var(--ed-line); border-radius: 6px; padding: 0.375rem; font: inherit; }
.ed-field output { color: var(--ed-ink); font-variant-numeric: tabular-nums; }
.ed-timeline-area { grid-area: tl; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.ed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; padding: 0.375rem 0.5rem; background: var(--ed-panel); border-bottom: 1px solid var(--ed-line); }
.ed-sep { width: 1px; height: 1.25rem; background: var(--ed-line); margin: 0 0.25rem; }
.ed-timeline { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); min-height: 0; outline: none; }
.ed-tl-heads { display: grid; grid-auto-rows: min-content; background: var(--ed-panel); border-right: 1px solid var(--ed-line); }
.ed-head { height: 3.5rem; display: flex; flex-direction: column; justify-content: center; padding: 0 0.5rem; font-size: 0.75rem; color: var(--ed-ink-2); border-bottom: 1px solid var(--ed-line); }
.ed-head-ruler, .ed-ruler { height: 1.5rem; }
.ed-head-audio, .ed-track-audio { height: 2.5rem; }
.ed-head-flag { font-size: 0.6875rem; color: #f7e463; }
.ed-tl-scroll { overflow: auto; position: relative; }
.ed-tl-content { position: relative; min-height: 100%; }
.ed-ruler { position: relative; border-bottom: 1px solid var(--ed-line); background: var(--ed-panel); cursor: col-resize; user-select: none; }
.ed-tick { font-family: var(--mono); position: absolute; top: 0; height: 100%; padding-left: 0.25rem; border-left: 1px solid var(--ed-line); font-size: 0.6875rem; color: var(--ed-ink-2); line-height: 1.5rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ed-track { position: relative; height: 3.5rem; border-bottom: 1px solid var(--ed-line); }
.ed-track.is-main { background: #121517; }
.ed-track.is-hidden { opacity: 0.5; }
.ed-clip {
  position: absolute; top: 0.25rem; bottom: 0.25rem; border-radius: 5px; overflow: hidden; cursor: grab; user-select: none; touch-action: none;
  background-color: var(--ed-clip); background-size: auto 100%; background-repeat: repeat-x; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}
.ed-clip-image { background-color: var(--ed-clip-img); }
.ed-track-audio .ed-clip { background-color: var(--ed-clip-audio); background-image: none; }
.ed-clip.is-selected { box-shadow: inset 0 0 0 2px #fff; }
.ed-clip:active { cursor: grabbing; }
.ed-clip-label { position: absolute; left: 0.5rem; bottom: 0.25rem; right: 0.5rem; font-size: 0.6875rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.ed-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgb(255 255 255 / 0.18); }
.ed-handle-in { left: 0; }
.ed-handle-out { right: 0; }
.ed-clip.is-selected .ed-handle { background: #fff; }
.ed-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ed-play); pointer-events: none; z-index: 2; }
.ed-playhead::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--ed-play); }
.ed-clip.is-selected { box-shadow: inset 0 0 0 2px var(--ed-accent); }
.ed-clip.is-selected .ed-handle { background: var(--ed-accent); }
.ed-transition-mark { position: absolute; left: 0; top: 0; bottom: 0; pointer-events: none; background: linear-gradient(to right, rgb(247 228 99 / .75), rgb(247 228 99 / 0)); }
.ed-transition-mark::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ed-accent); }
.ed-field select + select { margin-top: 4px; }
@media (max-width: 56rem) {
  .ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(16rem, 1fr) auto auto 18rem; grid-template-areas: 'bar' 'conflict' 'stage' 'inspector' 'bin' 'tl'; height: auto; }
}


/* Filtros SVG del ajuste de color de la vista previa: existen, pero no ocupan lugar. */
.ed-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* La idea dirige el video: la tarjeta pide solo la idea (y un detalle opcional). */
.idea-label .lbl-director { display: none; }
#ideas.is-director .idea-label .lbl-designs { display: none; }
#ideas.is-director .idea-label .lbl-director { display: inline; }
#ideas.is-director .idea-fieldwrap[data-field="badge"],
#ideas.is-director .idea-fieldwrap[data-field="cta"],
#ideas.is-director .idea-words,
#ideas.is-director .idea-font-label,
#ideas.is-director .idea-versions-btn,
#ideas.is-director .idea-versions-note,
#ideas.is-director .idea-versions { display: none; }
#fields-designer.is-director #direction,
#fields-designer.is-director .style-chip,
#fields-designer.is-director .idea-swatch { display: none; }
#ideas.is-director .idea-why { display: none; }

/* Higgsfield: saldo y conexión en "Nuevo video" */
.hf-box { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); padding: 12px 14px; margin: 4px 0 12px; }
.hf-line { margin: 0 0 4px; font-weight: 700; }
.hf-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 8px; }
.hf-topup { display: inline-flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.hf-topup input { width: 8em; }
