/* =========================================================================
   Acordia · Tema de marca sobre Bootstrap 5.3.3
   Paleta "Atacama dorada" · Marcellus (títulos) + Work Sans (texto)
   Estilo: plano, tipo serigrafía/linóleo. Sin degradados, sin sombras,
   sin brillos. Formas geométricas y mucho espacio vacío.

   Cómo se usa:
   1. Cargar bootstrap.min.css ANTES de este archivo.
   2. <html data-bs-theme="dark"> es el modo por defecto (Noche).
      data-bs-theme="light" activa el modo Marfil.
   3. Todo color sale de los tokens --ac-*. Bootstrap lee sus --bs-*,
      que aquí apuntan a los tokens. Para cambiar la marca, cambia
      solo el bloque 1.
   ========================================================================= */

/* 1. Tokens de marca (valores fijos, no cambian con el tema) ------------- */
:root {
  --ac-noche:       #191430;
  --ac-noche-2:     #221c40;   /* superficie sobre noche */
  --ac-noche-3:     #342c5c;   /* línea sobre noche */
  --ac-marfil:      #f1ece2;
  --ac-marfil-2:    #e7e0d1;   /* superficie sobre marfil */
  --ac-marfil-3:    #d3c9b4;   /* línea sobre marfil */
  --ac-oro:         #d4a64a;
  --ac-oro-claro:   #e2bb69;
  --ac-oro-osc:     #7a5712;
  --ac-jade:        #5fb39b;
  --ac-jade-osc:    #2e6f5e;

  --ac-font-display: "Marcellus", "Trajan Pro", Georgia, "Times New Roman", serif;
  --ac-font-text:    "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ac-radius:      4px;       /* esquinas casi rectas: grabado, no app genérica */
  --ac-arch:        999px 999px 0 0; /* el portal: forma firma de Acordia */
  --ac-space:       clamp(4rem, 8vw, 7rem); /* respiro entre secciones */
}

/* 2. Roles semánticos · modo Noche (por defecto) ------------------------- */
:root,
:root[data-bs-theme="dark"] {
  color-scheme: dark;
  --ac-bg:          var(--ac-noche);
  --ac-surface:     var(--ac-noche-2);
  --ac-line:        var(--ac-noche-3);
  --ac-fg:          var(--ac-marfil);
  --ac-fg-muted:    #bcb5cc;
  --ac-accent:      var(--ac-oro);        /* oro para texto y enlaces */
  --ac-accent-rgb:  212, 166, 74;
  --ac-accent-hover:var(--ac-oro-claro);
  --ac-accent-hover-rgb: 226, 187, 105;
  --ac-second:      var(--ac-jade);       /* jade para texto */
  --ac-second-rgb:  95, 179, 155;
  --ac-fill:        var(--ac-oro);        /* rellenos de botón */
  --ac-on-fill:     var(--ac-noche);
  --ac-fill-2:      var(--ac-jade);
  --ac-on-fill-2:   var(--ac-noche);
}

/* 3. Roles semánticos · modo Marfil ------------------------------------- */
:root[data-bs-theme="light"] {
  color-scheme: light;
  --ac-bg:          var(--ac-marfil);
  --ac-surface:     var(--ac-marfil-2);
  --ac-line:        var(--ac-marfil-3);
  --ac-fg:          var(--ac-noche);
  --ac-fg-muted:    #57506d;
  --ac-accent:      var(--ac-oro-osc);
  --ac-accent-rgb:  122, 87, 18;
  --ac-accent-hover:#5a3f0b;
  --ac-accent-hover-rgb: 90, 63, 11;
  --ac-second:      var(--ac-jade-osc);
  --ac-second-rgb:  46, 111, 94;
  --ac-fill:        var(--ac-oro);
  --ac-on-fill:     var(--ac-noche);
  --ac-fill-2:      var(--ac-jade-osc);
  --ac-on-fill-2:   var(--ac-marfil);
}

/* 4. Bootstrap ← tokens --------------------------------------------------- */
:root,
:root[data-bs-theme="dark"],
:root[data-bs-theme="light"] {
  --bs-font-sans-serif: var(--ac-font-text);
  --bs-body-font-family: var(--ac-font-text);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.6;
  --bs-body-bg: var(--ac-bg);
  --bs-body-bg-rgb: 25, 20, 48;
  --bs-body-color: var(--ac-fg);
  --bs-emphasis-color: var(--ac-fg);
  --bs-heading-color: var(--ac-fg);
  --bs-secondary-color: var(--ac-fg-muted);
  --bs-tertiary-color: var(--ac-fg-muted);
  --bs-secondary-bg: var(--ac-surface);
  --bs-tertiary-bg: var(--ac-surface);
  --bs-border-color: var(--ac-line);
  --bs-border-color-translucent: var(--ac-line);
  --bs-border-radius: var(--ac-radius);
  --bs-border-radius-sm: 2px;
  --bs-border-radius-lg: 6px;
  --bs-border-radius-xl: 8px;
  --bs-border-radius-pill: 999px;
  --bs-box-shadow: none;
  --bs-box-shadow-sm: none;
  --bs-box-shadow-lg: none;

  --bs-primary: var(--ac-oro);
  --bs-primary-rgb: 212, 166, 74;
  --bs-primary-text-emphasis: var(--ac-accent);
  --bs-primary-bg-subtle: var(--ac-surface);
  --bs-primary-border-subtle: var(--ac-fill);
  --bs-success: var(--ac-jade);
  --bs-success-rgb: var(--ac-second-rgb);
  --bs-success-text-emphasis: var(--ac-second);
  --bs-success-bg-subtle: var(--ac-surface);
  --bs-success-border-subtle: var(--ac-second);

  --bs-link-color: var(--ac-accent);
  --bs-link-color-rgb: var(--ac-accent-rgb);
  --bs-link-hover-color: var(--ac-accent-hover);
  --bs-link-hover-color-rgb: var(--ac-accent-hover-rgb);
  --bs-link-decoration: underline;
  --bs-focus-ring-color: rgba(212, 166, 74, .55);
  --bs-focus-ring-width: 2px;
}
:root[data-bs-theme="light"] { --bs-body-bg-rgb: 241, 236, 226; }

body { background: var(--ac-bg); color: var(--ac-fg); }

/* Tipografía */
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-1, .display-2, .display-3,
.display-4, .display-5, .display-6, .ac-display {
  font-family: var(--ac-font-display);
  font-weight: 400;
  letter-spacing: .01em;
  text-wrap: balance;
}
h5, h6, .h5, .h6 { font-family: var(--ac-font-text); font-weight: 600; }
.lead { font-weight: 400; color: var(--ac-fg-muted); max-width: 38rem; }
p { max-width: 65ch; }
.ac-eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ac-second);
}
/* Biblioteca: cada artista abre su grupo con una cabecera de ancho completo */
#biblioteca { scroll-margin-top: calc(var(--ac-nav-h, 4rem) + .5rem); }
/* Buscador propio de la galería: queda fijo bajo la barra mientras se recorre la Biblioteca */
.ac-lib-search {
  position: sticky; top: var(--ac-nav-h, 4rem); z-index: 5;
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; padding: .75rem 0;
  background: var(--ac-bg); border-bottom: 1px solid var(--ac-line);
}
.ac-lib-search .form-control { flex: 1 1 12rem; min-width: 0; }
.ac-lib-count { white-space: nowrap; }
/* El botón propio reemplaza a la X diminuta del navegador, que no se entiende como «limpiar» */
.ac-lib-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.ac-lib-clear { border-color: var(--ac-oro); color: var(--ac-oro); font-weight: 600; }
.ac-lib-clear span { font-size: 1.1em; margin-right: .25rem; }
@media (max-width: 575.98px) {
  .ac-lib-search { flex-wrap: wrap; gap: .4rem .6rem; padding: .5rem 0; }
  .ac-lib-search .form-control { flex: 1 1 6rem; }
  .ac-lib-fold { order: 3; padding-inline: .6rem; font-size: .9rem; }
  .ac-lib-count { order: 4; flex: 1 1 0; min-width: 0; white-space: normal; font-size: .75rem; }
}
.ac-no-results { margin-top: 1.5rem; color: var(--ac-fg-muted); }
/* Biblioteca por artista (RD28): un panel por artista, con la intensidad según cuántos temas tiene (1 / 2 a 4 / 5 o más)
   y sin leyenda. Un solo matiz (malva, fuera de la paleta, que no choca con el oro, el jade ni la pizarra, que ya
   significan algo) en tres pasos de luminosidad: se lee solo y resiste el daltonismo. Los vecinos pueden compartir tipo,
   así que la separación la hace el panel (borde, espacio y esquinas), no el color. Valores y contrastes: RD28. */
:root { --ac-t1: #937ba6; --ac-t2: #bf92e0; --ac-t3: #e0b8fe; }
:root[data-bs-theme="light"] { --ac-t1: #806495; --ac-t2: #703c91; --ac-t3: #580d7d; }
.ac-artist-group {
  --ac-art: var(--ac-t1); --ac-art-tint: 8%; --ac-art-bw: 1px;
  margin: 0 0 1rem; padding: .65rem .75rem .75rem;
  border: var(--ac-art-bw) solid var(--ac-art); border-radius: 14px; background: var(--ac-surface);
}
/* Las fichas del artista van en fila, como siempre (3 por fila, 2 en pantallas medianas, 1 en celular): nunca se apilan
   en columnas angostas. La fila compensa sus márgenes negativos de Bootstrap para que el relleno sea parejo. */
.ac-artist-cards { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; margin-top: 0; }
/* Escritorio y tabletas: más aire dentro del panel y entre fichas; en celular se mantiene compacto. */
@media (min-width: 576px) {
  .ac-artist-group { padding: 1.1rem 1.4rem 1.4rem; margin-bottom: 1.5rem; }
  .ac-artist-cards { --bs-gutter-x: 1.1rem; --bs-gutter-y: 1.1rem; }
  .ac-artist { padding-bottom: .25rem; }
}
.ac-artist-group.ac-t2 { --ac-art: var(--ac-t2); --ac-art-tint: 13%; }
.ac-artist-group.ac-t3 { --ac-art: var(--ac-t3); --ac-art-tint: 18%; --ac-art-bw: 2px; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .ac-artist-group { background: color-mix(in srgb, var(--ac-art) var(--ac-art-tint), var(--ac-surface)); }
}
/* Un panel sin temas a la vista (buscador o filtros) desaparece entero. */
.ac-artist-group:has(> .row > .ac-artist-head[hidden]),
.ac-artist-group:has(> .row > .ac-artist-head.ac-fuera) { display: none; }
.row > .ac-artist-head { flex: 0 0 100%; width: 100%; margin-top: 0; }
.ac-artist-head { border-radius: 10px; }
.ac-artist {
  display: flex; align-items: center; gap: .6rem; margin: 0; padding: .1rem 0 .15rem;
  font-family: var(--ac-font-display); font-size: 1.3rem; line-height: 1.15; font-weight: 400; color: var(--ac-fg);
}
/* El punto cambia de forma, no solo de color: anillo, lleno y lleno con aro. */
.ac-artist-dot {
  flex: none; box-sizing: border-box; width: .75rem; height: .75rem; border-radius: 50%;
  border: 2px solid var(--ac-art); background: transparent;
}
.ac-t2 .ac-artist-dot { background: var(--ac-art); }
.ac-t3 .ac-artist-dot {
  background: var(--ac-art); margin-inline: 3px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ac-art) 18%, var(--ac-surface)), 0 0 0 4px var(--ac-art);
}
.ac-artist small {
  margin-left: auto; white-space: nowrap; padding: .1rem .6rem; border-radius: 999px;
  border: 1px solid var(--ac-art); color: var(--ac-fg);
  font-family: var(--ac-font-text); font-size: .8rem; letter-spacing: 0; text-transform: none;
}
.ac-t3 .ac-artist small { font-weight: 600; }
.ac-artist-chev { display: none; flex: none; color: var(--ac-art); transition: transform .15s; }
/* RD53: escritorio y celular iguales. Cada artista parte comprimido (una píldora con su nombre); un toque abre sus temas.
   Un botón en la barra del buscador muestra todos los temas o vuelve a dejar solo los artistas. */
.ac-lib-fold { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; border-color: var(--ac-line); color: var(--ac-fg); }
.ac-lib-fold svg { width: 16px; height: 16px; flex: none; }
.ac-lib-fold:hover { border-color: var(--ac-fill); }
.ac-artist-head[role="button"] { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.ac-artist-head[role="button"] .ac-artist { width: 100%; }
.ac-artist-head:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: 2px; }
.ac-artist-chev { display: block; }
.ac-artist-group:not(.is-open) .ac-artist-cards > .col:not(.ac-artist-head) { display: none; }
.ac-artist-group.is-open .ac-artist-chev { transform: rotate(180deg); }
@media (max-width: 575.98px) {
  .ac-artist-group { margin-bottom: .5rem; padding: .15rem .65rem; border-radius: 14px; }
  .ac-artist-name { font-size: 1.1rem; }
  .ac-artist-group.is-open { padding-bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .ac-artist-chev { transition: none; } }
@media (forced-colors: active) { .ac-artist-group { border-color: CanvasText; } }
.ac-mono { font-variant-numeric: tabular-nums; }
a { text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* Selección y foco: anillo sólido, sin difuminado */
::selection { background: var(--ac-fill); color: var(--ac-on-fill); }
:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: 2px; }

/* 5. Botones -------------------------------------------------------------- */
.btn {
  --bs-btn-font-family: var(--ac-font-text);
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-padding-y: .625rem;
  --bs-btn-border-width: 2px;
  --bs-btn-box-shadow: none;
  --bs-btn-focus-box-shadow: 0 0 0 2px var(--ac-bg), 0 0 0 4px var(--ac-fill);
  letter-spacing: .01em;
  background-image: none;      /* regla de marca: nunca degradados */
}
.btn-primary {
  --bs-btn-color: var(--ac-on-fill);
  --bs-btn-bg: var(--ac-fill);
  --bs-btn-border-color: var(--ac-fill);
  --bs-btn-hover-color: var(--ac-on-fill);
  --bs-btn-hover-bg: var(--ac-oro-claro);
  --bs-btn-hover-border-color: var(--ac-oro-claro);
  --bs-btn-active-color: var(--ac-on-fill);
  --bs-btn-active-bg: #c0913a;
  --bs-btn-active-border-color: #c0913a;
  --bs-btn-disabled-color: var(--ac-on-fill);
  --bs-btn-disabled-bg: var(--ac-fill);
  --bs-btn-disabled-border-color: var(--ac-fill);
}
.btn-outline-primary {
  --bs-btn-color: var(--ac-accent);
  --bs-btn-border-color: var(--ac-accent);
  --bs-btn-hover-color: var(--ac-on-fill);
  --bs-btn-hover-bg: var(--ac-fill);
  --bs-btn-hover-border-color: var(--ac-fill);
  --bs-btn-active-color: var(--ac-on-fill);
  --bs-btn-active-bg: var(--ac-fill);
  --bs-btn-active-border-color: var(--ac-fill);
  --bs-btn-disabled-color: var(--ac-accent);
  --bs-btn-disabled-border-color: var(--ac-accent);
}
.btn-jade {
  --bs-btn-color: var(--ac-on-fill-2);
  --bs-btn-bg: var(--ac-fill-2);
  --bs-btn-border-color: var(--ac-fill-2);
  --bs-btn-hover-color: var(--ac-on-fill-2);
  --bs-btn-hover-bg: var(--ac-second);
  --bs-btn-hover-border-color: var(--ac-second);
  --bs-btn-active-color: var(--ac-on-fill-2);
  --bs-btn-active-bg: var(--ac-fill-2);
  --bs-btn-active-border-color: var(--ac-fill-2);
}
.btn-ghost {
  --bs-btn-color: var(--ac-fg);
  --bs-btn-border-color: var(--ac-line);
  --bs-btn-hover-color: var(--ac-fg);
  --bs-btn-hover-bg: var(--ac-surface);
  --bs-btn-hover-border-color: var(--ac-fg-muted);
  --bs-btn-active-bg: var(--ac-surface);
  --bs-btn-active-border-color: var(--ac-fg);
  --bs-btn-active-color: var(--ac-fg);
}

/* 6. Componentes Bootstrap ---------------------------------------------- */
.navbar {
  --bs-navbar-color: var(--ac-fg-muted);
  --bs-navbar-hover-color: var(--ac-fg);
  --bs-navbar-active-color: var(--ac-accent);
  --bs-navbar-brand-color: var(--ac-fg);
  --bs-navbar-brand-hover-color: var(--ac-fg);
  --bs-navbar-toggler-border-color: var(--ac-line);
  --bs-navbar-toggler-focus-width: 2px;
  background: var(--ac-bg);
  border-bottom: 1px solid var(--ac-line);
}
.navbar .nav-link { font-weight: 500; }
.navbar .nav-link.active { text-decoration: underline; text-underline-offset: .5em; text-decoration-thickness: 2px; }
/* Tabletas y celular en horizontal (768 a 991 px): la navegación desplegada medía 858 px a 844 px de ancho y los móviles ensanchaban toda la
   vista; se compacta para que quepa (RD30, lo vio la prueba del modo estudio a 844 px). */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar .navbar-nav { gap: 0 !important; }
  .navbar .navbar-nav .nav-link { padding-inline: .55rem; }
  .navbar .navbar-collapse .btn { --bs-btn-padding-x: .8rem; }
}

.card {
  --bs-card-bg: var(--ac-surface);
  --bs-card-border-color: var(--ac-line);
  --bs-card-border-radius: var(--ac-radius);
  --bs-card-inner-border-radius: var(--ac-radius);
  --bs-card-cap-bg: transparent;
  --bs-card-color: var(--ac-fg);
  --bs-card-spacer-y: 1.5rem;
  --bs-card-spacer-x: 1.5rem;
}
a.card { text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--ac-fill); transform: translateY(-2px); }

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--ac-fill);
  --bs-nav-pills-link-active-color: var(--ac-on-fill);
  --bs-nav-pills-border-radius: 999px;
  --bs-nav-link-color: var(--ac-fg-muted);
  --bs-nav-link-hover-color: var(--ac-fg);
  --bs-nav-link-font-weight: 600;
  gap: .25rem;
}
.nav-pills .nav-link { border: 1px solid var(--ac-line); }
.nav-pills .nav-link.active { border-color: var(--ac-fill); }

.form-control, .form-select {
  --bs-border-color: var(--ac-line);
  background-color: var(--ac-surface);
  color: var(--ac-fg);
  border-width: 2px;
  padding: .625rem .875rem;
}
.form-control::placeholder { color: var(--ac-fg-muted); opacity: 1; }
.form-control:focus, .form-select:focus {
  background-color: var(--ac-surface);
  color: var(--ac-fg);
  border-color: var(--ac-fill);
  box-shadow: none;
}
.form-label { font-weight: 600; font-size: .9rem; }
.form-check-input {
  --bs-form-check-bg: var(--ac-surface);
  border: 2px solid var(--ac-line);
}
.form-check-input:checked { background-color: var(--ac-fill-2); border-color: var(--ac-fill-2); }
.form-check-input:focus { border-color: var(--ac-fill); box-shadow: none; }
.form-switch .form-check-input:focus { --bs-form-switch-bg: none; }

.progress {
  --bs-progress-bg: var(--ac-surface);
  --bs-progress-bar-bg: var(--ac-fill-2);
  --bs-progress-height: .5rem;
  --bs-progress-border-radius: 0;
  border: 1px solid var(--ac-line);
}

.modal {
  --bs-modal-bg: var(--ac-bg);
  --bs-modal-color: var(--ac-fg);
  --bs-modal-border-color: var(--ac-fill);
  --bs-modal-border-width: 2px;
  --bs-modal-border-radius: var(--ac-radius);
  --bs-modal-header-border-color: var(--ac-line);
  --bs-modal-footer-border-color: var(--ac-line);
}
.modal-backdrop { --bs-backdrop-bg: #0b0918; --bs-backdrop-opacity: .8; }

.breadcrumb {
  --bs-breadcrumb-divider-color: var(--ac-fg-muted);
  --bs-breadcrumb-item-active-color: var(--ac-fg-muted);
  font-size: .9rem;
}
.list-group {
  --bs-list-group-bg: transparent;
  --bs-list-group-border-color: var(--ac-line);
  --bs-list-group-color: var(--ac-fg);
}
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ac-fg);
  --bs-table-border-color: var(--ac-line);
}
.btn-close { --bs-btn-close-focus-shadow: 0 0 0 2px var(--ac-fill); }
:root[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* 7. Piezas propias de Acordia ------------------------------------------ */

/* Marca */
.ac-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.ac-brand svg { width: 28px; height: 33px; flex: none; }
.ac-brand-name {
  font-family: var(--ac-font-display); font-size: 1.35rem;
  letter-spacing: .22em; color: var(--ac-fg);
}
.ac-logo-arch { stroke: var(--ac-fill); }
.ac-logo-string { stroke: var(--ac-fg); }
.ac-logo-dot { fill: var(--ac-jade); }

/* Secciones con respiro */
.ac-section { padding-block: var(--ac-space); }
.ac-section + .ac-section { border-top: 1px solid var(--ac-line); }
.ac-section-head { display: grid; gap: .75rem; margin-bottom: 2.5rem; }
.ac-section-head h2 { margin: 0; font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.ac-section-head p { margin: 0; color: var(--ac-fg-muted); }

/* Lo importante se destaca, pero sobrio: tinte dorado leve, bordes marcados y una barra de acento */
#biblioteca {
  background: color-mix(in srgb, var(--ac-oro) 6%, var(--ac-bg));
  border-block: 1px solid var(--ac-line);
}
#biblioteca + .ac-section { border-top: 0; }
.ac-score {
  padding: 1rem 1.15rem 1.15rem; border: 1px solid rgba(var(--ac-accent-rgb), .35);
  border-left: 4px solid var(--ac-oro); border-radius: var(--ac-radius);
  background: color-mix(in srgb, var(--ac-oro) 4%, var(--ac-surface));
}

.ac-score .ac-bars { border-left-color: rgba(var(--ac-accent-rgb), .45); }
.ac-score .ac-bar { border-color: rgba(var(--ac-accent-rgb), .45); }

/* Hero */
.ac-hero { padding-block: clamp(3rem, 7vw, 6rem); }
.ac-hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.05; margin: 0; }
.ac-hero-art { width: 100%; max-width: 520px; height: auto; display: block; margin-inline: auto; }

/* Ventana en arco: el portal como marco */
.ac-arch {
  border-radius: var(--ac-arch);
  border: 2px solid var(--ac-fill);
  background: var(--ac-surface);
}

/* Fichas (acordes, barrios, filtros) */
.ac-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .65rem; border: 1px solid var(--ac-line);
  border-radius: 999px; font-size: .82rem; font-weight: 500;
  color: var(--ac-fg); background: transparent; white-space: nowrap;
}
.ac-chip-chord {
  font-family: var(--ac-font-display); font-size: .95rem;
  border-color: var(--ac-fill); color: var(--ac-accent);
}
.ac-chip-ok::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--ac-second);
}
.ac-chip-example {
  border-style: dashed; color: var(--ac-fg-muted); font-size: .72rem;
  letter-spacing: .06em; text-transform: uppercase;
}

/* Pasos numerados (sí son una secuencia) */
.ac-step-num {
  font-family: var(--ac-font-display); font-size: 2.75rem; line-height: 1;
  color: var(--ac-accent);
}

/* Barrios: tarjeta con arco geométrico arriba */
.ac-barrio-icon { width: 64px; height: 64px; display: block; }

.i-oro  { fill: var(--ac-fill); }
.i-jade { fill: var(--ac-fill-2); }
.i-fg   { fill: var(--ac-fg); }
.i-line { fill: none; stroke: var(--ac-fg); }
.i-arch { fill: none; stroke: var(--ac-fill); }

/* Avatar de guía: arco con iniciales, sin fotos */
.ac-avatar {
  width: 56px; height: 64px; flex: none;
  display: grid; place-items: end center; padding-bottom: .55rem;
  border-radius: var(--ac-arch);
  background: var(--ac-fill-2); color: var(--ac-on-fill-2);
  font-family: var(--ac-font-display); font-size: 1.2rem;
}
.ac-avatar.is-oro { background: var(--ac-fill); color: var(--ac-on-fill); }

/* Precios */
.ac-plan-featured { border: 2px solid var(--ac-fill-2) !important; }
.ac-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.ac-list li { display: grid; grid-template-columns: 1rem 1fr; gap: .6rem; }
.ac-list li::before {
  content: ""; width: .55rem; height: .55rem; margin-top: .55em;
  background: var(--ac-second); transform: rotate(45deg);
}

/* Friso de arcos (divisor decorativo de color fijo) */
.ac-frieze {
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='18'%3E%3Cpath d='M4 18V11a10 10 0 0 1 20 0v7' fill='none' stroke='%23D4A64A' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: center;
  opacity: .7;
}

/* Diagrama de acorde (lo dibuja acordia.js) */
.ac-chord { display: grid; justify-items: center; gap: .25rem; }
.ac-chord-name { font-family: var(--ac-font-display); font-size: 1.4rem; color: var(--ac-accent); }
.ac-chord svg { width: 92px; height: auto; }
.ac-chord .grid { stroke: var(--ac-fg-muted); }
.ac-chord .nut { stroke: var(--ac-fg); }
.ac-chord .dot { fill: var(--ac-fill); }
.ac-chord .open { fill: none; stroke: var(--ac-second); }
.ac-chord .mute { stroke: var(--ac-fg-muted); }

/* Estructura de la canción: compases */
.ac-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 2px solid var(--ac-line); }
.ac-bar {
  padding: .7rem .5rem; border-right: 2px solid var(--ac-line);
  border-block: 1px solid var(--ac-line);
  font-family: var(--ac-font-display); font-size: 1.15rem; text-align: center;
}
.ac-bar.is-repeat { color: var(--ac-fg-muted); opacity: .75; }
.ac-bar.is-split { display: flex; padding-inline: 0; }
/* S18: casillas con 3+ acordes o nombres largos (bajos) ocupan dos columnas; en celular, la fila. */
.ac-bar.is-wide { grid-column: span 2; }
/* RD25: con mucho texto (nombres largos y ligados que repiten el nombre) no cabe en dos columnas: la fila entera. */
.ac-bar.is-dense { grid-column: 1 / -1; }
/* RD46: clave de tiempo como en una partitura: dos cifras apiladas al inicio del compás donde cambia la medida. */
.ac-bar[data-clef], .ac-st-pgc[data-clef] { position: relative; padding-inline-start: 1.3rem; }
.ac-bar[data-clef]::before, .ac-st-pgc[data-clef]::before {
  content: attr(data-cn) "\A" attr(data-cd); white-space: pre; text-align: center;
  position: absolute; left: .3rem; top: 50%; transform: translateY(-50%);
  font: 700 .75rem/.95 var(--ac-font-display); color: var(--ac-fg-muted); pointer-events: none;
}
/* Con varios acordes en la casilla no se reserva ancho: la clave va chica en la esquina para no apretar los acordes. */
.ac-bar.is-split[data-clef] { padding-inline-start: 0; }
.ac-bar.is-split[data-clef]::before { top: .15rem; transform: none; left: .2rem; font-size: .6rem; }
.ac-bar.is-wide .ac-part { flex-basis: auto !important; }  /* cada acorde parte de su propio ancho; el sobrante se reparte por duración */
.ac-part { flex-basis: 0; min-width: 0; padding-inline: .15rem; }
/* S22: silencio, tenue y sin botón */
.ac-rest { display: inline-flex; align-items: center; justify-content: center; color: var(--ac-fg-muted); opacity: .8; vertical-align: middle; }
/* RD7: ligado, el acorde que sigue sonando sin golpe nuevo: atenuado y con un arco a su izquierda */
.ac-tie { display: inline-flex; align-items: center; gap: .1rem; color: var(--ac-fg-muted); opacity: .8; }
.ac-tie .ac-chord-btn { color: inherit; }
.ac-tie-arc { flex: none; transform: translateY(-.35em); }
/* RD19: en un compás con mitades («&») el ligado no repite el nombre (no cabe en medio tiempo): una línea de
   sostén con un tope en su extremo; los ligados contiguos forman una sola línea. */
.ac-bar[data-sub] .ac-part.is-tie { position: relative; }
.ac-bar[data-sub] .ac-part.is-tie .ac-tie { display: none; }
.ac-bar[data-sub] .ac-part.is-tie::after {
  content: ""; position: absolute; left: 0; right: .35rem; top: 52%;
  border-top: 2px solid var(--ac-fg-muted); opacity: .6;
}
.ac-bar[data-sub] .ac-part.is-tie::before {
  content: ""; position: absolute; right: .35rem; top: calc(52% - 4px); height: 10px;
  border-right: 2px solid var(--ac-fg-muted); opacity: .6;
}
.ac-bar[data-sub] .ac-part.is-tie:has(+ .ac-part.is-tie)::before { display: none; }
.ac-bar[data-sub] .ac-part.is-tie:has(+ .ac-part.is-tie)::after { right: 0; }
.ac-bar[data-sub] .ac-part.is-tie + .ac-part.is-tie::after { left: 0; }

/* Rasgueo: 8 tiempos */
.ac-strum { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .35rem; }
.ac-strum-cell {
  aspect-ratio: 3 / 4; display: grid; place-items: center; gap: 0;
  border: 2px solid var(--ac-line); border-radius: var(--ac-radius);
  font-size: 1.3rem; font-weight: 600;
}
.ac-strum-cell.is-down { background: var(--ac-fill); border-color: var(--ac-fill); color: var(--ac-on-fill); }
.ac-strum-cell.is-up { border-color: var(--ac-fill-2); color: var(--ac-second); }
.ac-strum-count { font-size: .75rem; color: var(--ac-fg-muted); text-align: center; }

/* Footer */
.ac-footer { border-top: 1px solid var(--ac-line); padding-block: 3rem; color: var(--ac-fg-muted); font-size: .92rem; }
.ac-footer-brand { font-family: var(--ac-font-display); font-size: 1.5rem; color: var(--ac-fg); }

/* Utilidades pequeñas (evitan estilos en línea) */
.ac-h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
.ac-self-start { justify-self: start; }
.ac-min-0 { min-width: 0; }
.ac-illus { max-width: 100%; height: auto; }

/* Botón de tema */
.ac-theme-toggle { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-grid; place-items: center; }
.ac-theme-toggle svg { width: 1.1rem; height: 1.1rem; }
:root[data-bs-theme="dark"] .ac-icon-sun, :root:not([data-bs-theme="light"]) .ac-icon-sun { display: block; }
:root[data-bs-theme="dark"] .ac-icon-moon, :root:not([data-bs-theme="light"]) .ac-icon-moon { display: none; }
:root[data-bs-theme="light"] .ac-icon-sun { display: none; }
:root[data-bs-theme="light"] .ac-icon-moon { display: block; }

/* Movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Teléfono */
@media (max-width: 575.98px) {
  .ac-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-bar.is-wide.is-split { font-size: min(1.2rem, 4.4vw); }  /* S18: 4 acordes con bajo caben en la fila */
  /* RD25: en celular, el ligado de una casilla densa no repite el nombre: una línea de sostén (como RD19). */
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie { position: relative; }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie .ac-tie { display: none; }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie::after {
    content: ""; position: absolute; left: 0; right: .35rem; top: 52%;
    border-top: 2px solid var(--ac-fg-muted); opacity: .6;
  }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie::before {
    content: ""; position: absolute; right: .35rem; top: calc(52% - 4px); height: 10px;
    border-right: 2px solid var(--ac-fg-muted); opacity: .6;
  }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie:has(+ .ac-part.is-tie)::before { display: none; }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie:has(+ .ac-part.is-tie)::after { right: 0; }
  .ac-bar.is-dense:not([data-sub]) .ac-part.is-tie + .ac-part.is-tie::after { left: 0; }
  .ac-strum-cell { font-size: 1rem; }
}

/* Metrónomo (página de canción) */
.ac-met-input { width: 5.5rem; }
.ac-metronome .ac-met-range { width: auto; flex: 1 1 5rem; min-width: 5rem; }
.ac-met-dot {
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  border: 2px solid var(--bs-border-color); background: transparent;
  transition: background-color 0.06s, border-color 0.06s;
}
.ac-met-dot.is-first { border-color: var(--bs-primary); }
.ac-met-dot.is-on { background: var(--bs-body-color); border-color: var(--bs-body-color); }
.ac-met-dot.is-first.is-on { background: var(--bs-primary); border-color: var(--bs-primary); }

/* Metrónomo fijo, pegado a las pestañas y los compases mientras avanza el tema */
.ac-sticky-tools {
  position: sticky; top: var(--ac-nav-h, 56px); z-index: 1010;
  background: var(--bs-body-bg); padding-block: .5rem; margin-bottom: 1rem;
}
/* Barra de reproducción con color propio (RD26): los compases comparten el fondo de la tarjeta y la barra se perdía entre
   ellos. Un tinte «pizarra» (azul índigo desaturado, #6f82d8, fuera de la paleta de marca) la separa en claro y oscuro; las
   pestañas de versión toman este mismo color. */
.ac-sticky-tools { --ac-playbar-tint: #6f82d8; --ac-playbar-bg: var(--ac-surface); --ac-playbar-line: var(--ac-line); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .ac-sticky-tools {
    --ac-playbar-bg: color-mix(in srgb, var(--ac-playbar-tint) 32%, var(--ac-surface));
    --ac-playbar-line: color-mix(in srgb, var(--ac-playbar-tint) 70%, var(--ac-surface));
  }
}
.ac-sticky-tools .ac-metronome { --bs-card-bg: var(--ac-playbar-bg); --bs-card-border-color: var(--ac-playbar-line); }

.ac-met-reset-icon { display: none; }

/* Versiones (RD26): pestañas de navegador. La tira asoma sobre la barra de reproducción; la activa se pega a ella
   (mismo fondo, sin borde abajo) y las inactivas quedan hundidas. En celular solo la activa muestra su nombre. */
.ac-versions {
  --ver-line: var(--ac-playbar-line, var(--ac-line)); --ver-active-bg: var(--ac-playbar-bg, var(--ac-surface));
  display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 3px; margin: 0 0 -1px; padding: 0 .75rem;
  list-style: none; position: relative; z-index: 2; overflow-x: auto; scrollbar-width: none;
}
.ac-versions::-webkit-scrollbar { display: none; }
.ac-versions .nav-item { flex: 0 0 auto; }
.ac-versions .nav-link {
  display: flex; align-items: center; gap: .55rem; padding: .4rem 1rem .35rem .45rem; text-align: left;
  border: 1px solid var(--ver-line); border-bottom: 1px solid var(--ver-line); border-radius: 12px 12px 0 0;
  background: var(--ac-bg); color: var(--ac-fg-muted); position: relative; top: 0;
  --bs-nav-link-color: var(--ac-fg-muted); --bs-nav-link-hover-color: var(--ac-fg);
}
.ac-versions .nav-link:hover:not(.active) { background: rgba(var(--ac-accent-rgb), .1); }
.ac-versions .nav-link.active {
  background: var(--ver-active-bg); color: var(--ac-fg); border-bottom-color: var(--ver-active-bg);
  box-shadow: inset 0 3px 0 var(--ac-accent); padding-top: .5rem;
}
.ac-versions .nav-link:focus-visible { outline: 3px solid var(--ac-accent); outline-offset: -3px; box-shadow: none; }
/* Sin barra de reproducción (tema sin tempo): la tira lleva su propia línea base. */
.ac-versions:not(.ac-versions-bar) { --ver-line: var(--ac-line); --ver-active-bg: var(--ac-bg); margin-bottom: 1.5rem; border-bottom: 1px solid var(--ver-line); margin-top: 0; }
.ac-ver-ico {
  position: relative; flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  border-radius: 50%; background: rgba(var(--ac-accent-rgb), .18); color: var(--ac-accent);
}
.ac-versions .nav-link.active .ac-ver-ico, .ac-ver-new { background: var(--ac-fill); color: var(--ac-on-fill); }
.ac-ver-text { display: grid; line-height: 1.2; min-width: 0; }
.ac-ver-name { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.ac-versions .nav-link.active .ac-ver-name { font-weight: 700; }
.ac-ver-sub { font-size: .72rem; color: var(--ac-fg-muted); white-space: nowrap; }
/* «A fondo» brilla hasta que se abre por primera vez, como los tips. */
.ac-ver-new::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ac-accent);
  animation: ac-tip-glow 2.2s ease-out infinite; pointer-events: none;
}
.ac-ver-new.is-seen::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ac-ver-new::after { animation: none; opacity: 0; } }
/* Vitrina de «A fondo»: qué hay, sin mostrarlo. */
.ac-fondo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.ac-fondo-list li {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--ac-radius);
  border: 1px dashed rgba(var(--ac-accent-rgb), .5); background: rgba(var(--ac-accent-rgb), .06);
}
.ac-fondo-list li > svg { flex: none; color: var(--ac-accent); }
.ac-fondo-lock {
  margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ac-fg-muted);
}
/* Orden de la barra (S30), de arriba abajo: niveles y controles de reproducción. */
.ac-sticky-tools .card-body { gap: .5rem .75rem !important; padding-block: .6rem; }

/* Opciones de la barra (S26, parte 2): en escritorio los controles secundarios quedan sueltos en la barra
   (display: contents) y el botón no existe; en celular se agrupan y se despliegan con «Opciones». */
.ac-met-extra { display: contents; }
/* Dos grupos con título (S40): «Tempo» (bpm, deslizante, restablecer) y «Sonido» (metrónomo, guitarra, sin sonido).
   En escritorio «Tempo» se funde en la fila de Reproducir (display: contents) y «Sonido» es una fila propia. */
.ac-met-sec-tempo { display: contents; }
.ac-met-sec-sound { order: 4; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
.ac-met-sec-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ac-accent);
}
.ac-met-sec-sound .ac-met-sec-title { min-width: 3rem; }
.ac-met-sec-sound .btn { --bs-btn-padding-y: .3rem; }
.ac-met-sec-sound .ac-met-mute { margin-left: auto; }
/* Una tarjeta por fuente de sonido: su nombre o interruptor y su volumen juntos. */
.ac-snd-card {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem;
  padding: .25rem .5rem; border: 1px solid rgba(var(--ac-accent-rgb), .5); border-radius: .6rem;
}
.ac-snd-name { font-weight: 600; font-size: .9rem; color: var(--ac-fg); }
.ac-snd-vol { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--ac-fg); transition: opacity .15s; }
.ac-snd-icon { flex: none; color: var(--ac-accent); }
.ac-snd-range { width: 4.75rem; }
.ac-snd-card .ac-snd-range { width: 3rem; } /* S42: caben guitarra y bajo en una fila */
.ac-snd-card .ac-snd-out { min-width: 2rem; }
.ac-snd-out { min-width: 2.4rem; text-align: right; font-size: .85rem; color: var(--ac-fg-muted); }
/* Guitarra apagada: el volumen se ve atenuado y no responde hasta activarla. */
.ac-snd-card.is-off .ac-snd-vol { opacity: .45; }
.ac-snd-range:disabled { cursor: not-allowed; }
.ac-met-options { display: none; }
.ac-met-options-mute { display: inline-flex; align-items: center; line-height: 1; }
.ac-met-options-mute[hidden] { display: none; }
.ac-met-options-chev { display: inline-block; transition: transform .15s; }
.ac-met-options[aria-expanded="true"] .ac-met-options-chev { transform: rotate(180deg); }
.ac-sticky-tools .ac-met-help { order: 5; }
@media (min-width: 576px) {
  /* Escritorio (S40): «Habla con una guía» comparte la fila del selector de nivel, a la derecha, para que la barra
     fija no crezca con el grupo de sonido. */
  .ac-sticky-tools .ac-met-help { order: -2; margin-left: auto; }
  /* salto de línea: lo que sigue (reproducción) empieza en la fila siguiente */
  .ac-sticky-tools .card-body::after { content: ""; order: -1; flex: 1 1 100%; height: 0; margin-top: -.5rem; }
}
@media (max-width: 575.98px) {
  /* En celular la barra fija no puede crecer (< 30 % de la pantalla): lo esencial va en dos filas
     (reproducir + Opciones; versiones) y el resto se despliega bajo ellas. */
  .ac-met-options { display: inline-flex; align-items: center; gap: .35rem; }
  .ac-met-toggle { min-width: 7rem; }
  /* Versiones en celular: pestañas compactas; solo la activa muestra su nombre. */
  .ac-versions { padding: 0 .5rem; gap: 2px; }
  .ac-versions .nav-link { gap: .4rem; padding: .3rem .55rem .25rem .35rem; }
  .ac-versions .nav-link.active { padding-top: .4rem; padding-right: .8rem; }
  .ac-ver-ico { width: 1.8rem; height: 1.8rem; }
  .ac-versions .nav-link:not(.active) .ac-ver-text { display: none; }
  .ac-versions .nav-link:not(.active) { padding-right: .35rem; }
  .ac-met-extra {
    display: none; order: 5; flex: 1 1 100%; flex-direction: column; gap: .6rem;
  }
  .ac-met-extra.is-open { display: flex; }
  .ac-sticky-tools .ac-met-help { order: 6; }
  /* Dentro de «Opciones»: cada grupo con su título, uno debajo del otro. */
  .ac-met-sec { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; padding-top: .45rem;
    border-top: 1px solid rgba(var(--ac-accent-rgb), .3); }
  .ac-met-sec-title { flex: 1 1 100%; }
  .ac-met-sec-sound { order: 0; flex: none; }
  .ac-snd-card { flex: 1 1 100%; justify-content: space-between; }
  .ac-snd-vol { flex: 1 1 12rem; }
  .ac-snd-range { flex: 1 1 auto; width: auto; min-width: 4rem; }
  .ac-met-sec-sound .ac-met-mute { margin-left: 0; flex: 1 1 100%; justify-content: center; }
}

/* Cursor de compás */
.ac-bar { position: relative; transition: background-color .08s, color .08s; }
.ac-bar.is-current { box-shadow: inset 0 0 0 2px var(--ac-accent); }
.ac-bar.is-current::before {
  content: "\25BC"; position: absolute; top: -.7rem; left: 50%; transform: translateX(-50%);
  font-size: .8rem; line-height: 1; color: var(--ac-accent); z-index: 1;
}
.ac-bar.is-beat, .ac-part.is-beat { background: rgba(var(--ac-accent-rgb), .28); }
.ac-bar.is-downbeat, .ac-part.is-downbeat { background: var(--ac-fill); color: var(--ac-on-fill); }
.ac-rep-count { margin-left: .5rem; font-size: .85rem; color: var(--ac-accent); font-weight: 600; }
.ac-bars { scroll-margin-top: 12rem; }

/* Tips entre secciones: tarjeta con un ícono que brilla hasta que se abre */
.ac-tip { border: 2px dashed var(--ac-accent); border-radius: var(--ac-radius, .75rem); background: rgba(var(--ac-accent-rgb), .07); }
.ac-tip-btn {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .8rem; border: 0;
  background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: inherit;
}
.ac-tip-btn:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.ac-tip-icon {
  position: relative; flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; background: var(--ac-fill); color: var(--ac-on-fill);
}
.ac-tip-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ac-accent);
  animation: ac-tip-glow 2.2s ease-out infinite;
}
.ac-tip.is-seen .ac-tip-icon::after { animation: none; opacity: 0; }
@keyframes ac-tip-glow { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ac-tip-icon::after { animation: none; opacity: 0; } }
.ac-tip-label { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.ac-tip-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ac-accent); }
.ac-tip-title { font-weight: 600; line-height: 1.25; }
.ac-tip-chev { flex: none; transition: transform .15s; color: var(--ac-accent); }
.ac-tip-btn[aria-expanded="true"] .ac-tip-chev { transform: rotate(180deg); }
.ac-tip-body { margin: 0; padding: 0 .8rem .8rem 4.15rem; }
/* Acorde escrito entre backticks dentro de un tip (S15): Petaluma se ve chica junto al texto, de ahí el tamaño. */
.ac-inline-chord { font-family: "Petaluma Script", var(--ac-font-display); font-size: 1.25em; line-height: 1; }

/* Compás de inicio (RD37): se toca el compás y una burbuja ofrece «▶ Desde aquí». Sin íconos en la grilla. */
.ac-bar.is-pickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* :where() deja estos fondos por debajo del pulso (is-beat) y del cursor (is-current) */
:where(.ac-bar.is-pickable):hover { background: rgba(var(--ac-accent-rgb), .06); }
:where(.ac-bar.is-selected) { background: rgba(var(--ac-accent-rgb), .14); outline: 2px dashed var(--ac-accent); outline-offset: -3px; }
.ac-bar.is-start { box-shadow: inset 5px 0 0 var(--ac-fill); }
:where(.ac-bar.is-start) { background: rgba(var(--ac-accent-rgb), .08); }
.ac-bar.is-start.is-current { box-shadow: inset 0 0 0 2px var(--ac-accent), inset 5px 0 0 var(--ac-fill); }
.ac-start-tag {
  position: absolute; top: -.75rem; left: .35rem; z-index: 2; display: inline-flex; align-items: center; gap: .25rem;
  padding: .12rem .5rem; border-radius: 999px; background: var(--ac-fill); color: var(--ac-on-fill);
  font: 600 .68rem/1.3 var(--ac-font-text); letter-spacing: .02em; white-space: nowrap; pointer-events: none;
}
/* botón invisible por compás para teclado y lectores de pantalla: se ve solo al enfocarlo */
.ac-start-key {
  position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; background: transparent; opacity: 0;
  pointer-events: none;
}
.ac-start-key:focus-visible { opacity: 1; outline: 2px solid var(--ac-accent); outline-offset: -2px; }
.ac-start-pop {
  position: absolute; z-index: 1060; display: grid; gap: .45rem; justify-items: center; width: max-content;
  max-width: calc(100vw - 16px); padding: .6rem; border-radius: 10px;
  background: var(--ac-surface); border: 1px solid var(--ac-accent); box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.ac-start-pop[hidden] { display: none; }
.ac-start-pop-tip {
  position: absolute; left: var(--tip, 50%); top: -7px; width: 12px; height: 12px; background: var(--ac-surface);
  border-left: 1px solid var(--ac-accent); border-top: 1px solid var(--ac-accent); transform: translateX(-50%) rotate(45deg);
}
.ac-start-pop.is-above .ac-start-pop-tip { top: auto; bottom: -7px; transform: translateX(-50%) rotate(225deg); }
.ac-start-pop-cap { font: 500 .75rem var(--ac-font-text); color: var(--ac-fg-muted); letter-spacing: .04em; }
.ac-start-go {
  min-height: 48px; min-width: 11.5rem; padding: 0 1.2rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ac-fill); color: var(--ac-on-fill); font: 600 1.05rem var(--ac-font-text);
}
.ac-start-go.is-quiet { background: transparent; color: var(--ac-fg); border: 1px solid var(--ac-line); font-weight: 500; }
.ac-start-go:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 3px; }
.ac-start-toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 2100;
  transform: translateX(-50%) translateY(6px); max-width: calc(100vw - 32px); padding: .5rem .95rem; border-radius: 999px;
  background: var(--ac-fg); color: var(--ac-bg); font: 500 .88rem var(--ac-font-text); text-align: center;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.ac-start-toast.is-on { opacity: 1; transform: translateX(-50%); }
/* la ficha en la barra de reproducción */
.ac-start-chip {
  display: inline-flex; align-items: center; gap: .1rem; min-height: 38px; padding: 0 .1rem 0 .7rem; border-radius: 999px;
  border: 1px solid rgba(var(--ac-accent-rgb), .7); font: 500 .85rem var(--ac-font-text); color: var(--ac-fg); white-space: nowrap;
}
.ac-start-chip[hidden] { display: none; }
.ac-start-chip-text { display: inline-flex; align-items: center; gap: .35rem; }
.ac-start-chip-text svg { color: var(--ac-accent); }
.ac-start-chip-short { display: none; }
.ac-start-chip-x {
  width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; font-size: .95rem;
}
.ac-start-chip-x:hover { background: rgba(var(--ac-accent-rgb), .18); }
.ac-start-chip-x:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: -2px; }
/* En la página va en la fila de las pestañas de versión, a la derecha, para que la barra no crezca una fila;
   en el modo estudio, flotando bajo su barra, a la derecha (la barra del estudio tampoco crece). */
.ac-metronome .ac-start-chip { position: absolute; right: 0; bottom: calc(100% + .3rem); z-index: 3; background: var(--ac-bg); }
.ac-st-ctl .ac-metronome { position: static; }
.ac-st-ctl .ac-start-chip { right: .8rem; bottom: auto; top: calc(100% + .5rem); z-index: 5; }
@media (max-width: 575.98px) {
  .ac-start-chip { padding-left: .6rem; }
  .ac-start-chip-long { display: none; }
  .ac-start-chip-short { display: inline; }
}
.ac-cp-start { justify-self: start; margin-top: .5rem; }
/* RD38: loop de sección. El botón ⟲ en la esquina del panel de cada sección (zona táctil de 44 px por ::before); la sección
   que se repite queda resaltada en oro y la ficha dice «Repitiendo: Coro». */
.ac-score.has-loop { position: relative; }
.ac-score.has-loop > h2 { padding-right: 2.8rem; }
.ac-loop-btn {
  position: absolute; top: .55rem; right: .6rem; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(var(--ac-accent-rgb), .5); border-radius: 999px; background: transparent; color: var(--ac-accent); cursor: pointer;
}
.ac-loop-btn::before { content: ""; position: absolute; inset: -4px; border-radius: 999px; }
.ac-loop-btn svg { width: 17px; height: 17px; }
.ac-loop-btn:hover { background: rgba(var(--ac-accent-rgb), .14); }
.ac-loop-btn:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 2px; }
.ac-loop-btn[aria-pressed="true"] { background: var(--ac-fill); border-color: var(--ac-fill); color: var(--ac-on-fill); }
.ac-score.is-looping {
  border-color: var(--ac-accent); box-shadow: 0 0 0 2px rgba(var(--ac-accent-rgb), .55);
  background: color-mix(in srgb, var(--ac-oro) 12%, var(--ac-surface));
}
.ac-start-chip.is-loop { border-color: var(--ac-fill); background: color-mix(in srgb, var(--ac-oro) 18%, var(--ac-bg)); }
.ac-start-chip-text svg { flex: none; }
.ac-start-chip.is-compact .ac-start-chip-long { display: none; }
.ac-start-chip.is-compact .ac-start-chip-short { display: inline; }
@media (prefers-reduced-motion: reduce) { .ac-start-toast { transition: none; } }

@media (max-width: 575.98px) {
  .ac-sticky-tools .card-body { padding: .5rem .75rem; gap: .5rem !important; }
  .ac-sticky-tools .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .9rem; }
  .ac-sticky-tools .ac-met-input { width: 3.6rem; padding: .2rem .25rem; }
}

/* Deslizante del metrónomo: pista y control visibles en ambos temas */
.ac-metronome .ac-snd-range::-webkit-slider-runnable-track { height: .35rem; border-radius: 1rem; background: rgba(var(--ac-accent-rgb), .35); }
.ac-metronome .ac-snd-range::-moz-range-track { height: .35rem; border-radius: 1rem; background: rgba(var(--ac-accent-rgb), .35); }
.ac-metronome .ac-snd-range::-webkit-slider-thumb { background: var(--ac-fill); margin-top: -.35rem; }
.ac-metronome .ac-snd-range::-moz-range-thumb { background: var(--ac-fill); border: 0; }
.ac-metronome .ac-snd-range:focus-visible { outline: 3px solid var(--ac-accent); outline-offset: 3px; box-shadow: none; }
.ac-metronome .ac-met-range::-webkit-slider-runnable-track { height: .35rem; border-radius: 1rem; background: rgba(var(--ac-accent-rgb), .35); }
.ac-metronome .ac-met-range::-moz-range-track { height: .35rem; border-radius: 1rem; background: rgba(var(--ac-accent-rgb), .35); }
.ac-metronome .ac-met-range::-webkit-slider-thumb { background: var(--ac-fill); margin-top: -.35rem; }
.ac-metronome .ac-met-range::-moz-range-thumb { background: var(--ac-fill); border: 0; }

/* Acordes en tipografía de cancionero (Petaluma Script, SIL OFL 1.1; ver PetalumaScript-OFL.txt) */
@font-face {
  font-family: "Petaluma Script"; src: url("PetalumaScript.woff2") format("woff2");
  font-display: swap;
}
.ac-bar { font-family: "Petaluma Script", var(--ac-font-display); font-size: 1.6rem; line-height: 1.2; }

/* Sin sonido y acceso a guías en la barra del metrónomo */
.ac-met-mute { display: inline-flex; align-items: center; gap: .4rem; }
.ac-met-mute .ac-off { display: none; }
.ac-met-mute[aria-pressed="true"] { background: var(--ac-fill); border-color: var(--ac-fill); color: var(--ac-on-fill); }
.ac-met-mute[aria-pressed="true"] .ac-on { display: none; }
.ac-met-mute[aria-pressed="true"] .ac-off { display: inline; }
/* Cuenta inicial: 1 2 3 4 dentro del botón principal, que no crece ni agrega una fila */
.ac-met-toggle { min-width: 8.5rem; }
.ac-met-toggle.is-loading { white-space: nowrap; }
.ac-met-note { flex: 1 1 100%; font-size: .85rem; color: var(--ac-fg-muted); }
.ac-met-toggle.is-counting { white-space: nowrap; overflow: hidden; padding-inline: 0; }
.ac-met-toggle.is-counting [data-ac-met-label] { display: none; }
.ac-met-count { display: inline-flex; gap: .45rem; align-items: baseline; font-weight: 600; }
.ac-met-count span { opacity: .55; }
.ac-met-count span.is-on { opacity: 1; font-weight: 800; text-decoration: underline; text-underline-offset: .2em; }
.ac-met-countin { display: inline-flex; align-items: center; gap: .4rem; }
.ac-met-countin[aria-pressed="true"] { background: var(--ac-fill); border-color: var(--ac-fill); color: var(--ac-on-fill); }
@media (max-width: 575.98px) {
  .ac-sticky-tools .ac-met-reset-bpm { display: none; }
  .ac-sticky-tools .ac-met-reset-text { display: none; }
  .ac-sticky-tools .ac-met-reset-icon { display: inline; font-size: 1.1rem; line-height: 1; }
  .ac-sticky-tools .ac-metronome .ac-met-range { flex-basis: 4.5rem; min-width: 4.5rem; }
  .ac-sticky-tools .ac-metronome .card-body > .small, .ac-sticky-tools .ac-metronome .d-flex > .small { display: none; }
}

/* Los puntos de pulso repiten al compás que parpadea: fuera de la barra fija */
.ac-sticky-tools [data-ac-met-dots] { display: none !important; }

/* Franja de guías: va primero y se va al hacer scroll; la barra fija queda solo con los controles */
.ac-met-strip {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: space-between;
  margin-bottom: 1rem; padding: .7rem 1rem;
  border: 2px solid var(--ac-fill-2); border-radius: var(--ac-radius);
  background: var(--bs-body-bg);
}
.ac-met-pitch { flex: 1 1 14rem; min-width: 0; }
.ac-met-avatars .ac-avatar { width: 40px; height: 46px; font-size: .95rem; padding-bottom: .35rem; }

/* Botón corto de guías en la barra fija: aparece cuando la franja de arriba sale de pantalla */
.ac-met-help {
  --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .8rem; --bs-btn-font-size: .9rem;
  border: 2px solid var(--ac-fill-2); color: var(--ac-fg); border-radius: var(--ac-radius);
}
.ac-met-help[hidden] { display: none !important; }
.ac-met-help:hover { border-color: var(--ac-fill); color: var(--ac-fg); }
.ac-met-help strong { color: var(--ac-accent); }
@media (max-width: 575.98px) {
  .ac-sticky-tools .ac-met-help { flex: 1 1 100%; --bs-btn-padding-y: .2rem; --bs-btn-font-size: .85rem; }
}
/* Pantallas anchas (RD27): la ayuda de guías va a la altura de las pestañas, fuera del flujo. Antes compartía fila
   con ellas; al sacar las pestañas de la tarjeta (RD26) ocupaba una fila propia y la barra crecía, y cambiaba de alto
   cada vez que aparecía o se ocultaba. Así la barra mide siempre lo mismo y no empuja los compases. */
@media (min-width: 900px) {
  .ac-sticky-tools .ac-metronome { position: relative; }
  .ac-sticky-tools .ac-met-help { position: absolute; right: .75rem; bottom: calc(100% + .25rem); margin: 0; z-index: 3; }
}

/* Desplegable de guías: flota bajo la barra fija, sin empujar los compases */
.ac-guides-panel { position: absolute; left: 0; right: 0; top: 100%; margin-top: -.75rem; z-index: 2; }
.ac-guides-panel .card { border: 2px solid var(--ac-fill-2); box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .35); }
.ac-guides-panel .card-body { max-height: 60vh; overflow-y: auto; }
.ac-guide-row { display: flex; align-items: center; gap: .8rem; padding: .35rem .5rem; margin-inline: -.5rem; border-radius: var(--ac-radius); color: inherit; text-decoration: none; }
.ac-guide-row:hover, .ac-guide-row:focus-visible { background: rgba(var(--ac-accent-rgb), .12); color: inherit; }
.ac-guide-row .ac-avatar { width: 40px; height: 46px; font-size: .95rem; padding-bottom: .35rem; }
.ac-guide-info { flex: 1 1 auto; min-width: 0; }
.ac-guide-cost { flex: none; text-align: right; }
.ac-rating { color: var(--ac-accent); font-weight: 600; }
@media (max-width: 575.98px) {
  .ac-guide-row { display: grid; grid-template-columns: 40px 1fr; column-gap: .8rem; row-gap: .1rem; }
  .ac-guide-row .ac-avatar { grid-row: span 2; align-self: start; }
  .ac-guide-cost { text-align: left; }
  .ac-guides-panel .card-body { max-height: 70vh; }
}

/* Tarjeta de la guía a la que se llegó desde un tema */
.col.is-target > .card { border-color: var(--ac-fill); box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .45); }
.col[id^="guia-"] { scroll-margin-top: 6rem; }

/* Acordes que abren su diagrama: se ven como el texto de siempre */
.ac-chord-btn {
  background: none; border: 0; margin: -.25rem 0; padding: .25rem .6rem; font: inherit; color: inherit;
  cursor: pointer; border-radius: var(--ac-radius);
}
.ac-chord-btn:hover { color: var(--ac-accent); text-decoration: underline dotted; text-underline-offset: .25em; }
.ac-chord-btn:focus-visible, .ac-chord-btn[aria-expanded="true"] { outline: 2px solid var(--ac-accent); outline-offset: -2px; }

/* Panel del acorde: guitarra con tab y teclado */
.ac-chord-panel {
  position: absolute; z-index: 1030; width: 17rem; max-width: calc(100vw - 16px); display: grid; gap: .6rem;
  padding: .8rem; background: var(--bs-body-bg); color: var(--bs-body-color);
  border: 2px solid var(--ac-fill-2); border-radius: var(--ac-radius); box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .35);
}
.ac-chord-panel[hidden] { display: none; }
.ac-cp-head { display: flex; align-items: baseline; gap: .6rem; }
.ac-cp-name { font-family: "Petaluma Script", var(--ac-font-display); font-size: 1.7rem; line-height: 1.1; }
.ac-cp-notes { margin-right: auto; font-size: .85rem; color: var(--ac-fg-muted); }
.ac-cp-tabs, .ac-cp-foot { display: flex; align-items: center; gap: .4rem; }
.ac-cp-foot { justify-content: space-between; }
.ac-chord-panel .ac-chord svg { width: 150px; }
.ac-chord-panel svg .finger { fill: var(--ac-on-fill); font-weight: 700; }
.ac-cp-tab { margin: 0; font-size: .8rem; line-height: 1.35; color: var(--ac-fg-muted); overflow-x: auto; }
.ac-cp-note { margin: 0; font-size: .9rem; color: var(--ac-fg-muted); }
.ac-chord-panel .ac-cp-body svg[aria-label^="Teclas"] { width: 100%; max-width: 15rem; }
.ac-chord-panel .key { fill: #f4efe6; stroke: #9b93b0; stroke-width: .6; }
.ac-chord-panel .key.black { fill: #1c1830; }
.ac-chord-panel .key.on { fill: var(--ac-fill); }
.ac-chord-panel .key.black.on { fill: var(--ac-accent); }
.ac-chord-panel .key.bass { fill: var(--ac-fill-2); }
/* Resumen plegado de posiciones al inicio de cada pestaña (S28) */
.ac-summary { scroll-margin-top: 9rem; border: 1px solid rgba(var(--ac-accent-rgb), .3); border-radius: var(--ac-radius); padding: .6rem .9rem; }
.ac-summary > summary { cursor: pointer; font-weight: 600; }
.ac-sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .35rem .9rem; margin-top: .9rem; }
.ac-sum-item { margin: 0 0 .9rem; display: grid; justify-items: center; align-content: start; gap: .35rem; min-width: 0; grid-row: span 6; grid-template-rows: subgrid; }
.ac-sum-off { visibility: hidden; }
.ac-sum-name { font-family: "Petaluma Script", var(--ac-font-display); font-size: 1.4rem; line-height: 1.1; color: var(--ac-accent); }
.ac-sum-guitar svg { width: 84px; }
.ac-sum-tabs { display: flex; gap: .4rem; margin-top: .8rem; }
.ac-sum-view { display: grid; justify-items: center; width: 100%; }
.ac-sum-view svg { width: 100%; max-width: 7.5rem; height: auto; }
.ac-sum-tab { margin: 0; font-size: .7rem; line-height: 1.3; }
.ac-sum-note { margin: 0; font-size: .75rem; color: var(--ac-fg-muted); text-align: center; }
.ac-sum-actions { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.ac-summary .ac-sum-actions .btn { padding: .2rem .55rem; font-size: .75rem; line-height: 1.3; white-space: nowrap; }
.ac-sum-use { font-size: .78rem; display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.ac-sum-variant { margin-left: .4rem; font-family: var(--ac-font-body, inherit); font-size: .65rem; vertical-align: middle; }
.ac-sum-none { font-size: .8rem; color: var(--ac-fg-muted); text-align: center; }
.ac-sum-piano { width: 100%; max-width: 7rem; }
.ac-sum-piano svg { width: 100%; height: auto; }
.ac-summary svg .finger { fill: var(--ac-on-fill); font-weight: 700; }
.ac-summary .key { fill: #f4efe6; stroke: #9b93b0; stroke-width: .6; }
.ac-summary .key.black { fill: #1c1830; }
.ac-summary .key.on { fill: var(--ac-fill); }
.ac-summary .key.black.on { fill: var(--ac-accent); }
.ac-summary .key.bass { fill: var(--ac-fill-2); }
@media (max-width: 575.98px) {
  .ac-chord-panel {
    position: fixed; top: auto !important; left: 0 !important; right: 0; bottom: 0; width: auto; max-width: none;
    max-height: 70vh; overflow-y: auto; border-radius: var(--ac-radius) var(--ac-radius) 0 0; padding-bottom: 1.2rem;
  }
}

/* Título y artista fijos al bajar */
.ac-sticky-title { padding: 0 .25rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-sticky-title strong { font-family: var(--ac-font-display); font-size: 1.15rem; font-weight: 400; }
.ac-sticky-title span { color: var(--ac-fg-muted); font-size: .95rem; }
.ac-sticky-tools:not(:has(> :not([hidden]))) { display: none; }

/* Tabs y arreglos por sección del Avanzado (S17): la tab se desplaza en horizontal en celular. */
.ac-tab { overflow-x: auto; padding: .6rem .8rem; border: 1px solid rgba(var(--ac-accent-rgb), .3); border-radius: .5rem; }
.ac-arrangement { color: var(--bs-secondary-color); }

.ac-count strong { color: var(--bs-body-color); }

/* Sección Artistas (S24) */
.ac-artist-library { justify-self: start; }
.ac-artist-links a { overflow-wrap: anywhere; }

/* Pide una canción: demo (S25) */
.ac-demo-badge {
  display: inline-flex; align-items: center; padding: .2rem .7rem;
  border: 1px dashed var(--ac-accent); border-radius: 999px;
  color: var(--ac-accent); font-size: .78rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.ac-demo-badge-sm { font-size: .68rem; padding: .1rem .55rem; }
.ac-req-state {
  display: inline-flex; padding: .2rem .7rem; border-radius: 999px;
  border: 1px solid var(--ac-line); font-size: .82rem; font-weight: 600;
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}
.ac-req-state[data-status="published"] { border-color: var(--ac-second); color: var(--ac-second); }
.ac-req-state[data-status="preparing"] { border-color: var(--ac-accent); color: var(--ac-accent); }
.ac-req-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.ac-req-seg {
  height: .4rem; border-radius: 999px; background: var(--ac-line);
  transition: background-color .5s ease;
}
.ac-req-seg.on { background: var(--ac-accent); }
.ac-req-flash { animation: ac-req-flash 1.4s ease-out; }
@keyframes ac-req-flash {
  from { box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), .65); }
  to { box-shadow: 0 0 0 3px rgba(var(--ac-accent-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-req-state, .ac-req-seg { transition: none; }
  .ac-req-flash { animation: none; }
}

/* Panel de diagnóstico de audio (RD15): solo existe con ?debug=audio */
.ac-dbg { position: fixed; left: 8px; bottom: 8px; z-index: 2000; max-width: calc(100vw - 16px); font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ac-dbg-toggle, .ac-dbg-btn { border: 1px solid var(--bs-border-color, #888); background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #000); border-radius: 6px; padding: 4px 8px; font: inherit; }
.ac-dbg-panel { margin-top: 6px; padding: 8px; width: min(560px, calc(100vw - 16px)); border: 1px solid var(--bs-border-color, #888); border-radius: 8px; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #000); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.ac-dbg-head { margin-bottom: 6px; word-break: break-word; }
.ac-dbg-log { display: block; width: 100%; height: 34vh; margin-bottom: 6px; padding: 4px; font: inherit; resize: vertical; white-space: pre; overflow: auto; background: transparent; color: inherit; border: 1px solid var(--bs-border-color, #888); border-radius: 6px; }
.ac-dbg-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

/* Utilidades: afinador de guitarra (RD22) */
.ac-util-strip { margin-bottom: 1rem; }
.ac-util-btn { --bs-btn-padding-y: .35rem; border: 2px solid var(--ac-fill-2); color: var(--ac-fg); border-radius: var(--ac-radius); }
.ac-util-btns { justify-content: flex-end; }
.ac-util-btn svg { vertical-align: -.1em; margin-left: .2rem; }
.ac-util-btn:hover, .ac-util-btn[aria-expanded="true"] { border-color: var(--ac-accent); color: var(--ac-fg); background: rgba(var(--ac-accent-rgb), .12); }
.ac-tuner-panel { margin-bottom: 1rem; }
.ac-tuner-panel .card { border: 2px solid var(--ac-fill-2); }
.ac-tuner-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.ac-tuner-string {
  display: grid; justify-items: center; gap: 0; padding: .45rem .2rem; line-height: 1.15;
  border: 2px solid var(--ac-fill-2); border-radius: var(--ac-radius); color: var(--ac-fg);
}
.ac-tuner-string small { color: var(--bs-secondary-color); font-size: .7rem; }
.ac-tuner-string strong { font-size: 1.25rem; }
.ac-tuner-string span { font-size: .72rem; color: var(--bs-secondary-color); }
.ac-tuner-string:hover, .ac-tuner-string:focus-visible { border-color: var(--ac-accent); color: var(--ac-fg); }
.ac-tuner-string.is-on { border-color: var(--ac-accent); background: rgba(var(--ac-accent-rgb), .18); color: var(--ac-fg); }
.ac-tuner-meter { display: grid; gap: .6rem; }
.ac-tuner-meter[hidden] { display: none; }
.ac-tuner-read { display: flex; align-items: baseline; gap: .8rem; }
.ac-tuner-note { font-size: 2.4rem; line-height: 1; }
.ac-tuner-scale { position: relative; height: 2.2rem; border-radius: var(--ac-radius); background: var(--ac-fill-2); overflow: hidden; }
.ac-tuner-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--bs-body-color); opacity: .5; }
.ac-tuner-needle {
  --ac-cents: 0; position: absolute; top: .2rem; bottom: .2rem; width: .5rem; margin-left: -.25rem;
  left: calc(50% + var(--ac-cents) * 1%); border-radius: .25rem; background: var(--ac-accent);
  transition: left .12s linear;
}
.ac-tuner-needle.is-idle { opacity: .3; }
.ac-tuner-state { font-weight: 600; }
.ac-tuner-meter.is-in-tune .ac-tuner-needle { background: #2e9e5b; }
.ac-tuner-meter.is-in-tune .ac-tuner-state { color: #2e9e5b; }
@media (prefers-reduced-motion: reduce) { .ac-tuner-needle { transition: none; } }
@media (max-width: 575.98px) { .ac-tuner-string strong { font-size: 1.1rem; } }

/* ===== Modo estudio (RD30): el reproductor y los compases a pantalla completa ===================================
   La barra de reproducción real se muda aquí mientras está abierto (estudio.js). Horizontal (carril) por defecto;
   vertical; y, en celular vertical, páginas de hasta 3 figuras. Tamaños por consulta de medios (pantalla real). */
.ac-study-btn {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; font-weight: 600;
  --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .8rem;
  background: var(--ac-fill-2); color: var(--ac-on-fill-2); border: 0; border-radius: var(--bs-border-radius); margin-inline: .35rem;
}
.ac-study-btn:hover { background: var(--ac-fill-2); color: var(--ac-on-fill-2); filter: brightness(1.08); }
.ac-study-btn::after {
  content: ""; position: absolute; inset: -3px; border-radius: .55rem; border: 2px solid var(--ac-second);
  animation: ac-tip-glow 2.2s ease-out infinite; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .ac-study-btn::after { animation: none; opacity: 0; } }
/* En celular solo el ícono: con el texto no cabe en la fila de Reproducir y Opciones y la barra crecía una fila entera. */
@media (max-width: 575.98px) {
  .ac-study-btn span { display: none; }
  .ac-study-btn { --bs-btn-padding-x: .6rem; margin-inline: .15rem; }
}
html.ac-study-on { overflow: hidden; }
.ac-study {
  --ac-playbar-bg: var(--ac-surface); --ac-playbar-line: var(--ac-line); --ac-playbar-tint: #6f82d8;
  --st-bar-w: 230px; --st-diag: 118px; --st-fs: 2.2rem;
  position: fixed; inset: 0; z-index: 2000; height: 100dvh; display: flex; flex-direction: column;
  background: var(--ac-bg); color: var(--ac-fg);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .ac-study {
    --ac-playbar-bg: color-mix(in srgb, var(--ac-playbar-tint) 32%, var(--ac-surface));
    --ac-playbar-line: color-mix(in srgb, var(--ac-playbar-tint) 70%, var(--ac-surface));
  }
}
.ac-study[hidden] { display: none; }
@media (max-width: 1099.98px) { .ac-study { --st-bar-w: 190px; --st-diag: 100px; --st-fs: 1.9rem; } }
@media (max-height: 520px) and (min-width: 576px) { .ac-study { --st-bar-w: 132px; --st-diag: 68px; --st-fs: 1.35rem; } }
/* barra superior */
.ac-st-top {
  position: relative; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem;
  padding: .45rem .8rem; background: var(--ac-playbar-bg); border-bottom: 1px solid var(--ac-playbar-line);
}
.ac-st-top .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .9rem; }
.ac-st-title { font-family: var(--ac-font-display); line-height: 1.1; min-width: 0; }
.ac-st-title small { display: block; font-family: var(--ac-font-text); font-size: .7rem; color: var(--ac-fg-muted); }
.ac-st-spacer { flex: 1; }
.ac-st-seg { display: inline-flex; border: 1px solid var(--ac-line); border-radius: 999px; padding: 2px; background: var(--ac-bg); }
.ac-st-seg button { all: unset; cursor: pointer; padding: .2rem .65rem; border-radius: 999px; font-size: .85rem; color: var(--ac-fg-muted); white-space: nowrap; }
.ac-st-seg button:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: 2px; }
.ac-st-seg button[aria-pressed="true"] { background: var(--ac-fill); color: var(--ac-on-fill); font-weight: 600; }
/* la barra real, ya dentro del estudio: compacta; el sonido sale en un panel con «Opciones» */
.ac-st-ctl .ac-metronome, .ac-st-ctl .card { border: 0; background: transparent; box-shadow: none; --bs-card-bg: transparent; }
.ac-st-ctl .card-body { padding: 0; gap: .5rem .7rem !important; flex-wrap: wrap; }
.ac-st-ctl .ac-met-options { display: inline-flex; align-items: center; gap: .35rem; }
.ac-st-ctl .ac-study-btn { display: none; }
.ac-st-ctl .ac-met-extra, .ac-st-ctl .ac-met-extra.is-open { display: contents; }
.ac-st-ctl .ac-met-sec-tempo { display: inline-flex; align-items: center; gap: .4rem; padding: 0; border: 0; }
.ac-st-ctl .ac-met-sec-tempo .ac-met-sec-title, .ac-st-ctl .ac-met-range, .ac-st-ctl [data-ac-met-reset] { display: none; }
.ac-st-ctl [data-ac-met-dots] { display: none !important; }
.ac-st-ctl .ac-met-input { width: 4.4rem; padding-inline: .25rem; }
.ac-st-ctl .ac-met-sec-sound { display: none; }
.ac-st-ctl .ac-met-extra.is-open .ac-met-sec-sound {
  display: flex; flex-direction: column; align-items: stretch; gap: .6rem; position: absolute; right: .8rem; top: 100%; z-index: 20;
  width: min(340px, calc(100vw - 1.6rem)); padding: .8rem; margin-top: .3rem; border: 1px solid var(--ac-line); border-radius: 12px;
  background: var(--ac-surface); box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
.ac-st-ctl .ac-met-sec-sound .ac-met-sec-title { display: block; }
.ac-st-tabs .ac-versions { margin: 0; padding: 0; overflow: visible; }
.ac-st-tabs .ac-versions .nav-link { border-radius: 10px; border-bottom: 1px solid var(--ac-playbar-line); padding: .2rem .7rem .2rem .3rem; }
.ac-st-tabs .ac-versions .nav-link.active { box-shadow: none; border-color: var(--ac-accent); padding-top: .2rem; }
.ac-st-tabs .ac-ver-ico { width: 1.7rem; height: 1.7rem; }
.ac-st-tabs .ac-ver-sub { display: none; }
/* «¿Se complica esta parte?» sigue a la vista en el estudio (marketing de las guías): flota arriba a la derecha y su panel baja desde ahí */
.ac-st-helprow { position: relative; flex: none; height: 0; z-index: 6; }
.ac-st-help { position: absolute; right: 12px; top: 8px; max-width: calc(100vw - 24px); }
.ac-st-help .ac-met-help[hidden] { display: inline-block !important; }  /* en la página se oculta cuando la franja de arriba se ve; aquí no hay franja */
.ac-st-help .ac-met-help { --bs-btn-padding-y: .25rem; --bs-btn-font-size: .85rem; background: var(--ac-surface); }
.ac-st-helprow .ac-guides-panel { top: 0; margin-top: 46px; padding-inline: 12px; z-index: 7; }
.ac-st-top { z-index: 5; }
/* zona de compases */
.ac-st-main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ac-st-empty { padding: 2rem; color: var(--ac-fg-muted); }
.ac-st-track { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; display: flex; align-items: center; gap: 1.4rem; padding: 0 40vw 0 1.2rem; }
.ac-st-sec { flex: none; display: flex; flex-direction: column; gap: .4rem; opacity: .5; transition: opacity .2s; }
.ac-st-sec.is-cur-sec { opacity: 1; }
.ac-st-label { display: flex; gap: .5rem; align-items: baseline; font-family: var(--ac-font-display); font-size: 1.05rem; border-left: 3px solid var(--ac-oro); padding-left: .55rem; }
.ac-st-reps { font-family: var(--ac-font-text); font-size: .72rem; color: var(--ac-fg-muted); }
.ac-st-count { font-style: normal; font-family: var(--ac-font-text); font-size: .72rem; padding: 0 .45rem; border-radius: 999px; border: 1px solid var(--ac-accent); }
.ac-st-bars { display: flex; }
.ac-st-pill {
  position: absolute; left: 12px; top: 10px; z-index: 3; padding: .3rem .8rem; border-radius: 999px; transition: opacity .15s;
  background: var(--ac-surface); border: 1px solid var(--ac-accent); font-family: var(--ac-font-display); font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); pointer-events: none;
}
/* compás: figuras encima, nombre debajo; se ensancha según sus acordes */
.ac-st-bar {
  position: relative; flex: none; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer;
  width: max(var(--st-bar-w), calc(var(--parts, 1) * (var(--st-diag) + 18px))); border-left: 2px solid var(--ac-line);
}
.ac-st-bar:last-child { border-right: 2px solid var(--ac-line); }
.ac-st-bar:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: -2px; }
.ac-st-diag { display: flex; align-items: flex-end; min-height: calc(var(--st-diag) * 1.45 + 1.4rem); padding: .2rem 0; }
.ac-st-slot { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 3px; }
.ac-st-study .ac-st-slot, .ac-study .ac-st-slot .ac-chord svg { width: var(--st-diag); height: auto; }
.ac-study .ac-chord { display: grid; justify-items: center; gap: .15rem; }
.ac-study .ac-chord .grid { stroke: var(--ac-fg-muted); }
.ac-study .ac-chord .nut { stroke: var(--ac-fg); }
.ac-study .ac-chord .dot { fill: var(--ac-fill); }
.ac-study .ac-chord .open { fill: none; stroke: var(--ac-second); }
.ac-study .ac-chord .mute { stroke: var(--ac-fg-muted); }
.ac-study .ac-chord .finger { fill: var(--ac-on-fill); font-weight: 700; }
.ac-study .ac-chord-name { font-family: var(--ac-font-display); font-size: calc(var(--st-fs) * .8); color: var(--ac-accent); line-height: 1; }
.ac-study .ac-chord.is-tied { opacity: .55; }
.ac-study .ac-chord.is-tied .ac-chord-name { color: var(--ac-fg-muted); }
.ac-study .ac-chord.is-ghost { opacity: .3; }
.ac-study .ac-chord.is-ghost .ac-chord-name { color: var(--ac-fg-muted); }
.ac-st-note { align-self: center; color: var(--ac-fg-muted); font-size: .7rem; letter-spacing: .08em; }
.ac-st-cell {
  position: relative; display: flex; align-items: stretch; border-block: 1px solid var(--ac-line); padding: .55rem 0;
  font-family: "Petaluma Script", var(--ac-font-display); font-size: var(--st-fs); line-height: 1.1; text-align: center; transition: background .08s;
}
.ac-st-cell[data-clef] { padding-inline-start: 1.2rem; }
.ac-st-cell[data-clef]::before {
  content: attr(data-cn) "\A" attr(data-cd); white-space: pre; text-align: center; position: absolute; left: .3rem; top: 50%;
  transform: translateY(-50%); font: 700 .75rem/.95 var(--ac-font-display); color: var(--ac-fg-muted); pointer-events: none;
}
.ac-st-sub { position: relative; flex: 1 1 0; min-width: 0; display: grid; place-items: center; padding: 0 3px; white-space: nowrap; }
.ac-st-sub + .ac-st-sub { border-left: 1px dashed var(--ac-line); }
.ac-st-sub.is-tie { color: var(--ac-fg-muted); }
.ac-st-n { position: absolute; left: 4px; top: 1px; font: 500 .6rem var(--ac-font-text); color: var(--ac-fg-muted); }
.ac-st-bar.is-repeat .ac-st-cell { color: var(--ac-fg-muted); opacity: .75; }
.ac-st-bar.is-current .ac-st-cell { box-shadow: inset 0 0 0 2px var(--ac-accent); background: rgba(var(--ac-accent-rgb), .14); }
.ac-st-bar.is-current .ac-chord:not(.is-ghost) svg { filter: drop-shadow(0 0 6px rgba(var(--ac-accent-rgb), .55)); }
.ac-st-bar.is-current::before { content: "\25BC"; align-self: center; color: var(--ac-accent); font-size: .8rem; line-height: 1; margin-bottom: -.15rem; order: -1; position: relative; top: 2px; }
/* RD38: loop de sección en el estudio: ⟲ tras el nombre de la sección, el contador de vueltas y el tramo del mapa marcado */
.ac-st-loop {
  position: relative; flex: none; align-self: center; width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
  margin-left: .2rem; border: 1px solid rgba(var(--ac-accent-rgb), .5); border-radius: 999px; background: transparent;
  color: var(--ac-accent); cursor: pointer;
}
.ac-st-loop::before { content: ""; position: absolute; inset: -5px; border-radius: 999px; }
.ac-st-loop:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: 2px; }
.ac-st-loop[aria-pressed="true"] { background: var(--ac-fill); border-color: var(--ac-fill); color: var(--ac-on-fill); }
.ac-st-label.is-looping { color: var(--ac-accent); }
.ac-st-label.is-looping .ac-st-count { display: none; }  /* cada vuelta es una pasada: sin «1 / 2» */
.ac-st-lap {
  font-style: normal; font-family: var(--ac-font-text); font-size: .72rem; font-weight: 600; padding: 0 .45rem; border-radius: 999px;
  background: var(--ac-fill); color: var(--ac-on-fill); align-self: center;
}
.ac-st-lap:empty { display: none; }
.ac-st-mseg.is-loop { outline: 2px solid var(--ac-fill); outline-offset: 1px; }
/* RD37: el compás de inicio en el estudio: casilla marcada y una cinta «Desde aquí» colgando bajo ella */
.ac-st-cell, .ac-st-pgc { -webkit-tap-highlight-color: transparent; }
.ac-st-cell:active, .ac-st-pgc:active { background: rgba(var(--ac-accent-rgb), .25); }
.ac-st-bar.has-start .ac-st-cell, .ac-st-pgc.has-start { box-shadow: inset 5px 0 0 var(--ac-fill); }
:where(.ac-st-bar.has-start) .ac-st-cell, .ac-st-pgc:where(.has-start) { background: rgba(var(--ac-accent-rgb), .1); }
.ac-st-bar.has-start.is-current .ac-st-cell, .ac-st-pgc.has-start.is-current { box-shadow: inset 0 0 0 2px var(--ac-accent), inset 5px 0 0 var(--ac-fill); }
.ac-st-pgc { position: relative; }
.ac-st-flag {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 2; height: 1.9rem; padding-bottom: .4rem;
  display: flex; align-items: center; justify-content: center; gap: .3rem;
  background: var(--ac-fill); color: var(--ac-on-fill); font: 600 .78rem/1 var(--ac-font-text); white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); pointer-events: none;
}
/* vertical (como la página, a pantalla completa, con figuras) */
.ac-st-vert { position: absolute; inset: 0; overflow-y: auto; padding: 1rem 1.2rem 40vh; }
.ac-st-vsec { margin-bottom: 1rem; padding: .8rem 1rem 1rem; opacity: .6; border: 1px solid rgba(var(--ac-accent-rgb), .35); border-left: 4px solid var(--ac-oro); border-radius: 4px; background: color-mix(in srgb, var(--ac-oro) 4%, var(--ac-surface)); }
.ac-st-vsec.is-cur-sec { opacity: 1; }
.ac-st-vsec .ac-st-label { margin-bottom: .5rem; border-left: 0; padding-left: 0; }
.ac-st-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 2px solid var(--ac-line); }
.ac-st-grid .ac-st-bar { width: auto; min-width: 0; border-left: 0; border-right: 2px solid var(--ac-line); }
.ac-st-grid .ac-chord svg { width: min(var(--st-diag), 88%); }
/* celular vertical: páginas de hasta 3 figuras; la siguiente, en tenue y solo con nombres */
.ac-st-pager { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; padding: 0 12px; }
.ac-st-pgblock { display: flex; flex-direction: column; gap: .5rem; }
.ac-st-pgblock.is-next { opacity: .5; }
.ac-st-pgblock.is-next .ac-st-label { font-size: .9rem; border-left-color: var(--ac-fg-muted); }
.ac-st-pgrow { display: flex; border-right: 2px solid var(--ac-line); }
.ac-st-grp { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; border-left: 2px solid var(--ac-line); }
.ac-st-pgdiag { display: flex; justify-content: space-evenly; align-items: flex-end; min-height: calc(var(--st-diag) * 1.4 + 1.3rem); padding: .3rem 0; }
.ac-st-pgdiag .ac-chord svg { width: var(--st-diag); height: auto; }
.ac-st-pgcells { display: flex; border-block: 1px solid var(--ac-line); }
.ac-st-pgc {
  display: flex; align-items: center; justify-content: space-evenly; gap: .2rem; padding: .55rem .1rem; min-width: 0; cursor: pointer;
  font-family: "Petaluma Script", var(--ac-font-display); font-size: var(--st-fs); text-align: center; white-space: nowrap;
}
.ac-st-pgc + .ac-st-pgc { border-left: 1px dashed var(--ac-line); }
.ac-st-pgc.is-repeat { color: var(--ac-fg-muted); opacity: .75; justify-content: center; }
.ac-st-pgc.is-current { box-shadow: inset 0 0 0 2px var(--ac-accent); background: rgba(var(--ac-accent-rgb), .14); }
.ac-st-pgc:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: -2px; }
.ac-st-grp.is-current .ac-st-pgdiag .ac-chord svg { filter: drop-shadow(0 0 6px rgba(var(--ac-accent-rgb), .55)); }
.ac-st-pgblock.is-next .ac-st-pgc { padding: .35rem .1rem; }
.ac-st-dots { display: flex; gap: 4px; justify-content: center; }
.ac-st-dots i { width: 18px; height: 4px; border-radius: 2px; background: var(--ac-line); }
.ac-st-dots i.is-on { background: var(--ac-fill); }
/* mapa de secciones */
.ac-st-map { flex: none; display: flex; gap: 2px; padding: .4rem .8rem .5rem; border-top: 1px solid var(--ac-line); background: var(--ac-bg); }
.ac-st-mseg {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; min-width: 0; height: 22px; overflow: hidden; cursor: pointer;
  border-radius: 5px; background: color-mix(in srgb, var(--ac-accent) 18%, var(--ac-surface)); font-size: .65rem; color: var(--ac-fg-muted);
}
.ac-st-mseg:focus-visible { outline: 2px solid var(--ac-fill); outline-offset: 1px; }
.ac-st-mseg.is-cur { background: var(--ac-fill); color: var(--ac-on-fill); font-weight: 700; }
.ac-st-mseg i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .18); }
.ac-st-mseg span { position: relative; padding: 0 .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 575.98px) {
  .ac-st-ctl { flex: 1 1 100%; }
  .ac-st-ctl .ac-met-sec-tempo .small { display: none; }
  .ac-st-ctl .card-body { gap: .35rem !important; }
  .ac-st-ctl .btn { --bs-btn-padding-x: .45rem; }
  .ac-st-ctl .ac-met-toggle { min-width: 0; }
  .ac-st-ctl .ac-met-input { width: 3.2rem; }
  .ac-st-ctl .ac-met-sec-tempo { gap: .3rem; }
  .ac-st-title small, .ac-st-lbl, .ac-st-tabs .ac-ver-text { display: none; }
  .ac-st-mseg span { display: none; }
  .ac-st-main { --st-diag: 92px; }
}
@media (max-height: 520px) and (min-width: 576px) {
  .ac-st-top { flex-wrap: nowrap; gap: .4rem; padding: .3rem .6rem; }
  .ac-st-title, .ac-st-lbl, .ac-st-tabs .ac-ver-text { display: none; }
  .ac-st-ctl .card-body { flex-wrap: nowrap; gap: .4rem !important; }
  .ac-st-ctl .ac-met-sec-tempo .small { display: none; }
  .ac-st-ctl .ac-met-input { width: 3.8rem; }
}
@media (prefers-reduced-motion: reduce) { .ac-st-sec, .ac-st-cell { transition: none; } }
@media (forced-colors: active) { .ac-st-bar.is-current .ac-st-cell, .ac-st-pgc.is-current { outline: 2px solid Highlight; } }
