:root {
  --bg: #f5f6f9;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --text: #151b2b;
  --muted: #5a6275;
  --line: #e2e5ec;
  --brand: #1f4e9c;
  --brand-2: #163a76;
  --brand-soft: #e8eefa;
  --accent: #9b1c31;
  --ok: #1d7a55;
  --warn-bg: #fff7e6;
  --warn-line: #f0c36d;
  --warn-text: #6b4a05;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.07);
  --radius: 14px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0d1017;
  --bg-2: #121722;
  --panel: #151b27;
  --text: #e9edf5;
  --muted: #9aa3b5;
  --line: #262e3d;
  --brand: #7ea6ec;
  --brand-2: #a9c3f3;
  --brand-soft: #1a2436;
  --accent: #f08a9b;
  --ok: #52c79a;
  --warn-bg: #2a2212;
  --warn-line: #7a5b1c;
  --warn-text: #f3d9a4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1017;
    --bg-2: #121722;
    --panel: #151b27;
    --text: #e9edf5;
    --muted: #9aa3b5;
    --line: #262e3d;
    --brand: #7ea6ec;
    --brand-2: #a9c3f3;
    --brand-soft: #1a2436;
    --accent: #f08a9b;
    --ok: #52c79a;
    --warn-bg: #2a2212;
    --warn-line: #7a5b1c;
    --warn-text: #f3d9a4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.6em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
section { padding: 56px 0; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head p { color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-family: var(--serif); font-size: 1.2rem; }
:root[data-theme='dark'] .logo-mark { color: #0d1017; }
.logo b { color: var(--brand); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 550; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--brand-soft); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem; display: grid; place-items: center; }
.menu-movil { display: none; }
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.abierto { display: flex; }
  .menu-movil { display: grid; margin-left: auto; }
}

/* Hero + generador */
.hero { padding: 44px 0 28px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.hero-text { max-width: 820px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.9rem; margin: 0; padding: 0; list-style: none; }
.trust li::before { content: '✓ '; color: var(--ok); font-weight: 800; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
.tabs { display: flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 18px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; font-size: 0.93rem; padding: 9px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected='true'] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.search-row { display: flex; gap: 10px; }
input[type='text'], input[type='search'], input:not([type]) {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; width: 100%; min-width: 0;
}
input:focus-visible, button:focus-visible, .fc:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.search-row input { font-size: 1.05rem; padding: 15px 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: 0.95rem; border-radius: 11px; padding: 11px 16px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme='dark'] .btn.primary { color: #0d1017; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.small { padding: 7px 11px; font-size: 0.86rem; border-radius: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.chips-label { font-size: 0.85rem; color: var(--muted); margin-right: 2px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 0.86rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.opciones { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 18px; align-items: flex-end; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 7px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 0.9rem; font-weight: 600; background: var(--bg-2); cursor: pointer; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.num-tarjetas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.num-tarjetas input[type='range'] { width: 170px; accent-color: var(--brand); }
.num-tarjetas input[type='number'] { width: 76px; font: inherit; font-weight: 700; text-align: center; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 6px; }
.rapidos { display: flex; gap: 6px; }
.rapidos .chip { padding: 5px 10px; }
.chip[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.ayuda-tipo { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); max-width: 70ch; }
.aviso-sinia { margin-top: 10px; padding: 10px 13px; border-radius: 11px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); font-size: 0.9rem; color: var(--text); max-width: 80ch; }
.aviso-legal { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 11px 14px; border-radius: 11px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: 0.88rem; }
@media (max-width: 640px) {
  .search-row { flex-direction: column; }
  .panel { padding: 16px; border-radius: 16px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; white-space: normal; font-size: 0.86rem; padding: 9px 8px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}

/* Modo manual */
.field { margin-bottom: 14px; position: relative; }
.field > label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 0.95rem; }
.sugerencias { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow: auto; }
.sugerencias button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; padding: 10px 14px; cursor: pointer; }
.sugerencias button:hover, .sugerencias button:focus { background: var(--brand-soft); }
.sugerencias small { display: block; color: var(--muted); font-size: 0.8rem; }
.norma-elegida { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1.5px solid var(--brand); background: var(--brand-soft); border-radius: 12px; margin-bottom: 14px; }
.norma-elegida strong { display: block; }
.norma-elegida a { font-size: 0.85rem; }
.arbol { border: 1px solid var(--line); border-radius: 12px; max-height: 420px; overflow: auto; padding: 8px; background: var(--bg-2); font-size: 0.92rem; }
.arbol details { margin-left: 10px; }
.arbol > details { margin-left: 0; }
.arbol summary { cursor: pointer; padding: 3px 0; list-style: none; display: flex; gap: 6px; align-items: baseline; }
.arbol summary::-webkit-details-marker { display: none; }
.arbol summary::before { content: '▸'; color: var(--muted); width: 12px; flex: none; transition: transform 0.15s; }
.arbol details[open] > summary::before { transform: rotate(90deg); }
.arbol label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.arbol .art { margin-left: 30px; padding: 2px 0; }
.arbol .h-nombre { font-weight: 650; }
.arbol .h-cuenta { color: var(--muted); font-size: 0.8rem; }
.arbol .art small { color: var(--muted); }
.arbol input { accent-color: var(--brand); }
.sel-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.cargando { padding: 18px; color: var(--muted); text-align: center; }

/* Anuncios (placeholders) */
.ad {
  display: grid; place-items: center; text-align: center; margin: 0 auto; color: #7a8194;
  border: 1.5px dashed #b8bfcc; border-radius: 10px;
  background: repeating-linear-gradient(45deg, rgba(128, 138, 160, 0.07) 0 10px, rgba(128, 138, 160, 0.13) 10px 20px);
  font-weight: 800; letter-spacing: 0.18em; font-size: 0.85rem;
}
.ad small { display: block; font-weight: 500; letter-spacing: 0.02em; font-size: 0.72rem; margin-top: 2px; opacity: 0.8; }
.ad-banner { width: min(728px, 100%); height: 90px; }
.ad-slot { padding: 10px 0 18px; }
.ad-rect { width: 300px; max-width: 100%; height: 250px; }
.ad-toast { position: fixed; z-index: 60; right: 16px; bottom: 16px; width: 300px; max-width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; }
.ad-toast .ad { height: 100px; }
.ad-toast .cerrar, .modal .cerrar { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; box-shadow: var(--shadow); }
.ad-toast .ad-tag { font-size: 0.7rem; color: var(--muted); margin: 0 0 6px 2px; }
@media (max-width: 760px) { .ad-banner { height: 100px; width: min(320px, 100%); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8, 11, 18, 0.55); padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; background: var(--panel); color: var(--text); border-radius: 18px; padding: 22px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); text-align: center; }
.modal-box h3 { margin-bottom: 4px; }
.modal-box p { color: var(--muted); font-size: 0.92rem; }
.modal-box .ad { margin: 14px auto; }
.barra { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.barra i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.2s; }

/* Progreso */
.progreso { padding: 34px 0; }
.pasos { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; max-width: 560px; }
.pasos li { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.pasos li::before { content: ''; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line); }
.pasos li.activo { color: var(--text); font-weight: 650; }
.pasos li.activo::before { border-color: var(--brand); border-top-color: transparent; animation: gira 0.8s linear infinite; }
.pasos li.hecho { color: var(--text); }
.pasos li.hecho::before { content: '✓'; display: grid; place-items: center; background: var(--ok); border-color: var(--ok); color: #fff; font-size: 0.75rem; font-weight: 800; }
@keyframes gira { to { transform: rotate(360deg); } }
.error-box { padding: 14px 16px; border-radius: 12px; border: 1px solid #e7a3a3; background: color-mix(in srgb, #d33 10%, var(--panel)); margin-top: 16px; }

/* Resultado */
.resultado { padding-top: 26px; }
.deck-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.deck-head h2 { margin-bottom: 6px; }
.deck-meta { color: var(--muted); font-size: 0.92rem; margin: 0; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.usados { margin-top: 10px; font-size: 0.9rem; }
.usados summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.usados ul { margin: 8px 0; padding-left: 18px; columns: 2 260px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 22px; position: sticky; top: 70px; z-index: 30; box-shadow: var(--shadow); }
.personalizar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.grupo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.grupo .label { margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); outline: 1.5px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed='true'] { outline: 2.5px solid var(--text); }
input[type='color'] { width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--line); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color']::-webkit-color-swatch { border: 0; border-radius: 50%; }
.toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.toggle button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 10px; cursor: pointer; }
.toggle button[aria-pressed='true'] { background: var(--brand-soft); color: var(--brand); }
.emoji-btn { font-size: 1.2rem; width: 38px; height: 34px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg-2); cursor: pointer; }
.emoji-pop { position: absolute; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: grid; grid-template-columns: repeat(6, 38px); gap: 4px; }
.emoji-pop button { font-size: 1.25rem; border: 0; background: transparent; border-radius: 8px; height: 38px; cursor: pointer; }
.emoji-pop button:hover { background: var(--brand-soft); }
.emoji-pop input { grid-column: 1 / -1; padding: 8px 10px; font-size: 0.9rem; border-radius: 9px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; width: 290px; }
.menu-list button { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; padding: 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; }
.menu-list button:hover { background: var(--brand-soft); }
.menu-list b { display: block; font-size: 0.93rem; }
.menu-list small { color: var(--muted); font-size: 0.8rem; line-height: 1.35; display: block; }
.menu-list .ico { font-size: 1.3rem; line-height: 1.2; }
@media (max-width: 760px) {
  .toolbar { position: static; }
  .menu-list { left: 0; right: auto; }
}

/* Tarjetas giratorias */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.fc { perspective: 1400px; cursor: pointer; border-radius: 18px; min-height: 250px; }
.fc-inner { display: grid; height: 100%; transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); transform-style: preserve-3d; }
.fc.girada .fc-inner { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--fc-fondo); color: var(--fc-texto); border: 1.5px solid var(--fc-borde); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 26px rgba(20, 30, 60, 0.1); min-height: 250px; }
.fc-back { transform: rotateY(180deg); background: var(--fc-fondo-rev); }
.fc-top { display: flex; align-items: center; gap: 8px; background: var(--fc-acento); color: var(--fc-sobre-acento); padding: 8px 12px; font-size: 0.74rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.fc-emoji { font-size: 1.15rem; letter-spacing: 0; }
.fc-num { margin-left: auto; font-weight: 600; opacity: 0.9; }
.fc-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 16px 18px; gap: 10px; }
.fc-q { font-family: var(--serif); font-size: 1.14rem; font-weight: 600; line-height: 1.4; text-align: center; margin: 0; }
.fc-a { font-family: var(--serif); font-size: 1.08rem; font-weight: 700; line-height: 1.4; text-align: center; margin: 0; }
.fc-cita { margin: 0; font-family: var(--serif); font-style: italic; font-size: 0.88rem; line-height: 1.45; color: var(--fc-suave); border-left: 3px solid var(--fc-acento); padding: 2px 0 2px 10px; }
.hueco { display: inline-block; min-width: 4em; border-bottom: 2px solid currentColor; color: var(--fc-acento); }
.fc-foot { padding: 9px 14px 11px; font-size: 0.78rem; color: var(--fc-suave); border-top: 1px dashed var(--fc-borde); }
.fc-foot a { color: var(--fc-acento); font-weight: 650; text-decoration: none; }
.fc-foot a:hover { text-decoration: underline; }
.fc.sabe .fc-front { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 55%, transparent); }
.hint { text-align: center; color: var(--muted); font-size: 0.88rem; margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .fc-inner { transition: none; } html { scroll-behavior: auto; } }

/* Modo estudio */
.estudio { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.estudio[hidden] { display: none; }
.estudio-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.estudio-top h3 { margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.estudio-cuerpo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.estudio .fc { width: min(640px, 100%); min-height: 340px; }
.estudio .fc-face { min-height: 340px; }
.estudio .fc-q { font-size: clamp(1.15rem, 2.6vw, 1.5rem); }
.estudio .fc-a { font-size: clamp(1.1rem, 2.4vw, 1.35rem); }
.contadores { display: flex; gap: 16px; font-size: 0.9rem; color: var(--muted); margin: 0 0 12px; }
.contadores b { color: var(--text); }
.estudio-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(640px, 100%); margin-top: 18px; }
.btn.repasar { border-color: #e2a33b; color: #9a5b00; background: color-mix(in srgb, #e2a33b 12%, var(--panel)); }
.btn.sabe { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--panel)); }
:root[data-theme='dark'] .btn.repasar { color: #f1c276; }
.btn.grande { padding: 15px; font-size: 1.02rem; }
.estudio-pie { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 10px 16px 16px; }
.fin-estudio { text-align: center; max-width: 520px; }
.fin-estudio .acciones { justify-content: center; margin-top: 16px; }

/* Secciones informativas */
.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.pasos-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: paso; }
.paso { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.paso::before { counter-increment: paso; content: counter(paso); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 14px; }
:root[data-theme='dark'] .paso::before { color: #0d1017; }
.paso p { color: var(--muted); margin: 0; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.idea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.idea .ico { font-size: 1.7rem; margin-bottom: 8px; }
.idea p { color: var(--muted); font-size: 0.94rem; flex: 1; }
.idea .chips { margin-top: 4px; }
.normas-pop { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.normas-pop a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--text); font-weight: 650; }
.normas-pop a:hover { border-color: var(--brand); }
.normas-pop span { font-size: 1.4rem; }
.mis-mazos { display: grid; gap: 10px; }
.mazo-item { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.mazo-item .info { min-width: 0; }
.mazo-item strong { display: block; }
.mazo-item small { color: var(--muted); }
.vacio { color: var(--muted); padding: 18px; border: 1.5px dashed var(--line); border-radius: 12px; text-align: center; }
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.03rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--brand); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p, .faq details ol { color: var(--muted); margin: 10px 0 0; }
.aviso-grande { display: flex; gap: 14px; padding: 18px 20px; border-radius: 14px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); }
.aviso-grande .ico { font-size: 1.5rem; }
.aviso-grande p { margin: 0; }
.ejemplo-lista { margin-top: 26px; }
.ejemplo-lista ol { padding-left: 20px; }
.ejemplo-lista li { margin-bottom: 10px; }
.ejemplo-lista .r { color: var(--muted); }
@media (max-width: 760px) { .pasos-3 { grid-template-columns: 1fr; } section { padding: 40px 0; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 90px; color: var(--muted); font-size: 0.9rem; background: var(--bg-2); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #151b2b; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 0.92rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: 0.25s; z-index: 90; max-width: calc(100% - 32px); }
.toast.visible { opacity: 1; transform: translateX(-50%); }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.fc-a-info { font-weight: 400; font-size: 0.98rem; line-height: 1.5; text-align: left; white-space: pre-line; }

/* Avisos del mazo */
.aviso-cambios { margin-top: 10px; padding: 11px 13px; border-radius: 11px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: 0.9rem; max-width: 90ch; }
.aviso-cambios .btn { margin-left: 6px; margin-top: 6px; }

/* Edición de tarjetas */
.fc-wrap { display: flex; flex-direction: column; gap: 8px; }
.fc-edit { display: flex; gap: 8px; justify-content: center; }
.grid.editando .fc { outline: 2px dashed var(--brand); outline-offset: 3px; }
.editor { width: min(560px, 100%); text-align: left; display: grid; gap: 10px; }
.editor label { display: grid; gap: 5px; font-size: 0.85rem; font-weight: 650; color: var(--muted); }
.editor textarea, .editor select, .editor input[type='text'] { font: inherit; font-size: 0.95rem; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; resize: vertical; }

/* Mis mazos: estadísticas */
.resumen-estudio { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--line); font-size: 0.93rem; }
.resumen-estudio .btn { margin-left: auto; }
.mazo-item .stats { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 5px; font-size: 0.82rem; color: var(--muted); }
.mazo-item .stats .pend { color: var(--brand); font-weight: 700; }
.mazo-item .stats .alerta { color: var(--warn-text); background: var(--warn-bg); padding: 1px 7px; border-radius: 6px; }
.progreso-mini { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progreso-mini i { display: block; height: 100%; background: var(--ok); }
.sel-mazo { display: flex; align-items: center; }
.sel-mazo input { width: 18px; height: 18px; accent-color: var(--brand); }
.mazo-item { flex-wrap: nowrap; }
.mazo-item .info { flex: 1; }
@media (max-width: 760px) { .mazo-item { flex-wrap: wrap; } }
.sub-mis { margin: 18px 0 4px; }
.bloque-temas { margin-bottom: 18px; }
.bloque-temas h3 { margin-bottom: 8px; }

/* Modo test */
.test-cuerpo { justify-content: flex-start; }
.test-config { width: min(520px, 100%); display: grid; gap: 14px; }
.test-config .campo { display: grid; gap: 6px; font-weight: 650; font-size: 0.92rem; }
.test-config select, .test-config input { font: inherit; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.test-pregunta { width: min(720px, 100%); }
.test-enunciado { font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.35rem); font-weight: 600; line-height: 1.45; }
.test-enunciado .hueco { color: var(--brand); }
.test-opciones { display: grid; gap: 9px; margin: 14px 0 6px; }
.test-op { display: flex; gap: 10px; align-items: flex-start; text-align: left; font: inherit; font-size: 0.98rem; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.test-op:hover { border-color: var(--brand); }
.test-op[aria-checked='true'] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.test-op b { color: var(--brand); min-width: 1.4em; }
.test-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.test-mapa { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 720px; }
.test-mapa button { width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.test-mapa .hecha { background: var(--brand-soft); border-color: var(--brand); }
.test-mapa .actual { outline: 2.5px solid var(--text); }
.reloj { font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.reloj.urgente { background: #fde2e2; color: #b42318; }
.test-resultado { width: min(720px, 100%); text-align: center; }
.nota { font-size: 3.4rem; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.nota small { font-size: 1.2rem; color: var(--muted); }
.nota.aprobado { color: var(--ok); }
.nota.suspenso { color: #c2410c; }
.test-revision { width: min(720px, 100%); padding-left: 0; list-style: none; display: grid; gap: 12px; }
.test-revision .rev { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #c2410c; border-radius: 12px; padding: 12px 14px; }
.test-revision .rev.blanco { border-left-color: var(--muted); }
.test-revision .rev p { margin: 0 0 6px; }
.test-revision .tu { color: #c2410c; }
.test-revision .rev.blanco .tu { color: var(--muted); }
.test-revision .buena { color: var(--ok); font-weight: 650; }
.test-revision .fc-cita { color: var(--muted); border-left-color: var(--brand); }

/* Podcast */
.podcast-res { padding-top: 26px; }
.pod-player { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; position: sticky; top: 70px; z-index: 30; margin-bottom: 18px; }
.pod-player .pod-play { min-width: 140px; }
.pod-ctrl { display: flex; gap: 6px; align-items: center; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.pod-ctrl select { font: inherit; color: var(--text); background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 8px; max-width: 200px; }
.pod-estado { font-size: 0.85rem; color: var(--muted); flex: 1 1 200px; }
.pod-texto { max-width: 760px; }
.pod-sec { margin-bottom: 22px; }
.pod-sec h3 { font-size: 1.05rem; color: var(--brand); }
.pod-sec p { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.pod-f { cursor: pointer; border-radius: 4px; transition: background 0.2s; }
.pod-f:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.pod-f.activa { background: color-mix(in srgb, var(--brand) 20%, transparent); }
@media (max-width: 760px) { .pod-player { position: static; } }

/* Páginas de artículo */
.articulo-pag { padding: 30px 0 50px; }
.articulo-pag h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.articulo-pag h1 .rubrica { display: block; font-family: var(--serif); font-weight: 600; font-size: 0.62em; color: var(--muted); margin-top: 6px; }
.art-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.art-texto { max-width: 860px; }
.art-texto h2, .art-bloque h2 { font-size: 1.25rem; }
.art-texto p { font-family: var(--serif); font-size: 1.1rem; line-height: 1.7; }
.art-bloque { margin: 30px 0; max-width: 960px; }
.art-bloque .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.diff { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-family: var(--serif); line-height: 1.7; }
.diff del { background: #fde2e2; color: #9b1c1c; text-decoration: line-through; padding: 0 2px; border-radius: 3px; }
.diff ins { background: #dcfce7; color: #14532d; text-decoration: none; padding: 0 2px; border-radius: 3px; }
:root[data-theme='dark'] .diff del { background: #4a1d1d; color: #fecaca; }
:root[data-theme='dark'] .diff ins { background: #14391f; color: #bbf7d0; }
.versiones { color: var(--muted); font-size: 0.92rem; }
.lista-arts { columns: 2 300px; padding-left: 18px; }
.lista-arts li { margin-bottom: 5px; break-inside: avoid; }
.art-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 26px 0; }
.recomendado { display: grid; place-items: center; text-align: center; min-height: 110px; margin: 26px auto; max-width: 728px; border: 1.5px dashed var(--warn-line); border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); letter-spacing: 0.12em; }
.recomendado small { letter-spacing: 0; font-size: 0.78rem; }
.ad-patrocinio { border-color: var(--warn-line); }

/* Esquema de la ley */
.esquema, .esquema ul { list-style: none; padding-left: 0; margin: 0; }
.esquema ul { padding-left: 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.esquema summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.esquema summary small { color: var(--muted); font-weight: 500; }
.esquema .nivel-1 > details > summary { font-size: 1.1rem; color: var(--brand); }
.esq-art { padding: 3px 0; font-size: 0.95rem; }
.esq-art span { color: var(--muted); }
@media print {
  .site-header, .site-footer, .art-acciones, .ad-slot, .ad, .recomendado, .ad-toast { display: none !important; }
  .esquema details > summary::marker { content: ''; }
}

/* Índices de leyes y test */
.leyes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ley-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.ley-card:hover { border-color: var(--brand); }
.ley-card .ico { font-size: 1.7rem; }
.ley-card small { color: var(--muted); }
.ley-card .mini-links { font-size: 0.82rem; color: var(--brand); font-weight: 600; margin-top: 4px; }
.grupos-test { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.grupo-test { text-align: left; font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.grupo-test:hover { border-color: var(--brand); }
.grupo-test small { color: var(--muted); }
.test-dia { margin-top: 20px; max-width: 720px; }
.nota-previa { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }
.tarjeta-dia .art-acciones { margin-top: 14px; }

/* Glosario */
#filtro-glosario { max-width: 480px; margin-top: 10px; }
.letras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.letras a { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-weight: 700; }
.glosario h2 { margin-top: 26px; color: var(--brand); }
.glosario dl { margin: 0; }
.glosario .def { padding: 12px 0; border-bottom: 1px solid var(--line); }
.glosario dt { font-weight: 800; font-size: 1.05rem; }
.glosario dd { margin: 4px 0 0; font-family: var(--serif); line-height: 1.6; }
.glosario dd small { font-family: var(--sans); color: var(--muted); }

/* Legales y novedades */
.legal { max-width: 820px; }
.legal p { line-height: 1.7; }
.novedades h2 { margin-top: 28px; }
.novedades h3 { font-size: 1rem; color: var(--muted); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.nov-lista { padding-left: 18px; }
.nov-lista li { margin-bottom: 8px; line-height: 1.45; }
.nov-lista small { color: var(--muted); }

/* ---------- FlashOpo ---------- */
.logo-svg { width: 34px; height: 34px; flex: none; }
.logo b { color: #d99a00; }
:root[data-theme='dark'] .logo b { color: #f5b700; }
.btn-instalar { border: 1.5px solid #f5b700; background: color-mix(in srgb, #f5b700 14%, var(--panel)); color: var(--text); font: inherit; font-size: 0.82rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.btn-instalar:hover { background: color-mix(in srgb, #f5b700 28%, var(--panel)); }
@media (max-width: 480px) { .btn-instalar { padding: 5px 9px; font-size: 0.76rem; } .logo { font-size: 1rem; } }
.instalar-box { text-align: left; width: min(440px, 100%); }
.instalar-box .logo-svg { width: 48px; height: 48px; display: block; margin: 0 auto 8px; }
.instalar-box h3 { text-align: center; }
.pasos-instalar { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }
.pasos-instalar ol { margin: 6px 0 0; padding-left: 20px; color: var(--text); }
.link-btn { border: 0; background: none; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* Selector de oposición */
.selector-op { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 760px; }
.op-card { --op-color: #1f3f8f; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 18px 20px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.1s; }
.op-card:hover { border-color: var(--op-color); transform: translateY(-1px); }
.op-card[aria-pressed='true'] { border-color: var(--op-color); background: color-mix(in srgb, var(--op-color) 10%, var(--panel)); }
.op-card .op-emoji { font-size: 2rem; }
.op-card strong { font-size: 1.15rem; }
.op-card small { color: var(--muted); }
.selector-op.mini { margin-bottom: 14px; }
.selector-op.mini .op-card { flex-direction: row; align-items: center; padding: 10px 14px; box-shadow: none; }
.op-elegida { margin-top: 12px; color: var(--muted); }
@media (max-width: 560px) { .selector-op { grid-template-columns: 1fr; } }
/* Solo se muestra el temario de la oposición elegida (sin elección, se ven los dos) */
:root[data-op='policia-nacional'] [data-solo='guardia-civil'],
:root[data-op='guardia-civil'] [data-solo='policia-nacional'] { display: none !important; }

/* Temario */
.temario-portada { margin-bottom: 26px; }
.temas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tema-chip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); text-decoration: none; font-size: 0.88rem; line-height: 1.35; }
.tema-chip:hover { border-color: var(--brand); }
.tema-chip b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 0.85rem; }
.bloque-tit { margin: 22px 0 8px; color: var(--brand); }
.lista-temas { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.tema-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tema-item a { flex: 1; text-decoration: none; color: var(--text); }
.tema-item a:hover { color: var(--brand); }
.tema-n { font-weight: 800; color: var(--brand); margin-right: 4px; }
.sel-tema { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.sel-hueco { width: 18px; flex: none; }
.barra-seleccion { position: sticky; top: 70px; z-index: 20; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--line); margin: 10px 0; font-size: 0.9rem; }
.temario-op h2 small { font-size: 0.6em; color: var(--muted); font-weight: 600; }
.fuente { margin: 14px 0; }
.fuente h3 small { color: var(--muted); font-weight: 500; }
.arts-tema summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.arts-tema p { line-height: 1.9; font-size: 0.9rem; }

/* Pruebas físicas */
.fisicas { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; border-left: 5px solid #f5b700; }
.fisicas .ico { font-size: 2.4rem; }
.fisicas > div { flex: 1 1 320px; }
.fisicas h2 { font-size: 1.3rem; margin-bottom: 4px; }
.fisicas p { margin: 0; color: var(--muted); }

/* Varios temas en el generador */
.q-extras { display: grid; gap: 8px; margin-top: 8px; }
.q-extra-fila { display: flex; gap: 8px; }
.q-extra-fila input { flex: 1; }
.mas-temas { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.mas-temas .ayuda-tipo { margin: 0; }

/* ===== Flashcards BOE: generador visual, dictado y consulta rápida ===== */
.hero-portada { padding-top: 34px; }
.hero-portada h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; }
.subrayado { background: linear-gradient(transparent 62%, color-mix(in srgb, #f5b700 55%, transparent) 62%); padding: 0 2px; }
.campo-tipos { margin-top: 18px; }
.tipos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.tipo-tile { position: relative; display: block; }
.tipo-tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.tipo-tile .tile { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 12px 11px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg-2); cursor: pointer; transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s; border-top: 4px solid var(--tile); }
.tipo-tile .tile-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 1.15rem; font-weight: 800; background: color-mix(in srgb, var(--tile) 14%, transparent); color: var(--tile); margin-bottom: 4px; font-family: var(--serif); }
.tipo-tile b { font-size: 0.93rem; line-height: 1.2; }
.tipo-tile small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.tipo-tile:hover .tile { transform: translateY(-2px); box-shadow: var(--shadow); }
.tipo-tile input:checked + .tile { border-color: var(--tile); background: color-mix(in srgb, var(--tile) 9%, var(--bg-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tile) 35%, transparent); }
.tipo-tile input:checked + .tile b::after { content: ' ✓'; color: var(--tile); }
.tipo-tile input:focus-visible + .tile { outline: 3px solid color-mix(in srgb, var(--tile) 50%, transparent); outline-offset: 2px; }
:root[data-theme='dark'] .tipo-tile .tile-ico { color: color-mix(in srgb, var(--tile) 55%, #fff); }

.campo-voz { position: relative; flex: 1; min-width: 0; display: flex; }
.campo-voz input { padding-right: 52px; }
.btn-mic { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-soft); font-size: 1.1rem; cursor: pointer; }
.btn-mic:hover { background: color-mix(in srgb, var(--brand) 22%, var(--bg-2)); }
.btn-mic.escuchando { background: #d0363b; color: #fff; animation: latido 1.1s ease-in-out infinite; }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(208, 54, 59, 0.45); } 50% { box-shadow: 0 0 0 9px rgba(208, 54, 59, 0); } }
@media (max-width: 560px) { .search-row { flex-direction: column; } .search-row > .btn { width: 100%; } }

.arbol { max-height: 540px; }
.arbol .art { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.arbol .art label { flex: 1; min-width: 0; }
.art-leer { border: 1px solid var(--line); background: var(--panel); color: var(--brand); font: inherit; font-size: 0.76rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.art-leer:hover, .art-leer[aria-expanded='true'] { border-color: var(--brand); background: var(--brand-soft); }
.art-texto-inline { flex-basis: 100%; margin: 4px 0 10px 24px; padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--panel); border-radius: 0 10px 10px 0; font-family: var(--serif); font-size: 0.95rem; line-height: 1.55; }
.art-texto-inline p { margin: 0 0 8px; }
.art-texto-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-family: var(--sans, inherit); }

.fc-tipo-ico { margin-right: 5px; }
.fc-vf { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.fc-vf span { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--fc-borde); color: var(--fc-suave); }
.fc-vf span:first-child { border-color: color-mix(in srgb, #1d7a55 55%, transparent); color: #1d7a55; }
.fc-vf span:last-child { border-color: color-mix(in srgb, #c0392b 55%, transparent); color: #c0392b; }
.fc[data-tipo='articulo'] .fc-back .fc-a { font-size: 1.5rem; }
.fc[data-tipo='hueco'] .fc-back .fc-a { font-size: 1.35rem; color: var(--fc-acento); }

.muestrario { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.muestra { display: flex; flex-direction: column; gap: 8px; }
.muestra > .link-btn { align-self: center; font-size: 0.88rem; font-weight: 650; text-decoration: none; }
.muestra > .link-btn:hover { text-decoration: underline; }
.muestra-extra .pod-mini { flex: 1; min-height: 250px; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 18px; border: 1.5px solid color-mix(in srgb, var(--tile) 45%, var(--line)); background: color-mix(in srgb, var(--tile) 9%, var(--panel)); box-shadow: 0 10px 26px rgba(20, 30, 60, 0.08); }
.pod-mini p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.pod-mini .pod-eti { color: var(--tile); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pod-mini strong { font-family: var(--serif); font-size: 1.15rem; }
.pod-mini .btn { align-self: flex-start; margin-top: auto; }
.pod-mini .mezcla { font-size: 1.6rem; letter-spacing: 0.25em; margin-top: auto; color: var(--text); }
.ondas { display: flex; align-items: center; gap: 3px; height: 46px; }
.ondas i { flex: 1; background: var(--tile); border-radius: 3px; opacity: 0.75; }
.sonando .ondas i { animation: onda 0.9s ease-in-out infinite alternate; }
.sonando .ondas i:nth-child(3n) { animation-delay: 0.2s; }
.sonando .ondas i:nth-child(3n + 1) { animation-delay: 0.45s; }
@keyframes onda { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .sonando .ondas i, .btn-mic.escuchando { animation: none; } }
#filtro-leyes { max-width: 520px; margin-top: 8px; }
.muestra .fc { flex: 1; display: flex; flex-direction: column; }
.muestra .fc-inner { flex: 1; }
.tipo-tile b { display: block; }
.tipo-tile input:checked + .tile b::after { white-space: nowrap; }
