/* ══════════════════════════════════════════════════════════════
   Diagramas de acordes (js/acordes.js) — Canciones, Atril, Ensayo
   Los diagramas van sobre un panel siempre oscuro (--stage-*) en ambos temas.
   ══════════════════════════════════════════════════════════════ */
.acd-ov[hidden] { display: none }
.acd-ov { z-index: 1200 }
.acd-box { max-width: 560px }
.acd-head { align-items: flex-start }
.acd-nombre { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--chord-color) }
.acd-notas { margin-top: .2rem; font-size: .82rem; color: var(--text2) }
.acd-x {
  width: 40px; height: 40px; flex-shrink: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text2);
}
.acd-x:hover { background: var(--surface2); color: var(--text) }
.acd-tabs { display: flex; gap: 2px; padding: 3px; margin-bottom: .9rem; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius) }
.acd-tabs button {
  flex: 1; min-height: 40px; cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: none; border: none; border-radius: 7px; font: inherit;
  color: var(--text2); font-size: .86rem; font-weight: 600;
}
.acd-tabs button:hover { color: var(--text) }
.acd-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25) }
.acd-tabs .ico { width: 17px; height: 17px }

.acd-cont { background: var(--stage-bg); color: var(--stage-text); border-radius: var(--radius); padding: .9rem; overflow-x: auto }
.acd-fila { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; justify-content: center }
.acd-col { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start }
.acd-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem }
.acd-col .acd-fig { align-items: flex-start; max-width: 100% }
.acd-fig figcaption { font-size: .74rem; color: var(--stage-text2); text-align: center; max-width: 220px }
.acd-col .acd-fig figcaption { text-align: left; max-width: none }
.acd-fig svg { display: block; max-width: 100%; height: auto }
.acd-vacio { margin: .5rem; color: var(--stage-text2); font-size: .85rem }
.acd-pie { margin: .7rem 0 0; font-size: .8rem; color: var(--text2); line-height: 1.45 }
.acd-pie:empty { display: none }

/* SVG: mástil */
.acd-linea { stroke: #57534e; stroke-width: 1 }
.acd-cuerda { stroke: #a8a29e }
.acd-cejuela { fill: #e7e5e4 }
.acd-traste { fill: var(--stage-text2); font: 600 11px var(--font-ui) }
.acd-mx { fill: #a8a29e; font: 700 14px var(--font-ui); stroke: none }
.acd-cej { fill: #fbbf24; opacity: .35 }
.acd-dot, .acd-al { stroke: none }
.acd-raiz { fill: #fbbf24 }
.acd-nota { fill: #e7e5e4 }
.acd-bajo { fill: #4ade80 }
.acd-al { fill: none; stroke-width: 2 }
.acd-al.acd-raiz { stroke: #fbbf24 } .acd-al.acd-nota { stroke: #d6d3d1 } .acd-al.acd-bajo { stroke: #4ade80 }
.acd-dt { font: 700 9px var(--font-ui); fill: #1c1917 }
.acd-alt { font: 700 8px var(--font-ui); fill: var(--stage-text) }

/* SVG: teclado */
.acd-tb { fill: #f5f5f4; stroke: #292524; stroke-width: 1 }
.acd-tn { fill: #1c1917; stroke: #0c0a09; stroke-width: 1 }
.acd-tb.acd-raiz { fill: #fbbf24 } .acd-tb.acd-nota { fill: #fde68a } .acd-tb.acd-bajo { fill: #4ade80 }
.acd-tn.acd-raiz { fill: #f59e0b } .acd-tn.acd-nota { fill: #d97706 } .acd-tn.acd-bajo { fill: #16a34a }
.acd-tbt { font: 700 9px var(--font-ui); fill: #1c1917 }
.acd-tnt { font: 700 7.5px var(--font-ui); fill: #fff }

/* Acordes tocables en la letra (Atril, Ensayo) */
.ch { cursor: pointer; border-radius: 3px; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px }
.ch:hover { color: var(--chord-hover); background: rgba(251,191,36,.14) }
.ch:focus-visible { outline: 2px solid var(--chord-color); outline-offset: 1px }

@media (max-width: 480px) {
  .acd-box { padding: 1rem }
  .acd-nombre { font-size: 1.45rem }
  .acd-cont { padding: .7rem .5rem }
}
@media print { .acd-ov { display: none !important } }
.acd-box:focus { outline: none }

/* ── Acordes por sección (Canciones «Solo acordes», Atril «Acordes», Detector) ── */
.cs-lista { display: flex; flex-direction: column; gap: .55em; font-family: var(--font-mono) }
.cs-fila { display: grid; grid-template-columns: minmax(6.5em, max-content) minmax(0, 1fr); gap: .3em 1em; align-items: baseline; padding: .45em .6em; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2) }
.cs-nom { font-family: var(--font, inherit); font-size: .72em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text2) }
.cs-acordes { display: flex; flex-wrap: wrap; gap: .25em .7em; align-items: baseline }
.cs-ch { font-weight: 700; color: var(--chord-color) }
.cs-veces { font-size: .75em; color: var(--text3); font-weight: 600 }
.cs-fila.cur { border-color: var(--accent); background: var(--accent-soft) }
.cs-fila.nx { border-style: dashed; border-color: var(--accent-line) }
.cs-vacio { color: var(--text2); font-size: .9rem }
@media (max-width: 520px) { .cs-fila { grid-template-columns: minmax(0, 1fr) } }
