:root {
  --bg:#FAF8F4; --surface:#FFFFFF; --surfaceAlt:#F2EEE6; --border:#D8D1C5; --text:#181C24; --textMuted:#4A5260;
  --primary:#163A5F; --primaryHover:#102B47; --primaryText:#FFFFFF;
  --successBg:#EAF4EE; --successText:#155733; --warningBg:#FDF3E2; --warningText:#7A4B00;
  --dangerBg:#FBEAEA; --dangerText:#8B1D1D; --focus:#0B5ED7;
  --serif:Georgia,'Times New Roman',serif; --sans:'Segoe UI',system-ui,sans-serif; --mono:'Cascadia Mono',Consolas,monospace;
  --fs:16px;
}
[data-theme="dark"] {
  --bg:#12151C; --surface:#1A1F29; --surfaceAlt:#222836; --border:#323B4D; --text:#F2F4F8; --textMuted:#B8C0CE;
  --primary:#5B9BD5; --primaryHover:#76AEE0; --primaryText:#0B111A;
  --successBg:#142D20; --successText:#7FE0AA; --warningBg:#322510; --warningText:#F7C568;
  --dangerBg:#35171A; --dangerText:#F5989D; --focus:#82B7FF;
}
[data-font="large"] { --fs:18px; }
[data-font="xlarge"] { --fs:20px; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:var(--sans); font-size:var(--fs); line-height:1.55; padding-bottom:90px; }
h1,h2,h3 { font-family:var(--serif); margin:0 0 8px; line-height:1.25; }
h2 { font-size:1.4rem; } h3 { font-size:1.1rem; }
.skip-link { position:absolute; left:-999px; top:0; background:var(--primary); color:var(--primaryText); padding:8px 12px; z-index:100; }
.skip-link:focus { left:8px; }
.topbar { display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; align-items:center; padding:12px 24px; background:var(--surface); border-bottom:1px solid var(--border); }
.brand { display:flex; gap:12px; align-items:center; }
.brand-title { font-size:1.15rem; margin:0; }
.brand-sub { margin:0; font-size:.85rem; color:var(--textMuted); }
.topbar-controls { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.container { max-width:1180px; margin:0 auto; padding:24px 20px; }
.view[hidden], .step-panel[hidden], [hidden] { display:none !important; }
.card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; }
.grid-2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr)); gap:16px; }
.grid-2-tight { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.grid-3 { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.stack { display:flex; flex-direction:column; gap:12px; }
.actions-end { display:flex; justify-content:flex-end; }
.actions-between { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.actions-row { display:flex; gap:8px; flex-wrap:wrap; }
.muted { color:var(--textMuted); } .small { font-size:.88rem; }
.sep { border:0; border-top:1px solid var(--border); margin:16px 0; }
label span { display:block; font-weight:600; font-size:.92rem; margin-bottom:4px; }
input[type=text],input[type=url],input[type=password],input[type=search],select {
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font:inherit;
}
:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
.btn { appearance:none; border:1px solid var(--border); background:var(--surface); color:var(--text); padding:10px 18px; border-radius:8px; font:inherit; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-primary { background:var(--primary); border-color:var(--primary); color:var(--primaryText); }
.btn-primary:hover:not(:disabled) { background:var(--primaryHover); }
.btn-secondary { background:var(--surfaceAlt); }
.btn-ghost { background:transparent; }
.btn-sm { padding:6px 12px; font-size:.88rem; }
.pill { display:inline-block; padding:3px 12px; border-radius:999px; font-size:.82rem; font-weight:700; border:1px solid var(--border); }
.pill-ok { background:var(--successBg); color:var(--successText); }
.pill-warn { background:var(--warningBg); color:var(--warningText); }
.pill-neutral { background:var(--surfaceAlt); color:var(--textMuted); }
.callout { border-radius:10px; padding:12px 16px; border:1px solid var(--border); background:var(--surfaceAlt); }
.callout p { margin:6px 0; }
.callout-legal { border-left:5px solid var(--primary); background:var(--surface); margin-bottom:16px; }
.callout-warn { background:var(--warningBg); color:var(--warningText); }
.callout-ok { background:var(--successBg); color:var(--successText); }
.callout-info { background:var(--surfaceAlt); }
.alert-region { margin:12px 24px; padding:12px 16px; border-radius:10px; background:var(--dangerBg); color:var(--dangerText); border:1px solid var(--dangerText); }
.alert-region.ok { background:var(--successBg); color:var(--successText); border-color:var(--successText); }
.stepper { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.step-btn { flex:1; min-width:200px; display:flex; gap:10px; align-items:center; padding:12px 16px; border:1px solid var(--border); background:var(--surface); color:var(--text); border-radius:10px; font:inherit; font-weight:600; cursor:pointer; }
.step-btn.active { border-color:var(--primary); background:var(--surfaceAlt); box-shadow:inset 0 -3px 0 var(--primary); }
.step-num { width:28px; height:28px; border-radius:50%; background:var(--primary); color:var(--primaryText); display:grid; place-items:center; }
.radio-row { display:flex; flex-direction:column; gap:8px; margin:8px 0; }
.radio-opt,.check-row { display:flex; gap:8px; align-items:flex-start; cursor:pointer; }
.dropzone { border:2px dashed var(--border); border-radius:12px; padding:20px; text-align:center; }
.dropzone.dragover { border-color:var(--primary); background:var(--surfaceAlt); }
.browser-toolbar { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; margin-top:12px; }
.thumb { border:1px solid var(--border); border-radius:10px; padding:8px; background:var(--surfaceAlt); font-size:.8rem; }
.thumb img { width:100%; height:130px; object-fit:cover; border-radius:6px; display:block; margin-bottom:6px; }
.thumb.discarded { opacity:.5; }
.list-item { border:1px solid var(--border); border-radius:10px; padding:10px 12px; display:flex; justify-content:space-between; gap:8px; align-items:center; }
.participant-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.tech-details summary { cursor:pointer; font-weight:600; }
code { font-family:var(--mono); font-size:.82rem; word-break:break-all; }
.checklist-bar { position:fixed; bottom:0; left:0; right:0; background:var(--surface); border-top:2px solid var(--border); padding:10px 24px; display:flex; gap:12px; flex-wrap:wrap; align-items:center; z-index:50; }
.checklist-pills { display:flex; gap:6px; flex-wrap:wrap; }
.transcript-box { max-height:420px; overflow:auto; border:1px solid var(--border); border-radius:10px; padding:8px; margin-top:8px; }
.tmsg { padding:6px 8px; border-bottom:1px solid var(--border); font-size:.9rem; }
.tmsg b { color:var(--primary); }
body.audiencia .btn-primary:not(#btnExitAudiencia) { display:none; }
@media (prefers-reduced-motion:no-preference) { .btn { transition:background .15s; } }


/* ===== Atajos de teclado (F9) ===== */
.zeus-kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  line-height: 1.3;
}
.zeus-kbd-light { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }

/* ===== Paso 3 en dos columnas: PDF + panel de firma ===== */
.step3-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}
.step3-pdf-pane {
  position: sticky;
  top: 12px;
  height: calc(100vh - 140px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  background: #525659;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
}
.step3-pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1e3a5f;
  color: #fff;
  font-size: 0.88rem;
}
.step3-pdf-head .btn { background: rgba(255,255,255,0.18); color: #fff; border: none; }
.step3-pdf-body { position: relative; flex: 1; }
.step3-pdf-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.step3-pdf-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: #f8fafc; color: #1e3a5f; text-align: center; padding: 20px;
}
.step3-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step3-sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--surface, #fff);
  border-top: 2px solid var(--accent, #005a9c);
  padding: 12px 14px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
@media (max-width: 1100px) {
  .step3-split { grid-template-columns: 1fr; }
  .step3-pdf-pane { position: relative; height: 70vh; }
}

/* ===== Panel de interlocutores ===== */
.interlocutor-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.interlocutor-row input, .interlocutor-row select { width: 100%; font-size: 0.82rem; padding: 6px 8px; }
@media (max-width: 900px) { .interlocutor-row { grid-template-columns: 1fr 1fr; } }
