/* ==========================================================================
   Transcribe — hoja de estilos
   Un único fichero, sin build: lo que ves es lo que se sirve.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --violet: #7c5cff;
  --cyan:   #22d3ee;
  --pink:   #f472b6;
  --green:  #34d399;
  --amber:  #fbbf24;
  --red:    #f87171;

  --grad: linear-gradient(120deg, var(--violet), var(--cyan));
  --grad-soft: linear-gradient(120deg, rgba(124, 92, 255, .16), rgba(34, 211, 238, .12));

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --sidebar-w: 306px;
  --player-h: 68px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .9, .3, 1);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .16);
  --shadow-2: 0 24px 64px rgba(0, 0, 0, .38);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c14;
  --bg-deep: #070810;
  --surface: rgba(255, 255, 255, .034);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-solid: #12141f;
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #e9ebf5;
  --text-dim: #a2a8c0;
  --text-faint: #6e7490;
  --accent: #8b7cff;
  --accent-contrast: #0a0c14;
  --hl: rgba(251, 191, 36, .3);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5fa;
  --bg-deep: #eceef6;
  --surface: rgba(255, 255, 255, .82);
  --surface-2: rgba(17, 20, 40, .045);
  --surface-solid: #ffffff;
  --border: rgba(17, 20, 40, .1);
  --border-strong: rgba(17, 20, 40, .2);
  --text: #171a28;
  --text-dim: #565c78;
  --text-faint: #838aa6;
  --accent: #6d4dfa;
  --accent-contrast: #ffffff;
  --hl: rgba(251, 191, 36, .45);
  --shadow-1: 0 1px 2px rgba(20, 22, 45, .06), 0 8px 24px rgba(20, 22, 45, .07);
  --shadow-2: 0 24px 64px rgba(20, 22, 45, .16);
}

/* --- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; flex: none; }

::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Fondo animado -------------------------------------------------------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 68%); }
.aurora span:nth-child(2) { width: 40vw; height: 40vw; right: -10vw; top: 8vh; background: radial-gradient(circle, rgba(34, 211, 238, .38), transparent 68%); animation-delay: -9s; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 34vw; bottom: -16vw; background: radial-gradient(circle, rgba(244, 114, 182, .3), transparent 68%); animation-delay: -17s; }
[data-theme="light"] .aurora span { opacity: .32; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.14); }
}

/* --- Estructura ----------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100dvh;
}

/* --- Sidebar -------------------------------------------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 14px 14px;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 92, 255, .42);
}
.brand__mark svg { width: 21px; height: 21px; }
.brand__text { display: flex; flex-direction: column; font-weight: 680; letter-spacing: -.025em; font-size: 17px; }
.brand__text em { font-style: normal; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }

/* --- Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 560;
  font-size: 14px;
  white-space: nowrap;
  transition: transform .16s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 92, 255, .34);
}
.btn--primary:hover { box-shadow: 0 10px 30px rgba(124, 92, 255, .48); filter: brightness(1.06); }

.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text-dim); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

.btn--danger { background: color-mix(in srgb, var(--red) 18%, transparent); border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }
.btn--danger:hover { background: color-mix(in srgb, var(--red) 26%, transparent); }

.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  color: var(--text-dim);
  transition: background .18s, color .18s, transform .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* Controles que solo existen en la versión móvil (se activan en el @media final). */
.sidebar__close, .topbar__menu { display: none; }

.link { color: var(--accent); font-weight: 560; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { filter: brightness(1.15); }

/* --- Buscador ------------------------------------------------------------- */
.search {
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-faint);
  transition: border-color .2s, background .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--surface-2); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.6); }
.search--sm { height: 36px; max-width: 300px; }
.search__count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-faint); }

/* --- Historial ------------------------------------------------------------ */
.history { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 3px; }

.hitem {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  text-align: left;
  color: var(--text-dim);
  transition: background .16s, color .16s;
  position: relative;
}
.hitem:hover { background: var(--surface-2); color: var(--text); }
.hitem.is-active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.hitem__icon { display: grid; place-items: center; margin-top: 2px; }
.hitem__body { min-width: 0; }
.hitem__title { font-size: 13.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hitem__meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.hitem__meta b { font-weight: 500; }
.hitem__bar { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.hitem__bar i { display: block; height: 100%; border-radius: 3px; background: var(--grad); transition: width .4s var(--ease); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot--queued { background: var(--text-faint); }
.dot--processing { background: var(--cyan); animation: pulse 1.4s ease-in-out infinite; }
.dot--done { background: var(--green); }
.dot--error { background: var(--red); }
.dot--canceled { background: var(--amber); }

@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.history__empty { padding: 26px 14px; text-align: center; color: var(--text-faint); font-size: 13px; }
.history__group { padding: 12px 10px 4px; font-size: 11px; font-weight: 620; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }

/* --- Pie del sidebar ------------------------------------------------------ */
.sidebar__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.engine { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11.5px; color: var(--text-faint); }
.engine svg { width: 15px; height: 15px; }
.engine span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__actions { display: flex; gap: 2px; }
.icon-btn .i-light { display: none; }
[data-theme="light"] .icon-btn .i-dark { display: none; }
[data-theme="light"] .icon-btn .i-light { display: block; }

/* --- Main ----------------------------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  min-height: 58px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.topbar__title { font-weight: 620; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.queue-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}
.queue-pill .dot { background: var(--cyan); animation: pulse 1.4s ease-in-out infinite; }

.view { flex: 1; min-height: 0; overflow-y: auto; padding: 0 22px 40px; scroll-behavior: smooth; }
.view--home { display: flex; flex-direction: column; align-items: center; }
/* Sin esto los hijos se comprimen verticalmente cuando la ventana es baja. */
.view--home > * { flex: none; }

/* Columna de lectura centrada: el texto no se estira en pantallas anchas. */
.view--job { padding-inline: max(22px, calc((100% - 880px) / 2)); }

/* --- Hero ----------------------------------------------------------------- */
.hero { text-align: center; max-width: 640px; margin: clamp(18px, 5vh, 54px) auto 26px; animation: rise .7s var(--ease) both; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); font-weight: 700; letter-spacing: -.035em; }
.hero p { margin-top: 12px; color: var(--text-dim); font-size: 15.5px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --- Dropzone ------------------------------------------------------------- */
.dropzone {
  position: relative;
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
  animation: rise .7s .08s var(--ease) both;
}
.dropzone:hover, .dropzone:focus-visible { border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-2px); }
.dropzone.is-over {
  border-color: var(--accent);
  border-style: solid;
  transform: scale(1.012);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-2);
}
.dropzone__glow { position: absolute; inset: -40%; background: var(--grad-soft); opacity: 0; transition: opacity .3s; }
.dropzone.is-over .dropzone__glow, .dropzone:hover .dropzone__glow { opacity: 1; }
.dropzone__inner { position: relative; padding: clamp(30px, 5vw, 52px) 26px; text-align: center; }
.dropzone__icon {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 34px rgba(124, 92, 255, .4);
  transition: transform .3s var(--ease);
}
.dropzone__icon svg { width: 27px; height: 27px; }
.dropzone:hover .dropzone__icon { transform: translateY(-3px) rotate(-4deg); }
.dropzone.is-over .dropzone__icon { animation: bob .9s var(--ease) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.dropzone__title { font-size: 19px; font-weight: 620; letter-spacing: -.02em; }
.dropzone__hint { margin-top: 6px; color: var(--text-dim); font-size: 14px; }
.dropzone__meta { margin-top: 14px; font-size: 12px; color: var(--text-faint); }

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}

.home-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; animation: rise .7s .16s var(--ease) both; }

/* --- Grabadora ------------------------------------------------------------ */
.recorder {
  position: relative;
  margin-top: 18px;
  width: 100%; max-width: 460px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  text-align: center;
  animation: rise .4s var(--ease) both;
}
.recorder__pulse { width: 12px; height: 12px; margin: 0 auto 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent); animation: ring 1.6s ease-out infinite; }
@keyframes ring { to { box-shadow: 0 0 0 18px transparent; } }
.recorder__time { font-family: var(--mono); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.recorder__bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 42px; margin: 14px 0 18px; }
.recorder__bars i { width: 4px; min-height: 4px; border-radius: 4px; background: var(--grad); transition: height .08s linear; }
.recorder__actions { display: flex; gap: 10px; justify-content: center; }

/* --- Features ------------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  width: 100%; max-width: 720px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  animation: rise .7s .24s var(--ease) both;
}
.features li {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.features svg { width: 18px; height: 18px; color: var(--accent); }
.features div { display: flex; flex-direction: column; min-width: 0; }
.features strong { font-size: 13.5px; font-weight: 600; }
.features span { font-size: 12px; color: var(--text-faint); }

/* --- Cabecera de trabajo -------------------------------------------------- */
.job-head { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0 16px; flex-wrap: wrap; }
.job-head__main { flex: 1; min-width: 240px; }
.job-title {
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 680;
  letter-spacing: -.03em;
  padding: 2px 8px;
  margin-left: -8px;
  border-radius: 8px;
  outline: none;
  transition: background .18s, box-shadow .18s;
}
.job-title:hover { background: var(--surface-2); }
.job-title:focus { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.job-head__actions { display: flex; gap: 6px; flex-wrap: wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.chip svg { width: 13px; height: 13px; opacity: .75; }
.chip--accent { background: var(--grad-soft); border-color: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }
.chip--ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 34%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.chip--warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 34%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.chip--err { color: var(--red); border-color: color-mix(in srgb, var(--red) 34%, transparent); background: color-mix(in srgb, var(--red) 12%, transparent); }

/* --- Progreso ------------------------------------------------------------- */
.job-progress { margin-bottom: 20px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.job-progress__bar { height: 7px; border-radius: 7px; background: var(--surface-2); overflow: hidden; position: relative; }
.job-progress__bar i {
  display: block; height: 100%; width: 0;
  border-radius: 7px;
  background: var(--grad);
  background-size: 200% 100%;
  transition: width .5s var(--ease);
  animation: slide 2.2s linear infinite;
}
@keyframes slide { to { background-position: 200% 0; } }
.job-progress__label { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12.5px; color: var(--text-dim); }
.job-progress__label b { font-variant-numeric: tabular-nums; color: var(--text); }

/* --- Error ---------------------------------------------------------------- */
.job-error {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 17px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 32%, transparent);
}
.job-error svg { color: var(--red); margin-top: 1px; }
.job-error strong { display: block; font-size: 14px; }
.job-error p { margin-top: 3px; font-size: 13px; color: var(--text-dim); }

/* --- Toolbar -------------------------------------------------------------- */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 0 12px;
  margin-bottom: 4px;
  background: linear-gradient(to bottom, var(--bg) 68%, transparent);
}
.toolbar__spacer { flex: 1; }

.seg-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-toggle button { padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 540; color: var(--text-faint); transition: background .18s, color .18s; }
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button.is-active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-1); }
.seg-toggle--wide { width: 100%; }
.seg-toggle--wide button { flex: 1; padding: 9px; font-size: 13.5px; }

/* --- Dropdown ------------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 20;
  min-width: 230px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .18s, transform .18s var(--ease), visibility .18s;
}
.dropdown.is-open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.dropdown__menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 8px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  text-align: left;
  transition: background .15s;
}
.dropdown__menu button:hover { background: var(--surface-2); }
.dropdown__menu em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }

/* --- Transcripción -------------------------------------------------------- */
.transcript { padding-bottom: calc(var(--player-h) + 30px); }

.segment {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 14px;
  padding: 7px 12px 7px 8px;
  margin-left: -8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .16s;
  scroll-margin: 90px;
}
.segment:hover { background: var(--surface-2); }
.segment.is-active { background: var(--grad-soft); box-shadow: inset 2px 0 0 var(--accent); }
.segment__time {
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  padding-top: 4px;
  transition: color .16s;
}
.segment:hover .segment__time, .segment.is-active .segment__time { color: var(--accent); }
.segment__text { font-size: 16px; line-height: 1.72; }

.prose { max-width: 720px; font-size: 16.5px; line-height: 1.82; }
.prose p { margin: 0 0 1.15em; }

mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.is-current { background: var(--accent); color: #fff; }

.transcript__empty { padding: 60px 20px; text-align: center; color: var(--text-faint); }
.skeleton { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.skeleton i {
  display: block; height: 15px; border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton i:nth-child(3n) { width: 72%; }
.skeleton i:nth-child(3n+1) { width: 94%; }
.skeleton i:nth-child(3n+2) { width: 84%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Reproductor ---------------------------------------------------------- */
.player {
  position: absolute; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--player-h);
  padding: 0 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  animation: rise .35s var(--ease) both;
}
.player__play {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 92, 255, .38);
  transition: transform .16s var(--ease), box-shadow .2s;
}
.player__play:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(124, 92, 255, .5); }
.player__play:active { transform: scale(.96); }
.player__play .i-pause { display: none; }
.player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }

.player__time { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-dim); min-width: 42px; }
.player__time--total { text-align: right; }

.player__track { position: relative; flex: 1; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.player__track::before { content: ""; position: absolute; inset-inline: 0; height: 5px; border-radius: 5px; background: var(--surface-2); }
.player__buffered { position: absolute; height: 5px; border-radius: 5px; background: var(--border-strong); width: 0; }
.player__played { position: absolute; height: 5px; border-radius: 5px; background: var(--grad); width: 0; }
.player__thumb {
  position: absolute; left: 0;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  transform: translateX(-50%) scale(.72);
  transition: transform .16s var(--ease);
}
.player__track:hover .player__thumb, .player__track:focus-visible .player__thumb { transform: translateX(-50%) scale(1); }

.player__rate {
  min-width: 42px; height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  transition: color .18s, border-color .18s;
}
.player__rate:hover { color: var(--text); border-color: var(--border-strong); }

/* --- Modales -------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 5, 12, .62); backdrop-filter: blur(6px); animation: fade .2s both; }
.modal__card {
  position: relative;
  width: 100%; max-width: 620px;
  max-height: min(86dvh, 780px);
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  animation: pop .26s var(--ease) both;
  overflow: hidden;
}
.modal__card--sm { max-width: 460px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 17px; }
.modal__body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }

.input { display: flex; flex-direction: column; gap: 7px; }
.input > span { font-size: 13px; font-weight: 580; display: flex; justify-content: space-between; align-items: center; }
.input > span i { font-style: normal; font-weight: 440; color: var(--text-faint); }
.input > span b { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.input em { font-style: normal; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

select, textarea, .field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, background .18s;
  resize: vertical;
}
select:focus, textarea:focus, .field input:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--surface-2); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888fae' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
}
select option { background: var(--surface-solid); color: var(--text); }

input[type="range"] { appearance: none; width: 100%; height: 5px; border-radius: 5px; background: var(--surface-2); outline: none; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--grad); cursor: pointer; box-shadow: 0 2px 8px rgba(124, 92, 255, .5); }
input[type="range"]::-moz-range-thumb { width: 17px; height: 17px; border: none; border-radius: 50%; background: var(--violet); cursor: pointer; }

.switches { display: flex; flex-direction: column; gap: 12px; }
.switch { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); transition: background .22s, border-color .22s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-faint); transition: transform .22s var(--ease), background .22s; }
.switch input:checked + .switch__track { background: var(--grad); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch div { display: flex; flex-direction: column; }
.switch strong { font-size: 13.5px; font-weight: 580; }
.switch em { font-style: normal; font-size: 11.5px; color: var(--text-faint); }

.specs { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13px; }
.specs dt { color: var(--text-faint); }
.specs dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }

.shortcuts h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); margin-bottom: 9px; }
.shortcuts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-dim); }
.shortcuts li { display: flex; align-items: center; gap: 7px; }

/* --- Login ---------------------------------------------------------------- */
.login { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.login__card {
  position: relative;
  width: 100%; max-width: 380px;
  padding: 34px 30px 30px;
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: pop .4s var(--ease) both;
}
.login__logo {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  margin: 0 auto 16px;
  border-radius: 17px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px rgba(124, 92, 255, .45);
}
.login__logo svg { width: 27px; height: 27px; }
.login__card h1 { font-size: 24px; letter-spacing: -.03em; }
.login__card > p { margin: 8px 0 20px; font-size: 13.5px; color: var(--text-dim); }
.field { position: relative; display: block; margin-bottom: 12px; }
.field__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: grid; }
.field__icon svg { width: 17px; height: 17px; }
.field input { padding-left: 38px; height: 44px; }
.login__error { margin: 0 0 12px; font-size: 13px; color: var(--red); }

/* --- Toasts --------------------------------------------------------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 230px; max-width: 380px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in .32s var(--ease) both;
}
.toast.is-out { animation: toast-out .26s var(--ease) both; }
.toast svg { width: 17px; height: 17px; }
.toast--ok svg { color: var(--green); }
.toast--err svg { color: var(--red); }
.toast--info svg { color: var(--cyan); }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(28px) scale(.96); } }

/* --- Responsive ----------------------------------------------------------- */
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: min(86vw, var(--sidebar-w));
    transform: translateX(-102%);
    transition: transform .3s var(--ease);
    background: var(--bg);
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-2); }
  .sidebar__close, .topbar__menu { display: grid; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 12, .6); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  .app.nav-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  .player { left: 0; }
  .view { padding: 0 16px 32px; }
  .topbar { padding: 10px 14px; }
  .segment { grid-template-columns: 54px minmax(0, 1fr); gap: 10px; }
  .segment__text { font-size: 15.5px; }
  .toasts { left: 14px; right: 14px; align-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 560px) {
  .player { gap: 7px; padding: 0 12px; }
  .player__rate, .player .icon-btn { display: none; }
  .player__play { width: 38px; height: 38px; }
  .toolbar .search--sm { max-width: none; flex: 1 1 100%; }
  .job-head__actions { width: 100%; }
}

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

@media print {
  .sidebar, .topbar, .player, .toolbar, .job-head__actions, .aurora, .toasts { display: none !important; }
  body, .app { display: block; height: auto; overflow: visible; background: #fff; color: #000; }
  .view { overflow: visible; padding: 0; }
  .transcript { padding-bottom: 0; max-width: none; }
  .segment { break-inside: avoid; }
}
