/* Lo marcado como oculto se oculta siempre, aunque otra regla le ponga display */
[hidden] { display: none !important; }

/* Las mismas fuentes que usa beatsee: TeX Gyre Heros (clon libre de Helvetica) y Adventor.
   Licencia GUST (libre), descargadas de CTAN: ver fonts/GUST-FONT-LICENSE.txt */
@font-face { font-family: "TeX Gyre Heros"; src: url("fonts/texgyreheros-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros"; src: url("fonts/texgyreheros-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros Fina"; src: url("fonts/texgyreheros-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TeX Gyre Heros Cn"; src: url("fonts/texgyreheroscn-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TeX Gyre Adventor"; src: url("fonts/texgyreadventor-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TeX Gyre Adventor"; src: url("fonts/texgyreadventor-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TeX Gyre Adventor Fina"; src: url("fonts/texgyreadventor-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
/* VCR OSD Mono (Riciery Leal, "100% free"), Pixel Operator (Jayvee Enaguas, CC0) y Liberation Sans Narrow
   (clon libre de Arial Narrow, GPL con excepción para fuentes). Licencias en fonts/. */
@font-face { font-family: "VCR OSD Mono"; src: url("fonts/vcr-osd-mono.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pixel Operator"; src: url("fonts/pixel-operator.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pixel Operator Bold"; src: url("fonts/pixel-operator-bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Pixel Operator 8"; src: url("fonts/pixel-operator-8.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Liberation Sans Narrow"; src: url("fonts/liberation-sans-narrow-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Liberation Sans Narrow"; src: url("fonts/liberation-sans-narrow-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0c0b0a;
  --bg-2: #121110;
  --panel: #161412;
  --field: #0e0d0c;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f5f0e8;
  --muted: #8f877d;
  --orange: #ff6b1f;
  --orange-2: #ffa072;
  --orange-3: #b53d00;
  --grad: linear-gradient(135deg, var(--orange-2), var(--orange) 50%, var(--orange-3));
  --display: "Space Grotesk", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; line-height: 1.45;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
.mono { font-family: var(--mono); letter-spacing: 0.06em; }
.muted { color: var(--muted); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--field); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--grad); color: #1a0b02; font-weight: 600; padding: 10px 16px; border-radius: 9px;
  box-shadow: 0 6px 24px rgba(255, 107, 31, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .mono { font-size: .8em; opacity: .8; }
.btn--sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn--ghost:hover { border-color: rgba(255,255,255,.3); }
.btn--block { width: 100%; }
.icon-btn {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

/* Barra superior */
.top {
  height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.brand__logo { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #1a0b02; }
.top__name {
  flex: 1; max-width: 320px; background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 10px; font-weight: 500; color: var(--muted);
}
.top__name:hover, .top__name:focus { border-color: var(--line-2); color: var(--text); outline: none; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); }
.seg button { padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 12px; }
.seg button.is-on { background: rgba(255,107,31,.16); color: var(--orange); }
.seg--full { display: flex; width: 100%; margin-bottom: 14px; }
.seg--full button { flex: 1; }

/* Layout */
.app { display: grid; grid-template-columns: 360px 1fr; height: calc(100% - 56px); }
.side { display: grid; grid-template-columns: 64px 1fr; border-right: 1px solid var(--line); min-height: 0; background: var(--bg-2); }
.tabs { display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; border-right: 1px solid var(--line); }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px; border-radius: 9px;
  font-size: 10.5px; color: var(--muted);
}
.tab span { font-size: 16px; line-height: 1; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.tab.is-on { color: var(--orange); background: rgba(255,107,31,.1); }
.panels { overflow-y: auto; min-height: 0; }
.panel { display: none; padding: 16px; }
.panel.is-on { display: block; }
.panel h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.field input[type="text"], .field input[type="number"], .field select, textarea {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--text);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 24px; }
textarea { resize: vertical; margin-bottom: 8px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255,107,31,.6); }
.field input[type="color"] { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); cursor: pointer; padding: 2px; }
input[type="range"] { accent-color: var(--orange); width: 100%; }
input[type="checkbox"] { accent-color: var(--orange); }
.row { display: flex; gap: 8px; align-items: center; }
.row--between { justify-content: space-between; margin: 10px 0 8px; }
.row--end { justify-content: flex-end; margin-top: 8px; }
.field--half { flex: 1; min-width: 0; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; font-size: 12px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hint { color: var(--muted); font-size: 11.5px; margin-top: 8px; }

.card { padding: 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.card__title { font-weight: 600; font-size: 13px; margin-bottom: 10px; }
summary.card__title { cursor: pointer; margin-bottom: 0; list-style: none; }
summary.card__title::-webkit-details-marker { display: none; }
summary.card__title::after { content: "+"; float: right; color: var(--orange); }
details[open] > summary.card__title { margin-bottom: 10px; }
details[open] > summary.card__title::after { content: "–"; }
.row--between .card__title { margin: 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: 12px; margin-bottom: 14px; color: var(--muted); transition: all .15s;
}
.drop:hover, .drop.is-drag { border-color: var(--orange); color: var(--text); background: rgba(255,107,31,.05); }
.drop__icon { color: var(--orange); font-size: 16px; }
.drop small { font-size: 11px; }
.drop--sm { flex-direction: row; justify-content: center; padding: 14px; }
.drop--sm .mono { color: var(--orange); }
.drop.has-file { border-style: solid; border-color: rgba(255,107,31,.4); color: var(--text); }

.layer { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; background: var(--panel); }
.layer__head { display: flex; align-items: center; gap: 8px; padding: 11px 12px; font-weight: 600; cursor: pointer; }
.layer__body { padding: 0 12px 4px; }

.progress { position: relative; height: 22px; border-radius: 7px; background: var(--field); border: 1px solid var(--line); margin-top: 10px; overflow: hidden; }
.progress__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(255,107,31,.35), rgba(255,107,31,.6)); transition: width .2s; }
.progress__label { position: relative; display: block; text-align: center; line-height: 20px; font-size: 10.5px; }
.progress.is-indet .progress__fill { width: 40% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { left: -40%; } to { left: 100%; } }

/* Lista de líneas */
.lines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.lines:empty::before { content: "Aún no hay letra. Detéctala, pégala o añade líneas con ＋."; color: var(--muted); font-size: 12px; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 9px; }
.line {
  display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.line.is-active { border-color: rgba(255,107,31,.55); background: rgba(255,107,31,.07); }
.line.is-sel { box-shadow: 0 0 0 1px var(--orange) inset; }
.line.is-guess { border-style: dashed; border-color: rgba(255, 210, 80, 0.5); }
.line.is-guess .line__times::before { content: "≈"; color: #ffd250; font-weight: 700; margin-right: 2px; }
.card__sub { color: var(--muted); font-size: 11.5px; margin: 12px 0 6px; }
.line__text { grid-column: 1 / -1; width: 100%; background: transparent; border: 0; padding: 2px 0; color: var(--text); font-size: 13px; }
.line__text:focus { outline: none; }
.line__times { display: flex; align-items: center; gap: 4px; }
.line__times input {
  width: 66px; background: var(--field); border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.line__times span { color: var(--muted); font-size: 11px; }
.line__times { grid-column: 1 / -1; }
.line__times input.line__dur { width: 50px; margin-left: 6px; color: var(--orange-2); border-color: rgba(255,107,31,.25); }
.line__acts { display: flex; gap: 2px; grid-column: 1 / -1; justify-self: end; margin-top: -2px; }
.line__acts button { width: 24px; height: 24px; border-radius: 6px; color: var(--muted); font-size: 11px; }
.line__acts button:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* Selector de fuentes */
.fontpick__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  background: var(--field); border: 1px solid var(--line); border-radius: 7px; text-align: left;
}
.fontpick__btn:hover { border-color: rgba(255,107,31,.6); }
.fontpick__name { font-size: 16px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fontpick__hint { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.fontpanel {
  position: fixed; z-index: 90; width: min(440px, calc(100vw - 16px)); max-height: min(520px, calc(100vh - 16px));
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px;
  background: #151311; border: 1px solid var(--line-2); box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.fontpanel[hidden] { display: none; }
.fontpanel__search { width: 100%; background: var(--field); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; color: var(--text); }
.fontpanel__tip { font-size: 11px; color: var(--muted); }
.fontpanel__upload {
  display: block; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600;
  border: 1.5px dashed rgba(255,107,31,.55); color: var(--orange-2);
}
.fontpanel__upload:hover { background: rgba(255,107,31,.08); }
.fontpanel__item { position: relative; }
.fontpanel__del { position: absolute; top: 3px; right: 5px; font-size: 10px; color: var(--muted); padding: 2px 4px; border-radius: 4px; }
.fontpanel__del:hover { color: #fff; background: rgba(255,60,60,.5); }
.fontpanel__list { overflow-y: auto; min-height: 0; padding-right: 2px; }
.fontpanel__group { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--orange); margin: 12px 0 6px; text-transform: uppercase; }
.fontpanel__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fontpanel__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 7px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); min-width: 0;
}
.fontpanel__item:hover { border-color: var(--orange); background: rgba(255,107,31,.08); }
.fontpanel__item.is-on { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.fontpanel__item span { font-size: 19px; line-height: 1.15; color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; }
.fontpanel__item small { font-size: 9.5px; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Estilos */
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.preset {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 11px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, transform .15s;
}
.preset:hover { border-color: rgba(255,107,31,.5); transform: translateY(-1px); }
.preset.is-on { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.preset__thumb {
  position: relative; aspect-ratio: 9 / 12; border-radius: 7px; overflow: hidden; display: grid; place-items: center;
  padding: 8px; text-align: center; line-height: 1.05;
}
.preset__thumb b { font-weight: inherit; padding: 0 2px; border-radius: 3px; }
.preset__name { font-weight: 600; font-size: 12px; }
.preset__tag { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.reco__stats { font-size: 10.5px; color: var(--orange-2); margin: 12px 0 8px; line-height: 1.6; }
.reco__list { display: flex; flex-direction: column; gap: 6px; }
.reco__item { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 7px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); }
.reco__item .preset__thumb { aspect-ratio: 9 / 14; padding: 2px; font-size: 6px !important; }
.reco__why { font-size: 11px; color: var(--muted); line-height: 1.35; }
.reco__why b { color: var(--text); font-size: 12px; display: block; }
.reco__rank { color: var(--orange); font-family: var(--mono); font-size: 10px; }
.reco__hook { margin-top: 10px; padding: 9px; border-radius: 9px; border: 1px dashed rgba(255,107,31,.5); font-size: 12px; }
.reco__hook .row { margin-top: 8px; }

.safezone { position: absolute; inset: 0; pointer-events: none; }
.safezone[hidden] { display: none; }
.safezone > div { position: absolute; background: rgba(255, 60, 60, 0.18); border: 1px dashed rgba(255, 120, 120, 0.7); display: grid; place-items: center; }
.safezone span { font-size: 9px; font-family: var(--mono); color: #ffd0d0; letter-spacing: .05em; text-align: center; padding: 2px; }
.safezone__top { left: 0; right: 0; top: 0; height: 9%; }
.safezone__right { right: 0; top: 38%; width: 15%; height: 42%; }
.safezone__bottom { left: 0; right: 0; bottom: 0; height: 20%; }

/* Vocabulario */
.vocab__how { list-style: disc; padding-left: 16px; display: grid; gap: 4px; }
.vocab__status { font-size: 10.5px; color: var(--orange-2); margin-top: 10px; }
.vocab__search { flex: 1; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--text); }
.vocab { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 420px; overflow-y: auto; }
.vocab:empty::before { content: "Sin palabras todavía."; color: var(--muted); font-size: 12px; padding: 12px; text-align: center; border: 1px dashed var(--line); border-radius: 9px; }
.vocab__item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 5px; padding: 7px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.vocab__item input { min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; color: var(--text); font-size: 12px; }
.vocab__item input[data-f="w"] { font-weight: 600; }
.vocab__item .vocab__vars { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }

/* Escenario */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 50% 30%, #17151a, var(--bg) 70%); }
.stage__view { flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px; position: relative; }
.stage__frame { position: relative; box-shadow: 0 30px 90px rgba(0,0,0,.6); border-radius: 6px; overflow: hidden; background: #000; }
.stage__frame.is-drag { outline: 2px dashed var(--orange); outline-offset: 4px; }
#canvas { display: block; width: 100%; height: 100%; }
.stage__empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,0,0,.35); color: var(--muted); font-size: 12px;
}
.stage__empty[hidden], .tapmode[hidden], .stage__card[hidden] { display: none; }
.stage__card {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(92%, 380px);
  display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; text-align: left;
  background: rgba(12, 11, 10, 0.88); border: 1px solid rgba(255, 107, 31, 0.45); backdrop-filter: blur(8px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}
.stage__card .progress { margin-top: 0; }
.stage__card .btn--ghost { align-self: flex-end; }
.stage__cardTitle { font-family: var(--display); font-weight: 600; font-size: 15px; }
.stage__cardText { color: var(--muted); font-size: 12px; }
.tapmode {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: min(90%, 520px);
  background: rgba(10,9,8,.85); border: 1px solid rgba(255,107,31,.5); border-radius: 12px; padding: 12px 16px; text-align: center;
  backdrop-filter: blur(8px);
}
.tapmode .mono { color: var(--orange); font-size: 11px; }
.tapmode p:nth-child(2) { font-family: var(--display); font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.tapmode small { color: var(--muted); }

.transport { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg-2); }
.play { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #1a0b02; font-size: 12px; flex-shrink: 0; }
.time { font-size: 12px; }
.transport__spacer { flex: 1; }
.zoom { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.zoom input { width: 90px; }

/* Línea de tiempo */
.timeline { height: 150px; overflow-x: auto; overflow-y: hidden; background: #0a0908; border-top: 1px solid var(--line); position: relative; }
.timeline__inner { position: relative; height: 100%; min-width: 100%; cursor: text; }
.tl__ruler { position: absolute; inset: 0 0 auto; height: 20px; border-bottom: 1px solid var(--line); }
.tl__tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); padding-left: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); line-height: 20px; }
.tl__wave { position: absolute; left: 0; top: 24px; height: 56px; width: 100%; }
.tl__lyrics { position: absolute; left: 0; right: 0; top: 88px; height: 50px; }
.tl__block {
  position: absolute; top: 0; height: 100%; border-radius: 7px; padding: 6px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: rgba(255,107,31,.14); border: 1px solid rgba(255,107,31,.45); font-size: 11px; cursor: grab; user-select: none;
}
.tl__block:hover { background: rgba(255,107,31,.22); }
.tl__block.is-sel { background: rgba(255,107,31,.32); border-color: var(--orange); }
.tl__block.is-drag { cursor: grabbing; }
.tl__block::before, .tl__block::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.tl__block::before { left: 0; }
.tl__block::after { right: 0; }
.tl__head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); box-shadow: 0 0 10px var(--orange); pointer-events: none; left: 0; }
.tl__head::before { content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--orange); }

/* Fragmento a exportar */
.frag { display: flex; align-items: center; gap: 6px; margin-left: 10px; flex-wrap: nowrap; min-width: 0; }
.frag__quick { max-width: 92px; }
@media (max-width: 1250px) { .frag__lbl { display: none; } .zoom input { width: 70px; } }
.frag__btn { padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.frag__btn:hover { color: var(--text); border-color: var(--orange); }
.frag__quick { background: var(--field); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; font-size: 11.5px; color: var(--muted); }
.frag__chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: rgba(255,107,31,.16); border: 1px solid rgba(255,107,31,.5); color: var(--orange-2); font-size: 11px; }
.frag__chip[hidden] { display: none; }
.frag__chip button { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; color: var(--text); }
.frag__chip button:hover { background: rgba(255,255,255,.1); }

.tl__range { position: absolute; top: 0; bottom: 0; background: rgba(255,107,31,.09); border-left: 2px solid var(--orange); border-right: 2px solid var(--orange); pointer-events: none; z-index: 3; }
.tl__range[hidden] { display: none; }
.tl__rangeBar { position: absolute; left: 0; right: 0; top: 0; height: 20px; background: rgba(255,107,31,.45); pointer-events: auto; cursor: grab; overflow: hidden; white-space: nowrap; }
.tl__rangeBar span { font-family: var(--mono); font-size: 10px; line-height: 20px; padding: 0 6px; color: #1a0b02; font-weight: 600; }
.tl__rangeH { position: absolute; top: 0; bottom: 0; width: 12px; pointer-events: auto; cursor: ew-resize; }
.tl__rangeH::after { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 26px; border-radius: 3px; background: var(--orange); transform: translate(-50%, -50%); box-shadow: 0 0 8px rgba(255,107,31,.7); }
.tl__rangeH--l { left: -7px; }
.tl__rangeH--r { right: -7px; }
.tl__ruler { cursor: crosshair; }

.exprange { position: relative; height: 64px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); overflow: hidden; cursor: crosshair; margin-top: 8px; touch-action: none; }
.exprange canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.exprange__sel { position: absolute; top: 0; bottom: 0; background: rgba(255,107,31,.22); border-left: 2px solid var(--orange); border-right: 2px solid var(--orange); cursor: grab; }
.exprange__h { position: absolute; top: 0; bottom: 0; left: -8px; width: 14px; cursor: ew-resize; }
.exprange__h::after { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 24px; border-radius: 3px; background: var(--orange); transform: translate(-50%, -50%); }
.exprange__h--r { left: auto; right: -8px; }
.exprange__head { position: absolute; top: 0; bottom: 0; width: 1px; background: #fff; opacity: .6; pointer-events: none; }
.exprange__label { font-size: 11.5px; color: var(--orange-2); margin-top: 6px; }
.exp__fine { margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.exp__fine summary { cursor: pointer; margin-bottom: 8px; }

/* Modal */
.modal { margin: auto; border: 0; background: transparent; color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal__box { width: min(440px, 92vw); padding: 20px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2); }
.modal__box h3 { font-family: var(--display); font-size: 22px; margin-bottom: 16px; }
.modal__box .btn--block { margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1d1a17; border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 10px; font-size: 12.5px;
  transition: opacity .25s, transform .25s; z-index: 100; max-width: 90vw; width: max-content;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 960px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .stage { order: -1; }
  .stage__view { height: 56vh; }
  .side { border-right: 0; border-top: 1px solid var(--line); grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .tab { flex: 1; min-width: 60px; }
  .panels { overflow: visible; }
  .top { gap: 10px; padding: 0 12px; }
  .top__name { display: none; }
  #newProject { display: none; }
}
@media (max-width: 520px) {
  .brand { font-size: 0; gap: 0; }
  .seg button { padding: 5px 7px; }
  .zoom input { width: 70px; }
}

/* Disposiciones de la letra */
.layouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.layouts button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 3px 5px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-size: 10px; color: var(--muted); }
.layouts button:hover { border-color: rgba(255,107,31,.6); color: var(--text); }
.layouts button.is-on { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.lt { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 5px; background: #000; color: #fff; font-style: normal; font-family: "TeX Gyre Heros", Arial, sans-serif; font-weight: 700; overflow: hidden; line-height: 1; text-align: center; }
.lt--phrase { font-size: 6px; font-weight: 400; }
.lt--phrasexl { font-size: 5px; letter-spacing: .12em; white-space: nowrap; }
.lt--word { font-size: 9px; }
.lt--wordxl { font-size: 12px; transform: scaleY(2.6); letter-spacing: -.04em; }
.lt--poster { place-items: start; padding: 4px; font-size: 12px; text-align: left; letter-spacing: -.03em; }
.lt--brat { grid-template-columns: 1fr 1fr; place-items: center; padding: 8px 4px; font-size: 6px; font-weight: 400; }
.lt--cloud { display: block; padding-top: 9px; font-size: 8px; line-height: 1.1; }
.lt--cloud b { display: inline-block; }
.lt--cloud .rot { transform: rotate(-90deg); }

.exp__warn { color: #ffd250; background: rgba(255,210,80,.08); border: 1px solid rgba(255,210,80,.35); border-radius: 8px; padding: 8px 10px; }
.exp__warn[hidden] { display: none; }

.fontpanel__alt { color: var(--orange-2) !important; font-size: 9px !important; }

/* Subir a TikTok */
.tt { margin-top: 12px; padding: 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.tt[hidden] { display: none; }
.tt textarea { font-size: 12px; }
.tt__btn { background: linear-gradient(135deg, #25f4ee, #fe2c55); color: #fff; box-shadow: 0 6px 24px rgba(254,44,85,.3); }

/* Pinterest */
.pin__form { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.pin__form input { width: 100%; background: var(--field); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 10px; color: var(--text); }
.pin__error { color: #ff8a8a; background: rgba(255,80,80,.08); border: 1px solid rgba(255,80,80,.35); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin: 8px 0; }
.pin__list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.pin__item { padding: 8px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.pin__item video { width: 100%; max-height: 260px; border-radius: 7px; background: #000; display: block; }
.pin__title { font-weight: 600; font-size: 12.5px; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin__meta { font-size: 10.5px; color: var(--muted); margin: 2px 0 8px; }
.pin__item .row { flex-wrap: wrap; }

/* ───────── Asistente paso a paso ───────── */
body.wiz-open .app { grid-template-columns: 440px 1fr; }
body.wiz-open .side { display: none; }
body.wiz-open #stageEmpty, body.wiz-open #lyricPrompt { display: none; }
.wiz { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-right: 1px solid var(--line); }
.wiz__head { position: relative; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.wiz__kicker { font-size: 10.5px; color: var(--orange); letter-spacing: .18em; }
.wiz__close { position: absolute; right: 14px; top: 12px; font-size: 11.5px; color: var(--muted); padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); }
.wiz__close:hover { color: var(--text); border-color: var(--line-2); }
.wiz__dots { display: flex; gap: 4px; margin-top: 12px; }
.wiz__dots li { flex: 1; }
.wiz__dots button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); padding: 4px 0; }
.wiz__dots button b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: 11px; color: var(--muted); }
.wiz__dots button:disabled { opacity: .45; cursor: default; }
.wiz__dots li.is-done b { background: rgba(255,107,31,.2); border-color: rgba(255,107,31,.6); color: var(--orange-2); }
.wiz__dots li.is-on button { color: var(--text); }
.wiz__dots li.is-on b { background: var(--grad); border-color: transparent; color: #1a0b02; }
.wiz__body { flex: 1; overflow-y: auto; min-height: 0; padding: 18px; }
.wiz__step h2 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 4px 0 14px; }
.wiz__step h2 + .hint { margin-bottom: 10px; }
.wiz__drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; margin-bottom: 16px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-2); border-radius: 16px; color: var(--muted); transition: all .15s;
}
.wiz__drop:hover, .wiz__drop.is-drag { border-color: var(--orange); background: rgba(255,107,31,.05); color: var(--text); }
.wiz__drop.has-file { border-style: solid; border-color: rgba(255,107,31,.55); background: rgba(255,107,31,.06); }
.wiz__dropIcon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--grad); color: #1a0b02; font-size: 24px; margin-bottom: 4px; }
.wiz__drop b { color: var(--text); font-size: 15px; word-break: break-word; }
.wiz__choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wiz__choices button { text-align: left; padding: 13px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s; }
.wiz__choices button:hover { border-color: rgba(255,107,31,.55); }
.wiz__choices button.is-on { border-color: var(--orange); background: rgba(255,107,31,.08); box-shadow: 0 0 0 1px var(--orange) inset; }
.wiz__choices b { font-size: 14px; }
.wiz__choices span { font-size: 12px; color: var(--muted); }
.wiz__box { padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.wiz__box textarea { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--text); resize: vertical; line-height: 1.5; margin-bottom: 8px; }
.wiz__box input[type="url"], .wiz__box input[type="password"] { width: 100%; background: var(--field); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 10px; color: var(--text); }
.wiz__ok { color: #7be0a4; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.3); border-radius: 9px; padding: 9px 11px; font-size: 12.5px; margin-top: 10px; }
.wiz__ok.is-warn { color: #ffd250; background: rgba(255,210,80,.08); border-color: rgba(255,210,80,.35); }
.wiz__swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wiz__swatches button { aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; }
.wiz__swatches button.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--orange); }
.wiz__formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.wiz__formats button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); text-align: center; }
.wiz__formats button.is-on { border-color: var(--orange); color: var(--text); box-shadow: 0 0 0 1px var(--orange) inset; }
.wiz__ratio { display: block; border: 2px solid currentColor; border-radius: 4px; }
.wiz__ratio--v { width: 20px; height: 34px; }
.wiz__ratio--h { width: 38px; height: 22px; margin: 6px 0; }
.wiz__ratio--s { width: 28px; height: 28px; margin: 3px 0; }
.wiz__more { margin-top: 12px; }
.wiz__more summary { cursor: pointer; color: var(--orange-2); font-size: 12.5px; margin-bottom: 8px; }
.wiz__summary { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.wiz__summary li { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: center; padding: 9px 11px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; }
.wiz__summary li > span:first-child { color: var(--muted); }
.wiz__summary li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz__summary li button { font-size: 11px; color: var(--orange-2); }
.wiz__label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
#wizRange { margin-bottom: 12px; }
#wizRange button.is-on { background: rgba(255,107,31,.16); color: var(--orange); }
.wiz__step .btn--block { margin-top: 8px; }
.wiz__export { padding: 14px; font-size: 15px; }
.wiz__foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-2); }
.wiz__hint { flex: 1; font-size: 11.5px; color: var(--muted); text-align: center; }
#wizNext:disabled { opacity: .45; cursor: not-allowed; transform: none; }
@media (max-width: 960px) {
  body.wiz-open .app { grid-template-columns: 1fr; }
  .wiz { border-right: 0; border-top: 1px solid var(--line); }
  .wiz__body { overflow: visible; }
}

.frag__chip { white-space: nowrap; }
body.wiz-open .frag__quick { display: none; }
@media (max-width: 600px) { .hide-sm { display: none; } .top__right { gap: 6px; } .top .btn--sm { padding: 7px 9px; } }
