/* SoP — estilos (sin fuentes externas: pila de fuentes del sistema) */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f0f1ed;
  --border: #dfe1db;
  --text: #1d2321;
  --muted: #646d69;
  --accent: #1f6f78;
  --accent-strong: #17585f;
  --accent-soft: #e2f0f0;
  --ok: #2f7d4f;
  --warn: #a86a12;
  --err: #b4372f;
  --err-soft: #fbe9e7;
  --warn-soft: #fbf1df;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 2px 8px rgb(0 0 0 / .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --s1: #1f6f78; --s2: #c0562f; --s3: #6b5bb8; --s4: #3d8b3d;
  --s5: #b0408a; --s6: #8a6d1c; --s7: #2c6fb5; --s8: #7a4b2a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615; --surface: #1a1f1e; --surface-2: #222827; --border: #2e3533;
    --text: #e6eae8; --muted: #98a29e; --accent: #4fb3bd; --accent-strong: #79c9d1;
    --accent-soft: #1d3436; --ok: #5cb87f; --warn: #e0a64a; --err: #ef7d73;
    --err-soft: #3a2220; --warn-soft: #3a3020;
    --shadow: none;
    --s1: #4fb3bd; --s2: #e9875f; --s3: #a497e6; --s4: #74c374;
    --s5: #e47ec2; --s6: #d2b15a; --s7: #73a9e8; --s8: #c79572;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 15px; font-weight: 650; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 24px 8px; margin: 0; }
[hidden] { display: none !important; }

/* ---------- barra superior ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: 26px; fill: var(--accent); }
.brand-name { font-weight: 750; font-size: 18px; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 13px; }
.health {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.health.ok .dot { background: var(--ok); }
.health.warn .dot { background: var(--warn); }
.health.err .dot { background: var(--err); }

/* ---------- maquetacion ---------- */
.layout {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px;
  max-width: 1440px; margin: 0 auto; padding: 20px;
}
.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main { min-width: 0; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .brand-sub { display: none; }
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* ---------- formularios ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-top: 10px; }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .dropzone:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.minmax span { display: flex; gap: 6px; }

.btn {
  font: inherit; font-size: 14px; font-weight: 550; border-radius: 7px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1414; } }
.btn.danger { color: var(--err); }
.btn.danger:hover:not(:disabled) { background: var(--err-soft); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 14px; padding: 10px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 22px 12px; margin: 0;
  cursor: pointer; color: var(--muted); background: var(--surface-2); transition: border-color .15s, background .15s;
}
.dropzone svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-main { color: var(--text); font-weight: 600; font-size: 14px; }
.dz-sub { font-size: 12px; }
.dz-file { margin-top: 6px; font-size: 13px; color: var(--accent); font-weight: 600; word-break: break-all; }

.advanced { margin-top: 12px; }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.form-error { color: var(--err); font-size: 13px; margin: 10px 0 0; }
.upload-progress { margin-top: 12px; }
.upload-progress small { color: var(--muted); }

.bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.bar.big { height: 8px; margin: 10px 0 14px; }

/* ---------- historial ---------- */
.history { padding-bottom: 8px; }
.job-list { list-style: none; margin: 0 -8px; padding: 0; max-height: 52vh; overflow: auto; }
.job-list li a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px; border-radius: 7px;
  text-decoration: none; color: var(--text);
}
.job-list li a:hover { background: var(--surface-2); }
.job-list li a[aria-current="true"] { background: var(--accent-soft); }
.job-list .name { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-list .when { font-size: 12px; color: var(--muted); }
.pill {
  font-size: 11px; font-weight: 650; border-radius: 999px; padding: 1px 8px; align-self: center;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.ok { color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }

/* ---------- estado vacio ---------- */
.empty-state { text-align: center; padding: 72px 24px; color: var(--muted); max-width: 560px; margin: 0 auto; }
.empty-state svg { width: 72px; height: 72px; color: var(--accent); opacity: .85; }
.empty-state h1 { color: var(--text); font-size: 22px; margin: 16px 0 8px; }

/* ---------- trabajo ---------- */
.job { display: flex; flex-direction: column; gap: 14px; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.job-head h1 { font-size: 20px; word-break: break-word; }
.job-head p { margin: 4px 0 0; font-size: 13px; }
.job-actions { display: flex; gap: 8px; }

.progress-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .phases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.phases li {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.phases .ph-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.phases .ph-name::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); background: transparent;
}
.phases .ph-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.phases li.en_curso { border-color: var(--accent); background: var(--accent-soft); }
.phases li.en_curso .ph-name::before { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.phases li.completado .ph-name::before { background: var(--ok); border-color: var(--ok); }
.phases li.omitido { opacity: .6; }
.phases li.omitido .ph-name::before { border-style: dashed; }
.phases li.error { border-color: var(--err); background: var(--err-soft); }
.phases li.error .ph-name::before { background: var(--err); border-color: var(--err); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .phases li.en_curso .ph-name::before { animation: none; } }

.alert { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--err-soft); color: var(--err); font-size: 14px; }
.notice { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }

.player-card { padding: 12px 16px; }
.player-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.player-row audio { flex: 1 1 320px; min-width: 0; height: 40px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button {
  font: inherit; font-size: 13px; padding: 6px 14px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .segmented button[aria-pressed="true"] { color: #0b1414; } }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border: 0; background: none; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: flex; flex-direction: column; gap: 14px; }

/* ---------- interlocutores y transcripcion ---------- */
.speaker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.speaker { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.speaker .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.speaker .sp-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.speaker input { padding: 5px 8px; }

.transcript { display: flex; flex-direction: column; gap: 2px; }
.turn {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 12px; padding: 8px 12px;
  border-left: 3px solid var(--c, var(--border)); border-radius: 0 8px 8px 0; cursor: pointer; background: var(--surface);
}
.turn:hover { background: var(--surface-2); }
.turn.current { background: var(--accent-soft); }
.turn .ts { font: 12px/1.9 var(--mono); color: var(--muted); }
.turn .who { font-weight: 650; font-size: 13px; color: var(--c); }
.turn .txt { grid-column: 2; margin: 0; }

/* ---------- acta ---------- */
.regen { display: flex; flex-direction: column; gap: 10px; }
.regen label { margin: 0; }
.regen .btn { align-self: flex-start; }
.markdown { padding: 20px 24px; overflow-wrap: anywhere; }
.markdown h1 { font-size: 20px; margin: 0 0 12px; }
.markdown h2 { font-size: 16px; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.markdown h3 { font-size: 15px; margin: 14px 0 6px; }
.markdown p, .markdown ul, .markdown ol { margin: 6px 0; }
.markdown table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 14px; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.markdown th { background: var(--surface-2); }
.markdown em { color: var(--muted); }
.markdown strong { font-weight: 700; color: var(--text); }
.markdown code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }

/* ---------- descargas ---------- */
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.dl {
  display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text);
}
.dl b { color: var(--accent); }
.dl span { font-size: 13px; color: var(--muted); }
.dl:hover { border-color: var(--accent); }
.dl[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.timings { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; padding: 0 4px; font-size: 13px; }
.timings dt { color: var(--muted); }
.timings dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- dialogo y avisos ---------- */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; max-width: 420px; }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 16px rgb(0 0 0 / .2); z-index: 50; max-width: calc(100vw - 32px);
}

/* =====================================================================
   Usuarios, administracion y "Acerca de"
   ===================================================================== */
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px; }
.btn.link-btn { text-decoration: none; margin-top: 6px; color: var(--muted); }
.form-error:empty { display: none; }
fieldset { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 14px; margin-top: 8px; cursor: pointer; }
.check input { width: auto; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.check small { font-size: 12px; }

/* ---------- acceso ---------- */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 34px; height: 34px; }
.auth-brand div { display: flex; flex-direction: column; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-lead { font-size: 14px; margin: 6px 0 4px; }
.auth-note { font-size: 13px; text-align: center; margin: 14px 0 0; }
.pw-rule { display: block; margin-top: 6px; font-size: 12px; }

/* ---------- barra superior: usuario ---------- */
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-admin { text-decoration: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 3px 12px 3px 3px; font: inherit; font-size: 14px; cursor: pointer; max-width: 240px; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none; }
@media (prefers-color-scheme: dark) { .avatar { color: #0b1414; } }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .14); padding: 6px; z-index: 30; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 13px; overflow-wrap: anywhere; }
.menu-head strong { font-size: 14px; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .user-name, .nav-admin, .health-text { display: none; }
  .user-btn { padding: 3px; }
  .health { padding: 6px; }
  .topbar { padding: 10px 16px; }
}

/* ---------- visibilidad e historial ---------- */
.visibility { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 14px; }
.vis-options .check { margin-top: 6px; }
.group-checks { display: flex; flex-direction: column; gap: 0; padding: 2px 0 0 24px; }
.group-checks .check { margin-top: 6px; }
.vis-none { font-size: 13px; margin: 2px 0 0; }
.job-filter { margin: -4px 0 8px; font-size: 13px; padding: 5px 8px; }
.vis-icon { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 3px;
  border: 1.5px solid var(--muted); opacity: .7; }
.vis-icon.shared { border-color: var(--accent); background: var(--accent-soft); opacity: 1; border-radius: 50%; }
.job-sharing { margin: 6px 0 0; font-size: 13px; }
.vis-badge { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.vis-badge.shared { background: var(--accent-soft); color: var(--accent); }
.job-actions { flex-wrap: wrap; }

/* ---------- dialogo de formulario ---------- */
.form-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); }
.form-dialog form { display: flex; flex-direction: column; }
.form-dialog h2 { font-size: 17px; margin-bottom: 4px; }
.fd-body { overflow-y: auto; max-height: calc(100vh - 220px); padding: 2px 2px 4px; }
.fd-body > p { font-size: 14px; }
.fd-groups { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; }
.fd-groups .group-checks { padding-left: 0; max-height: 180px; overflow-y: auto; }
.member-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.member-list .check span { overflow-wrap: anywhere; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; font-family: var(--mono); }

/* ---------- administracion ---------- */
.admin { max-width: 1440px; margin: 0 auto; padding: 16px 20px 80px; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.admin-tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs .admin-back { margin-left: auto; font-weight: 500; }
@media (max-width: 760px) {
  .admin { padding: 12px 16px 80px; }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .admin-tabs a { white-space: nowrap; padding: 9px 10px; }
  .admin-tabs .admin-back { margin-left: 0; }
}
.admin-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.panel-head h1 { font-size: 21px; }
.panel-head p { margin: 4px 0 0; font-size: 13px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-actions select { width: auto; }
.search { width: 240px; max-width: 100%; }
@media (max-width: 640px) { .panel-actions, .search, .panel-actions select { width: 100%; } }
.privacy-note { margin: 0; }
.center { display: flex; justify-content: center; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td .pill { margin: 1px 4px 1px 0; display: inline-block; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; min-width: 200px; }
td .fname { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table.audit td { font-size: 13px; }
tr.row-warn td:nth-child(3) { color: var(--err); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pill.grp { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- parametros ---------- */
.settings-section { padding: 6px 16px 8px; }
.settings-section h2 { padding: 12px 0 8px; font-size: 16px; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 4px 20px; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border); position: relative; }
.setting.dirty { background: linear-gradient(90deg, var(--warn-soft), transparent 70%); margin: 0 -16px; padding: 11px 16px; }
.setting-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.setting-label label { display: inline; margin: 0; color: var(--text); font-size: 14px; font-weight: 550; }
.setting.overridden .setting-label label::after { content: "•"; color: var(--accent); margin-left: 6px; font-size: 18px; line-height: 0; vertical-align: -2px; }
.setting-control { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; }
.setting-control > select, .setting-control > input, .setting-control > textarea { width: 100%; }
.setting-meta { grid-column: 1 / -1; font-size: 12px; }
.num-wrap { display: flex; align-items: center; gap: 6px; width: 100%; }
.num-wrap input { text-align: right; font-variant-numeric: tabular-nums; }
.unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .setting { grid-template-columns: minmax(0, 1fr); }
  .setting-control { justify-content: flex-start; }
}
.info { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: 700 12px/1 Georgia, "Times New Roman", serif; font-style: italic; cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; }
.info:hover, .info[aria-expanded="true"] { background: var(--accent); color: var(--surface); }
.help-pop { grid-column: 1 / -1; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-top: 6px; }
.help-pop p { margin: 0 0 8px; line-height: 1.55; }
.help-pop dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.help-pop dt { color: var(--muted); }
.help-pop dd { margin: 0; }
.switch { flex-direction: row; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--text); font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--text); color: var(--bg);
  border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 6px 24px rgb(0 0 0 / .25); z-index: 20; font-size: 14px; font-weight: 600; }
.save-bar .spacer { flex: 1; }
.save-bar .btn:not(.primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }

/* ---------- acerca de ---------- */
.about-hero h1 { font-size: 22px; margin-bottom: 8px; }
.about-hero p { margin: 4px 0; max-width: 820px; }
.about-section h2 { font-size: 16px; margin-bottom: 12px; }
.about-section > p { margin: 10px 0 0; font-size: 13px; }
.about-list { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; max-width: 980px; }
.about-section .table-wrap { box-shadow: none; }
.pipeline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: step; }
.pipeline li { counter-increment: step; flex: 1 1 140px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; font-size: 13px; background: var(--surface-2); position: relative; }
.pipeline li::before { content: counter(step); position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--accent); }
.pipeline strong { font-size: 14px; padding-right: 14px; }
.pipeline span { color: var(--muted); }
.arch-wrap { overflow-x: auto; }
.arch { width: 100%; min-width: 640px; height: auto; display: block; font-family: var(--font); }
.dg-zone { fill: none; stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 6 5; }
.dg-internal { fill: var(--surface-2); fill-opacity: .55; stroke: var(--accent); stroke-opacity: .5; }
.dg-zlabel { font-size: 12px; fill: var(--muted); font-weight: 600; }
.dg-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.dg-web, .dg-api { stroke: var(--accent); stroke-width: 2; }
.dg-api { fill: var(--accent-soft); }
.dg-llm { stroke: var(--s3); stroke-width: 2; }
.dg-ext { fill: var(--surface-2); }
.dg-t { font-size: 14px; font-weight: 650; text-anchor: middle; fill: var(--text); }
.dg-s { font-size: 11.5px; text-anchor: middle; fill: var(--muted); }
.dg-line { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.dg-arrow { fill: var(--muted); }
.dg-vol { fill: var(--warn-soft); stroke: var(--warn); stroke-opacity: .5; stroke-width: 1.2; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv .pill { margin: 0 6px 4px 0; display: inline-block; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { margin-top: 6px; } }

/* =====================================================================
   Tema "tech": paleta del logo (turquesa), reticula, monoespaciada en
   etiquetas y cifras, brillos sutiles. Va al final: sobrescribe lo anterior.
   ===================================================================== */
:root {
  --bg: #eef2f2;
  --surface: #ffffff;
  --surface-2: #f2f6f6;
  --border: #d8e1e2;
  --text: #162022;
  --muted: #5b6a6d;
  --accent: #267c86;          /* texto y controles (contraste AA sobre blanco) */
  --accent-strong: #1d646c;
  --accent-bright: #3fa9b5;   /* barras del logo: decoracion, brillos */
  --accent-soft: #e0f1f2;
  --glow: rgb(63 169 181 / .28);
  --grid: rgb(38 124 134 / .07);
  --radius: 8px;
  --shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 1px 2px rgb(16 40 44 / .06), 0 4px 16px rgb(16 40 44 / .04);
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --s1: #267c86;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1012;
    --surface: #10191c;
    --surface-2: #152226;
    --border: #213237;
    --text: #e2eced;
    --muted: #8ea2a6;
    --accent: #4fc1cd;
    --accent-strong: #7fd6df;
    --accent-bright: #3fa9b5;
    --accent-soft: #11313a;
    --glow: rgb(79 193 205 / .30);
    --grid: rgb(79 193 205 / .06);
    --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 0 0 1px rgb(0 0 0 / .2);
    --s1: #4fc1cd;
  }
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}
::selection { background: var(--accent-bright); color: #fff; }

/* ---------- barra superior ---------- */
.topbar {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--accent-bright) 35%, transparent);
}
.brand-mark { fill: var(--accent-bright); filter: drop-shadow(0 0 6px var(--glow)); }
.brand-name { font-family: var(--mono); font-weight: 800; letter-spacing: -.02em; }
.brand-sub { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.health, .user-btn { border-radius: 6px; }
.health { font-family: var(--mono); font-size: 12px; }
.health.ok .dot { background: #31c48d; box-shadow: 0 0 0 0 rgb(49 196 141 / .6); animation: pulse 2.4s ease-out infinite; }
.health.warn .dot { box-shadow: 0 0 8px var(--warn); }
.health.err .dot { box-shadow: 0 0 8px var(--err); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(49 196 141 / .55); } 70%, 100% { box-shadow: 0 0 0 6px rgb(49 196 141 / 0); } }
.avatar { border-radius: 6px; font-family: var(--mono); background: linear-gradient(135deg, var(--accent), var(--accent-bright)); }

/* ---------- tarjetas y titulos ---------- */
.card { border-radius: var(--radius); position: relative; }
.card > h2, .card-head h2, .settings-section h2, .about-section h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}
.card > h2::before, .card-head h2::before, .settings-section h2::before, .about-section h2::before {
  content: "//"; color: var(--accent-bright); margin-right: 8px; font-weight: 700;
}
.job-head h1, .panel-head h1, .empty-state h1, .about-hero h1 { letter-spacing: -.015em; }
.panel-head h1::after { content: "_"; color: var(--accent-bright); margin-left: 2px; animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* ---------- controles ---------- */
input, select, textarea { border-radius: 6px; transition: border-color .15s, box-shadow .15s; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--glow);
}
.btn { border-radius: 6px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-bright) 55%, var(--accent)), var(--accent));
  border-color: var(--accent-strong);
  box-shadow: 0 1px 0 rgb(255 255 255 / .25) inset, 0 2px 10px var(--glow);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); box-shadow: 0 0 0 3px var(--glow), 0 4px 16px var(--glow); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #041416; border-color: var(--accent); } }
.dropzone { border-radius: var(--radius); border-color: color-mix(in srgb, var(--accent-bright) 45%, var(--border));
  background-image: radial-gradient(color-mix(in srgb, var(--accent-bright) 14%, transparent) 1px, transparent 1px); background-size: 14px 14px; }
.dropzone:hover, .dropzone.over { box-shadow: 0 0 0 3px var(--glow) inset; }
.dropzone svg { filter: drop-shadow(0 0 6px var(--glow)); }
.info { border-radius: 4px; font: 700 11px/1 var(--mono); font-style: normal; }

/* ---------- monoespaciada en cifras, estados y etiquetas ---------- */
.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; }
.job-list .when, .job-head p, .phases .ph-time, .turn .ts, .timings, td.num, td.nowrap, .unit, .setting-meta, .sp-meta,
#job-progress-text, .dl b, .kv dd, .upload-progress small, .menu-head span { font-family: var(--mono); font-size: 12px; }
table.data th { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; }
.tabs button, .admin-tabs a { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.phases .ph-name { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.vis-badge { font-family: var(--mono); font-size: 11px; border-radius: 4px; }

/* ---------- progreso ---------- */
.bar { border-radius: 2px; }
.bar span { border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); box-shadow: 0 0 10px var(--glow); }
.job:has(.phases li.en_curso) .bar.big span {
  background-image: repeating-linear-gradient(-45deg, rgb(255 255 255 / .22) 0 8px, transparent 8px 16px), linear-gradient(90deg, var(--accent), var(--accent-bright));
  background-size: 22px 22px, 100% 100%; animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 22px 0, 0 0; } }
.phases li { border-radius: 6px; }
.phases li.en_curso { box-shadow: 0 0 0 1px var(--accent-bright), 0 0 14px var(--glow); }

/* ---------- transcripcion, tablas, acta ---------- */
.turn { border-radius: 0 6px 6px 0; }
.turn.current { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-bright) 40%, transparent) inset; }
.table-wrap { border-radius: var(--radius); }
table.data tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.markdown h2 { border-bottom-color: color-mix(in srgb, var(--accent-bright) 35%, var(--border)); }
.markdown h2::before { content: "# "; color: var(--accent-bright); font-family: var(--mono); }
.help-pop { border-left-color: var(--accent-bright); }
.save-bar { border-radius: var(--radius); font-family: var(--mono); font-size: 13px; }
.toast { border-radius: 6px; font-family: var(--mono); font-size: 13px; box-shadow: 0 0 0 1px var(--accent-bright), 0 6px 22px var(--glow); }
.empty-state svg { color: var(--accent-bright); filter: drop-shadow(0 0 14px var(--glow)); }
.pipeline li { border-radius: 6px; }
.pipeline li::before { font-family: var(--mono); content: "0" counter(step); }
.arch { font-family: var(--mono); }
.dg-t { font-size: 13px; }
.dg-s { font-size: 10.5px; }
.dg-web, .dg-api { stroke: var(--accent-bright); }

/* ---------- pantalla de acceso: tarjeta SIEMPRE blanca ---------- */
.auth-view {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(60% 50% at 50% 40%, var(--glow), transparent 70%), var(--bg);
}
.auth-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 85%);
}
.auth-card {
  /* Paleta clara fija dentro de la tarjeta, sea cual sea el tema */
  --surface: #ffffff; --surface-2: #f2f6f6; --border: #d8e1e2; --text: #162022; --muted: #5b6a6d;
  --accent: #267c86; --accent-strong: #1d646c; --accent-soft: #e0f1f2;
  --err: #b4372f; --err-soft: #fbe9e7;
  color-scheme: light;
  background: #ffffff; color: var(--text); position: relative; z-index: 1;
  max-width: 420px; padding: 8px 32px 28px; border: 1px solid #d8e1e2; border-radius: 14px;
  box-shadow: 0 0 0 1px rgb(63 169 181 / .18), 0 20px 60px rgb(10 30 34 / .18), 0 0 80px var(--glow);
}
.auth-card::before {  /* linea de acento superior */
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #3fa9b5, transparent);
}
.auth-card .btn.primary { color: #fff; border-color: #1d646c; }
.auth-brand { display: flex; justify-content: center; margin: 0 -16px 6px; }
.auth-brand img { display: block; width: 100%; max-width: 340px; height: auto; }
.auth-card h1 { font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); text-align: center; margin-bottom: 6px; }
.auth-card h1::before { content: "> "; color: #3fa9b5; }
.auth-lead { text-align: center; }
.auth-foot { position: relative; z-index: 1; margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; text-align: center; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #31c48d; flex: none; animation: pulse 2.4s ease-out infinite; }
@media (max-width: 480px) { .auth-card { padding: 4px 20px 22px; } }

@media (prefers-reduced-motion: reduce) {
  .health.ok .dot, .dot-live, .panel-head h1::after, .job:has(.phases li.en_curso) .bar.big span { animation: none !important; }
}

/* =====================================================================
   Menu horizontal, vistas de trabajo y grabadora
   ===================================================================== */
.main-nav {
  position: sticky; top: 57px; z-index: 9; display: flex; gap: 4px; padding: 0 20px; overflow-x: auto;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.main-nav a {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px 11px; text-decoration: none; white-space: nowrap;
  color: var(--muted); font: 600 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em;
  border-bottom: 2px solid transparent; margin-bottom: -1px; position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent-bright); }
.main-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; box-shadow: 0 0 12px var(--accent-bright); }
.nav-ico { font-size: 14px; line-height: 1; width: 14px; text-align: center; }
.nav-rec { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px color-mix(in srgb, #e5484d 25%, transparent); }
.main-nav a.recording .nav-rec { animation: recblink 1s steps(1) infinite; box-shadow: 0 0 10px #ff3b3b; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-bright); color: #041416;
  font: 700 11px/18px var(--mono); text-align: center; letter-spacing: 0; }
@media (max-width: 640px) { .main-nav { padding: 0 8px; } .main-nav a { padding: 12px 10px 11px; font-size: 11.5px; } }

#app-view { min-width: 0; }
.view.work { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start;
  max-width: 1440px; margin: 0 auto; padding: 20px; }
@media (max-width: 1000px) { .view.work { grid-template-columns: minmax(0, 1fr); padding: 16px; } }
.opts-slot { min-width: 0; position: sticky; top: 112px; }
@media (max-width: 1000px) { .opts-slot { position: static; } }
.opts-card .advanced { margin-top: 14px; }
.dropzone-big { padding: 64px 20px; gap: 8px; }
.dropzone-big svg { width: 44px; height: 44px; }
.dropzone-big .dz-main { font-size: 17px; }
.dropzone-big .dz-sub { font-size: 13px; }

/* ---------- grabadora ---------- */
.recorder .card-head { flex-wrap: wrap; }
.mic-pick { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.mic-pick select { width: auto; max-width: 260px; font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 13px; padding: 5px 8px; }
.rec-screen {
  position: relative; border-radius: 10px; overflow: hidden; color: #cdeff3;
  background: radial-gradient(120% 90% at 50% 40%, #0b1b1e 0%, #050b0c 70%);
  border: 1px solid #1b3439;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .03), inset 0 0 60px rgb(0 0 0 / .8), 0 8px 30px rgb(0 0 0 / .18);
}
.rec-screen::after { /* lineas de barrido CRT */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / .025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.rec-hud { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; align-items: center; gap: 14px; z-index: 2;
  font: 600 12px/1 var(--mono); letter-spacing: .14em; }
.rec-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border: 1.5px solid rgb(255 80 80 / .35);
  border-radius: 4px; color: rgb(255 120 120 / .45); font-weight: 800; letter-spacing: .18em; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #5a1d1d; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .4); flex: none; }
.rec-badge.on { color: #ff5b5b; border-color: #ff5b5b; text-shadow: 0 0 8px rgb(255 60 60 / .7); box-shadow: 0 0 14px rgb(255 50 50 / .25); }
.rec-badge.on .rec-dot { background: radial-gradient(circle at 35% 35%, #ff8a8a, #ff1f1f 55%, #b30000); box-shadow: 0 0 10px #ff2a2a, 0 0 22px rgb(255 40 40 / .6);
  animation: recblink 1s steps(1) infinite; }
.rec-badge.paused { color: #ffbe5a; border-color: rgb(255 190 90 / .6); }
.rec-badge.paused .rec-dot { background: #ffbe5a; box-shadow: 0 0 8px rgb(255 190 90 / .7); }
@keyframes recblink { 50% { opacity: .15; } }
.rec-state { color: #7fd6df; text-shadow: 0 0 8px rgb(79 193 205 / .5); }
.rec-meta { margin-left: auto; color: rgb(205 239 243 / .55); font-weight: 500; letter-spacing: .06em; text-transform: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rec-scope { display: block; width: 100%; height: 260px; }
@media (max-width: 640px) { .rec-scope { height: 190px; } .rec-meta { display: none; } }
.rec-bottom { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; z-index: 2; }
.rec-timer { font: 700 clamp(30px, 6vw, 52px)/1 var(--mono); letter-spacing: .02em; color: #e8fbfd;
  text-shadow: 0 0 10px rgb(79 193 205 / .55), 0 0 28px rgb(79 193 205 / .25); font-variant-numeric: tabular-nums; }
.rec-timer .ms { font-size: .55em; color: #7fd6df; margin-left: 2px; }
.recorder.is-recording .rec-timer { color: #fff; }
.rec-vu { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 120px; }
.rec-vu-bar { width: 160px; max-width: 34vw; height: 8px; border-radius: 2px; background: rgb(255 255 255 / .06); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(127 214 223 / .15); }
.rec-vu-bar span { display: block; height: 100%; width: 0; transition: width .06s linear;
  background: linear-gradient(90deg, #2fbf8a 0%, #5ce1ee 60%, #ffbe5a 85%, #ff4d4d 100%); background-size: 160px 100%; }
.rec-vu-bar span.hot { box-shadow: 0 0 10px #ff4d4d; }
.rec-db { font: 500 11px/1 var(--mono); color: rgb(205 239 243 / .7); font-variant-numeric: tabular-nums; }

.rec-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 26px 12px 14px; border-radius: 999px; cursor: pointer;
  font: 700 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: box-shadow .15s, transform .05s;
}
.rec-btn:hover:not(:disabled) { box-shadow: 0 0 0 4px rgb(255 59 59 / .15), 0 6px 22px rgb(255 59 59 / .2); }
.rec-btn:active:not(:disabled) { transform: translateY(1px); }
.rec-btn:disabled { opacity: .5; cursor: not-allowed; }
.rec-btn-icon { width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 32%, #ff8f8f, #ff2a2a 52%, #b80000);
  box-shadow: 0 0 0 3px rgb(255 59 59 / .2), 0 0 16px rgb(255 40 40 / .55), inset 0 -2px 4px rgb(0 0 0 / .3); }
.rec-btn.again .rec-btn-icon { box-shadow: 0 0 0 3px rgb(255 59 59 / .15); }
.rec-controls .btn { padding: 11px 18px; font-family: var(--mono); font-weight: 600; letter-spacing: .06em; }
.rec-notice { margin: 14px 0 0; }
.rec-sys { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.rec-sys input:disabled + .switch-ui { opacity: .5; }
.rec-hint { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.rec-hint b { color: var(--text); font-weight: 600; }
.rec-notice a { color: inherit; font-weight: 600; word-break: break-all; }
.rec-result { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; }
.rec-result audio { width: 100%; height: 40px; }
.rec-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .rec-badge.on .rec-dot, .main-nav a.recording .nav-rec { animation: none; } }

/* =====================================================================
   Pagina de producto
   ===================================================================== */
body.is-landing { background-attachment: scroll; }
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.lp-nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px max(20px, calc((100vw - 1200px) / 2));
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.lp-links { display: flex; gap: 4px; margin-left: auto; }
.lp-links a { padding: 8px 12px; color: var(--muted); text-decoration: none; font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; border-radius: 6px; }
.lp-links a:hover { color: var(--text); background: var(--surface-2); }
.lp-login { text-decoration: none; white-space: nowrap; }
@media (max-width: 860px) { .lp-links { display: none; } .lp-login { margin-left: auto; } }
@media (max-width: 480px) { .lp-nav .brand-sub { display: none; } }

.landing main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 72px 0 56px; }
@media (max-width: 960px) { .lp-hero { grid-template-columns: minmax(0, 1fr); padding: 40px 0; gap: 32px; } }
.lp-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-bright) 40%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  color: var(--accent); font: 600 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.lp-hero h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; margin: 0 0 18px; }
.lp-hl { background: linear-gradient(90deg, var(--accent), var(--accent-bright)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-lead { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 580px; margin: 0 0 26px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-big { padding: 13px 24px; font-size: 15px; text-decoration: none; display: inline-block; }
.lp-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 28px 0 0; color: var(--muted); font: 500 12px/1 var(--mono); }
.lp-badges li::before { content: "✓ "; color: var(--accent-bright); font-weight: 700; }

.lp-window { border-radius: 14px; overflow: hidden; background: #071012; border: 1px solid #1b3439; color: #cdeff3;
  box-shadow: 0 30px 80px rgb(4 20 24 / .35), 0 0 0 1px rgb(63 169 181 / .12), 0 0 90px var(--glow); }
.lp-window-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #0c1a1d; border-bottom: 1px solid #1b3439; }
.lp-window-bar span { width: 10px; height: 10px; border-radius: 50%; background: #29464c; }
.lp-window-bar span:first-child { background: #ff5f57; } .lp-window-bar span:nth-child(2) { background: #febc2e; } .lp-window-bar span:nth-child(3) { background: #28c840; }
.lp-window-bar em { margin-left: 10px; font: 500 12px/1 var(--mono); font-style: normal; color: rgb(205 239 243 / .6); }
.lp-scope-wrap { position: relative; }
.lp-scope-wrap canvas { display: block; width: 100%; height: 170px; }
.lp-rec { position: absolute; top: 10px; left: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; border: 1.5px solid #ff5b5b;
  border-radius: 4px; color: #ff5b5b; font: 800 11px/1 var(--mono); letter-spacing: .18em; text-shadow: 0 0 8px rgb(255 60 60 / .7); }
.lp-rec .rec-dot { width: 9px; height: 9px; background: #ff2a2a; box-shadow: 0 0 8px #ff2a2a; animation: recblink 1s steps(1) infinite; }
.lp-tc { position: absolute; right: 12px; bottom: 10px; font: 700 20px/1 var(--mono); color: #e8fbfd; text-shadow: 0 0 10px rgb(79 193 205 / .55); font-variant-numeric: tabular-nums; }
.lp-lines { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #12272b; }
.lp-line { margin: 0; display: grid; grid-template-columns: 54px 64px 1fr; gap: 8px; font-size: 13px; line-height: 1.45; color: #cfe4e7;
  opacity: 0; animation: lpin .6s ease-out forwards; }
.lp-line b { font-weight: 700; } .lp-line span { font: 500 11.5px/1.7 var(--mono); color: rgb(205 239 243 / .45); }
.lp-line.s1 b { color: #5ce1ee; } .lp-line.s2 b { color: #ff9a6a; } .lp-line.s3 b { color: #b8a8ff; }
.lp-line.s1 { animation-delay: .3s; } .lp-line.s2 { animation-delay: 1.1s; } .lp-line.s3 { animation-delay: 1.9s; }
.lp-acta { margin: 8px 16px 16px; padding: 10px 12px; border-radius: 8px; background: #0c1a1d; border: 1px dashed #1f3d42; display: flex; flex-direction: column; gap: 4px;
  font: 500 12px/1.5 var(--mono); color: #a9c9cd; opacity: 0; animation: lpin .6s 2.7s ease-out forwards; }
.lp-acta b { color: #5ce1ee; }
@keyframes lpin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lp-section { padding: 64px 0; border-top: 1px solid var(--border); }
.lp-eyebrow { margin: 0 0 8px; font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-bright); }
.lp-section h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.02em; font-weight: 750; margin: 0 0 28px; }
.lp-sub { color: var(--muted); margin: -16px 0 28px; font-size: 16px; }
.lp-note { color: var(--muted); font-size: 14px; margin: 22px 0 0; }
.lp-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .lp-features { grid-template-columns: minmax(0, 1fr); } }
.lp-features article { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 22px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.lp-features article:hover { border-color: color-mix(in srgb, var(--accent-bright) 55%, var(--border)); box-shadow: 0 0 0 3px var(--glow); transform: translateY(-2px); }
.lp-features h3 { font-size: 16px; margin: 12px 0 6px; }
.lp-features p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lp-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; font: 700 16px/1 var(--mono);
  color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-bright) 35%, transparent); }
.lp-features article:first-child .lp-ico { color: #ff3b3b; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
@media (max-width: 900px) { .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lp-steps li { counter-increment: s; padding: 16px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.lp-steps li::before { content: "0" counter(s); font: 700 12px/1 var(--mono); color: var(--accent-bright); margin-bottom: 6px; }
.lp-steps span { color: var(--muted); font-size: 13px; }
.lp-privacy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 860px) { .lp-privacy { grid-template-columns: minmax(0, 1fr); } }
.lp-privacy p { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }
.lp-privacy h2 { margin-bottom: 16px; }
.lp-checks { list-style: none; margin: 0; padding: 22px 24px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.lp-checks li { display: flex; gap: 10px; font-size: 15px; }
.lp-checks li::before { content: "✓"; color: #041416; background: var(--accent-bright); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font: 800 12px/1 var(--font); flex: none; margin-top: 1px; }

.lp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
@media (max-width: 960px) { .lp-plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; } }
.lp-plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lp-plan h3 { font: 800 15px/1 var(--mono); text-transform: uppercase; letter-spacing: .16em; margin: 0 0 10px; color: var(--accent); }
.lp-plan-for { color: var(--muted); font-size: 14px; margin: 0 0 16px; min-height: 42px; }
.lp-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px dashed var(--border); }
.lp-plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.lp-plan li { padding-left: 22px; position: relative; line-height: 1.45; }
.lp-plan li::before { content: "›"; position: absolute; left: 4px; top: -1px; color: var(--accent-bright); font: 800 16px/1.3 var(--mono); }
.lp-plan small { color: var(--muted); }
.lp-featured { border-color: var(--accent-bright); box-shadow: 0 0 0 1px var(--accent-bright), 0 18px 50px var(--glow); }
@media (min-width: 961px) { .lp-featured { transform: translateY(-8px); } }
.lp-tag { position: absolute; top: -11px; right: 20px; padding: 5px 10px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  color: #fff; font: 700 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.lp-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .lp-faq { grid-template-columns: minmax(0, 1fr); } }
.lp-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
.lp-faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; font: 700 18px/1 var(--mono); color: var(--accent-bright); transition: transform .2s; }
.lp-faq details[open] summary::after { transform: rotate(45deg); }
.lp-faq p { margin: 10px 0 2px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.lp-final { text-align: center; padding: 72px 0 80px; border-top: 1px solid var(--border); }
.lp-final h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 22px; letter-spacing: -.02em; }
.lp-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px max(20px, calc((100vw - 1200px) / 2));
  border-top: 1px solid var(--border); color: var(--muted); font: 500 12px/1.4 var(--mono); background: var(--surface); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease-out, transform .6s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .lp-line, .lp-acta { animation: none; opacity: 1; }
  .lp-rec .rec-dot { animation: none; }
}
.auth-back { position: relative; z-index: 1; align-self: center; color: var(--muted); text-decoration: none; font: 600 12px/1 var(--mono); letter-spacing: .06em; }
.auth-back:hover { color: var(--accent); }

/* La tarjeta de opciones solo se ve dentro de su hueco (Grabar / Subir) */
body > #opts-form { display: none; }
.lp-privacy .lp-eyebrow { font-size: 12px; color: var(--accent-bright); }
.lp-section { scroll-margin-top: 64px; }
