:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --text: #1d1f1c;
  --muted: #6b6d66;
  --line: #e2ded3;
  --accent: #1d6b52;
  --accent-soft: #dcefe7;
  --accent-text: #ffffff;
  --warm: #b4492f;
  --irr: #c62828;
  --irr-soft: #fde7e5;
  --orth: #b86200;
  --orth-soft: #fff0dc;
  --ok: #1f8a4c;
  --ok-soft: #e1f4e8;
  --bad: #c62828;
  --bad-soft: #fde7e5;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121412; --surface: #1b1e1b; --surface-2: #252925; --text: #ecebe6; --muted: #9a9c95;
    --line: #2f332f; --accent: #49b38c; --accent-soft: #1d3a30; --accent-text: #0d1a14; --warm: #e07a5f;
    --irr: #ff6b61; --irr-soft: #3a1f1d; --orth: #f0a040; --orth-soft: #3a2a14;
    --ok: #4fc47d; --ok-soft: #173323; --bad: #ff6b61; --bad-soft: #3a1f1d;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121412; --surface: #1b1e1b; --surface-2: #252925; --text: #ecebe6; --muted: #9a9c95;
  --line: #2f332f; --accent: #49b38c; --accent-soft: #1d3a30; --accent-text: #0d1a14; --warm: #e07a5f;
  --irr: #ff6b61; --irr-soft: #3a1f1d; --orth: #f0a040; --orth-soft: #3a2a14;
  --ok: #4fc47d; --ok-soft: #173323; --bad: #ff6b61; --bad-soft: #3a1f1d;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topActions { display: flex; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--warm); }

main { max-width: 760px; margin: 0 auto; padding: 16px; outline: none; }

/* Barra inferior */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabbar a.active { color: var(--accent); }

/* Elementos comunes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h2, .section-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.section-title { margin: 22px 2px 10px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.center { text-align: center; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600;
  text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 14px;
  cursor: pointer; font-weight: 500; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip .n { opacity: .7; margin-left: 4px; font-size: 12px; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge.irr { background: var(--irr-soft); color: var(--irr); }
.badge.isc { background: var(--accent-soft); color: var(--accent); }
.badge.refl { background: var(--orth-soft); color: var(--orth); }

.search {
  width: 100%; padding: 12px 14px 12px 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; outline: none;
}
.search:focus { border-color: var(--accent); }
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 19px; height: 19px; }

select, .input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-size: 16px; outline: none;
}
.input:focus, select:focus { border-color: var(--accent); }

/* Lista de verbos */
.vlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.vrow:last-child { border-bottom: 0; }
.vrow:hover { background: var(--surface-2); }
.vrow .inf { font-weight: 650; font-size: 17px; }
.vrow .tr { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.freq { display: inline-flex; gap: 2px; }
.freq i { width: 5px; height: 12px; border-radius: 2px; background: var(--line); }
.freq i.on { background: var(--accent); }
.rank { font-size: 12px; color: var(--muted); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.form-hit { display: block; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); text-decoration: none; margin-bottom: 8px; }
.form-hit b { color: var(--accent); }

/* Detalle del verbo */
.vhead { display: flex; gap: 14px; align-items: flex-start; }
.vhead h2 { font-size: 30px; margin: 0; letter-spacing: -.02em; font-weight: 750; }
.vhead .trs { margin-top: 4px; }
.trs-all { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 14px; margin-top: 10px; }
.trs-all dt { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; padding-top: 2px; }
.trs-all dd { margin: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .l-irr::before { background: var(--irr); }
.legend .l-orth::before { background: var(--orth); }
.mood-tabs { position: sticky; top: 59px; z-index: 5; background: var(--bg); padding: 8px 0; margin: 4px 0 8px; overflow-x: auto; scrollbar-width: none; }
.mood-tabs .chips { flex-wrap: nowrap; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 8px; box-shadow: var(--shadow); }
.tcard header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tcard h3 { margin: 0; font-size: 15px; flex: 1; }
.tcard h3 small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.frow { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: baseline; padding: 5px 4px; border-radius: 8px; cursor: pointer; }
.frow:hover { background: var(--surface-2); }
.frow .p { color: var(--muted); font-size: 14px; }
.frow .f { font-size: 16.5px; font-weight: 500; }
.frow.na { cursor: default; opacity: .45; }
.frow.na:hover { background: none; }
.irr { color: var(--irr); font-weight: 700; }
.orth { color: var(--orth); font-weight: 700; }
.f .aux { color: var(--muted); font-weight: 450; }
.note-aux { font-size: 12px; color: var(--muted); padding: 2px 4px 4px; }
.speaking { background: var(--accent-soft) !important; }
.nominal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }

/* ===== Niveles: dos ejes con lenguaje visual distinto =====
 * Frecuencia de uso → neutro (gris/tinta) + icono de señal.
 * Nivel MCER       → código grande con color propio por nivel. */
:root { --cA1: #2e7d32; --cA2: #5a8f29; --cB1: #1565c0; --cB2: #4f3cc9; --cC1: #b0275f; --cC2: #7b5a48; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --cA1: #5cbf63; --cA2: #93c25a; --cB1: #5d9bf0; --cB2: #9a8cf5; --cC1: #ee6fa0; --cC2: #c49a83; }
}
:root[data-theme="dark"] { --cA1: #5cbf63; --cA2: #93c25a; --cB1: #5d9bf0; --cB2: #9a8cf5; --cC1: #ee6fa0; --cC2: #c49a83; }
.cA1 { --c: var(--cA1); } .cA2 { --c: var(--cA2); } .cB1 { --c: var(--cB1); }
.cB2 { --c: var(--cB2); } .cC1 { --c: var(--cC1); } .cC2 { --c: var(--cC2); }

.sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.sig i { width: 3px; border-radius: 1px; background: currentColor; opacity: .22; }
.sig i.on { opacity: .9; }
.freqmark { color: var(--muted); display: inline-flex; }

.lvlpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 10px; margin-bottom: 14px; box-shadow: var(--shadow); }
.lvl-group + .lvl-group { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lvl-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; color: var(--text); }
.lvl-head svg { width: 16px; height: 16px; color: var(--muted); }
.lvl-head .sig { color: var(--muted); }
.lvl-head .q { margin-left: auto; color: var(--muted); font-size: 12px; font-style: italic; white-space: nowrap; }
.cefr-legend { margin-top: 8px; font-size: 12.5px; display: grid; gap: 3px; }
.cefr-legend div { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px; align-items: baseline; }
.cefr-legend b { color: var(--c); }
@media (max-width: 520px) {
  .copt span { display: none; }
  .copt { padding: 8px 2px 6px; }
  .lvl-head .q { display: none; }
}
.freq-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.fopt { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 550; cursor: pointer; }
.fopt small { font-size: 11px; color: var(--muted); font-weight: 500; }
.fopt:hover { border-color: var(--muted); }
.fopt.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.fopt.on small { color: var(--bg); opacity: .7; }
.cefr-opts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.copt { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--c); }
.copt b { font-size: 18px; line-height: 1.05; letter-spacing: -.02em; }
.copt span { font-size: 10.5px; line-height: 1.15; color: var(--muted); text-align: center; }
.copt small { font-size: 10px; color: var(--muted); opacity: .8; }
.copt:hover { border-color: var(--c); }
.copt.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 35%, transparent); }
.copt.on span, .copt.on small { color: rgba(255, 255, 255, .92); }
.lvl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lvl-foot b { color: var(--text); }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 650; font-size: 13px; cursor: pointer; padding: 2px 0; white-space: nowrap; }

/* Etiquetas en lista y ficha */
.ctag { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 4px; border-radius: 6px; font-size: 11.5px; font-weight: 800;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.levelinfo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; }
.cbadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.cbadge b { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 999px; background: var(--c); color: #fff; font-size: 11.5px; }
.fbadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.fbadge .sig { color: var(--muted); }
.lvlinfo { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 13px; }
.lvlinfo dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 2px; }
.lvlinfo dd { margin: 0; }

/* Sinónimos en la ficha del verbo */
.syn { margin-top: 12px; }
.syn-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 7px; }
.syn-chip { text-decoration: none; color: var(--text); }
.syn-chip:hover { border-color: var(--accent); }
.syn-chip.off { color: var(--muted); background: var(--surface-2); border-style: dashed; }

/* Idioma, filtros y selector de tiempos/personas */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.filterbar { position: sticky; top: 59px; z-index: 5; background: var(--bg); padding: 8px 0 10px; margin-bottom: 4px; }
.filter-btn { display: flex; align-items: center; gap: 10px; min-width: 200px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 6px 12px; cursor: pointer; }
.filter-btn svg { flex: none; color: var(--accent); }
.filter-btn span { min-width: 0; }
.filter-btn b { display: block; font-size: 14px; }
.filter-btn small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.quickmoods { margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chip.part { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.sm { padding: 4px 10px; font-size: 13px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.picker .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.mood-group { padding: 8px 0; border-top: 1px solid var(--line); }
.mood-group .chips { margin-top: 8px; padding-left: 28px; }
.mood-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; font-weight: 700; font-size: 15px; cursor: pointer; padding: 2px 0; }
.mood-btn span { font-weight: 500; color: var(--muted); font-size: 13px; }
.mood-btn i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: inline-grid; place-items: center; font-style: normal; font-size: 13px; color: var(--accent-text); }
.mood-btn.on i { background: var(--accent); border-color: var(--accent); }
.mood-btn.on i::after { content: '✓'; }
.mood-btn.part i { border-color: var(--accent); }
.mood-btn.part i::after { content: '–'; color: var(--accent); font-weight: 800; }
.inset { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.summary { margin-top: 8px; font-size: 13.5px; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.frow.two { align-items: start; }
.frow.two > div { display: flex; flex-direction: column; }
.es-f { font-size: 14px; color: var(--muted); margin-top: 1px; cursor: pointer; }
.es-f i { font-style: normal; opacity: .7; margin-right: 2px; }
.es-f:hover { color: var(--accent); }
.q-es { font-size: 28px; font-weight: 750; margin: 6px 0 2px; cursor: pointer; }
.q-es-sub { margin-top: 8px; color: var(--muted); cursor: pointer; }

/* Práctica */
.hero { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring div { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 750; font-size: 17px; line-height: 1.05; text-align: center; }
.ring small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kpi b { display: block; font-size: 22px; letter-spacing: -.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mode { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.mode b { display: block; font-size: 15px; }
.mode span { font-size: 12.5px; color: var(--muted); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.field { margin-bottom: 16px; }
.field > label, .field > .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick .btn { min-height: 56px; flex-direction: column; gap: 0; line-height: 1.2; }
.quick .btn small { font-weight: 500; font-size: 12px; opacity: .8; }

.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.qcard { text-align: center; padding: 22px 18px; }
.q-verb { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.q-tr { color: var(--muted); margin-top: 2px; }
.q-tense { display: inline-block; margin-top: 12px; background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 99px; font-weight: 650; font-size: 14px; }
.q-person { font-size: 22px; margin-top: 14px; font-weight: 650; }
.q-form { font-size: 32px; font-weight: 750; margin: 6px 0; }
.opts { display: grid; gap: 10px; margin-top: 4px; }
.opt { padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 18px; font-weight: 550; cursor: pointer; text-align: center; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.opt:disabled { cursor: default; }
.answer-input { width: 100%; padding: 14px; font-size: 20px; text-align: center; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); outline: none; }
.answer-input:focus { border-color: var(--accent); }
.answer-input.right { border-color: var(--ok); background: var(--ok-soft); }
.answer-input.wrong { border-color: var(--bad); background: var(--bad-soft); }
.accents { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.accents button { width: 42px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-size: 18px; cursor: pointer; }
.feedback { border-radius: 12px; padding: 12px 14px; margin-top: 12px; text-align: left; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.ko { background: var(--bad-soft); color: var(--text); }
.feedback.ko .t { color: var(--bad); font-weight: 700; }
.feedback .corr { font-size: 19px; font-weight: 700; color: var(--text); }
.feedback .diff mark { background: var(--bad); color: #fff; border-radius: 3px; padding: 0 1px; }
.flash { perspective: 1000px; min-height: 200px; cursor: pointer; }
.flash .answer { font-size: 30px; font-weight: 750; color: var(--accent); margin-top: 14px; }
.table-ex .trow { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.table-ex .trow .p { text-align: right; color: var(--muted); }
.table-ex .answer-input { font-size: 17px; padding: 10px; text-align: left; }
.table-ex .fix { font-size: 13px; color: var(--bad); grid-column: 2; margin-top: -4px; }

/* Estadísticas */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.bars .b div { width: 100%; max-width: 26px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b div.zero { background: var(--line); }
.bars .b span { font-size: 10px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: 1fr 120px 42px; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track div { height: 100%; border-radius: 99px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; text-align: center; }
.boxes div { background: var(--surface-2); border-radius: 10px; padding: 8px 2px; }
.boxes b { display: block; font-size: 18px; }
.boxes span { font-size: 11px; color: var(--muted); }

/* Hoja inferior */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 18px; } }
.sheet-close { position: absolute; right: 10px; top: 10px; }
.sheet h2 { margin: 0 40px 6px 0; font-size: 20px; }
.rules-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.rules-table th, .rules-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.rules-table th { color: var(--muted); font-size: 12px; }
.tip { background: var(--orth-soft); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .lbl b { display: block; font-weight: 600; }
.setting .lbl span { font-size: 13px; color: var(--muted); }
.setting select { width: auto; min-width: 130px; }
.setting.voice { flex-wrap: wrap; }
.setting.voice .lbl { flex: 1 1 140px; }
.setting.voice .row { flex: 1 1 260px; justify-content: flex-end; min-width: 0; }
.setting.voice select { flex: 1; min-width: 0; max-width: 340px; }
.switch { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

@media (max-width: 420px) {
  .vhead h2 { font-size: 26px; }
  .hbar { grid-template-columns: 1fr 80px 38px; }
  .tgrid { grid-template-columns: 1fr; }
}
.lvl-scope { margin-top: 10px; font-size: 12px; color: var(--muted); }
.lvl-scope b { color: var(--text); font-weight: 600; }
.lvl-warn { margin-top: 8px; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: var(--orth-soft); color: var(--text); }

/* ===== Gestión de listas ===== */
.savebar, .bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.bulkbar { position: sticky; top: 118px; z-index: 4; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.bulkbar .btn:disabled { opacity: .4; }
.pick-top { position: sticky; top: 59px; z-index: 5; background: var(--bg); padding-top: 4px; }
.pick-count { font-size: 13px; color: var(--muted); padding: 0 2px 8px; }
.pick-count b { color: var(--text); }
.pickrow { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pickrow .badge.irr { font-size: 10px; padding: 1px 5px; }
.pickbox { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.pickrow.in { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pickrow.in .pickbox { background: var(--accent); border-color: var(--accent); }
.pickrow.in .pickbox::after { content: '✓'; color: var(--accent-text); font-size: 13px; font-weight: 800; }
@media (max-width: 520px) {
  .fopt { padding: 6px 9px; font-size: 12.5px; gap: 6px; }
  .freq-opts { gap: 5px; }
}
.chip.below { opacity: .5; text-decoration: line-through; text-decoration-thickness: 1px; }
.chip.below.on { opacity: 1; text-decoration: none; }

/* Sentido de las listas */
.dirbar { margin-bottom: 10px; }
.dirbar .seg { width: 100%; }
.dirbar .seg button { flex: 1; }
.it-sub { font-weight: 600; color: var(--accent); font-style: italic; }
