/* ==========================================================================
   Pre-Beit Din — sistema visual
   Tekhelet (azul de los tzitzit) sobre lino, tipografía Cardo + IBM Plex.
   ========================================================================== */
:root {
  /* Color */
  --linen: #f7f6f2;
  --linen-deep: #eeece5;
  --paper: #ffffff;
  --ink: #10131c;
  --ink-soft: #3c4356;
  --muted: #6a7183;
  --rule: #e2e0d8;
  --rule-strong: #cbc8bd;
  --tekhelet: #2b3a8f;
  --tekhelet-deep: #1b2560;
  --tekhelet-soft: #e8eaf7;
  --gold: #b08a2e;
  --ok: #1e7a52;   --ok-soft: #e3f3ea;
  --warn: #a2661b; --warn-soft: #fbf0df;
  --bad: #a62b24;  --bad-soft: #fae9e7;
  --review: #5b3fa8; --review-soft: #eeeafb;

  /* Tipografía */
  --display: "Cardo", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Forma y profundidad */
  --r-sm: 6px; --r: 12px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 19, 28, .05);
  --shadow: 0 2px 4px rgba(16, 19, 28, .04), 0 12px 32px -12px rgba(16, 19, 28, .18);
  --shadow-lg: 0 4px 8px rgba(16, 19, 28, .05), 0 30px 60px -24px rgba(27, 37, 96, .35);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15.5px; line-height: 1.6; color: var(--ink);
  background: var(--linen); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--tekhelet); text-decoration-color: color-mix(in srgb, var(--tekhelet) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem); }
h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6rem 0; }
[x-cloak] { display: none !important; }
:focus-visible { outline: 2px solid var(--tekhelet); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--tekhelet); color: #fff; }

/* Ojal: etiqueta superior en versalitas — estructura, no decoración */
.eyebrow, .card-title {
  font-family: var(--sans); font-size: .7rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem;
}

/* ---------------------------------------------------------------- Cabecera */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 0 22px; height: 60px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-family: var(--display); font-size: 1.16rem; white-space: nowrap; text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, var(--tekhelet) 0%, var(--tekhelet-deep) 100%);
  color: #fff; font-size: .82rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand b { font-weight: 700; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: rgba(255,255,255,.72); padding: 7px 13px; border-radius: 7px; font-size: .9rem; white-space: nowrap; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 0 -2px 0 var(--gold); }
.userbox { display: flex; align-items: center; gap: 12px; font-size: .86rem; color: rgba(255,255,255,.78); white-space: nowrap; }
.userbox button { background: none; border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 7px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; transition: background .15s var(--ease); }
.userbox button:hover { background: rgba(255,255,255,.12); }

.container { max-width: 1320px; margin: 0 auto; padding: 30px 22px 70px; }
.container.narrow { max-width: 900px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 5px; font-size: .95rem; }

/* ------------------------------------------------------------- Superficies */
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 24px; position: relative;
}
.card + .card { margin-top: 18px; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols-3, .grid.cols-4, .grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 660px) { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-6, .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
.stat { padding: 18px 20px; }
.stat .n { font-family: var(--display); font-size: 2.1rem; font-weight: 700; line-height: 1; }
.stat .l { color: var(--muted); font-size: .84rem; margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }

/* --------------------------------------------------------------- Controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: 9px; border: 1px solid var(--rule-strong); background: var(--paper);
  color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important;
  transition: transform .12s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
  white-space: nowrap; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(170deg, var(--tekhelet) 0%, var(--tekhelet-deep) 100%);
  border-color: var(--tekhelet-deep); color: #fff; box-shadow: 0 1px 2px rgba(27,37,96,.3), 0 8px 20px -10px rgba(27,37,96,.7);
}
.btn.primary:hover { box-shadow: 0 2px 4px rgba(27,37,96,.3), 0 14px 26px -12px rgba(27,37,96,.8); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--rule)); }
.btn.lg { padding: 14px 28px; font-size: 1.04rem; border-radius: 11px; }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 7px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--linen-deep); color: var(--ink-soft); white-space: nowrap;
  border: 1px solid transparent;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 20%, transparent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.badge.review { background: var(--review-soft); color: var(--review); border-color: color-mix(in srgb, var(--review) 20%, transparent); }
.badge.info { background: var(--tekhelet-soft); color: var(--tekhelet); border-color: color-mix(in srgb, var(--tekhelet) 18%, transparent); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.alert { padding: 14px 16px 14px 18px; border-radius: var(--r-sm); border: 1px solid; border-left-width: 4px; margin-bottom: 16px; font-size: .95rem; }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left-color: var(--ok); color: #14563a; }
.alert.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); border-left-color: var(--bad); color: #7d201a; }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); border-left-color: var(--warn); color: #7a4d14; }
.alert.review { background: var(--review-soft); border-color: color-mix(in srgb, var(--review) 30%, transparent); border-left-color: var(--review); color: #432e7d; }
.alert.info { background: var(--tekhelet-soft); border-color: color-mix(in srgb, var(--tekhelet) 25%, transparent); border-left-color: var(--tekhelet); color: var(--tekhelet-deep); }

table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th {
  text-align: left; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--rule-strong);
}
.table td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover td { background: var(--linen); }
.table-wrap { overflow-x: auto; }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--rule-strong); border-radius: 9px; font: inherit;
  background: var(--paper); color: var(--ink); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--tekhelet); box-shadow: 0 0 0 3px var(--tekhelet-soft);
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--tekhelet); flex: none; }
.error-text { color: var(--bad); font-size: .85rem; margin-top: 5px; }
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); font-size: .88rem; text-decoration: none; }

/* ------------------------------------------------------------------ Acceso */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(43,58,143,.14), transparent 70%),
    linear-gradient(var(--linen), var(--linen-deep));
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 560px; }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .92rem; color: var(--muted); }
.userbox a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.4); }
.userbox a:hover { color: #fff; }
.auth-card .card { padding: 30px; box-shadow: var(--shadow-lg); }
.brand-big { text-align: center; margin-bottom: 26px; }
.brand-big .mark {
  width: 62px; height: 62px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--ink), #232a3d); color: var(--gold);
  font-family: var(--display); font-size: 1.7rem; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-big h1 { margin: 0; font-size: 1.9rem; }
.brand-big .tagline { color: var(--muted); margin: 6px 0 0; font-size: .92rem; letter-spacing: .02em; }

/* ======================================================= Sala de examen === */
body.exam { background: linear-gradient(180deg, #eef0f6 0%, var(--linen-deep) 100%); }
.exam-shell { min-height: 100vh; display: flex; flex-direction: column; }
.exam-top {
  background: var(--ink); color: #fff; padding: 11px 22px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap;
}
.exam-top .title { font-family: var(--display); font-size: 1.06rem; }
.exam-logo { height: 30px; width: auto; max-width: 120px; object-fit: contain; }

/* Logo subido: reemplaza la marca de texto manteniendo el tamaño */
.mark.has-logo { background: none !important; box-shadow: none !important; padding: 0; }
.mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .mark.has-logo { width: 38px; height: 38px; }
.brand-big .mark.has-logo { width: 88px; height: 88px; }
.logo-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.logo-stage { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--linen); margin-bottom: 12px; font-family: var(--display); font-size: 1.16rem; }
.logo-stage.dark { background: var(--ink); color: #fff; border-color: var(--ink); justify-content: flex-start; }
.logo-stage .mark { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(160deg, var(--tekhelet) 0%, var(--tekhelet-deep) 100%); color: #fff; font-size: .82rem; }
.logo-stage .mark.big { width: 88px; height: 88px; border-radius: 16px; font-size: 1.6rem; }
@media (max-width: 660px) { .logo-preview { grid-template-columns: 1fr; } }
.exam-top .pill {
  background: rgba(255,255,255,.09); padding: 5px 13px; border-radius: 999px; font-size: .85rem;
  display: inline-flex; gap: 7px; align-items: center; border: 1px solid rgba(255,255,255,.08);
}
.exam-top .pill.alarm { background: color-mix(in srgb, var(--bad) 75%, transparent); border-color: transparent; }
.exam-top .timer { font-family: var(--mono); font-weight: 600; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.exam-top .timer.low { color: #ffb9b2; }
.exam-body { flex: 1; display: flex; justify-content: center; padding: 32px 18px 70px; }
.exam-body > .inner { width: 100%; max-width: 940px; }

/* Secuencia del test técnico: el orden es información, no adorno */
.stepper { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; counter-reset: paso; }
.stepper .s {
  flex: 1 1 110px; font-size: .78rem; color: var(--muted); padding-top: 10px;
  border-top: 3px solid var(--rule-strong); transition: color .2s var(--ease), border-color .2s var(--ease);
  display: flex; align-items: baseline; gap: 7px; counter-increment: paso;
}
.stepper .s::before {
  content: counter(paso, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; opacity: .75;
}
.stepper .s.done { border-color: var(--ok); color: var(--ok); }
.stepper .s.done::before { content: "✓"; }
.stepper .s.current { border-color: var(--tekhelet); color: var(--ink); font-weight: 600; }

.wizard-card {
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--rule);
  padding: 34px 36px; position: relative; overflow: hidden;
}
/* Doble raya (talit) que marca las tarjetas del rito de verificación */
.wizard-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--tekhelet), var(--tekhelet-deep));
  box-shadow: 3px 0 0 var(--paper), 8px 0 0 color-mix(in srgb, var(--tekhelet) 35%, transparent);
}
.wizard-card h1 { font-size: 1.72rem; margin-bottom: .3em; }
.wizard-card .lede { color: var(--ink-soft); font-size: 1.02rem; max-width: 62ch; }
.wizard-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; align-items: start; margin-top: 22px; }
@media (max-width: 820px) { .wizard-grid { grid-template-columns: 1fr; } .wizard-card { padding: 24px 20px 24px 26px; } }

.preview-box {
  position: relative; background: #0c0f16; border-radius: var(--r); overflow: hidden; aspect-ratio: 4/3;
  display: grid; place-items: center; color: #79839a; font-size: .9rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.preview-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-box .rec {
  position: absolute; top: 12px; left: 12px; background: var(--bad); color: #fff; padding: 4px 11px;
  border-radius: 999px; font-size: .76rem; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: 6px;
}

.checklist { list-style: none; padding: 0; margin: 0 0 20px; }
.checklist li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .93rem; }
.checklist li:last-child { border-bottom: 0; }
.checklist .ic {
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 700;
  flex: none; background: var(--linen-deep); color: #939aac; transition: background .2s var(--ease), color .2s var(--ease);
}
.checklist .ic.ok { background: var(--ok); color: #fff; }
.checklist .ic.bad { background: var(--bad); color: #fff; }
.checklist .val { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.detected { font-size: 1.1rem; font-weight: 700; color: var(--ok); display: flex; align-items: center; gap: 9px; font-family: var(--display); }

.meter { height: 12px; background: var(--linen-deep); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(16,19,28,.08); }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f9e6b, #7bc96f 55%, #dcae3c 82%, #c85347); transition: width .07s linear; }
.say {
  font-family: var(--display); font-size: 1.35rem; line-height: 1.4; background: var(--tekhelet-soft);
  border-left: 4px solid var(--tekhelet); padding: 16px 20px; border-radius: var(--r-sm); margin: 14px 0 20px; color: var(--tekhelet-deep);
}

/* Consentimiento */
.consent-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.consent-list li { display: flex; gap: 14px; align-items: flex-start; padding: 15px 17px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--linen); }
.consent-list .ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 1.1rem;
  background: var(--paper); border: 1px solid var(--rule-strong); box-shadow: var(--shadow-sm);
}
.consent-list strong { display: block; font-size: .96rem; }
.consent-list span { color: var(--muted); font-size: .88rem; }
/* Bienvenida e introducción: pasos numerados */
.journey { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 0; counter-reset: j; }
.journey li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; position: relative; counter-increment: j; }
.journey li:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 52px; bottom: -8px; width: 2px; background: var(--rule);
}
.journey .ic {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 1.1rem;
  background: var(--tekhelet-soft); border: 1px solid color-mix(in srgb, var(--tekhelet) 25%, transparent); position: relative;
}
.journey .ic::after {
  content: counter(j); position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--tekhelet); color: #fff; font: 700 .68rem/18px var(--sans); text-align: center;
}
.journey strong { display: block; font-size: .98rem; }
.journey li > span > span { color: var(--muted); font-size: .9rem; }
.journey.how li > span > span { color: var(--ink-soft); }
.intro-h { font-size: 1.2rem; margin: 26px 0 0; }
.tips { background: var(--linen); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 18px; margin: 0 0 22px; }
.tips ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: .92rem; }
.tips li { margin: 3px 0; }
kbd {
  font-family: var(--mono); font-size: .82em; padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--rule-strong); border-bottom-width: 2px; background: var(--paper);
}

/* Pasos guiados dentro de una verificación (el actual resaltado, con su botón) */
.task-steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.task-steps > li { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); padding: 14px 18px; transition: border-color .2s, box-shadow .2s; }
.task-steps > li.now { border: 2px solid var(--tekhelet); box-shadow: var(--shadow); padding: 17px 19px; }
.task-steps > li.todo { opacity: .55; }
.task-steps > li.done { background: var(--linen); }
.ts-head { display: flex; align-items: center; gap: 12px; }
.ts-head strong { font-size: 1.02rem; }
.ts-n {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 .85rem/1 var(--sans); border: 2px solid var(--rule-strong); color: var(--muted);
}
.task-steps > li.now .ts-n { border-color: var(--tekhelet); background: var(--tekhelet); color: #fff; }
.task-steps > li.done .ts-n { border-color: var(--ok); background: var(--ok); color: #fff; }
.task-steps > li.done strong { color: var(--muted); font-weight: 500; }
.ts-badge { margin-left: auto; font: 700 .7rem/1 var(--sans); letter-spacing: .08em; color: var(--tekhelet); background: var(--tekhelet-soft); padding: 5px 9px; border-radius: 999px; }
.ts-body { margin: 12px 0 2px 40px; }
.ts-body > p { margin: 0 0 10px; }
.ts-body .say { margin: 8px 0 14px; }
.ts-body audio { width: 100%; max-width: 420px; }
.meter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .88rem; }
.meter-row .meter { flex: 1; max-width: 360px; }
@media (max-width: 660px) { .ts-body { margin-left: 0; } }

/* Bienvenida hablada */
.voice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 4px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--linen); transition: border-color .2s, background .2s;
}
.voice-bar.on { border-color: color-mix(in srgb, var(--tekhelet) 35%, transparent); background: var(--tekhelet-soft); }
.voice-bar .btn { border-radius: 999px; }
.voice-note { color: var(--muted); font-size: .88rem; }
.voice-bar.on .voice-note { color: var(--tekhelet-deep); }
.voice-wave { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.voice-wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--tekhelet); animation: vw 1s ease-in-out infinite; }
.voice-wave i:nth-child(2) { animation-delay: .15s; } .voice-wave i:nth-child(3) { animation-delay: .3s; } .voice-wave i:nth-child(4) { animation-delay: .45s; }
@keyframes vw { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* Permisos del navegador: aviso previo y ayuda para desbloquear */
.perm-primer {
  display: grid; grid-template-columns: 1fr 290px; gap: 22px; align-items: center;
  background: var(--tekhelet-soft); border: 1px solid color-mix(in srgb, var(--tekhelet) 22%, transparent);
  border-radius: var(--r); padding: 18px 20px; margin: 16px 0 22px; color: var(--tekhelet-deep); font-size: .94rem;
}
.fake-prompt {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 14px 14px 12px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--rule); font-size: .8rem;
}
.fake-prompt::before {
  content: ""; position: absolute; top: -7px; left: 26px; width: 12px; height: 12px; background: var(--paper);
  border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); transform: rotate(45deg);
}
.fp-host { font-weight: 600; margin-bottom: 6px; }
.fp-what { color: var(--ink-soft); margin-bottom: 10px; }
.fp-btns { display: grid; gap: 6px; }
.fp-btn { display: block; text-align: center; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-soft); }
.fp-btn.go { background: var(--tekhelet); border-color: var(--tekhelet); color: #fff; font-weight: 600; box-shadow: 0 0 0 4px color-mix(in srgb, var(--tekhelet) 22%, transparent); }
.fp-hand { position: absolute; right: -6px; top: 58px; font-size: 1.6rem; animation: fp-tap 1.4s var(--ease) infinite; }
@keyframes fp-tap { 0%, 100% { transform: translate(0, 6px); } 50% { transform: translate(-6px, -2px); } }
.perm-denied {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-left: 4px solid var(--warn);
  border-radius: var(--r); padding: 18px 20px; margin: 16px 0 22px; color: #6b4412;
}
.perm-denied h3 { margin: 0 0 6px; font-size: 1.1rem; color: #6b4412; }
.perm-denied ol { margin: 10px 0 12px; padding-left: 22px; }
.perm-denied li { margin: 5px 0; }
.perm-denied .key { font-family: var(--mono); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 0 5px; }
@media (max-width: 820px) { .perm-primer { grid-template-columns: 1fr; } .fake-prompt { max-width: 290px; } }

.legal {
  white-space: pre-line; background: var(--linen); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px; max-height: 260px; overflow: auto; font-size: .92rem; color: var(--ink-soft);
}
.consent-accept { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border: 2px solid var(--tekhelet); border-radius: var(--r); background: var(--tekhelet-soft); margin: 20px 0; }
.consent-accept input { margin-top: 3px; }

/* Pregunta y grabación */
.question-card {
  background: var(--paper); border-radius: var(--r-lg); padding: 38px 40px; box-shadow: var(--shadow); border: 1px solid var(--rule);
}
@media (max-width: 660px) { .question-card { padding: 24px 20px; } }
.question-card .qnum { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.question-card .qtext { font-family: var(--display); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.32; margin: 12px 0 28px; }
.rec-state { display: flex; align-items: center; gap: 16px; padding: 17px 20px; border-radius: var(--r); background: var(--linen); margin-bottom: 20px; border: 1px solid var(--rule); }
.rec-state.recording { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.rec-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--bad); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 60%, transparent); animation: ring 1.6s infinite; }
@keyframes ring { 70% { box-shadow: 0 0 0 11px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.progress { height: 5px; background: var(--linen-deep); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--tekhelet), var(--tekhelet-deep)); transition: width .4s var(--ease); }

/* Sello de grabación: la firma visual del sistema */
.self-view {
  position: fixed; right: 20px; bottom: 20px; width: 196px; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 2px solid var(--paper); background: #000; z-index: 20;
}
.self-view video { width: 100%; display: block; transform: scaleX(-1); }
.self-view .seal {
  position: absolute; inset: auto auto 8px 8px; display: flex; align-items: center; gap: 7px;
  background: rgba(16,19,28,.72); backdrop-filter: blur(6px); color: #fff; padding: 4px 10px 4px 7px;
  border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.self-view .seal::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ff4d42; box-shadow: 0 0 0 0 rgba(255,77,66,.6); animation: ring 1.8s infinite; }

.overlay { position: fixed; inset: 0; background: rgba(12,15,22,.82); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 22px; }
.overlay .box { background: var(--paper); border-radius: var(--r-lg); padding: 34px; max-width: 500px; text-align: center; box-shadow: var(--shadow-lg); }
.save-status { font-weight: 600; display: flex; align-items: center; gap: 11px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--rule-strong); border-top-color: var(--tekhelet); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.net-table { width: 100%; }
.net-table td { padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.net-table tr:last-child td { border-bottom: 0; }

/* ==================================================== Revisión y evidencia */
.layer { border-left: 4px solid var(--rule-strong); }
.layer.l1 { border-left-color: var(--ok); }
.layer.l2 { border-left-color: var(--tekhelet); }
.layer.l3 { border-left-color: var(--review); }
.layer-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.quote { background: var(--linen); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 15px 17px; white-space: pre-wrap; font-size: .95rem; }
audio { width: 100%; height: 38px; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.timeline li { display: flex; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: .9rem; cursor: pointer; border-radius: 7px; transition: background .12s var(--ease); }
.timeline li:hover { background: var(--tekhelet-soft); }
.timeline li.incident { color: var(--bad); }
.timeline li.warning { color: var(--warn); }
.timeline .t { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); flex: none; width: 72px; font-size: .82rem; }
.player video { width: 100%; background: #000; border-radius: var(--r); aspect-ratio: 4/3; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.verdict-big { font-size: 1.2rem; font-weight: 700; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.live-card .ind { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .9rem; margin: 12px 0; }
.live-card .ind span.ok { color: var(--ok); } .live-card .ind span.bad { color: var(--bad); }
.live-video { background: #0c0f16; border-radius: var(--r); aspect-ratio: 4/3; width: 100%; }
details summary { cursor: pointer; }
details summary:hover { color: var(--tekhelet); }

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