:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #1c2430;
  --muted: #5d6877;
  --border: #dde3ea;
  --primary: #1f4e79;
  --primary-hover: #173c5e;
  --primary-soft: #e6eef6;
  --ok: #1e8e3e;
  --ok-soft: #e4f4e8;
  --bad: #c62828;
  --bad-soft: #fbe9e9;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --info: #1565c0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; }

h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }

/* ---------- Encabezado de una línea con el menú ---------- */
.app-header { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.app-header h1 { font-size: 1.12rem; white-space: nowrap; }
.logo { width: 36px; height: 36px; flex: none; }
.logo rect { fill: var(--primary); }
.logo .f { fill: #fff; }
.logo .o { fill: none; stroke: #fff; stroke-width: 2; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tour-start { flex: none; font-size: 0.95rem; padding: 8px 12px; }

/* ---------- Ver más grande (menú «Aa») ---------- */
html[data-letra="1"] { font-size: 112.5%; }
html[data-letra="1"] body { font-size: 17px; }
html[data-letra="2"] { font-size: 125%; }
html[data-letra="2"] body { font-size: 19px; }
html[data-contraste] { --text: #0b1018; --muted: #2c3540; --border: #8a95a3; --primary: #153a5b; --primary-soft: #dbe6f1; --bg: #edf0f4; --warn: #8a4f00; }
html[data-contraste] :is(input, select, textarea) { border-color: #6b7686; }
html[data-contraste] .bubble-btn { border-color: #5b6573; color: var(--text); }
/* Clave: círculos más grandes (en el celular, una columna de 5 por fila para que quepan). */
html[data-letra="1"] .bubble-btn { width: 36px; height: 36px; }
html[data-letra="2"] .bubble-btn { width: 42px; height: 42px; }
@media (max-width: 480px) {
  html[data-letra="1"] .key-grid .bubble-btn { width: 32px; height: 32px; }
  html[data-letra="2"] .key-grid .bubble-btn { width: 40px; height: 40px; }
  html[data-letra="2"] .card .key-grid { grid-template-columns: 1fr; }
}
html[data-contraste] ::placeholder { color: #5a6472; }
details.menu > summary.view-btn { font-weight: 800; font-size: 1rem; padding: 8px 12px; }
.view-list { min-width: 280px; gap: 6px; padding: 12px; }
.vm-title { margin: 0; font-weight: 700; font-size: 0.95rem; }
.view-list :is(.vm-size, .vm-theme) { align-self: stretch; }
.view-list .vm-theme button { flex: 1; color: var(--text); }
.view-list .vm-size button { flex: 1; color: var(--text); }
.vm-size button[data-letra="1"] { font-size: 1.15em; }
.vm-size button[data-letra="2"] { font-size: 1.3em; }
.view-list > label.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; }
@media (max-width: 480px) {
  /* Con letra grande, el encabezado del celular no crece: así caben el nombre y los botones. */
  html[data-letra] .app-header h1 { font-size: 17px; }
  .app-header { gap: 8px; }
  .head-actions { gap: 6px; }
  html[data-letra] .app-header .btn { font-size: 15px; padding: 7px 10px; }
  .menu-list.view-list { position: fixed; left: 12px; right: 12px; top: 64px; min-width: 0; max-height: calc(100dvh - 160px); overflow: auto; }
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button:hover { background: var(--surface-2); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--primary); color: #fff; }
.tab-ic { line-height: 1; }
@media (max-width: 1100px) {
  .tabs { order: 3; flex-basis: 100%; }
  .tabs button { flex: 1 0 auto; }
}
.step {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
}

/* Pasos dentro de Prueba: Datos y clave · Preguntas · Imprimir hoja */
.sub-steps { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.sub-steps button { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.sub-steps button:hover { border-color: var(--primary); }
.sub-steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; flex: none; }
.sub-steps button.done { color: var(--ok); }
.sub-steps button.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.sub-steps button[aria-current] { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.sub-steps button[aria-current] i { background: var(--primary); border-color: var(--primary); color: #fff; }
.ss-line { width: 18px; height: 2px; background: var(--border); flex: none; }
.ss-opt { font-weight: 400; color: var(--muted); font-size: 0.85em; }
@media (max-width: 480px) { .hide-sm { display: none; } }

/* ---------- Inicio ---------- */
.home-hello { font-size: 1.4rem; margin: 6px 0 14px; }
.home-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 6px 0 14px; }
.home-top .home-hello { margin: 0; }
.home-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-tile { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font: inherit; color: var(--text); cursor: pointer; }
.home-tile:hover { border-color: var(--primary); }
.home-tile .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--primary-soft); flex: none; }
.home-tile b { display: block; font-size: 1.05rem; }
.home-tile small { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.home-tile.main { background: var(--primary); border-color: var(--primary); color: #fff; }
.home-tile.main .ic { background: rgba(255, 255, 255, 0.16); }
.home-tile.main small { color: rgba(255, 255, 255, 0.85); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0 14px; margin-top: 14px; align-items: start; }
.hc-head { display: flex; align-items: flex-start; gap: 10px; }
.hc-title { flex: 1; min-width: 0; }
.hc-cap { display: block; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.74rem; }
.hc-head h2 { font-size: 1.25rem; margin: 2px 0; }
.hc-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.hc-step { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 0.84rem; color: var(--muted); cursor: pointer; }
.hc-step b { color: var(--text); font-size: 0.9rem; }
.hc-step:hover { border-color: var(--primary); }
.hc-step.done { background: var(--ok-soft); border-color: #bfe3c8; }
.hc-step.done b { color: var(--ok); }
.hc-step.opt { border-style: dashed; }
.hc-step.now { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.hc-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hc-progress .sp-bar { flex: 1; margin: 0; }
.hc-actions { margin-top: 4px; }
.home-help p { margin: 6px 0 10px; }

/* ---------- Celular: menú abajo con la cámara al centro ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .toast, .native-notice { bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important; }
  .app-header { position: static; flex-wrap: nowrap; padding: 10px 0 6px; margin-bottom: 8px; }
  .app-header h1 { font-size: 1.05rem; }
  .brand-long, .tour-t { display: none; }
  .logo { width: 32px; height: 32px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    order: 0; flex-basis: auto;
    justify-content: space-around; align-items: flex-end; overflow: visible;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    border: 0; border-top: 1px solid var(--border); border-radius: 0;
    box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.08);
  }
  .tabs button { position: relative; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 0.72rem; background: transparent !important; color: var(--muted); }
  .tabs button[aria-selected="true"] { color: var(--primary); }
  .tabs .tab-ic { font-size: 1.3rem; }
  .tabs button.tab-cam .tab-ic { width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 1.5rem; border: 4px solid var(--bg); box-shadow: 0 4px 10px rgba(31, 78, 121, 0.35); }
  .tabs .badge { position: absolute; top: -26px; left: calc(50% + 12px); font-size: 0.7rem; line-height: 18px; min-width: 18px; padding: 0 5px; }
  .sub-steps { flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: none; margin-bottom: 10px; }
  .sub-steps button { font-size: 0.82rem; padding: 4px 10px 4px 4px; }
  .sub-steps i { width: 21px; height: 21px; }
  .ss-line { width: 6px; }
  .ss-opt { display: none; }
  .home-hello { font-size: 1.2rem; margin-top: 2px; }
  .home-tiles, .home-cols { grid-template-columns: 1fr; }
  .home-tile { padding: 13px 14px; }
  .home-tile .ic { width: 44px; height: 44px; font-size: 1.35rem; }
  .hc-steps { grid-template-columns: 1fr 1fr; }
  .tab-panel .next-bar { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .ss-x { display: none; }
}

.badge {
  display: inline-block;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 0.75rem;
  line-height: 20px;
}

/* ---------- Tarjetas y formularios ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card > h2, .card-head { margin-bottom: 14px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h2 { margin: 0; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: transform 0.15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 12px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 18px;
}
.span-2 { grid-column: span 2; }
@media (max-width: 520px) { .span-2 { grid-column: auto; } }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.92rem; }
label small, .small { font-weight: 400; font-size: 0.82rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
textarea { resize: vertical; }
#keyText { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.08em; }
.inline-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.range { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
label.range input { flex: 1; }
label.range output { min-width: 3.2em; font-variant-numeric: tabular-nums; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  flex-direction: row;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.secondary:hover { background: #d6e3f0; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }
.btn.big { padding: 16px 22px; font-size: 1.05rem; flex: 1; min-width: 200px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.card-head .actions { margin-top: 0; }
.actions.end { justify-content: flex-end; }

.alert { padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); margin: 12px 0 0; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert .layout-fix { margin: 6px 0 0 4px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Pestaña Prueba: lo básico arriba, el resto plegado ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.num-step { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); max-width: 220px; }
.num-step input[type="number"] { border: 0; border-radius: 0; text-align: center; font-weight: 700; font-size: 1.05rem; min-width: 0; -moz-appearance: textfield; }
.num-step input::-webkit-outer-spin-button, .num-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-btn { flex: none; width: 42px; border: 0; background: var(--surface-2); color: var(--primary); font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.num-btn:hover { background: var(--primary-soft); }
.seg { display: inline-flex; flex-wrap: nowrap; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); align-self: flex-start; max-width: 100%; }
.seg button { border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.seg button:first-child { border-left: 0; }
.seg button[aria-checked="true"] { background: var(--primary); color: #fff; }
.mf-keys { display: grid; gap: 10px; margin-top: 12px; }
.mf-keys:empty { display: none; }
#formsOrderNote { margin: 12px 0 0; }
@media (max-width: 480px) {
  #formsCountSeg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  #formsCountSeg button:nth-child(3) { border-left: 0; }
  #formsCountSeg button:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
.forms-hint { margin: 12px 0 0; }
.seg button:not([aria-checked="true"]):hover { background: var(--primary-soft); color: var(--primary); }
.pz-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 480px) { .pz-head-actions { flex-wrap: nowrap; } }
details.menu { position: relative; }
details.menu > summary { list-style: none; font-size: 1.1rem; line-height: 1; padding: 6px 12px; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16); padding: 6px; display: flex; flex-direction: column; }
.menu-list > button, .menu-list > label { display: block; text-align: left; border: 0; background: none; font: inherit; font-weight: 500; font-size: 0.92rem; color: var(--text); padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.menu-list > button:hover, .menu-list > label:hover { background: var(--surface-2); }
.menu-list > button:disabled { opacity: 0.5; cursor: not-allowed; }
.menu-list > .danger { color: var(--bad); }
.menu-list > hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.card-head .key-photo { margin-left: auto; }
.card-head #keyStatus { margin-left: auto; }
.card-head #keyStatus + .key-photo { margin-left: 0; }
.pz-opts { padding-top: 12px; padding-bottom: 6px; }
.pz-opts-title { font-size: 1rem; margin-bottom: 4px !important; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pz-opts-title .muted { font-weight: 400; }
details.opt { border-top: 1px solid var(--border); }
details.opt:first-of-type { border-top: 0; }
details.opt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 2px; }
details.opt > summary::-webkit-details-marker { display: none; }
details.opt > summary::after { content: "›"; color: var(--muted); font-weight: 700; font-size: 1.2rem; line-height: 1; transition: transform 0.15s; }
details.opt[open] > summary::after { transform: rotate(90deg); }
details.opt > summary h2 { font-size: 0.98rem; margin: 0; }
.opt-ic { width: 28px; flex: none; text-align: center; font-size: 1.1rem; }
.opt-t { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.opt-t b { font-size: 0.98rem; }
.opt-v { color: var(--muted); font-size: 0.86rem; text-align: right; }
.opt-body { padding: 2px 4px 16px 38px; }
.next-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.08); padding: 10px 14px; margin-bottom: 16px; }
.next-status { margin-right: auto; font-weight: 600; font-size: 0.92rem; }
.next-status.ok { color: var(--ok); }
.next-status.warn { color: var(--warn); }
@media (max-width: 640px) {
  .opt-t { flex-direction: column; }
  .opt-v { text-align: left; }
  .opt-body { padding-left: 4px; }
  .next-bar { padding: 8px 10px; }
  .next-bar .btn.ghost { display: none; }
  .next-bar .btn.primary { flex: 1; }
  .next-status { flex-basis: 100%; font-size: 0.85rem; }
  .card-head .key-photo { margin-left: 0; }
}
@media (max-width: 480px) {
  /* Clave: dos bloques de 5 por fila en el celular. */
  .card .key-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px 8px; }
  .key-grid .bubble-btn { width: 28px; height: 28px; }
  .key-grid .key-row .qn { width: 1.7em; margin-right: 2px; }
  .next-status { font-size: 0.82rem; }
}

/* ---------- Clave ---------- */
.key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-top: 14px;
  max-height: 470px;
  overflow-y: auto;
  padding: 4px 2px;
}
.key-block { display: flex; flex-direction: column; gap: 4px; }
.key-row { display: flex; align-items: center; gap: 4px; }
.key-row .qn { width: 2.4em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
.key-row.unset .qn { color: var(--warn); }
.bubble-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid #9aa5b1;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.bubble-btn:hover { border-color: var(--primary); color: var(--primary); }
.bubble-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Hoja ---------- */
.tips { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.tips li { margin: 3px 0; }
.sheet-preview {
  background: #e9edf2;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: center;
}
.sheet-preview svg {
  width: 100%;
  max-width: 680px;
  height: auto;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

/* ---------- Evaluación: editor a la izquierda, vista previa al lado ---------- */
.ev-toggle { display: none; }
.ev-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.ev-editor, .ev-preview { min-width: 0; }
@media (min-width: 1000px) {
  .ev-split { grid-template-columns: minmax(380px, 0.85fr) minmax(0, 1fr); }
  .ev-preview { position: sticky; top: calc(var(--head-h, 60px) + 4px); max-height: calc(100vh - var(--head-h, 60px) - 16px); display: flex; flex-direction: column; }
  .ev-preview .doc-preview-wrap { flex: 1; min-height: 0; overflow: auto; }
}
.ev-editor { padding-top: 6px; }
.ev-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 -18px 12px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.ev-tabs button { flex: none; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 12px 9px; cursor: pointer; white-space: nowrap; }
.ev-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.ev-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.ev-sum { font-size: 0.86rem; color: var(--ok); font-weight: 600; }
.ev-sum:empty::before { content: "Aún no hay preguntas: pégalas abajo."; color: var(--muted); font-weight: 400; }
.ev-warn { border: 0; font: inherit; font-weight: 700; font-size: 0.84rem; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); cursor: pointer; }
.ev-pane > .form-grid + .checks, .ev-pane > .checks { margin-top: 12px; }
.ev-pane > label { margin-top: 12px; }
.ev-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.ev-preset { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 0.82rem; color: var(--muted); cursor: pointer; text-align: center; }
.ev-preset b { color: var(--text); font-size: 0.92rem; }
.ev-preset:hover { border-color: var(--primary); }
.ev-preset[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); background: #fbfdff; }
.ev-preset .mini { width: 100%; height: 56px; background: var(--surface-2); border-radius: 6px; padding: 7px; display: grid; gap: 4px; align-content: start; margin-bottom: 4px; }
.ev-preset .mini i { display: block; height: 4px; border-radius: 2px; background: #c9d2dc; }
.ev-preset .mini i.s { width: 65%; }
.ev-preset .mini.two { grid-template-columns: 1fr 1fr; }
.ev-preset .mini.big i { height: 7px; }
.ev-quick { display: grid; gap: 10px; margin-bottom: 8px; }
.ev-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ev-q .seg button { padding: 7px 11px; }
.ev-more { border-top: 1px solid var(--border); margin-top: 6px; }
.ev-preview .card, .ev-preview { min-width: 0; }
.ev-pbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ev-pbar .spacer { flex: 1; }
.ev-preview .doc-preview { max-width: none; }
.ev-note { margin: 6px 2px 0; }
.ev-fab { display: none; }
.pi-title { font-size: 1rem; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
@media (max-width: 999px) {
  .ev-toggle { display: flex; width: 100%; margin-bottom: 10px; }
  .ev-toggle button { flex: 1; padding: 9px 10px; }
  .ev-split[data-mode="editar"] .ev-preview { display: none; }
  .ev-split[data-mode="ver"] .ev-editor { display: none; }
  .ev-split[data-mode="ver"] ~ .ev-fab { display: inline-flex; position: fixed; right: 14px; bottom: 24px; z-index: 15; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
  .ev-pbar #docPrint { display: none; }
  .ev-preview .doc-preview-wrap { padding: 8px; }
}
@media (max-width: 760px) {
  .ev-split[data-mode="ver"] ~ .ev-fab { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .ev-tabs { margin-left: -14px; margin-right: -14px; }
  .ev-presets .ev-preset small { font-size: 0.74rem; }
}

/* ---------- Corregir: escanear a la izquierda, resultados a la derecha ---------- */
.corr-grid { display: grid; grid-template-columns: 1fr; gap: 0 18px; align-items: start; }
@media (min-width: 980px) {
  .corr-grid { grid-template-columns: 330px minmax(0, 1fr); }
  .corr-side { position: sticky; top: calc(var(--head-h, 60px) + 4px); max-height: calc(100vh - var(--head-h, 60px) - 16px); overflow-y: auto; scrollbar-width: thin; border-radius: var(--radius); }
}
.scan-card h2 { margin-bottom: 2px; }
.corr-test { margin: 0 0 12px; }
.scan-card .scan-buttons { flex-direction: column; gap: 8px; }
.scan-card .btn.big { min-width: 0; width: 100%; flex: none; }
.scan-progress { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.sp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sp-bar { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 6px 0 8px; }
.sp-bar > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.sp-missing { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.sp-missing span, .sp-missing button { font: inherit; font-size: 0.78rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.sp-missing button { cursor: pointer; color: var(--primary); font-weight: 600; }
.scan-card .scan-queue { max-height: 260px; overflow-y: auto; }
.scan-more { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.scan-more .tips-box { margin: 4px 0 0; }
.corr-section { font-size: 1.05rem; margin: 22px 2px 10px; }
.results-head h2 { margin-right: auto; }
.results-head input[type="search"] { width: 170px; padding: 7px 10px; }
.review-filter { border: 0; font: inherit; font-weight: 700; font-size: 0.84rem; padding: 5px 11px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); cursor: pointer; }
.review-filter[aria-pressed="true"] { background: var(--warn); color: #fff; }
.results-table tbody tr.review { background: #fffaf0; }
.results-table tbody tr.review:hover { background: #fff3dc; }
.results-table tbody tr.just { animation: just-row 2.2s ease-out; }
@keyframes just-row { from { background: #d7f0dd; } to { background: transparent; } }
.results-table .who-name { font-weight: 600; white-space: normal; }
.results-table .who-sub { display: none; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.grade-chip { display: inline-block; min-width: 2.6em; text-align: center; padding: 2px 8px; border-radius: 7px; font-weight: 700; }
.grade-chip.grade-pass { background: var(--ok-soft); }
.grade-chip.grade-fail { background: var(--bad-soft); }
.strip { display: inline-flex; gap: 1px; width: 150px; height: 14px; vertical-align: middle; }
.strip i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: #c9d2dc; }
.strip i.correct { background: #4caf6a; }
.strip i.wrong, .strip i.multiple { background: #e05757; }
.strip i.excluded { background: transparent; border: 1px dashed #c9d2dc; }
.strip-n { display: block; font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.results-hint { margin: 10px 0 0; }
.stat.stat-low b { color: var(--bad); font-size: 1.15rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.el-dialog.result-dialog { width: min(1080px, calc(100vw - 24px)); }
.result-dialog[open] { display: flex; flex-direction: column; }
.rd-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.rd-bar .spacer { flex: 1; }
.rd-body { overflow-y: auto; padding: 12px; background: var(--bg); }
.rd-body .card.detail { margin-bottom: 12px; }
.rd-body .answers-list { max-height: none; overflow: visible; }
@media (max-width: 640px) {
  .el-dialog.result-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .rd-body { padding: 8px; flex: 1; }
  .results-head input[type="search"] { width: 100%; order: 5; }
  .results-table .c-resp, .results-table .c-logro, .results-table .c-dev, .results-table .c-score { display: none; }
  .results-table .who-sub { display: block; }
}

/* ---------- Escaneo ---------- */
.scan-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.tips-box { margin: 12px 0; }
.tips-box summary { cursor: pointer; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.threshold-row { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.threshold-row .range { flex: 1; min-width: 240px; }
.scan-queue { list-style: none; margin: 12px 0 0; padding: 0; }
.scan-queue li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  margin-top: 6px;
  font-size: 0.92rem;
}
.scan-queue li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-queue li.ok { background: var(--ok-soft); }
.scan-queue li.error { background: var(--bad-soft); color: var(--bad); flex-wrap: wrap; }
.scan-queue li button { flex: none; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.drop-hint {
  position: fixed;
  inset: 12px;
  z-index: 50;
  display: grid;
  place-items: center;
  border: 3px dashed var(--primary);
  border-radius: 16px;
  background: rgba(230, 238, 246, 0.92);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 700;
  pointer-events: none;
}

/* ---------- Detalle de un resultado ---------- */
.detail-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.detail-head .who { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; min-width: 260px; }
.detail-head .who label { flex: 1; min-width: 120px; }
.detail-head .who label.code { flex: 0 0 130px; min-width: 0; }
.score-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 82px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pill b { font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pill span { font-size: 0.75rem; color: var(--muted); }
.pill.ok b { color: var(--ok); }
.pill.bad b { color: var(--bad); }
.pill.grade { background: var(--primary); border-color: var(--primary); }
.pill.grade b, .pill.grade span { color: #fff; }
.pill.grade.fail { background: var(--bad); border-color: var(--bad); }

.detail-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .detail-body { grid-template-columns: 1fr; } }
.sheet-view { position: relative; }
.sheet-view canvas { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.answers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 10px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
}
.ans {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.ans .qn { width: 2.2em; text-align: right; font-weight: 700; }
.ans select { width: auto; padding: 2px 4px; font-size: 0.85rem; }
.ans .k { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ans.correct { background: var(--ok-soft); }
.ans.wrong, .ans.multiple { background: var(--bad-soft); }
.ans.blank { background: var(--warn-soft); }
.ans.uncertain { outline: 2px dashed #e0a800; outline-offset: -2px; }
.ans .icon { width: 1.1em; text-align: center; }

/* ---------- Resultados ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table tbody tr { cursor: pointer; }
.results-table tbody tr:hover { background: var(--surface-2); }
.results-table tbody tr.selected { background: var(--primary-soft); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; margin-left: 6px; vertical-align: 1px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.grade-fail { color: var(--bad); font-weight: 700; }
.grade-pass { color: var(--ok); font-weight: 700; }
.bar { position: relative; height: 10px; width: 120px; background: var(--border); border-radius: 5px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 5px; }
.bar.low > i { background: var(--bad); }
.bar.mid > i { background: #e0a800; }
.dist span { display: inline-block; min-width: 3.2em; }
.dist .is-key { font-weight: 700; color: var(--ok); }
.empty { text-align: center; padding: 40px 18px; }
.empty p { color: var(--muted); margin-top: 0; }

.export-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--primary-soft);
}
.export-box > div:first-child { flex: 1 1 320px; }
.export-box p { margin: 2px 0 0; }
.export-box .actions { margin-top: 0; }
.export-box #exportProgress { flex-basis: 100%; margin: 0; }

/* ---------- Objetivos de aprendizaje ---------- */
.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit input { max-width: 110px; }
.oa-summary { margin-top: 10px; }
.oa-table { width: auto; min-width: 320px; margin-bottom: 6px; }
.warn-list { margin: 8px 0 0; padding-left: 20px; color: var(--warn); font-size: 0.88rem; }
.warn-list li.bad { color: var(--bad); }
.oa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.oa-chip { padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; background: var(--surface-2); border: 1px solid var(--border); }
.oa-chip em { font-style: normal; font-weight: 700; margin-left: 2px; }
.lvl-L { background: #dcefdc !important; }
.lvl-ML { background: #fff1c2 !important; }
.lvl-NL { background: #f9d6d6 !important; }
.sub-h { font-size: 0.95rem; margin: 18px 0 8px; }
.oa-matrix td.num { text-align: center; }

/* ---------- Evaluación ---------- */
fieldset.checks { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.checks legend { font-weight: 600; font-size: 0.92rem; padding: 0 4px; }
.sheet-options fieldset.checks { margin: 0; align-self: end; }
.logo-row { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.logo-row img { max-height: 40px; max-width: 120px; object-fit: contain; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.doc-preview-wrap { background: #e9edf2; border-radius: 8px; padding: 16px; overflow-x: auto; }
.doc-preview { background: #fff; margin: 0 auto; padding: 15mm; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15); min-height: 120mm; max-width: 100%; box-sizing: border-box; }
.doc-empty { text-align: center; padding-top: 40mm; }
.sheet-preview.landscape svg { max-width: 900px; }
#tab-evaluacion .tips-box { margin: 8px 0 12px; }

/* ---------- Elementos de las preguntas ---------- */
.doc-preview .td-q { position: relative; }
.doc-preview .td-q:hover { outline: 1px dashed #b8c4d2; outline-offset: 2mm; }
.td-tools {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-bottom: 1mm;
  opacity: 0.55;
}
.doc-preview .td-q:hover .td-tools, .td-tools:focus-within { opacity: 1; }
.td-tools select {
  width: auto; padding: 2px 6px; border-radius: 999px; border: 1px solid #b8c4d2;
  background: #fff; color: var(--text); font: 500 12px/1.4 system-ui, sans-serif; cursor: pointer;
}
.td-add {
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--primary);
  background: #fff; color: var(--primary); font: 600 12px/1.4 system-ui, sans-serif; cursor: pointer;
}

.doc-preview [data-el] { cursor: pointer; border-radius: 4px; }
.doc-preview [data-el]:hover { outline: 2px solid var(--primary); outline-offset: 1mm; }
#docOrphans ul { margin: 6px 0 0; padding-left: 18px; }
#docOrphans li { margin: 4px 0; }
#docOrphans select { width: auto; padding: 3px 6px; }

.el-dialog { width: min(1040px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: none; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.el-dialog::backdrop { background: rgba(16, 24, 40, 0.45); }
.el-form { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.el-head, .el-foot { display: flex; align-items: center; gap: 8px; padding: 14px 18px; }
.el-head { justify-content: space-between; border-bottom: 1px solid var(--border); }
.el-foot { border-top: 1px solid var(--border); }
.el-foot .spacer { flex: 1; }
.el-types { display: flex; gap: 6px; padding: 12px 18px 0; flex-wrap: wrap; }
.el-types button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.el-types button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.el-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 14px 18px; overflow: auto; }
@media (max-width: 760px) { .el-body { grid-template-columns: 1fr; } }
.el-fields label { margin-bottom: 10px; }
.form-grid.tight { gap: 8px 12px; }
.el-common { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.el-drop { border: 2px dashed #b8c4d2; border-radius: 10px; padding: 18px; text-align: center; background: var(--surface-2); }
.el-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.el-preview-col { background: #e9edf2; border-radius: 10px; padding: 10px 14px; }
.el-preview { background: #fff; padding: 12px; min-height: 120px; font-family: Arial, sans-serif; font-size: 11pt; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 10px;
  background: #1c2430;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.app-footer { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 24px; }
.app-footer p { margin: 6px 0; }
.app-footer .legal { font-size: 0.76rem; }
.app-footer a { color: var(--primary); }
.native-app .donate-wrap { display: none !important; }

/* ---------- Impresión ---------- */
.print-area { display: none; }
@media print {
  /* Sin el relleno de la barra de abajo del celular ni otros márgenes: si no, sobra una página en blanco. */
  html, body { margin: 0 !important; padding: 0 !important; height: auto !important; min-height: 0 !important; background: #fff; }
  .app, .toast, .native-notice { display: none !important; }
  .print-area { display: block; }
  .print-area svg { display: block; }
  .print-doc .td-q { break-inside: avoid; }
  .print-form + .print-form, .print-page + .print-page { break-before: page; }
  .print-page { break-inside: avoid; overflow: hidden; }
  .print-page:not(.print-reparto) { display: flex; align-items: flex-start; justify-content: center; }
  .print-page:not(.print-reparto) svg { overflow: hidden; max-width: 100%; max-height: 100%; width: auto; height: auto; }
  .el-dialog { display: none !important; }
}

@media (max-width: 480px) {
  .btn.big { min-width: 0; }
}

/* Filas (versiones) de la evaluación */
.forms-opts { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.forms-opts .btn { align-self: flex-start; }
label.inline-select { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
label.inline-select select { width: auto; }
.form-keys { margin-top: 12px; overflow-x: auto; }
.form-keys table { border-collapse: collapse; font-size: 0.85rem; }
.form-keys th, .form-keys td { border: 1px solid var(--border); padding: 2px 6px; text-align: center; }
.form-keys th { background: var(--bg); }
.form-keys td.fk-label { font-weight: 600; text-align: left; white-space: nowrap; }
.tag.form { background: #e8eaf6; color: #283593; }
.tag.group { background: #e0f2f1; color: #00695c; }
.group-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.group-filter button { border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.group-filter button small { color: var(--muted); font-weight: 500; }
.group-filter button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.group-filter button[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.85); }
.sheet-preview .sheet-page + .sheet-page { margin-top: 16px; }
label.form-pick select { width: auto; min-width: 4.5em; }

/* ---------- Manual ---------- */
.man-help { margin: -6px 0 10px; text-align: right; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--primary); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
#tab-manual .card { line-height: 1.6; }
#tab-manual p { max-width: 72ch; }
.man-intro > p { margin: 0 0 12px; }
.man-search { max-width: 420px; }
.man-index { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.man-index button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.man-index button:hover { border-color: var(--primary); color: var(--primary); }
.man-index b, .man-num {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px;
  border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.78rem;
}
.man-section { scroll-margin-top: 70px; }
.man-section h2 { display: flex; align-items: flex-start; gap: 10px; }
.man-section h2 .man-num { flex: none; margin-top: -2px; }
.man-section h2 .man-num { min-width: 30px; height: 30px; font-size: 0.9rem; }
.man-section h2 small { color: var(--muted); font-weight: 500; font-size: 0.85rem; white-space: nowrap; }
.man-section h3 { margin: 20px 0 6px; font-size: 1.02rem; }
.man-video { margin: 4px 0 16px; max-width: 760px; }
.man-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.man-embed iframe, .man-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.man-video-soon {
  display: grid; place-items: center; min-height: 64px; padding: 12px;
  border: 2px dashed var(--border); border-radius: 10px; color: var(--muted); font-weight: 600; text-align: center;
}
.man-steps { counter-reset: man; list-style: none; margin: 8px 0 14px; padding: 0; max-width: 78ch; }
.man-steps > li { counter-increment: man; position: relative; padding: 4px 0 8px 40px; }
.man-steps > li::before {
  content: counter(man); position: absolute; left: 0; top: 4px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 0.85rem;
}
.man-steps ul { margin: 4px 0 0; padding-left: 20px; }
.man-list { margin: 6px 0 14px; padding-left: 22px; max-width: 78ch; }
.man-list li { margin: 4px 0; }
.man-flow { list-style: none; counter-reset: flow; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0 16px; padding: 0; }
.man-flow li { counter-increment: flow; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.man-flow b { display: block; color: var(--primary); }
.man-flow b::before { content: counter(flow) ". "; }
.man-flow span { display: block; font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.man-tip, .man-warn { padding: 10px 14px; border-radius: 8px; margin: 12px 0; max-width: 78ch; }
.man-tip { background: var(--primary-soft); }
.man-warn { background: var(--warn-soft); color: #6b4000; }
.man-table-wrap { overflow-x: auto; margin: 8px 0 12px; }
.man-table { border-collapse: collapse; width: 100%; max-width: 900px; font-size: 0.92rem; }
.man-table th, .man-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.man-table th { background: var(--surface-2); }
.man-table td:first-child { white-space: nowrap; }
.man-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.man-dot.ok { background: var(--ok); }
.man-dot.bad { background: var(--bad); }
.man-faq details { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.man-faq summary { cursor: pointer; font-weight: 600; }
.man-faq details p { margin: 8px 0 2px; }
.man-section > .btn { margin-top: 6px; }
@media (max-width: 480px) {
  .man-table td:first-child { white-space: normal; }
  .man-steps > li { padding-left: 34px; }
}
@media print {
  .print-manual { font-size: 11pt; line-height: 1.45; color: #000; }
  .print-manual .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 8mm; }
  .print-manual .man-section ~ .man-section { break-before: page; }
  .print-manual .man-flow li, .print-manual .man-tip, .print-manual .man-warn, .print-manual .man-faq details, .print-manual .man-steps > li { break-inside: avoid; }
}
@media (max-width: 480px) {
  .man-index { gap: 6px; }
  .man-index button { padding: 5px 10px; font-size: 0.85rem; }
}

.man-example { margin: 6px 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; white-space: pre-wrap; overflow-x: auto; }

/* ---------- Fórmulas (opcional) ---------- */
.more-tools { margin-top: 8px; }
.more-tools summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.more-tools[open] summary { margin-bottom: 6px; }
.more-tools p { margin: 4px 0 0 26px; }
.math-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; }
.math-dialog { width: min(760px, calc(100vw - 24px)); overflow: auto; }
.math-dialog > p, .math-dialog > .math-quick, .math-dialog > .math-field-host, .math-dialog > .actions { margin-left: 18px; margin-right: 18px; }
.math-dialog > .actions { margin-bottom: 16px; }
.math-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; margin-bottom: 10px; }
.math-quick button { min-width: 42px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font: inherit; font-size: 1rem; cursor: pointer; }
.math-quick button:hover { border-color: var(--primary); color: var(--primary); }
.math-field-host { min-height: 64px; }
.math-field-host math-field { display: block; width: 100%; font-size: 1.6rem; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.math-field-host math-field:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.math-keyboard-host { position: relative; }

/* ---------- App Android ---------- */
.native-notice {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #1c2430; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); font-size: 0.92rem;
}
.native-notice[hidden] { display: none; }
.native-notice span { flex: 1; word-break: break-word; }
.native-notice button { border: 0; border-radius: 8px; padding: 8px 12px; background: #fff; color: var(--primary); font: inherit; font-weight: 700; }
.native-notice button.close { background: transparent; color: #fff; padding: 8px; }
.native-app body { padding-top: env(safe-area-inset-top, 0px); }

/* ---------- Transcribir una hoja dañada ---------- */
.tr-dialog { width: min(720px, calc(100vw - 24px)); }
.tr-dialog[open] { display: flex; flex-direction: column; }
.tr-body { padding: 12px 18px; overflow: auto; }
.tr-body > label { margin-top: 10px; }
.tr-grid { max-height: 44vh; overflow: auto; margin-top: 6px; }
.tr-grid .key-row.multi .qn { color: var(--bad); }
.tr-photo input { padding: 6px 0; border: 0; }
@media (max-width: 480px) {
  .tr-dialog .el-foot { flex-wrap: wrap; }
  .tr-dialog .el-foot .spacer { display: none; }
  .tr-dialog .el-foot .btn { flex: 1 1 40%; }
  .tr-dialog .el-foot #trAdd { flex-basis: 100%; order: -1; }
  .tr-grid { max-height: none; overflow: visible; }
}

/* Casillas de desarrollo (versión Pro) en el detalle y en la transcripción */
.answers-list .dev-head { grid-column: 1 / -1; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); font-weight: 700; font-size: 0.88rem; color: var(--primary); }
.ans.dev .qn { width: auto; min-width: 2.2em; }
.tr-dev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.tr-dev label.inline-select select { min-width: 4.2em; }

/* ---------- Tutorial guiado (js/tutorial.js) ---------- */
.tour-shade { position: fixed; inset: 0; z-index: 1000; background: transparent; }
.tour-shade.dark { background: rgba(15, 23, 42, 0.62); }
.tour-spot {
  position: fixed; z-index: 1001; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 4px #f6b93b, 0 0 0 200vmax rgba(15, 23, 42, 0.62);
  transition: left 0.2s, top 0.2s, width 0.2s, height 0.2s;
}
.tour-bubble {
  position: fixed; z-index: 1002; max-height: calc(100vh - 24px); overflow: auto;
  background: #fff; color: #1c2430; border-radius: 16px; padding: 18px 20px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); font-size: 1.15rem; line-height: 1.5;
}
.tour-bubble[data-arrow="up"]::before, .tour-bubble[data-arrow="down"]::before {
  content: ''; position: absolute; left: calc(var(--arrow-x, 50%) - 10px); width: 0; height: 0;
  border: 10px solid transparent;
}
.tour-bubble[data-arrow="up"]::before { top: -20px; border-bottom-color: #fff; }
.tour-bubble[data-arrow="down"]::before { bottom: -20px; border-top-color: #fff; }
.tour-count { margin: 0 32px 4px 0; font-size: 0.95rem; font-weight: 700; color: #1f4e79; }
.tour-title { margin: 0 32px 6px 0; font-size: 1.35rem; line-height: 1.25; color: #0e2a45; }
.tour-text p { margin: 0 0 8px; }
.tour-close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #eef2f7; color: #1c2430; font-size: 1.3rem; cursor: pointer;
}
.tour-close:hover, .tour-close:focus-visible { background: #dde5ef; }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-actions .btn { min-height: 52px; font-size: 1.1rem; padding: 10px 18px; }
.tour-actions .tour-next { margin-left: auto; }
.tour-menu { display: grid; gap: 8px; margin-top: 12px; }
.tour-menu .btn { min-height: 50px; font-size: 1.05rem; justify-content: flex-start; text-align: left; white-space: normal; }
.tour-menu .btn.primary { justify-content: center; text-align: center; }
.tour-menu small { font-weight: 400; opacity: 0.85; }
.tour-or { margin: 6px 0 0; font-size: 0.95rem; color: #5d6877; }
.tour-bubble .btn:focus-visible { outline: 3px solid #f6b93b; outline-offset: 2px; }
@media (max-width: 520px) {
  .tour-start { padding: 7px 11px; font-size: 0.95rem; }
  .tour-bubble { font-size: 1.1rem; padding: 16px 16px 14px; }
}
@media print { .tour-shade, .tour-spot, .tour-bubble, .tour-start { display: none !important; } }

/* ---------- Aviso grande después de cada foto ---------- */
.el-dialog.scan-notice { width: min(520px, calc(100vw - 24px)); overflow: auto; }
.scan-notice .sn-card { padding: 26px 22px 18px; text-align: center; display: grid; gap: 6px; justify-items: center; color: #fff; background: #17733a; }
.scan-notice.review .sn-card { background: #9a5b00; }
.scan-notice.error .sn-card { background: #b3261e; }
.sn-icon { font-size: 3.4rem; line-height: 1; }
.scan-notice h2 { margin: 4px 0 0; font-size: 1.9rem; line-height: 1.15; overflow-wrap: anywhere; }
.sn-sub { margin: 0; font-size: 1.1rem; }
.sn-grade { margin: 6px 0 0; font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.sn-msg { margin: 6px 0 0; font-size: 1.1rem; font-weight: 600; background: rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 8px 12px; }
.sn-list, .sn-tips { margin: 6px 0 0; padding: 0; list-style: none; font-size: 1.05rem; display: grid; gap: 4px; text-align: left; }
.sn-tips li::before { content: '• '; }
.sn-progress { margin: 10px 0 0; font-size: 1.05rem; background: rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 8px 12px; width: 100%; }
.sn-actions { padding: 16px 18px 18px; display: grid; gap: 10px; background: var(--surface); }
.sn-actions .btn.big { width: 100%; font-size: 1.2rem; padding: 16px; }
.sn-more { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sn-more .btn { flex: 1 1 auto; font-size: 1rem; }
@media (max-width: 560px) {
  .el-dialog.scan-notice { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .scan-notice[open] { display: flex; flex-direction: column; }
  .scan-notice .sn-card { flex: 1; align-content: center; }
  .sn-actions { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* ---------- Asistente paso a paso ---------- */
.el-dialog.wiz { width: min(640px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); }
.wiz[open] { display: flex; flex-direction: column; }
.wiz-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wiz-top b { font-size: 1.05rem; }
.wiz-dots { display: flex; gap: 6px; margin-left: auto; }
.wiz-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); display: block; }
.wiz-dots i.on { background: var(--primary); }
.wiz-body { flex: 1; overflow: auto; padding: 22px 20px; display: grid; align-content: start; gap: 16px; font-size: 1.1rem; }
.wiz-step { color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.wiz-q { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: 0; }
.wiz-help { color: var(--muted); font-size: 1.05rem; margin: 0; }
.wiz-input { width: 100%; font: inherit; font-size: 1.3rem; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); }
.wiz-input:focus { outline: none; border-color: var(--primary); }
.wiz-input.small { font-size: 1.1rem; padding: 12px 14px; margin-top: 6px; }
.wiz-input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.wiz-label { display: block; font-weight: 700; font-size: 1rem; }
.wiz-label small { color: var(--muted); font-weight: 500; }
.wiz-always { font-size: 0.95rem; color: var(--muted); }
.wiz-num { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; }
.wiz-num button { font-size: 2.2rem; font-weight: 700; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--primary); height: 76px; cursor: pointer; }
.wiz-num input { min-width: 0; text-align: center; font: inherit; font-size: 2.4rem; font-weight: 800; border: 2px solid var(--primary); border-radius: 16px; background: var(--surface); color: var(--text); }
.wiz-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.wiz-chips button { font: inherit; font-size: 1.1rem; font-weight: 700; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.wiz-chips button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.wiz-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wiz-choices button { display: grid; gap: 2px; justify-items: center; padding: 14px 8px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.wiz-choices button b { font-size: 2rem; line-height: 1.1; }
.wiz-choices button span { font-size: 1rem; color: var(--muted); letter-spacing: 0.1em; }
.wiz-choices button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: #fff; }
.wiz-choices button[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.85); }
.wiz-letters { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 10px; }
.wiz-letters button { height: 96px; font-size: 2.4rem; font-weight: 800; border-radius: 18px; border: 3px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.wiz-letters button:hover { border-color: var(--primary); }
.wiz-letters button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.wiz-prog { display: flex; gap: 5px; flex-wrap: wrap; max-height: 150px; overflow: auto; }
.wiz-prog button { min-width: 34px; height: 34px; padding: 0 4px; border-radius: 8px; font: inherit; font-size: 0.85rem; font-weight: 700; background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; }
.wiz-prog button.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.wiz-prog button.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.wiz-status { margin: 0; font-weight: 600; color: var(--muted); }
.wiz-status.ok { color: var(--ok); }
.wiz-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.wiz-links .link-btn, .wiz-body > .link-btn { font-size: 1rem; justify-self: start; }
.wiz-warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 1rem; }
.wiz-sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wiz-sum li { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.wiz-sum li span { color: var(--muted); font-size: 0.9rem; }
.wiz-sum li b { font-size: 1.15rem; }
.wiz-sum li.warn { border-color: var(--warn); background: var(--warn-soft); }
.wiz-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.wiz-foot .btn { min-height: 60px; font-size: 1.15rem; font-weight: 800; }
.wiz-foot #wizBack[hidden] + .btn { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .el-dialog.wiz { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .wiz-body { padding: 18px 16px; }
  .wiz-q { font-size: 1.5rem; }
  .wiz-letters button { height: 84px; font-size: 2.1rem; }
  .wiz-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------- Invitación a donar (Inicio) ---------- */
.home-donate { background: var(--ok-soft); border-color: #b9dfc6; }
.home-donate h2 { margin-top: 0; }
.home-donate p { margin: 0 0 10px; }
.el-dialog.donate-dialog { width: min(460px, calc(100vw - 24px)); padding: 22px; }
.donate-dialog h2 { margin-top: 0; }
.dn-data { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.dn-data dt { color: var(--muted); }
.dn-data dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Modo noche (menú «Aa») ----------
   Lo que representa papel (hojas, evaluación, informes) sigue blanco. */
html[data-tema="oscuro"] {
  --bg: #0f141a;
  --surface: #18202a;
  --surface-2: #1f2934;
  --text: #e4e9ef;
  --muted: #a3afbd;
  --border: #2f3b48;
  --primary: #4a8bd0;
  --primary-hover: #3b78b8;
  --primary-soft: #1c3045;
  --ok: #4cc06a;
  --ok-soft: #16301f;
  --bad: #f2716a;
  --bad-soft: #3a1c1c;
  --warn: #f0b44c;
  --warn-soft: #36280f;
  --info: #79b8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
  --pro-soft: #33280f;
  --edited: #d08be6;
  --limit-bg: #4a3a12;
  --fail-bg: #4a1f1f;
  color-scheme: dark;
}
html[data-tema="oscuro"][data-contraste] { --text: #ffffff; --muted: #c7d0da; --border: #55626f; }
html[data-tema="oscuro"] :is(input, select, textarea) { background: var(--surface-2); color: var(--text); border-color: var(--border); }
html[data-tema="oscuro"] ::placeholder { color: #7d8a99; }
html[data-tema="oscuro"] .btn.secondary:hover { background: #24405c; }
html[data-tema="oscuro"] .bubble-btn { border-color: #6b7888; }
html[data-tema="oscuro"] :is(.sheet-preview, .doc-preview-wrap, .el-preview-col) { background: #0b1016; }
html[data-tema="oscuro"] .ev-preset[aria-checked="true"] { background: var(--primary-soft); }
html[data-tema="oscuro"] .ev-preset .mini i, html[data-tema="oscuro"] .strip i { background: #3a4654; }
html[data-tema="oscuro"] .strip i.correct { background: #4caf6a; }
html[data-tema="oscuro"] .strip i.wrong, html[data-tema="oscuro"] .strip i.multiple { background: #e05757; }
html[data-tema="oscuro"] .strip i.excluded { background: transparent; border-color: #3a4654; }
html[data-tema="oscuro"] .results-table tbody tr.review { background: #2a2312; }
html[data-tema="oscuro"] .results-table tbody tr.review:hover { background: #352c14; }
html[data-tema="oscuro"] .hc-step.done { border-color: #2c6b3f; }
html[data-tema="oscuro"] .lvl-L { background: #173a1f !important; }
html[data-tema="oscuro"] .lvl-ML { background: #3d3311 !important; }
html[data-tema="oscuro"] .lvl-NL { background: #3f1d1d !important; }
html[data-tema="oscuro"] .tag.form { background: #232b4d; color: #b8c2ff; }
html[data-tema="oscuro"] .tag.group { background: #123631; color: #8ee0d3; }
html[data-tema="oscuro"] .man-warn { color: #f5cf8a; }
html[data-tema="oscuro"] .home-donate { border-color: #2c6b3f; }
/* Colores de estado más claros: el texto encima va oscuro para que se lea. */
html[data-tema="oscuro"] :is(.sub-steps button.done i, .review-filter[aria-pressed="true"], .badge, .pill.grade.fail) { color: #0b1018; }
/* Burbujas del tutorial: el mismo contraste que el resto. */
html[data-tema="oscuro"] .tour-bubble { background: var(--surface); color: var(--text); }
html[data-tema="oscuro"] .tour-count { color: var(--primary); }
html[data-tema="oscuro"] .tour-title { color: var(--text); }
html[data-tema="oscuro"] .tour-close { background: var(--surface-2); color: var(--text); }
html[data-tema="oscuro"] .tour-or { color: var(--muted); }
html[data-tema="oscuro"] .tour-bubble[data-arrow="up"]::before { border-bottom-color: var(--surface); }
html[data-tema="oscuro"] .tour-bubble[data-arrow="down"]::before { border-top-color: var(--surface); }

/* ---------- Aviso «ahora es CorrigeYa» (versión normal) ---------- */
.el-dialog.move-dialog { width: min(480px, calc(100vw - 24px)); padding: 24px; }
.move-dialog h2 { margin-top: 0; }
.move-dialog .actions { display: grid; gap: 8px; }
