/* Los dos temas del sistema. Este es el ÚNICO archivo con colores literales: todo lo demás usa var().
   El script de index.html fija siempre data-theme a "light" o "dark", nunca lo deja sin valor, por eso
   bastan dos bloques planos y la paleta oscura no se repite dentro de una media query.
   Contrastes medidos en test/tokens.test.ts.
   Importante para quien edite este archivo: no metas comentarios DENTRO de los bloques :root, ni
   siquiera entre declaraciones. tokensIn (test/helpers/contrast.ts) trocea por ";" y usa el primer
   ":" de cada trozo para separar nombre y valor; un comentario pegado a una declaración se cuela en
   el nombre y esa declaración desaparece en silencio para los tests. Coloca las explicaciones aquí,
   en la cabecera.
   --border-strong es una línea neutra con más peso que --border-subtle, para elementos gráficos
   funcionales (las cuerdas del mástil) que necesitan al menos 3 a 1 de contraste sobre --bg-panel,
   no solo separar bloques.
   --text-muted ya NO es decorativo: la §1 de la spec de la interfaz oscura lo define como "el suelo
   de contraste", y la §2 lo asigna a las etiquetas de sección, que son texto. Por eso el oscuro sube
   de #82828B a #9A9AA4 (6,2:1 sobre --bg-panel) y el test le exige 4,5:1 como a cualquier otro texto,
   no el antiguo suelo de 3:1. El claro (#67676F) ya cumplía ese listón y se queda como está.
   --danger-soft/--danger-text son el par de "silenciado" (§1 y §6): sustituyen al relleno de --error
   pleno que el rediseño del reproductor dejó marcado como deuda en su entrega. --danger-text se mide
   sobre --danger-soft MEZCLADO con la superficie que hay detrás, no sobre la superficie desnuda: el
   token es translúcido. La opacidad difiere entre temas (.28 en oscuro, .14 en claro) porque un
   mismo velo rojo tiñe mucho más sobre un fondo claro que sobre uno oscuro.
   --accent-text es el acento LEGIBLE COMO TEXTO sobre --accent-soft (estado activo de un toggle, §1).
   --accent no sirve para eso: medido sobre el relleno suave da 3,6-4,2:1 en claro y 4,2:1 sobre
   --bg-control en oscuro, por debajo del 4,5:1 que exige la §9.5. Hoy coincide en valor con
   --accent-hover en los dos temas, y aun así es un token aparte a propósito: son roles distintos y un
   retoque futuro del hover no debe poder bajar en silencio el contraste de todos los toggles. Su
   suelo se mide en tokens.test.ts contra --accent-soft mezclado sobre las tres superficies.
   --cover-veil/--cover-chip/--cover-ink son el trío de la zona de portada del catálogo. Cambian de
   POLARIDAD con el tema, y es a propósito: el velo existe para separar el texto de las esquinas de
   la fotografía que habrá detrás, y la dirección en que tiene que separarlo depende del color de la
   tinta. En oscuro la tinta es clara, así que el velo oscurece y las pastillas son casi negras; en
   claro la tinta es oscura y ocurre lo contrario. Un velo oscuro fijo dejaría --cover-ink del tema
   claro (casi negro) ilegible sobre su propia esquina. Mientras no haya portadas, el fondo de la
   zona es --bg-control liso y ese par es el que mide tokens.test.ts.
   --panel-float-shadow es la PRIMERA sombra de la interfaz además de la del papel. Existe porque el
   panel derecho, cuando no cabe en el flujo, se superpone a la hoja y necesita separarse de ella por
   su borde izquierdo: sin esa separación el panel y la partitura se leen como una sola superficie.
   Es más densa en oscuro que en claro por la misma razón que el resto de sombras oscuras: sobre un
   fondo casi negro una sombra suave no se ve.
   --dialog-shadow es la SEGUNDA sombra: la del diálogo modal. Necesita ser más marcada que la del
   panel flotante porque el diálogo flota sobre una página atenuada por --scrim, no sobre un panel.
   Sin esa separación extra, el diálogo se confundirá con el fondo oscurecido.
   --bg-lcd/--lcd-dim son la pantalla de posición del transporte (LCD). --bg-lcd es su fondo, más
   hundido que el panel en oscuro y un gris cálido en claro; --lcd-dim es solo para los ceros de
   relleno del compás, decorativos a propósito (el número que importa va en --text-primary), por
   eso no se le exige contraste de texto.
   --band-* son las franjas de posición del mástil (activa y vecina).
   --fb-* y --deg* son los puntos del mástil (2026-10-02, mock design/mock-mastil-notas.html).
   --fb-scale-bg es el relleno propio de la nota de escala: antes era --bg-control, casi del mismo gris
   que el panel, y la nota no se distinguía; su texto es --text-primary. --fb-scale-edge es su borde y
   se le exige 3:1 sobre el panel porque es lo que identifica el punto (objeto gráfico). --fb-pip es la
   marca sin texto del estilo «Foco»: decorativa, solo se le pide que se vea. Los halos son decorativos.
   --deg3/--deg5 (tercera y quinta del estilo «Grados en color») siguen el patrón del acento: color
   pleno para aro y relleno de lo que suena (con --on-accent encima), -soft para el relleno de fondo y
   -text para el grado escrito sobre ese relleno. Es el único sitio de la interfaz con más de un acento,
   por decisión del propietario.
   Paleta «Nueva» (2026-11-13, maqueta design/maqueta-estilo-fretlark.html, aprobada por el propietario):
   grises neutros y azul de sistema en lugar de los grises cálidos y el ámbar. El relleno de acento es
   el mismo azul en los dos temas con texto blanco encima; por eso --accent ya no se usa como TEXTO
   sobre el panel (en oscuro no llegaría a 4,5:1): el acento legible es siempre --accent-text. La
   quinta del mástil pasa de índigo a naranja para no confundirse con la tónica, ahora azul, y la
   tercera y la quinta usan el mismo relleno en los dos temas porque llevan texto blanco encima.
   Acento naranja (2026-11-15, a petición del propietario, «como el de Cloudflare»): el acento pasa de
   azul a naranja. El #F38020 de Cloudflare con texto blanco solo da 2,6:1, así que el texto sobre el
   relleno de acento (--on-accent) pasa a casi negro en los dos temas. En oscuro el relleno es el
   #F38020 tal cual; en claro baja a #E06A0B para llegar a 3:1 sobre el panel blanco. La quinta del
   mástil intercambia el color con la tónica y pasa al azul de antes. --on-deg es el texto blanco
   sobre los rellenos plenos de tercera y quinta, que antes compartían --on-accent.
   Acento ámbar dorado (2026-11-16, a petición del propietario, que no quería el naranja): el relleno
   es oro, con el mismo texto casi negro encima. En claro baja a #B88200 para llegar a 3:1 sobre el
   panel blanco (el #F2A900 de la maqueta solo daba 2:1); en oscuro es #E6A200 y no más claro, porque
   un ámbar más vivo llegaría a 4,5:1 sobre su propio relleno suave y el test que justifica
   --accent-text fallaría. En oscuro se parece al --warning; los avisos no dependen solo del color.
   --accent-fill (2026-11-16, a petición del propietario: en claro el ámbar quedaba apagado) es el
   relleno que lleva texto encima (--on-accent): botón principal, reproducir, insignias, compás que
   suena, tónica que suena y tecla de piano. Lo que se lee ahí es el texto, así que el relleno no
   necesita 3:1 sobre el panel y en claro puede ser el ámbar brillante #F2A900. --accent se queda
   para lo que se ve sin texto (bordes, líneas, barras de progreso, puntos, iconos), que sí lo
   necesita. --accent-hover es el hover de --accent-fill. En oscuro los dos valen lo mismo.
   --accent-soft (2026-11-16) sale del ámbar brillante y va más cargado (24 % en claro, 28 % en
   oscuro) porque los botones y chips activos ya no llevan borde de acento: el velo solo tiene que
   leerse como ámbar y no como gris.
   Acento azul AnkiWeb (2026-11-16, a petición del propietario, «los colores de apps.ankiweb.net»):
   --accent es su primary del tema claro, hsl(208 65% 55%) = #4291D7, y en oscuro su primary oscuro,
   hsl(205 67% 62%) = #5DA9DF; los dos llegan a 3:1 sobre su panel. El botón principal copia su
   degradado hacia la derecha («brillo»): de --accent-fill-from (#358AD4, su primary-darker) a
   --accent-fill-to (#5DA9DF), igual en los dos temas. AnkiWeb pone texto blanco encima, pero eso da
   3,4-3,7:1; --on-accent sigue casi negro, como en su tema oscuro, y el test mide los dos extremos
   del degradado. Los rellenos planos (insignias, tónica que suena) usan --accent-fill. La quinta del
   mástil vuelve al naranja para no confundirse con la tónica azul, como con el azul de sistema.
*/
:root {
  color-scheme: light;
  --bg-base:#F5F5F7; --bg-panel:#FFFFFF; --bg-control:#EFEFF1; --bg-control-hover:#E5E5EA;
  --border-subtle:#E3E3E8;
  --text-primary:#1D1D1F; --text-secondary:#636366; --text-muted:#636366;
  --accent:#4291D7; --accent-fill:#4291D7; --accent-fill-from:#358AD4; --accent-fill-to:#5DA9DF; --accent-hover:#5DA9DF; --accent-soft:rgba(66,145,215,.20); --accent-text:#1B5D98; --on-accent:#1D1D1F; --on-deg:#FFFFFF;
  --paper:#FFFFFF; --paper-ink:#000000; --paper-shadow:0 4px 20px rgba(0,0,0,.10); --accent-on-paper:#1B5D98;
  --panel-float-shadow:-8px 0 20px rgba(0,0,0,.14);
  --dialog-shadow:0 24px 60px rgba(0,0,0,.16),0 8px 20px rgba(0,0,0,.08);
  --scrim:rgba(20,20,22,.42);
  --media-overlay:rgba(0,0,0,.48); --on-media:#FFFFFF;
  --mark:rgba(0,0,0,.08);
  --border-strong:#8E8E93;
  --success:#1F7A30; --warning:#8A5B00; --error:#B3261E;
  --danger-soft:rgba(185,28,28,.14); --danger-text:#9F1B15;
  --cover-veil:rgba(255,255,255,.55); --cover-chip:rgba(255,255,255,.82); --cover-ink:#1D1D1F;
  --bg-lcd:#ECECEF; --lcd-dim:#AEAEB2;
  --band-active:rgba(66,145,215,.12); --band-active-edge:rgba(66,145,215,.60);
  --band-nb:rgba(29,29,31,.04); --band-nb-edge:rgba(29,29,31,.30);
  --fb-scale-bg:#E5E5EA; --fb-scale-edge:#8E8E93; --fb-on-halo:rgba(66,145,215,.32); --fb-out-halo:rgba(29,29,31,.25); --fb-pip:#C7C7CC;
  --deg3:#0D7F76; --deg3-soft:rgba(13,127,118,.14); --deg3-text:#0A5F58;
  --deg5:#B8560C; --deg5-soft:rgba(184,86,12,.13); --deg5-text:#8A3F07;
  --font-sans:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Instrument Sans', system-ui, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-base:#161618; --bg-panel:#1F1F22; --bg-control:#2C2C30; --bg-control-hover:#38383D;
  --border-subtle:#2E2E33;
  --text-primary:#F5F5F7; --text-secondary:#A1A1A6; --text-muted:#98989D;
  --accent:#5DA9DF; --accent-fill:#5DA9DF; --accent-fill-from:#358AD4; --accent-fill-to:#5DA9DF; --accent-hover:#74B7E7; --accent-soft:rgba(93,169,223,.26); --accent-text:#89C8F5; --on-accent:#1D1D1F; --on-deg:#FFFFFF;
  --paper:#FFFFFF; --paper-ink:#000000; --paper-shadow:0 8px 32px rgba(0,0,0,.45); --accent-on-paper:#1B5D98;
  --panel-float-shadow:-8px 0 24px rgba(0,0,0,.50);
  --dialog-shadow:0 24px 60px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.06);
  --scrim:rgba(0,0,0,.62);
  --media-overlay:rgba(0,0,0,.55); --on-media:#FFFFFF;
  --mark:rgba(255,255,255,.10);
  --border-strong:#6E6E76;
  --success:#30D158; --warning:#FFB340; --error:#FF453A;
  --danger-soft:rgba(185,28,28,.28); --danger-text:#F2A3A3;
  --cover-veil:rgba(0,0,0,.42); --cover-chip:rgba(18,18,20,.72); --cover-ink:#F5F5F7;
  --bg-lcd:#0B0B0D; --lcd-dim:#3A3A3F;
  --band-active:rgba(93,169,223,.12); --band-active-edge:rgba(93,169,223,.60);
  --band-nb:rgba(245,245,247,.04); --band-nb-edge:rgba(245,245,247,.34);
  --fb-scale-bg:#3A3A3F; --fb-scale-edge:#7C7C80; --fb-on-halo:rgba(93,169,223,.38); --fb-out-halo:rgba(245,245,247,.28); --fb-pip:#48484A;
  --deg3:#0D7F76; --deg3-soft:rgba(13,127,118,.28); --deg3-text:#8FE0D6;
  --deg5:#B8560C; --deg5-soft:rgba(184,86,12,.28); --deg5-text:#FFC08A;
  --font-sans:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Instrument Sans', system-ui, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, monospace;
}

/* Sección de teoría (#192). Va detrás de una copia de src/styles/tokens.css (la añade build.ts): aquí
   solo hay variables del tema, ningún color literal, igual que en el resto de la app. Detrás va
   src/styles/theory-content.css (enlaces, botones, diagramas, ejercicios…), que comparte con la app: aquí
   queda solo el marco de las páginas públicas. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg-base); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 2; background: var(--bg-control); padding: 6px 12px; }

.th-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-panel);
}
.th-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.th-brand svg { width: 26px; height: 26px; fill: var(--accent); }
.th-section { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600; }
.th-lang { margin-left: auto; position: relative; }
.th-lang summary { cursor: pointer; color: var(--text-secondary); font-size: 14px; }
.th-lang ul {
  position: absolute; right: 0; z-index: 3; margin: 6px 0 0; padding: 6px; list-style: none;
  background: var(--bg-control); border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: var(--dialog-shadow);
}
.th-lang li a { display: block; padding: 4px 10px; font-size: 14px; white-space: nowrap; color: var(--text-primary); text-decoration: none; }
.th-lang li a[aria-current] { color: var(--accent-text); font-weight: 600; }

.th-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 12px; }
.th-lead { font-size: 17px; color: var(--text-secondary); }
.th-meta { color: var(--text-muted); font-size: 14px; }
.th-crumbs { font-size: 14px; color: var(--text-muted); }

.th-cards { list-style: none; padding: 0; display: grid; gap: 12px; }
.th-card { background: var(--bg-panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 4px 20px 8px; }
.th-card h3 a { color: var(--text-primary); }
.th-audience { color: var(--accent-text); font-weight: 600; margin: 0; }
.th-start { margin-top: 20px; }
.th-soon ul { color: var(--text-secondary); }

.th-lessons { padding-left: 24px; }
.th-lessons li { margin: 12px 0; }
.th-lessons li > a { font-weight: 600; }
.th-lessons li p { margin: 2px 0 0; color: var(--text-secondary); }
.th-lessons li.is-read::marker { color: var(--success); }
.th-read { color: var(--success); font-size: 14px; }
.th-lessons-compact { margin: 8px 0 12px; }
.th-lessons-compact li { margin: 4px 0; }
.th-lessons-compact li > a { font-weight: 500; }

.th-foot { display: flex; gap: 16px; justify-content: center; padding: 24px 16px; font-size: 14px; border-top: 1px solid var(--border-subtle); }
.th-lang-list { list-style: none; padding: 0; }
.th-lang-list li { margin: 8px 0; }

@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  .th-top { gap: 12px; }
  .th-top .th-btn { height: 32px; padding: 0 11px; }
  .th-brand-name, .th-lang-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* El cuerpo de una lección de teoría: prosa, diagramas (mástil, teclado, pentagrama, ritmo) y tarjetas de
   ejercicio. Lo comparten las páginas públicas (`scripts/theory/build.ts` lo añade detrás de `theory.css`, y el
   `<body>` lleva `th-content`) y la página de Teoría de la app (`TheoryPage`, en el artículo de la lección).
   Todo va bajo `:where(.th-content)`: fuera de ese contenedor no toca nada (el mástil del reproductor usa los
   mismos nombres `.fretboard` y `.fb-*` en `song.css`), y `:where` no suma especificidad, así que las páginas
   públicas se ven como antes de separar el fichero. Solo variables del tema, ningún color literal. */
:where(.th-content) a { text-decoration: underline; }
:where(.th-content) a { color: var(--accent-text); text-underline-offset: 2px; }
:where(.th-content) a:hover { color: var(--accent-hover); }
:where(.th-content) .th-btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 15px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-control); color: var(--text-primary); font: 600 14px var(--font-sans); text-decoration: none; cursor: pointer;
}
:where(.th-content) .th-btn:hover { background: var(--bg-control-hover); color: var(--text-primary); }
:where(.th-content) .th-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
:where(.th-content) .th-btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
:where(.th-content) .th-mark[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
:where(.th-content) h2 { font-size: 20px; margin: 32px 0 8px; }
:where(.th-content) h3 { font-size: 17px; margin: 24px 0 6px; }
:where(.th-content) .th-note { font-size: 14px; color: var(--text-secondary); border-left: 3px solid var(--border-strong); padding-left: 10px; }
:where(.th-content) .th-lesson code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-control); padding: 1px 5px; border-radius: 4px; }
:where(.th-content) .th-lesson blockquote { margin: 16px 0; padding: 8px 16px; background: var(--bg-panel); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
:where(.th-content) .th-lesson table { border-collapse: collapse; margin: 12px 0; display: block; overflow-x: auto; }
:where(.th-content) .th-lesson th, :where(.th-content) .th-lesson td { border: 1px solid var(--border-subtle); padding: 6px 12px; text-align: left; vertical-align: top; }
:where(.th-content) .th-lesson th { background: var(--bg-panel); font-weight: 600; }
/* Las columnas de cifras o de notas sueltas (lo que el Markdown alinea con `:-:` o `-:`) mandan sobre el `left`. */
:where(.th-content) .th-lesson .th-grid th:not(:first-child), :where(.th-content) .th-lesson .th-grid td:not(:first-child) { text-align: center; }
:where(.th-content) .th-lesson th[align="center"], :where(.th-content) .th-lesson td[align="center"] { text-align: center; }
:where(.th-content) .th-lesson th[align="right"], :where(.th-content) .th-lesson td[align="right"] { text-align: right; font-variant-numeric: tabular-nums; }
:where(.th-content) .th-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
:where(.th-content) .th-pager a { display: block; padding: 12px 16px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-panel); text-decoration: none; color: var(--text-primary); }
:where(.th-content) .th-pager a span { display: block; font-size: 14px; color: var(--text-muted); }
:where(.th-content) .th-pager a[rel="next"], :where(.th-content) .th-pager a:last-child { text-align: right; }
/* Diagrama del mástil (scripts/theory/fretboard.ts). */
:where(.th-content) .fretboard { margin: 20px 0; padding: 12px; background: var(--bg-panel); border: 1px solid var(--border-subtle); border-radius: 12px; }
/* A su tamaño y centrado: `--fig-w` es el ancho al que se dibuja el SVG (lo pone el build); el marco no se
   estira más allá, y en una columna estrecha se queda en el 100 % y el SVG se desplaza dentro. */
:where(.th-content) .fretboard[style*="--fig-w"] { box-sizing: border-box; width: calc(var(--fig-w) + 26px); max-width: 100%; margin-inline: auto; }
/* Figuras seguidas, para compararlas: lado a lado mientras quepan, y si no, en la fila siguiente. */
:where(.th-content) .th-figs { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px 16px; margin: 20px 0; }
/* Todas a una misma escala, la del `viewBox` (el build dibuja cada tipo a 1,6 veces —teclado, pentagrama—,
   1,25 —mástil— o 1,2 —ritmo—, y aquí se deshace), para que lo que se compara se vea del mismo tamaño
   aunque una baje a la fila siguiente, y para que dos teclados quepan en la columna. A esa escala el
   `min-width` que el build pone en el SVG estorba: se quita (el `!important` gana al estilo en línea). */
:where(.th-content) .th-figs > .fretboard { flex: 0 1 auto; width: calc(var(--fig-w) * .625 + 26px); margin: 0; }
:where(.th-content) .th-figs > .fretboard:not(.keyboard):not(.staff):not(.rhythm) { width: calc(var(--fig-w) * .8 + 26px); }
:where(.th-content) .th-figs > .fretboard.rhythm { width: calc(var(--fig-w) * .84 + 26px); }
:where(.th-content) .th-figs svg { min-width: 0 !important; }
:where(.th-content) .fretboard-scroll { overflow-x: auto; }
:where(.th-content) .fretboard svg { display: block; width: 100%; height: auto; margin-inline: auto; }
:where(.th-content) .fretboard figcaption { margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
:where(.th-content) .fb-string, :where(.th-content) .fb-fret { stroke: var(--border-strong); stroke-width: 1; }
:where(.th-content) .fb-nut { stroke: var(--text-primary); stroke-width: 4; }
:where(.th-content) .fb-inlay { fill: var(--border-subtle); }
:where(.th-content) .fb-fretno { fill: var(--text-muted); font-size: 12px; text-anchor: middle; font-family: var(--font-sans); }
:where(.th-content) .fb-dot circle { stroke-width: 2; }
:where(.th-content) .fb-x { fill: var(--text-secondary); font-size: 18px; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: var(--font-sans); }
:where(.th-content) .fb-dot text { font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: var(--font-sans); }
:where(.th-content) .fb-root circle { fill: var(--accent); stroke: var(--accent); }
:where(.th-content) .fb-root text { fill: var(--on-accent); }
:where(.th-content) .fb-third circle { fill: var(--deg3); stroke: var(--deg3); }
:where(.th-content) .fb-third text { fill: var(--on-accent); }
:where(.th-content) .fb-fifth circle { fill: var(--deg5); stroke: var(--deg5); }
:where(.th-content) .fb-fifth text { fill: var(--on-accent); }
:where(.th-content) .fb-blue circle { fill: var(--bg-control); stroke: var(--deg5); stroke-dasharray: 3 2; }
:where(.th-content) .fb-blue text { fill: var(--text-primary); }
:where(.th-content) .fb-color circle { fill: var(--bg-control); stroke: var(--accent); stroke-width: 2.5; }
:where(.th-content) .fb-color text { fill: var(--text-primary); }
:where(.th-content) .fb-scale circle { fill: var(--fb-scale-bg); stroke: var(--fb-scale-edge); }
:where(.th-content) .fb-scale text { fill: var(--text-primary); }
:where(.th-content) .fb-muted circle { fill: var(--bg-panel); stroke: var(--fb-scale-edge); stroke-dasharray: 2 2; }
:where(.th-content) .fb-muted text { fill: var(--text-muted); }
:where(.th-content) .fb-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 8px 0 0; font-size: 14px; color: var(--text-secondary); }
:where(.th-content) .fb-legend li { display: inline-flex; align-items: center; gap: 6px; }
:where(.th-content) .fb-key { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; display: inline-block; }
:where(.th-content) .fb-key.fb-root { background: var(--accent); border-color: var(--accent); }
:where(.th-content) .fb-key.fb-third { background: var(--deg3); border-color: var(--deg3); }
:where(.th-content) .fb-key.fb-fifth { background: var(--deg5); border-color: var(--deg5); }
:where(.th-content) .fb-key.fb-blue { background: var(--bg-control); border-color: var(--deg5); border-style: dashed; }
:where(.th-content) .fb-key.fb-color { background: var(--bg-control); border-color: var(--accent); border-width: 2px; }
:where(.th-content) .fb-key.fb-scale { background: var(--fb-scale-bg); border-color: var(--fb-scale-edge); }
:where(.th-content) .fb-key.fb-muted { background: var(--bg-panel); border-color: var(--fb-scale-edge); border-style: dashed; }

/* Teclado (scripts/theory/keyboard.ts): las notas marcadas reutilizan los puntos del mástil (.fb-dot). */
:where(.th-content) .kb-white { fill: var(--paper); stroke: var(--border-strong); stroke-width: 1; }
:where(.th-content) .kb-black { fill: var(--paper-ink); }
:where(.th-content) .kb-step { fill: var(--text-secondary); font-size: 12px; font-weight: 700; text-anchor: middle; font-family: var(--font-sans); }

/* Pentagrama (scripts/theory/staff.ts): símbolos de Bravura en contornos. */
:where(.th-content) .st-line, :where(.th-content) .st-ledger { stroke: var(--text-secondary); stroke-width: 1; }
:where(.th-content) .st-bar { stroke: var(--text-primary); stroke-width: 1.5; }
:where(.th-content) .st-glyph, :where(.th-content) .st-note { fill: var(--text-primary); }
:where(.th-content) .st-hl { fill: var(--accent); }
:where(.th-content) .st-label { fill: var(--text-secondary); font-size: 12px; font-weight: 700; text-anchor: middle; font-family: var(--font-sans); }
:where(.th-content) .st-hl-text { fill: var(--accent-text); }

/* Rejilla de ritmo (scripts/theory/rhythm.ts). */
:where(.th-content) .rh-cell { fill: var(--bg-base); stroke: var(--border-subtle); stroke-width: 1; }
:where(.th-content) .rh-beat { fill: var(--bg-control); }
:where(.th-content) .rh-bar { stroke: var(--text-primary); stroke-width: 2; }
:where(.th-content) .rh-hit { fill: var(--accent); }
:where(.th-content) .rh-hold { fill: var(--accent); opacity: .45; }
:where(.th-content) .rh-accent-mark { fill: var(--accent-text); font-size: 14px; font-weight: 700; text-anchor: middle; font-family: var(--font-sans); }
:where(.th-content) .rh-count { fill: var(--text-muted); font-size: 12px; text-anchor: middle; font-family: var(--font-sans); }
:where(.th-content) .rh-count-beat { fill: var(--text-primary); font-weight: 700; }
:where(.th-content) .rh-meter { fill: var(--text-primary); font-size: 18px; font-weight: 700; text-anchor: middle; font-family: var(--font-sans); }

/* Ejercicio de la biblioteca dentro de una lección: tarjeta estática y, al pulsar «Escuchar», el reproductor. */
:where(.th-content) .th-exercise {
  margin: 20px 0; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-panel);
}
:where(.th-content) .th-ex-meta { margin: 0; color: var(--text-secondary); font-size: 13px; }
:where(.th-content) .th-ex-name { margin: 2px 0 6px; font-size: 17px; }
:where(.th-content) .th-ex-desc { margin: 0 0 12px; font-size: 15px; color: var(--text-secondary); }
:where(.th-content) .th-ex-frame { display: block; width: 100%; height: 240px; border: 0; border-radius: 8px; background: var(--bg-base); }
:where(.th-content) .th-ex-play { gap: 6px; }
/* Dentro de la app, `song.css` da a estos mismos nombres propiedades del mástil del reproductor (que es HTML
   y no SVG): se devuelven a su valor inicial para que el diagrama se vea como en las páginas públicas. */
:where(.th-content) .fretboard { position: static; }
:where(.th-content) .fretboard-scroll { overscroll-behavior-x: auto; }
:where(.th-content) .fb-dot { display: inline; position: static; border: 0; background: none; letter-spacing: normal; transition: none; }
:where(.th-content) .fb-legend { align-items: normal; }

@media (max-width: 560px) {
  :where(.th-content) .th-pager { grid-template-columns: 1fr; }
}
