/* Sísifo · leyes (/leyes, /ley/<slug>) y repaso (/repasar). opos/leyes.py */

/* ---------- /leyes ---------- */
.leyes-intro { max-width: 70ch; margin: 0 0 8px; }
.leyes-grupo h2 { margin: 26px 0 10px; }
.leyes-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.leyes-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: 0; }
.leyes-item.sin { opacity: .6; box-shadow: none; }
.leyes-check { display: grid; place-items: center; width: 28px; height: 44px; flex: none; cursor: pointer; }
.leyes-check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.leyes-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.leyes-nombre { font-weight: 750; font-size: 16.5px; color: var(--text); }
a.leyes-nombre:hover { color: var(--accent); }
.leyes-materia { font-size: 14px; color: var(--muted); line-height: 1.3; }
.leyes-cab { display: flex; align-items: center; gap: 8px; }
.leyes-audio { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.leyes-audio .ico { width: 14px; height: 14px; }
.leyes-audio:hover { text-decoration: none; filter: brightness(.97); }
.leyes-rep { flex: none; min-height: 42px; padding: 8px 12px; font-size: 14.5px; }
.leyes-varias { position: sticky; bottom: 12px; z-index: 5; margin: 18px auto 10px; max-width: 520px; display: none; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-l); padding: 10px 10px 10px 16px; }
.leyes-form:has(.leyes-check input:checked) .leyes-varias { display: flex; }
@media (max-width: 860px) {
  .leyes-lista { grid-template-columns: 1fr; gap: 8px; }
  .leyes-item { padding: 8px 10px; gap: 8px; }
  .leyes-rep span { display: none; }
  .leyes-rep { width: 44px; padding: 0; }
  .leyes-varias { bottom: calc(76px + env(safe-area-inset-bottom)); margin-left: 0; margin-right: 0; }
}

/* ---------- /ley/<slug> ---------- */
.ley-cab { max-width: 860px; margin: 0 0 18px; }
.ley-cab h1 { margin: 10px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ley-cab a.chip { color: inherit; text-decoration: none; }   /* la comunidad de una ley autonómica: lleva a su grupo en /leyes */
.ley-cab a.chip:hover { filter: brightness(.96); }
.ley-materia { font-family: system-ui, sans-serif; font-weight: 600; font-size: 17px; color: var(--muted); letter-spacing: 0; }
.ley-oficial { margin: 0 0 4px; font-size: 15px; line-height: 1.4; }
.ley-meta { margin: 0 0 14px; }
.ley-meta .ico { width: 14px; height: 14px; vertical-align: -2px; }
.ley-repasar { gap: 10px; }
.ley-spotify { gap: 9px; margin-left: 8px; }
.ley-spotify .ico { width: 22px; height: 22px; stroke: none; }
@media (max-width: 640px) { .ley-cab:has(.ley-spotify) .ley-repasar, .ley-spotify { width: 100%; } .ley-spotify { margin: 8px 0 0; } }
.ley-repasar small { font-weight: 500; opacity: .85; font-size: 14px; }
.ley-cuerpo { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 34px; align-items: start; }
.ley-lado { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - 24px); display: flex; flex-direction: column; gap: 10px; }
.ley-repasar-m { display: none; }
.ley-indice { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ley-indice > summary { list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 10px 14px; min-height: 46px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ley-indice > summary::-webkit-details-marker { display: none; }
.ley-indice nav { overflow-y: auto; overscroll-behavior: contain; padding: 6px 4px 10px; max-height: calc(100vh - var(--top) - 100px); scrollbar-width: thin; }
.ley-indice ul { list-style: none; margin: 0; padding: 0; }
.ley-indice ul ul { padding-left: 10px; border-left: 1px solid var(--line); margin-left: 10px; }
.ley-indice a { display: block; color: var(--text); padding: 5px 8px; border-radius: 8px; font-size: 14px; line-height: 1.3; }
.ley-indice a span, .ley-indice summary span { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.ley-indice li > a span { display: inline; }
.ley-indice li > a span::before { content: " · "; }
.ley-indice a:hover { background: var(--surface-2); text-decoration: none; }
.ley-indice a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.ley-indice .ind-h > details > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; padding: 4px 6px 4px 22px; position: relative; border-radius: 8px; }
.ley-indice .ind-h > details > summary::-webkit-details-marker { display: none; }
.ley-indice .ind-h > details > summary::before { content: "▸"; position: absolute; left: 7px; top: 9px; color: var(--muted); font-size: 12px; }
.ley-indice .ind-h > details[open] > summary::before { content: "▾"; }
.ley-indice .ind-h > details > summary a { padding: 1px 0; font-weight: 700; font-size: 13.5px; }
.ley-indice .ind-h > details > summary a:hover { background: none; color: var(--accent); }
.ley-indice .ind-h > details > summary > span { padding: 0 0 2px; font-size: 13px; }
.ley-indice .ind-h.n3 > details > summary a, .ley-indice .ind-h.n4 > details > summary a { font-weight: 650; }

.ley-texto { max-width: 76ch; min-width: 0; font-size: 17px; line-height: 1.65; }
.ley-texto p { margin: 0 0 .7em; overflow-wrap: anywhere; }
.ley-texto p.sub { padding-left: 1.4em; }
.ley-texto [id] { scroll-margin-top: calc(var(--top) + 16px); }
.ley-enc { font-family: var(--display, Georgia, serif); text-align: left; margin: 2.2em 0 .8em; line-height: 1.25; }
.ley-enc span { display: block; font-family: system-ui, sans-serif; font-weight: 600; font-size: .8em; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.ley-enc.n1 { font-size: 26px; color: var(--accent); }
.ley-enc.n2 { font-size: 22px; padding-top: 1em; border-top: 2px solid var(--line); }
.ley-enc.n3 { font-size: 19px; }
.ley-enc.n4, .ley-enc.n5 { font-size: 17px; font-family: system-ui, sans-serif; font-weight: 700; }
.ley-art { margin: 0 0 1.6em; content-visibility: auto; contain-intrinsic-size: auto 260px; }
.ley-art h3 { font-size: 17.5px; margin: 0 0 .45em; line-height: 1.35; position: relative; }
.ley-art h3 span { font-weight: 650; color: var(--text); }
.ley-art .ancla { position: absolute; left: -1.1em; color: var(--line-2); font-weight: 400; opacity: 0; }
.ley-art:hover .ancla, .ley-art .ancla:focus { opacity: 1; text-decoration: none; }
.ley-art:target h3 { color: var(--accent); }
.ley-art:target { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-soft) 45%, transparent); border-radius: 4px; }
.ley-notas { margin: -.2em 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.ley-notas > summary { cursor: pointer; width: fit-content; }
.ley-notas p { margin: .3em 0; }
.ley-preambulo { margin: 0 0 1.4em; font-size: 16px; }
.ley-preambulo > p { padding: 0 16px; }
.ley-nota { margin: 0 0 1em; }
.ley-fuente { margin-top: 2.5em; border-top: 1px solid var(--line); padding-top: 1em; }

/* leyes troceadas: portada con sus partes y página de cada parte */
.ley-de { margin: 8px 0 0; font-weight: 650; font-size: 15px; color: var(--muted); }
.ley-de a { color: var(--accent); }
.ley-h1-parte { margin: 4px 0 6px; display: flex; flex-direction: column; gap: 2px; }
.ley-h1-parte .ley-libro { font-family: system-ui, sans-serif; font-weight: 650; font-size: 15px; color: var(--muted); letter-spacing: 0; order: -1; }
.ley-h1-parte .ley-materia { font-size: 18px; color: var(--text); line-height: 1.3; }
.ley-partes-intro { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; }
.ley-modo-portada .ley-enc.n1 { margin: 1.4em 0 .6em; font-size: 22px; }
.ley-modo-parte .ley-texto > .ley-enc:first-child { margin-top: 0; }
.ley-modo-parte .ley-texto > .ley-enc.n1 + .ley-enc.n2 { border-top: 0; padding-top: 0; margin-top: .6em; }
.ley-partes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ley-parte { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; color: var(--text); line-height: 1.3; box-sizing: border-box; }
.ley-parte:hover { text-decoration: none; border-color: var(--accent); }
.ley-parte b { font-size: 15.5px; color: var(--accent); }
.ley-parte span { font-size: 15px; font-weight: 600; }
.ley-parte small { margin-top: 4px; font-size: 13px; }
.ley-pasos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2.4em 0 0; }
.ley-paso { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; color: var(--text); line-height: 1.3; min-width: 0; }
.ley-paso:hover { text-decoration: none; border-color: var(--accent); }
.ley-paso.sig { text-align: right; grid-column: 2; }
.ley-paso small { color: var(--muted); font-size: 13px; }
.ley-paso b { color: var(--accent); font-size: 15px; }
.ley-paso span { font-size: 14px; overflow-wrap: anywhere; }
.ley-indice .ind-portada { margin: 2px 4px 6px; }
.ley-indice .ind-portada a { font-weight: 650; color: var(--accent); }
.ley-indice .ind-parte > a { font-weight: 650; font-size: 13.5px; }
.ley-indice .ind-parte > a span { display: block; font-weight: 400; }
.ley-indice .ind-parte > a span::before { content: none; }
.ley-indice .ind-actual > details > summary { background: var(--accent-soft); }

@media (max-width: 999px) {
  .ley-cuerpo { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ley-lado { position: sticky; top: var(--top); z-index: 20; max-height: none; flex-direction: row; gap: 8px; margin: 0 -16px 14px; padding: 8px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); }     /* sin backdrop-filter: haría de caja del índice fijo */
  .ley-indice { flex: 1; border: 0; background: none; }
  .ley-indice > summary { border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); justify-content: center; }
  .ley-indice[open] > summary { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
  .ley-indice nav { position: fixed; left: 0; right: 0; top: calc(var(--top) + 63px); bottom: 0; z-index: 40; max-height: none;
    background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px calc(90px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-l); }
  .ley-indice a { padding: 9px 8px; font-size: 15px; }
  .ley-repasar-m { display: inline-flex; flex: 1; min-height: 46px; }
  .ley-texto { font-size: 16.5px; }
  .ley-art .ancla { display: none; }
  .ley-partes { grid-template-columns: 1fr; }
  .ley-modo-parte .ley-texto > .ley-enc:first-child { margin-top: .4em; }
  .ley-pasos { grid-template-columns: 1fr; }
  .ley-paso.sig { grid-column: 1; }
}

/* ---------- /repasar ---------- */
body:has(.repaso) div.pie-wrap, body:has(.repaso) nav.bottom { display: none; }
body:has(.repaso) main { padding-bottom: 0; }
.repaso { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  height: calc(100dvh - var(--top) - 28px); padding-bottom: max(14px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.rep-cab { display: flex; flex-direction: column; gap: 6px; flex: none; }
.rep-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rep-titulo { margin: 0; font-weight: 750; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rep-cont { margin: 0; color: var(--muted); }
.rep-cont b { color: var(--text); font-variant-numeric: tabular-nums; }
.rep-barra { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rep-barra span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.rep-ajustes { position: relative; flex: none; }
.rep-ajustes > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: var(--muted); }
.rep-ajustes > summary::-webkit-details-marker { display: none; }
.rep-ajustes > summary:hover, .rep-ajustes[open] > summary { background: var(--surface-2); color: var(--text); }
.rep-ajustes .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rep-ajustes-caja { position: absolute; right: 0; top: 48px; z-index: 30; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-l); }
.rep-ajustes-caja label { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.rep-ajustes-caja input[type=number] { width: 80px; font: inherit; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--text); margin-left: auto; }
.rep-ajustes-caja fieldset { border: 0; padding: 0; margin: 0; }
.rep-ajustes-caja legend { font-weight: 650; padding: 0; margin-bottom: 2px; }
.rep-ajustes-caja p { margin: 0; }
.rep-cargando { margin: 30px 0; text-align: center; }

.rep-tarjeta { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.rep-tarjeta[hidden], .rep-fin[hidden] { display: none; }
.rep-caja { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.rep-caja .chips { margin: 0; }
.rep-cuerpo { margin: auto 0; }
.rep-frase { font-size: 21px; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.rep-pregunta { font-size: 22px; line-height: 1.4; font-weight: 650; margin: 0; text-wrap: balance; }
.rep-respuesta { font-family: var(--display, Georgia, serif); font-size: 24px; line-height: 1.3; color: var(--accent); margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.hueco { display: inline-block; min-width: 4.5em; border-bottom: 3px solid var(--accent); height: 1.05em; vertical-align: -.1em; margin: 0 2px; background: var(--accent-soft); border-radius: 4px 4px 0 0; }
mark.hueco.lleno { display: inline; min-width: 0; height: auto; color: var(--accent); background: var(--accent-soft); font-weight: 750; padding: 0 4px; border-bottom-width: 2px; }
.rep-opciones { display: grid; grid-template-columns: 1fr; gap: 8px; }
.rep-op { justify-content: flex-start; text-align: left; font-weight: 600; min-height: 50px; }
.rep-op kbd, .rep-mostrar kbd { font: 600 12px/1 system-ui, sans-serif; border: 1px solid currentColor; border-radius: 5px; padding: 3px 5px; opacity: .55; }
button.rep-op.ok, button.rep-op.ok:hover { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); opacity: 1; }
button.rep-op.mal, button.rep-op.mal:hover { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); opacity: 1; }
.rep-op:disabled { cursor: default; opacity: 1; }
.rep-op.apagada:disabled { opacity: .5; }
.rep-aviso { margin: 0; font-weight: 700; }
.rep-aviso.ok { color: var(--ok); }
.rep-aviso.mal { color: var(--warn); }
.rep-ver { align-self: flex-start; }
.rep-ver .ico { width: 14px; height: 14px; vertical-align: -2px; }
.rep-botones { flex: none; }
.rep-mostrar { width: 100%; min-height: 60px; font-size: 18px; gap: 12px; }
.rep-notas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rep-notas[hidden], .rep-mostrar[hidden] { display: none; }
.rep-notas:not(.cuatro) { grid-template-columns: 1fr 1fr; }
.rep-notas:not(.cuatro) .extra { display: none; }
.nota > span { white-space: normal; }
.nota { flex-direction: column; gap: 2px; min-height: 64px; padding: 8px 4px; font-size: 16px; border: 1px solid transparent; white-space: nowrap; }
.nota small { font-weight: 500; font-size: 12.5px; opacity: .8; }
.nota.n1 { background: var(--warn-soft); color: var(--warn); }
.nota.n2 { background: var(--mid-soft); color: var(--mid); }
.nota.n3 { background: var(--ok-soft); color: var(--ok); }
.nota.n4 { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-2)); color: var(--accent); }
.nota:hover { filter: brightness(.96); }
.nota:focus-visible, .rep-op:focus-visible, .rep-mostrar:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.rep-fin { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px; }
.rep-fin h1 { margin: 6px 0; }
.rep-fin p { margin: 0; }
.rep-fin-ico { width: 46px; height: 46px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.6; }
.rep-racha { font-weight: 750; color: var(--accent); font-size: 18px; }
.rep-manana { font-weight: 650; font-size: 17px; margin-top: 6px !important; }
.rep-fin-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

.rep-elegir { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.rep-elegir-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; }
.rep-elegir-lista label { display: flex; align-items: baseline; gap: 8px; min-height: 40px; padding: 6px 0; }
.rep-elegir-lista input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 860px) {
  .repaso { height: calc(100dvh - var(--top) - 18px); gap: 10px; }
  .rep-caja { padding: 14px 16px; }
  .rep-frase { font-size: 19px; }
  .rep-pregunta { font-size: 20px; }
  .rep-respuesta { font-size: 21px; }
  .rep-mostrar kbd, .rep-op kbd { display: none; }
  .nota { min-height: 62px; font-size: 15px; }
  .rep-notas { gap: 6px; }
}
@media (min-width: 861px) {
  .rep-opciones { grid-template-columns: 1fr 1fr; }
  .repaso { height: min(calc(100dvh - var(--top) - 26px), 660px); }
}

/* modo «escribir»: el hueco es un campo de texto */
.hueco-input { font: inherit; font-weight: 700; color: var(--accent); width: 9em; max-width: 100%; padding: 0 6px; margin: 0 2px;
  border: 0; border-bottom: 3px solid var(--accent); border-radius: 4px 4px 0 0; background: var(--accent-soft); }
.hueco-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.rep-campo .hueco-input { width: 100%; font-size: 1.1em; padding: 6px 8px; }
.rep-escrita { margin: .8em 0 0; font-weight: 700; }
.rep-escrita.ok { color: var(--ok); }
.rep-escrita.casi { color: var(--warn); }
.rep-escrita.mal { color: var(--warn); }
.rep-escrita s { font-weight: 500; opacity: .8; }

@media (max-width: 640px) {      /* la caja de la página tiene 14 px a cada lado (app.css): la barra fija, igual */
  .ley-lado { margin: 0 -14px 14px; padding: 8px 14px; }
}

/* píldoras de audio (leyes.audio_articulo, static/pildora.js): en el artículo de /ley/… y bajo la pregunta del repaso */
.pildora { display: flex; align-items: center; gap: 10px; max-width: 320px; min-height: 36px; }
.rep-audio { margin: 16px 0 0; }
/* en la ley, solo el icono junto al encabezado; el salpicadero es la barra de abajo */
.pild-mini { display: inline-flex; vertical-align: middle; gap: 7px; max-width: none; min-height: 0; margin-left: 10px; }
.pild-mini .pild-play { width: 30px; height: 30px; min-height: 30px; }
.pild-mini .pild-play svg { width: 14px; height: 14px; }
.pild-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.pild-mini.sonando .pild-eq { display: inline-flex; }
.pild-eq i { width: 3px; border-radius: 1.5px; background: var(--accent); height: 60%; animation: pild-eq 1s ease-in-out infinite; }
.pild-eq i:nth-child(2) { animation-delay: .25s; height: 100%; }
.pild-eq i:nth-child(3) { animation-delay: .5s; height: 40%; }
@keyframes pild-eq { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .pild-eq i { animation: none; } }
.pild-play { flex: 0 0 auto; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.pild-play:hover { background: var(--accent-2); }
.pild-play svg { width: 17px; height: 17px; fill: currentColor; }
.pildora.sonando .pild-play svg { width: 15px; height: 15px; }
.pild-barra, .pild-vbar { flex: 1; min-width: 80px; appearance: none; -webkit-appearance: none; height: 4px; margin: 0; padding: 0;
  border: 0; border-radius: 2px; cursor: pointer;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--line-2) var(--p, 0%)); }
.pild-barra::-webkit-slider-thumb, .pild-vbar::-webkit-slider-thumb { appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 0; }
.pild-barra::-moz-range-thumb, .pild-vbar::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 0; }
.pild-barra::-moz-range-track, .pild-vbar::-moz-range-track { height: 4px; border-radius: 2px; background: transparent; }
.pild-t { flex: 0 0 auto; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.pild-vol { flex: 0 0 auto; display: inline-flex; align-items: center; }
.pild-mute { flex: 0 0 auto; width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 50%;
  background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.pild-mute:hover { background: var(--accent-soft); color: var(--accent); }
.pild-mute svg { width: 18px; height: 18px; fill: currentColor; }
.pild-vbar { flex: 0 0 auto; min-width: 0; width: 52px; margin-left: 4px; }  /* siempre visible: con hover no se descubría */

/* «modo escucha» de la ley (static/pildora.js): barra fija abajo, oculta hasta el primer play (✕ la cierra) */
body.escuchando { padding-bottom: 68px; }
.escucha[hidden] { display: none; }
.escucha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .07); }
.esc-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; max-width: 960px; margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.esc-titulo { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 1 auto; min-width: 0; max-width: 230px; }
.esc-pasos { flex: 0 0 auto; display: inline-flex; gap: 2px; }
.esc-paso, .esc-lista-btn, .esc-cerrar { flex: 0 0 auto; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%;
  background: none; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.esc-paso:hover, .esc-lista-btn:hover, .esc-cerrar:hover, .esc-lista-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }
.esc-paso:disabled, .esc-paso:disabled:hover { opacity: .35; cursor: default; background: none; color: var(--text); }
.esc-paso svg, .esc-lista-btn svg, .esc-cerrar svg { width: 18px; height: 18px; fill: currentColor; }
/* escritorio: los dos grupos se funden en una fila; el orden lo pone el CSS */
.esc-g1, .esc-g2 { display: contents; }
.esc-play { order: 0; }
.esc-titulo { order: 1; }
.esc-pasos { order: 2; }
.esc-barra { order: 3; flex: 1; }
.esc-fila .pild-t { order: 4; }
.esc-fila .pild-vol { order: 5; }
.esc-lista-btn { order: 6; }
.esc-cerrar { order: 7; }
.escucha .pild-vbar { height: 3px; opacity: .85; }  /* la de volumen, corta y más discreta que el progreso */
.esc-lista { position: absolute; right: 12px; bottom: calc(100% + 8px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-s, 10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14); max-height: 40vh; overflow: auto; min-width: 230px; }
.esc-lista button { display: block; width: 100%; text-align: left; background: none; color: var(--text); border: 0;
  border-radius: 8px; padding: 8px 10px; min-height: 0; font-weight: 500; font-size: 14px; }
.esc-lista button:hover { background: var(--accent-soft); color: var(--accent); }
.esc-lista button.actual { color: var(--accent); font-weight: 700; }
@media (max-width: 640px) {      /* fila 1: solo mandos; fila 2: tiempo · progreso largo · volumen corto (en iOS, pildora.js deja solo el silencio) */
  body.escuchando { padding-bottom: 96px; }
  .esc-fila { display: block; padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); }
  .esc-g1, .esc-g2 { display: flex; align-items: center; gap: 4px; min-width: 0; }
  .esc-g2 { margin-top: 4px; gap: 8px; }
  .esc-play { width: 40px; height: 40px; min-height: 40px; }
  .esc-titulo { flex: 1 1 auto; max-width: none; margin-left: 4px; }
  .esc-paso, .esc-lista-btn, .esc-cerrar { width: 40px; height: 40px; min-height: 40px; }
  .esc-fila .pild-t { order: 0; }
  .esc-barra { order: 1; flex: 1; }
  .esc-fila .pild-vol { order: 2; }
}

/* «Continuar: Art. 27 · 1:23» (pildora.js, montarReanudar): el botón flotante para seguir donde se dejó la escucha.
   Desaparece al primer play (la barra toma el mando). En móvil, por encima de la barra de navegación inferior. */
.esc-continuar { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 89;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-l); }
.esc-continuar svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.esc-continuar:hover { filter: brightness(1.06); }
@media (max-width: 860px) {
  .esc-continuar { right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* karaoke (pildora.js, resaltar): el párrafo que está sonando, con un realce suave que no molesta para leer */
.ley-art p.sonando-p { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); border-radius: 4px; }

/* ---------- cambios de las leyes (opos/cambios_leyes.py): etiqueta en el artículo y página /ley/<slug>/cambios ---------- */
.ley-cambio { margin: 4px 0 10px; }
.ley-cambio > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 3px 10px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.ley-cambio > summary::-webkit-details-marker { display: none; }
.ley-cambio > summary::before { content: "↻"; font-weight: 800; }
.ley-cambio.lc-redaccion > summary, .ley-cambio.lc-derogado > summary { background: var(--line); color: var(--muted); }
.ley-cambio[open] > summary { margin-bottom: 8px; }
.lc-diff { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; line-height: 1.6; }
.lc-diff p { margin: 0 0 8px; }
.lc-diff p:last-child { margin: 0; }
.lc-diff del { color: var(--muted); text-decoration: line-through; background: rgba(160, 140, 130, .14); border-radius: 3px; }
.lc-diff ins { text-decoration: none; background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--accent); }
.lc-antes, .lc-ahora { padding: 2px 0 6px; }
.lc-antes { color: var(--muted); }
.lc-antes p { text-decoration: line-through; text-decoration-color: rgba(120, 100, 90, .45); }
.lc-ahora { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.lc-antes > b, .lc-ahora > b { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; color: var(--muted); }
.lc-ahora > b { color: var(--accent); }
.ley-cambios { max-width: 860px; }
.lc-lista { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.lc-item { padding: 14px 16px; }
.lc-cab { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.lc-fecha { color: var(--muted); font-weight: 700; font-size: 14px; }
.lc-tipo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.lc-cifra .lc-tipo .chip { background: var(--accent-soft); color: var(--accent); }
.lc-diff .lc-salto { color: var(--muted); margin: 0 0 6px; line-height: 1; }
