/*
  Раздел аккордов /akkordy (chord-pages). Поверх lessons.css (.lx): схемы клавиатур в inline SVG,
  таблицы аккордов, блоки «как сыграть».
*/
.cd-board {
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius);
  background: #fff;
  box-shadow: var(--lx-shadow);
}

.cd-board h2 {
  margin-bottom: .35rem;
  font-size: 1.35rem;
}

.cd-board-sub {
  margin-bottom: 1rem;
  color: var(--lx-muted);
}

/* Схема шире экрана телефона — прокручивается сама, страница не едет. */
.cd-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c9d5e8 transparent;
}

.cd-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  font-family: Nunito, sans-serif;
}

.cd-key circle,
.cd-key rect {
  fill: #fff;
  stroke: #c9d6ea;
  stroke-width: 1.5;
}

.cd-key text {
  fill: var(--lx-muted);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
}

.cd-key.cd-black rect {
  fill: #2a3448;
  stroke: #2a3448;
}

.cd-key.cd-black text {
  fill: #fff;
}

.cd-key.cd-white text {
  dominant-baseline: auto;
}

.cd-key.cd-primary circle,
.cd-key.cd-primary rect {
  fill: var(--lx-blue);
  stroke: var(--lx-blue-ink);
}

.cd-key.cd-primary text {
  fill: #fff;
  font-weight: 800;
}

.cd-key.cd-bass circle,
.cd-key.cd-bass rect {
  fill: var(--lx-free);
  stroke: #0b5c3b;
}

.cd-key.cd-bass text {
  fill: #fff;
  font-weight: 800;
}

.cd-key.cd-duplicate circle,
.cd-key.cd-duplicate rect {
  fill: var(--lx-blue-soft);
  stroke: var(--lx-blue);
  stroke-dasharray: 4 3;
}

.cd-key.cd-duplicate text {
  fill: var(--lx-blue-ink);
}

.cd-row {
  text-anchor: end;
  fill: var(--lx-muted);
  font-size: 12px;
  font-weight: 700;
  dominant-baseline: central;
}

.cd-caption {
  margin: .75rem 0 0;
  font-size: .9rem;
  color: var(--lx-muted);
}

.cd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  color: var(--lx-text);
}

.cd-legend li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.cd-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #c9d6ea;
  background: #fff;
}

.cd-dot-primary { background: var(--lx-blue); border-color: var(--lx-blue-ink); }
.cd-dot-bass { background: var(--lx-free); border-color: #0b5c3b; }
.cd-dot-duplicate { background: var(--lx-blue-soft); border: 1.5px dashed var(--lx-blue); }

.cd-how h2 {
  margin-bottom: 1rem;
}

.cd-how h3 {
  margin: 1.5rem 0 .5rem;
  font-size: 1.15rem;
}

.cd-how p {
  line-height: 1.7;
}

.cd-chords {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: .75rem;
  margin: 1rem 0 2.5rem;
  padding: 0;
  list-style: none;
}

.cd-chord {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  height: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--lx-line);
  border-radius: 12px;
  background: #fff;
  color: var(--lx-ink);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cd-chord:hover,
.cd-chord:focus-visible {
  border-color: var(--lx-blue);
  box-shadow: var(--lx-shadow);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--lx-ink);
}

.cd-chord strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.cd-chord span {
  overflow-wrap: anywhere;
  hyphens: auto;
  font-size: .85rem;
  color: var(--lx-muted);
}

.cd-instruments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cd-instrument {
  padding: 1.5rem;
  border: 1px solid var(--lx-line);
  border-radius: var(--lx-radius);
  background: #fff;
  box-shadow: var(--lx-shadow);
}

.cd-instrument h2 {
  font-size: 1.35rem;
}

.cd-instrument h2 a {
  color: inherit;
}

.cd-instrument .cd-chords {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.cd-faq dt {
  margin-top: 1.25rem;
  color: var(--lx-ink);
  font-weight: 700;
}

.cd-faq dd {
  margin: .35rem 0 0;
  line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  .cd-chord { transition: none; }
  .cd-chord:hover { transform: none; }
}

.cd-key text.cd-sm {
  font-size: 10px;
  letter-spacing: -.02em;
}

/* Подписи в трёх системах программы: видна одна, её выбирает переключатель (без JS). */
.cd-key text.cd-xs {
  font-size: 9px;
  letter-spacing: -.03em;
}

.cd-t {
  display: none;
}

#cd-n-letters:checked ~ .cd-board .cd-t-letters,
#cd-n-syllables:checked ~ .cd-board .cd-t-syllables,
#cd-n-digits:checked ~ .cd-board .cd-t-digits {
  display: inline;
}

.cd-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cd-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin-bottom: 1.5rem;
}

.cd-switch-label {
  color: var(--lx-muted);
  font-weight: 600;
}

.cd-switch-options {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--lx-line);
  border-radius: 12px;
  background: #fff;
}

.cd-switch-option {
  margin: 0;
  padding: .45rem 1rem;
  border-radius: 9px;
  color: var(--lx-text);
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

#cd-n-letters:checked ~ .cd-switch [for="cd-n-letters"],
#cd-n-syllables:checked ~ .cd-switch [for="cd-n-syllables"],
#cd-n-digits:checked ~ .cd-switch [for="cd-n-digits"] {
  background: var(--lx-blue);
  color: #fff;
}

#cd-n-letters:focus-visible ~ .cd-switch [for="cd-n-letters"],
#cd-n-syllables:focus-visible ~ .cd-switch [for="cd-n-syllables"],
#cd-n-digits:focus-visible ~ .cd-switch [for="cd-n-digits"] {
  outline: 3px solid rgba(37, 104, 239, .55);
  outline-offset: 2px;
}

.cd-program {
  width: 100%;
  margin: 1rem 0 0;
  border-collapse: collapse;
}

.cd-program th,
.cd-program td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--lx-line);
  text-align: left;
  vertical-align: top;
}

.cd-program th {
  color: var(--lx-muted);
  font-weight: 600;
  font-size: .9rem;
}

.cd-program td {
  color: var(--lx-ink);
  font-weight: 700;
}

.cd-program small {
  display: block;
  color: var(--lx-muted);
  font-weight: 400;
}

@media (max-width: 575px) {
  .cd-program th,
  .cd-program td {
    padding: .5rem .35rem;
    font-size: .9rem;
  }
}
