/* Viral Studio — interfaz mínima. Sin animaciones, sin librerías externas. */
:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e2230; --line: #2a2f3d;
  --text: #e6e8ee; --muted: #8b93a7; --accent: #f5b301; --accent-text: #1a1300;
  --ok: #3ccf7a; --err: #ff5c5c; --link: #7fb4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--text); }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--err); }
.ok { color: var(--ok); }
header { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
header .spacer { flex: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 16px 18px 140px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row > * { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
label { display: inline-flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 120px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; min-width: 0; color: var(--text); font-size: 13px; }
input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; min-width: 0;
}
input[type=text], input[type=url], input[type=password] { width: 100%; }
input[type=number] { width: 92px; }
input[type=range] { width: 180px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { background: #3a1d1d; border-color: #6b2a2a; color: #ffb3b3; }
button.sm { padding: 4px 8px; font-size: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 8px 12px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab { display: none; }
.tab.active { display: block; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.hook { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel2); }
.hook.selected { border-color: var(--accent); }
.hook .title { font-weight: 600; }
.hook .quote { color: var(--muted); font-style: italic; margin: 4px 0; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #2b3042; color: var(--text); font-size: 11px; margin-right: 4px; }
.badge.top { background: var(--accent); color: var(--accent-text); }
.media { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel2); }
.media video, .media img { width: 100%; max-height: 420px; background: #000; border-radius: 6px; display: block; }
.media audio { width: 100%; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; border: 0; }
video.player { object-fit: contain; }
#progress { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 18px; z-index: 6; display: none; }
#progress.on { display: block; }
#progress .bar { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
#progress .fill { height: 100%; background: var(--accent); width: 0; }
#toast { position: fixed; right: 18px; bottom: 90px; background: var(--panel2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; display: none; max-width: 420px; z-index: 7; }
#toast.on { display: block; }
#toast.error { border-color: var(--err); }
.hidden { display: none !important; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.tbl { border-collapse: collapse; width: 100%; }
.tbl th, .tbl td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); font-size: 12px; }
.tbl th { color: var(--muted); font-weight: 600; }
.vf-frag input { margin-top: 4px; }

.help { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 11px; line-height: 1; align-items: center; justify-content: center; cursor: help; margin-left: 4px; user-select: none; flex: none; }
.help:hover { color: var(--accent); border-color: var(--accent); }
.viral-mode #srcAnalyzeControls { display: none; }
.viral-mode #videoCard .grid-2 > div:last-child { display: none; }
.viral-mode #videoCard .grid-2 { grid-template-columns: 1fr; max-width: 640px; }
a.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
a.btn.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
a.btn:hover { text-decoration: none; filter: brightness(1.08); }
.tbl tr.total td { font-weight: 700; color: var(--text); border-top: 2px solid var(--muted); }
.vf-sub-frag { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; display: grid; grid-template-columns: minmax(260px, 480px) 1fr; gap: 12px; }
@media (max-width: 820px) { .vf-sub-frag { grid-template-columns: 1fr; } }
.vf-sub-frag img { width: 100%; border-radius: 6px; display: block; }
.cue-row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.cue-row input[type=text] { flex: 1; }
.cue-row .t { width: 96px; flex: none; color: var(--muted); font-size: 11px; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
label .val { color: var(--accent); font-weight: 600; margin-left: 6px; }
label input[type=range] { width: 100%; }
.vf-sub-frag { grid-template-columns: 1fr; }
#vfSubFrames img { width: 100%; border-radius: 6px; display: block; }
#vfSubFrames .small { margin-top: 4px; }
[hidden] { display: none !important; }

/* móvil: el iPhone como mando a distancia */
@media (max-width: 600px) {
  header { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  h1 { font-size: 16px; }
  main { padding: 10px 10px 140px; }
  .card { padding: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs button { white-space: nowrap; padding: 10px 10px; }
  button, a.btn { padding: 10px 14px; font-size: 15px; }
  label { min-width: 0; width: 100%; }
  input[type=number] { width: 100%; }
  .row > input[type=url] { min-width: 0 !important; }
  #progress { left: 8px; right: 8px; }
}
