/* ==========================================================================
   ГАРМОНЬ — цифровая хромка
   Тёплое дерево, латунь, бумага и немного сцены.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #17110e;
  --bg-deep: #100b09;
  --panel: #241a14;
  --panel-2: #2d2018;
  --panel-3: #36261c;
  --ink: #f3e7d2;
  --ink-soft: #dcc9ac;
  --muted: #b39c7f;
  --faint: #8c7359;
  --gold: #d8a64a;
  --gold-soft: #edc87f;
  --gold-deep: #9b6d25;
  --red: #b54434;
  --red-bright: #df6d56;
  --red-deep: #6f251c;
  --teal: #5aa596;
  --teal-deep: #245d53;
  --tonic: #ff9a3c;
  --tonic-soft: #ffc887;
  --tonic-deep: #b95b12;
  --paper: #f3e8d2;
  --paper-2: #eadcc1;
  --paper-ink: #2c2118;
  --line: rgba(240, 220, 186, 0.12);
  --line-strong: rgba(240, 220, 186, 0.22);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius-lg: 24px;
  --radius-md: 16px;
  --key-size: clamp(28px, 2.55vw, 38px);
  --key-gap: clamp(5px, 0.55vw, 8px);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Roboto Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(124, 61, 35, 0.38), transparent 60%),
    radial-gradient(900px 600px at -12% 30%, rgba(88, 42, 26, 0.33), transparent 62%),
    linear-gradient(165deg, #1d1511 0%, #130e0b 55%, #0e0a08 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(0, 0, 0, 0.08) 5px 6px);
  z-index: 0;
}

::selection { background: var(--gold); color: #24170d; }

button, input, select { font: inherit; }
button { color: inherit; }

.app {
  position: relative;
  z-index: 1;
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 26px clamp(18px, 3.4vw, 52px) 30px;
}

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.ambient-one { width: 420px; height: 420px; background: rgba(159, 66, 36, 0.18); top: -160px; right: 12%; }
.ambient-two { width: 360px; height: 360px; background: rgba(216, 166, 74, 0.08); bottom: 8%; left: -140px; }

/* --- Верхняя панель ------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(216, 166, 74, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 232, 190, 0.24), transparent 55%),
    linear-gradient(145deg, #743226, #391712 70%);
  box-shadow: inset 0 0 0 4px rgba(15, 9, 7, 0.35), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(216, 166, 74, 0.33);
  border-radius: 50%;
}
.brand-key {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 7px rgba(237, 200, 127, 0.8);
}
.brand-key-a { top: 22px; left: 23px; }
.brand-key-b { top: 22px; left: 34px; }
.brand-key-c { top: 34px; left: 28px; }
.brand-key-d { top: 34px; left: 39px; }

.brand-copy { min-width: 0; }
.kicker {
  display: block;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.4;
}
.brand h1 {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.075em;
}
.brand-dot { color: var(--red-bright); }
.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.top-actions { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.top-field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 9, 7, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}
.seg-button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.seg-button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.seg-button.is-active {
  color: #2b1c0f;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.instrument-switch .seg-button { padding: 7px 9px; font-size: 9.5px; }

.select-wrap { position: relative; display: block; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 192px;
  padding: 10px 36px 10px 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(54, 38, 28, 0.95), rgba(30, 21, 16, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.select-wrap select:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.18); }
.select-chevron {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--gold);
  font-size: 14px;
  pointer-events: none;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 168px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(47, 33, 25, 0.92), rgba(27, 19, 15, 0.95));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.sound-toggle:hover { border-color: rgba(216, 166, 74, 0.5); }
.sound-toggle.is-ready { border-color: rgba(90, 165, 150, 0.45); }
.sound-toggle.is-muted { opacity: 0.66; }

.guitar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 136px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(47, 33, 25, 0.92), rgba(27, 19, 15, 0.95));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.guitar-toggle:hover { border-color: rgba(216, 166, 74, 0.5); }
.guitar-toggle.is-off { opacity: 0.58; }
.guitar-glyph {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  width: 31px;
  height: 31px;
  padding: 6px 7px;
  border: 1px solid rgba(216, 166, 74, 0.34);
  border-radius: 50%;
  background: rgba(216, 166, 74, 0.08);
}
.guitar-glyph i { display: block; height: 1px; border-radius: 1px; background: var(--gold-soft); }
.guitar-glyph i:nth-child(1), .guitar-glyph i:nth-child(6) { background: rgba(237, 200, 127, 0.6); }
.guitar-glyph i:nth-child(2), .guitar-glyph i:nth-child(5) { background: rgba(237, 200, 127, 0.8); }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 128px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(47, 33, 25, 0.92), rgba(27, 19, 15, 0.95));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { border-color: rgba(216, 166, 74, 0.5); }
.theme-glyph {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset -6px -4px 0 0 var(--gold-soft);
  transform: rotate(-18deg);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.theme-toggle.is-light .theme-glyph {
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.16), 0 0 10px rgba(237, 200, 127, 0.45);
  transform: none;
}

.chord-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.theory-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(216, 166, 74, 0.42);
  border-radius: 50%;
  color: var(--gold-soft);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 232, 190, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(54, 38, 28, 0.95), rgba(27, 19, 15, 0.96));
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.theory-toggle:hover {
  border-color: rgba(237, 200, 127, 0.78);
  box-shadow: 0 0 0 4px rgba(216, 166, 74, 0.1), 0 8px 20px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
.theory-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.theory-glyph {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-1px);
}

.sound-toggle.is-muted .sound-icon span { animation: none; height: 3px; }
.sound-copy { display: flex; flex-direction: column; gap: 1px; }
.sound-copy b { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.sound-copy small { color: var(--muted); font-size: 9px; letter-spacing: 0.02em; }
.sound-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(216, 166, 74, 0.34);
  border-radius: 50%;
  background: rgba(216, 166, 74, 0.08);
}
.sound-icon span { width: 2px; border-radius: 2px; background: var(--gold-soft); height: 8px; }
.sound-icon span:nth-child(2) { height: 14px; }
.sound-icon span:nth-child(3) { height: 10px; }
.sound-icon span:nth-child(4) { height: 5px; }
.sound-toggle.is-ready .sound-icon span { animation: soundBars 1.25s ease-in-out infinite; }
.sound-toggle.is-ready .sound-icon span:nth-child(2) { animation-delay: 0.12s; }
.sound-toggle.is-ready .sound-icon span:nth-child(3) { animation-delay: 0.25s; }
.sound-toggle.is-ready .sound-icon span:nth-child(4) { animation-delay: 0.34s; }
@keyframes soundBars {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.2); }
}

/* --- Строка состояния ---------------------------------------------------- */

.subbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 2px 18px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.subbar-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.subbar-sep { width: 1px; height: 10px; background: var(--line-strong); }
.subbar-spacer { flex: 1; }
.subbar-hint { color: var(--muted); font-size: 10px; letter-spacing: 0.03em; text-transform: none; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(90, 165, 150, 0.8);
}

/* --- Сетка ---------------------------------------------------------------- */

[hidden] { display: none !important; }

/* Главный экран: гармонь — во всю ширину левой колонки, аккорды —
   на правой вертикали, тренажёр — сразу под гармонью. Дополнительные
   инструменты живут внизу и по умолчанию свёрнуты. */
.workspace {
  display: grid;
  --order-areas:
    "instrument chord"
    "guitar chord"
    "piano chord"
    "practice chord"
    "theory theory"
    "extras extras";
  --order-areas-mobile:
    "instrument"
    "guitar"
    "piano"
    "chord"
    "practice"
    "theory"
    "extras";
  grid-template-columns: minmax(0, 1fr) 408px;
  grid-template-areas: var(--order-areas);
  gap: 20px;
  align-items: start;
}
/* Шпаргалка закрыта — инструменты и тренажёр занимают всю ширину. */
.workspace.is-sheet-closed { grid-template-columns: minmax(0, 1fr); }
.instrument-card { grid-area: instrument; min-width: 0; }
.guitar-card { grid-area: guitar; min-width: 0; }
.piano-card { grid-area: piano; min-width: 0; }
.chord-card { grid-area: chord; min-width: 0; }
.practice-card { grid-area: practice; min-width: 0; }
.theory-page-card { grid-area: theory; min-width: 0; }
.extras { grid-area: extras; min-width: 0; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(90, 55, 33, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(43, 30, 22, 0.98), rgba(28, 20, 15, 0.99));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(216, 166, 74, 0.04);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}
.card-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.015em;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(216, 166, 74, 0.3);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.07);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.badge-soft { color: var(--teal); border-color: rgba(90, 165, 150, 0.32); background: rgba(90, 165, 150, 0.08); }
.card-lead { margin: 12px 20px 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }

/* --- Аккорды ------------------------------------------------------------- */

.chord-card { padding-bottom: 18px; }
.chord-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 15px 20px 16px;
}
.chord-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.17s ease, background 0.17s ease, transform 0.17s ease;
}
.chord-chip:hover { border-color: rgba(216, 166, 74, 0.38); background: rgba(216, 166, 74, 0.05); transform: translateY(-1px); }
.chord-chip.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: linear-gradient(160deg, rgba(216, 166, 74, 0.16), rgba(181, 68, 52, 0.08));
  box-shadow: inset 0 0 0 1px rgba(216, 166, 74, 0.09);
}
.chip-symbol {
  grid-row: span 2;
  min-width: 26px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
}
.chip-name { color: var(--ink-soft); font-size: 9.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-row { color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.05em; }

.chord-focus {
  margin: 0 20px;
  padding: 15px;
  border: 1px solid rgba(216, 166, 74, 0.2);
  border-radius: 15px;
  background:
    radial-gradient(110% 90% at 85% 0%, rgba(181, 68, 52, 0.16), transparent 60%),
    rgba(12, 8, 6, 0.3);
}
.chord-focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chord-symbol {
  display: inline-block;
  margin-right: 7px;
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(216, 166, 74, 0.16);
}
.chord-fullname { color: var(--ink-soft); font-size: 11px; letter-spacing: 0.02em; vertical-align: middle; }
.chord-row-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.chord-notes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.chord-note {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(240, 220, 186, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}
.chord-note b { color: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 600; }
.chord-note small { color: var(--faint); font-size: 8px; }
/* --- Формула аккорда и ступени ------------------------------------------- */

.chord-formula-block { margin-top: 12px; }
.chord-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.formula-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(90, 165, 150, 0.34);
  border-radius: 7px;
  background: rgba(90, 165, 150, 0.09);
  color: #bfe8dd;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.formula-step.is-tonic {
  border-color: rgba(255, 154, 60, 0.7);
  background: rgba(255, 154, 60, 0.13);
  color: var(--tonic-soft);
  box-shadow: 0 0 12px rgba(255, 154, 60, 0.12);
}
.formula-sep { color: var(--faint); font-family: var(--mono); font-size: 10px; }
.chord-formula-hint { margin: 6px 0 0; color: var(--faint); font-size: 8.5px; line-height: 1.5; }
.chord-degree {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(90, 165, 150, 0.15);
  color: #a9e0d3;
  font-family: var(--mono);
  font-size: 7.5px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.chord-note.is-tonic {
  border-color: rgba(255, 154, 60, 0.44);
  background: rgba(255, 154, 60, 0.08);
}
.chord-note.is-tonic .chord-degree {
  background: rgba(255, 154, 60, 0.18);
  color: var(--tonic-soft);
}

.fingering-copy { margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.fingering-copy b { color: var(--ink-soft); font-weight: 600; }

/* --- Компактная нотная тетрадь в карточке аккордов ----------------------- */

.chord-notebook {
  margin: 12px -6px 0;
  padding: 8px 8px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 5, 4, 0.25);
}
.chord-notebook-standalone {
  margin: 14px 20px 0;
  padding: 10px;
  border-color: rgba(216, 166, 74, 0.2);
  background: rgba(8, 5, 4, 0.3);
}
.notebook-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.notebook-head .voicing-label { margin: 0; }
.notebook-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.notebook-count select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 34px;
  padding: 3px 15px 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink-soft);
  background:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%) calc(100% - 8px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) calc(100% - 5px) 50% / 4px 4px no-repeat,
    rgba(12, 8, 6, 0.4);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
.notebook-count select:focus-visible { border-color: var(--gold); }
.notebook-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.notebook-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 7px; }
.notebook-options { display: flex; align-items: center; gap: 4px; }
.notebook-font { display: inline-flex; align-items: center; gap: 2px; }
.notebook-font .notebook-option { padding: 2px 6px; font-size: 9px; }
.notebook-font-value { min-width: 26px; color: var(--faint); font-family: var(--mono); font-size: 7px; text-align: center; }
.notebook-option,
.notebook-clear {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.notebook-option:hover,
.notebook-clear:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.5); }
.notebook-option.is-active { color: var(--gold-soft); border-color: rgba(216, 166, 74, 0.62); background: rgba(216, 166, 74, 0.12); }
.notebook-clear { margin-left: auto; }
.notebook-paper {
  position: relative;
  padding: 2px;
  border: 1px solid rgba(74, 53, 34, 0.22);
  border-radius: 7px;
  background:
    radial-gradient(100% 100% at 0% 0%, rgba(255, 255, 255, 0.42), transparent 58%),
    linear-gradient(180deg, #f7eedc, #eddfc4);
  box-shadow: inset 0 0 18px rgba(96, 61, 27, 0.12);
  overflow: hidden;
}
.notebook-host { width: 100%; }
.notebook-host .staff-svg {
  display: block;
  width: 100%;
  height: auto;
}
.notebook-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #8b765c;
  font-family: var(--serif);
  font-size: 10px;
  font-style: italic;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}
.notebook-empty.is-hidden { opacity: 0; visibility: hidden; }
.notebook-tabs:empty { display: none; }
.tab-sheet {
  margin-top: 4px;
  padding: 2px 8px 3px 40px;
  border-top: 1px solid rgba(74, 53, 34, 0.18);
  background: rgba(255, 249, 237, 0.35);
  overflow-x: auto;
}
.tab-row {
  display: grid;
  grid-template-columns: 10px repeat(var(--tab-cols, 6), minmax(0, 1fr));
  align-items: center;
  min-height: 13px;
  border-bottom: 1px solid rgba(74, 53, 34, 0.28);
  color: #7b654c;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
}
.tab-row:last-child { border-bottom: none; }
.tab-string { color: #8b765c; font-size: 6.5px; font-weight: 700; }
.tab-cell { min-width: 0; text-align: center; color: #6d5a44; }
.tab-cell.is-set { color: #9e2f28; font-weight: 700; }
.staff-digit { fill: #7b654c; font-family: var(--mono); font-size: 8px; font-weight: 700; opacity: 0.9; }
.staff-digit.note-right { fill: #9e2f28; }
.staff-digit.note-left { fill: #23675c; }
.staff-digit.mini-staff-digit { font-size: calc(8px * var(--notebook-font-scale, 1)); }
.notebook-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 7px;
  letter-spacing: 0.03em;
}
.notebook-caption { margin-left: auto; font-family: var(--mono); font-size: 6.5px; }
.mini-accidental { font-size: 11px; }
.staff-label.mini-staff-label { font-size: calc(9px * var(--notebook-font-scale, 1)); letter-spacing: -0.02em; }

.hand-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.hand-summary-block {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}
.hand-summary-block > span {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hand-summary-block .hand-notes { margin-top: 0; min-height: 0; }
.hand-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.hand-actions .play-chord {
  width: 100%;
  margin: 0;
  padding: 7px 5px;
  font-size: 7.5px;
  letter-spacing: 0.05em;
}


.mini-keyboard {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  min-height: 122px;
  margin: 10px 0 2px;
  padding: 13px 8px 8px;
  border-radius: 10px;
  background: rgba(8, 5, 4, 0.26);
}
.mini-row { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mini-row.has-offset { padding-top: 12px; }
.mini-dot {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(240, 220, 186, 0.18);
  border-radius: 50%;
  background: #66503d;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.mini-dot.mini-chord { background: #8c4435; border-color: rgba(223, 109, 86, 0.5); }
.mini-dot.mini-bass { background: #a08e74; border-color: rgba(240, 220, 186, 0.3); }
.mini-dot.is-target {
  background: var(--gold-soft) !important;
  border-color: var(--gold-soft) !important;
  transform: scale(1.8);
  box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.18), 0 0 16px rgba(237, 200, 127, 0.8);
  animation: miniPulse 2.2s ease-in-out infinite;
}
.mini-dot.is-bass-target {
  background: var(--paper) !important;
  border-color: #fff !important;
  transform: scale(1.45);
  box-shadow: 0 0 0 2px rgba(243, 232, 210, 0.16);
}
@keyframes miniPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.16), 0 0 12px rgba(237, 200, 127, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(216, 166, 74, 0.08), 0 0 22px rgba(237, 200, 127, 0.9); }
}
.mini-legend { display: flex; justify-content: center; gap: 13px; color: var(--faint); font-size: 8px; letter-spacing: 0.04em; }
.legend-dot { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; }
.legend-chord { background: var(--gold); }
.legend-bass { background: var(--paper); }
.legend-melody { background: #e7d7bc; }
.legend-extra { background: #b8c7cc; }
.legend-note-right { background: var(--red-bright); }
.legend-note-left { background: var(--teal); }
.legend-fingering { background: #9edbca; box-shadow: 0 0 0 1px rgba(220, 245, 240, 0.55); }
.legend-tonic { background: var(--tonic); box-shadow: 0 0 0 1px rgba(255, 236, 210, 0.55), 0 0 8px rgba(255, 154, 60, 0.55); }
.legend-chord-tone { background: var(--teal); box-shadow: 0 0 0 1px rgba(36, 93, 83, 0.45); }

.play-chord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(216, 166, 74, 0.45);
  border-radius: 9px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.play-chord:hover { background: var(--gold); color: #2a1b0d; }
.play-glyph { font-size: 8px; }
.chord-tip {
  margin: 12px 20px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.55;
}
.theory-link {
  display: inline-flex;
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: var(--gold-soft);
  background: transparent;
  font-family: var(--sans);
  font-size: 9.5px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.theory-link:hover { color: var(--gold); }

.chord-builder { margin: 14px 20px 0; }
.builder-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 6px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.builder-head:first-child { margin-top: 0; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(216, 166, 74, 0.35);
  border-radius: 50%;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 7px;
}
.jazz-badge {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(181, 68, 52, 0.35);
  border-radius: 4px;
  color: #d9977f;
  background: rgba(181, 68, 52, 0.08);
  font-size: 7px;
  letter-spacing: 0.08em;
}
.builder-count {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(216, 166, 74, 0.28);
  border-radius: 4px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.07);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.root-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.root-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 32px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.root-chip b { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.root-chip small { color: var(--faint); font-size: 6.5px; line-height: 1; }
.root-chip:hover { border-color: rgba(216, 166, 74, 0.4); color: var(--ink); }
.root-chip.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: rgba(216, 166, 74, 0.12);
  color: var(--gold-soft);
}
.root-chip.is-selected small { color: var(--gold); }
.root-chip.is-disabled, .root-chip:disabled {
  opacity: 0.27;
  cursor: not-allowed;
  filter: saturate(0.4);
}
.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.category-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  padding: 6px 7px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.category-tab b {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.category-tab small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
}
.category-tab:hover { border-color: rgba(216, 166, 74, 0.4); color: var(--ink); }
.category-tab.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: rgba(216, 166, 74, 0.12);
  color: var(--gold-soft);
}
.category-tab.is-selected small { color: var(--gold); }
.category-hint {
  margin: 7px 0 0;
  min-height: 3.1em;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}
.quality-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.quality-chip {
  min-height: 27px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quality-chip:hover { border-color: rgba(216, 166, 74, 0.4); color: var(--ink); }
.quality-chip b { font-weight: 700; }
.quality-chip.is-jazz { color: #d69b83; border-color: rgba(181, 68, 52, 0.22); }
.quality-chip.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: rgba(216, 166, 74, 0.12);
  color: var(--gold-soft);
}
.quality-chip.is-jazz.is-selected { border-color: rgba(224, 139, 104, 0.65); background: rgba(181, 68, 52, 0.13); }
.quality-chip.is-disabled, .quality-chip:disabled {
  opacity: 0.24;
  cursor: not-allowed;
  filter: saturate(0.3);
}

.chord-picker {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 7px;
  margin: 14px 20px 0;
}
.picker-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.picker-field span {
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.picker-field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  padding: 8px 24px 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%) calc(100% - 12px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) calc(100% - 8px) 50% / 5px 5px no-repeat,
    rgba(12, 8, 6, 0.38);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.picker-field select:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(216, 166, 74, 0.15); }

.chord-availability {
  margin: 10px 20px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.chord-availability b { color: var(--gold-soft); font-weight: 700; }
.chord-availability.is-warning { color: #d7a17d; }

.voicing-block { margin-top: 13px; }
.voicing-label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.voicing-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.voicing-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.voicing-chip:hover { border-color: rgba(216, 166, 74, 0.4); color: var(--ink); }
.voicing-chip.is-root { border-color: rgba(90, 165, 150, 0.35); }
.voicing-chip.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: rgba(216, 166, 74, 0.12);
  color: var(--gold-soft);
}
.voicing-bass { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.voicing-kind { color: var(--faint); font-size: 7px; text-transform: uppercase; letter-spacing: 0.05em; }
.voicing-empty { color: var(--faint); font-size: 9px; font-style: italic; }

.hand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.hand-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 5, 4, 0.25);
}
.hand-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.hand-head span { color: var(--ink-soft); font-size: 8px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.hand-head small { color: var(--faint); font-size: 6.5px; letter-spacing: 0.03em; }
.hand-block .mini-keyboard {
  min-height: 0;
  margin: 4px 0 0;
  padding: 6px 2px 2px;
  gap: 4px;
  background: transparent;
}
.hand-block .mini-row { gap: 3px; }
.hand-block .mini-row.has-offset { padding-top: 9px; }
.hand-block .mini-dot { width: 6px; height: 6px; border-width: 1px; }
.mini-dot.mini-melody { background: #6e5a41; border-color: rgba(240, 220, 186, 0.22); }
.mini-dot.mini-extra { background: #90a6aa; border-color: rgba(220, 235, 236, 0.35); }
.mini-dot.is-right-target {
  background: var(--gold-soft) !important;
  border-color: var(--gold-soft) !important;
  transform: scale(1.6);
  box-shadow: 0 0 0 2px rgba(90, 165, 150, 0.32), 0 0 12px rgba(237, 200, 127, 0.75);
}
.hand-notes { display: flex; flex-wrap: wrap; gap: 3px; min-height: 28px; margin-top: 5px; align-content: flex-start; }
.hand-note {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}
.hand-note b { color: var(--ink-soft); font-family: var(--mono); font-size: 8px; font-weight: 600; }
.hand-note small { color: var(--faint); font-size: 6.5px; }
.hand-empty { color: var(--faint); font-size: 7.5px; line-height: 1.35; font-style: italic; }
.hand-play {
  width: 100%;
  margin: 6px 0 0;
  padding: 6px 4px;
  font-size: 7px;
  letter-spacing: 0.04em;
}
.play-chord:disabled, .hand-play:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  color: var(--faint);
  border-color: var(--line);
  background: transparent;
}
.chord-focus.is-unavailable { border-color: rgba(181, 68, 52, 0.38); background: rgba(181, 68, 52, 0.06); }

.garmon-key.is-right-fingering { z-index: 3; }
.garmon-key.kind-melody.is-right-fingering {
  color: #123c35;
  border-color: rgba(36, 93, 83, 0.85);
  background: radial-gradient(circle at 35% 27%, #f4fffc 0%, #d3f0e8 44%, #96cfc0 74%, #5f9f90 100%);
  box-shadow:
    0 3px 0 #3d6a60,
    0 6px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    0 0 0 2px rgba(90, 165, 150, 0.18);
}
.garmon-key.is-right-fingering::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(90, 165, 150, 0.12), 0 0 16px rgba(90, 165, 150, 0.45);
  animation: rightChordPulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
/* Все тоны аккорда — один бирюзовый цвет; выбранное обращение лишь ярче. */
.garmon-key.kind-melody.is-chord-tone:not(.is-right-fingering):not(.is-active) {
  color: #123c35;
  border-color: rgba(36, 93, 83, 0.85);
  background: radial-gradient(circle at 35% 27%, #f4fffc 0%, #d3f0e8 44%, #96cfc0 74%, #5f9f90 100%);
  box-shadow:
    0 3px 0 #3d6a60,
    0 6px 10px rgba(0, 0, 0, 0.36),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(90, 165, 150, 0.16);
}
.garmon-key.kind-melody.is-chord-tone:not(.is-right-fingering):not(.is-active)::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px rgba(36, 93, 83, 0.55);
  pointer-events: none;
}
/* Тоника — яркий оранжевый; этот же цвет используется на пианино и гитаре. */
.garmon-key.kind-melody.is-chord-tone.is-chord-root-tone:not(.is-active) {
  color: #4a2508;
  border-color: rgba(255, 200, 135, 0.9);
  background: radial-gradient(circle at 35% 27%, #fff0d8 0%, #ffc887 34%, #ff9a3c 72%, #b95b12 100%);
  box-shadow:
    0 3px 0 #7a3d0c,
    0 6px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    0 0 0 2px rgba(255, 154, 60, 0.3),
    0 0 18px rgba(255, 154, 60, 0.36);
}
.garmon-key.kind-melody.is-chord-tone.is-chord-root-tone:not(.is-active)::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--tonic);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 154, 60, 0.15), 0 0 16px rgba(255, 154, 60, 0.5);
  animation: none;
  pointer-events: none;
}
.garmon-key.is-bass-shell { z-index: 3; }
.garmon-key.is-bass-shell::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid #86a8c8;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(134, 168, 200, 0.12), 0 0 16px rgba(134, 168, 200, 0.42);
  pointer-events: none;
}
.mini-dot.is-bass-shell-target {
  background: #86a8c8 !important;
  border-color: #b8d2e8 !important;
  transform: scale(1.55);
  box-shadow: 0 0 0 2px rgba(134, 168, 200, 0.3), 0 0 12px rgba(134, 168, 200, 0.7);
}
/* Гамма: тоника — оранжевая, остальные ступени — бирюзовые. */
.garmon-key.kind-melody.is-scale-tone:not(.is-active) {
  color: #123c35;
  border-color: rgba(36, 93, 83, 0.85);
  background: radial-gradient(circle at 35% 27%, #f4fffc 0%, #d3f0e8 44%, #96cfc0 74%, #5f9f90 100%);
  box-shadow:
    0 3px 0 #3d6a60,
    0 6px 10px rgba(0, 0, 0, 0.36),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(90, 165, 150, 0.16);
}
.garmon-key.kind-melody.is-scale-tone.is-scale-tonic:not(.is-active) {
  color: #4a2508;
  border-color: rgba(255, 200, 135, 0.9);
  background: radial-gradient(circle at 35% 27%, #fff0d8 0%, #ffc887 34%, #ff9a3c 72%, #b95b12 100%);
  box-shadow:
    0 3px 0 #7a3d0c,
    0 6px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.78),
    0 0 0 2px rgba(255, 154, 60, 0.3);
}
.garmon-key.is-scale-current {
  z-index: 4;
}
.garmon-key.is-scale-current::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.16), 0 0 20px rgba(237, 200, 127, 0.65);
  animation: scalePulse 0.9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scalePulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}
@keyframes rightChordPulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}


/* --- Звук ---------------------------------------------------------------- */

.sound-card { padding-bottom: 16px; }
.sound-card .card-head { padding-bottom: 5px; }
.sound-caption { margin: 8px 20px 0; color: var(--faint); font-size: 9.5px; line-height: 1.55; }
.sample-credit { margin: 5px 20px 0; color: rgba(140, 115, 89, 0.8); font-size: 8px; letter-spacing: 0.03em; }
.sample-credit a { color: rgba(179, 156, 127, 0.9); text-decoration: none; border-bottom: 1px dotted rgba(216, 166, 74, 0.35); }
.sample-credit a:hover { color: var(--gold); }
.timbre-switch { display: flex; margin: 12px 16px 2px; }
.timbre-switch .seg-button { flex: 1; padding: 8px 8px; font-size: 10px; }
/* --- Звук гитары и пианино ---------------------------------------------- */

.sound-switch-row { margin-top: 14px; }
.sound-group {
  margin: 14px 20px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sound-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.sound-group-head b { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.sound-group-head small { color: var(--faint); font-size: 8px; letter-spacing: 0.04em; }
.sound-group .slider-row { margin: 9px 0 4px; }
.sound-group input[type="range"] { width: 100%; margin: 0; }
.play-instrument { color: var(--gold-soft); border-color: rgba(216, 166, 74, 0.4); }
.play-instrument:hover { color: #2a1b0d; background: var(--gold); }

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 20px 6px;
}
.slider-row label { color: var(--ink-soft); font-size: 10px; letter-spacing: 0.03em; }
.slider-row output { color: var(--gold-soft); font-family: var(--mono); font-size: 9px; }
input[type="range"] {
  display: block;
  width: calc(100% - 40px);
  height: 16px;
  margin: 0 20px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--fill, 50%), rgba(240, 220, 186, 0.13) var(--fill, 50%));
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(240, 220, 186, 0.16); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--gold); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 2px solid #2a1c11;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 1px rgba(216, 166, 74, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #2a1c11;
  border-radius: 50%;
  background: var(--gold-soft);
}
input[type="range"]:focus-visible { outline: 1px dashed var(--gold); outline-offset: 3px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 20px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.switch-copy { display: flex; flex-direction: column; gap: 2px; }
.switch-copy b { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.switch-copy small { color: var(--faint); font-size: 8.5px; }
.switch { position: relative; display: inline-block; width: 34px; height: 19px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + span { background: rgba(216, 166, 74, 0.22); border-color: rgba(216, 166, 74, 0.55); }
.switch input:checked + span::after { transform: translateX(15px); background: var(--gold-soft); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.audio-meter {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
  margin: 16px 20px 8px;
  padding: 0 2px;
}
.audio-meter span { width: 3px; height: 5px; border-radius: 2px; background: rgba(216, 166, 74, 0.28); transition: height 0.15s ease, background 0.15s ease; }
.audio-meter span:nth-child(2) { height: 9px; }
.audio-meter span:nth-child(3) { height: 14px; }
.audio-meter span:nth-child(4) { height: 20px; }
.audio-meter span:nth-child(5) { height: 12px; }
.audio-meter span:nth-child(6) { height: 8px; }
.audio-meter span:nth-child(7) { height: 4px; }
.audio-meter em { margin-left: 5px; color: var(--faint); font-size: 8px; font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; }
.audio-meter.is-playing span { background: var(--gold-soft); animation: meterDance 0.7s ease-in-out infinite alternate; }
.audio-meter.is-playing span:nth-child(2) { animation-delay: 0.1s; }
.audio-meter.is-playing span:nth-child(3) { animation-delay: 0.2s; }
.audio-meter.is-playing span:nth-child(4) { animation-delay: 0.05s; }
.audio-meter.is-playing span:nth-child(5) { animation-delay: 0.18s; }
.audio-meter.is-playing span:nth-child(6) { animation-delay: 0.12s; }
.audio-meter.is-playing span:nth-child(7) { animation-delay: 0.24s; }
@keyframes meterDance { from { transform: scaleY(0.55); } to { transform: scaleY(1.15); } }

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 40px);
  margin: 8px 20px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.ghost-button:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.4); background: rgba(255, 255, 255, 0.03); }
.ghost-button.small { width: auto; margin: 0; padding: 7px 11px; font-size: 8px; }

/* --- Практика: гаммы, определитель, диктант ------------------------------ */

.practice-card { padding-bottom: 18px; }
.practice-head { align-items: center; }
.practice-tabs { flex-wrap: wrap; }
.practice-tabs .seg-button { padding: 7px 11px; font-size: 9.5px; }
.practice-pane { padding: 12px 20px 0; }
.practice-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.practice-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}
.practice-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.practice-field-wide { flex: 1 1 190px; }
.practice-field span {
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.practice-field select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 116px;
  padding: 8px 26px 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 13px) 52% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) 52% / 5px 5px no-repeat,
    rgba(13, 9, 7, 0.42);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}
.practice-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}
.practice-check input { accent-color: var(--gold); }
.practice-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid rgba(216, 166, 74, 0.45);
  border-radius: 9px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.08);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.practice-play:hover { background: var(--gold); color: #2a1b0d; }
.practice-play.is-playing {
  color: #fff1d9;
  border-color: rgba(181, 68, 52, 0.7);
  background: rgba(181, 68, 52, 0.35);
}
.scale-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.scale-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.scale-title-row b {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-soft);
}
.scale-title-row span { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.scale-progress {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.scale-steps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.scale-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 36px;
  padding: 5px 5px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.scale-step b { font-family: var(--mono); font-size: 11px; font-weight: 700; line-height: 1; }
.scale-step b sup { font-size: 0.55em; opacity: 0.6; vertical-align: 0.55em; }
.scale-step small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1;
}
.scale-step.is-tonic { border-color: rgba(255, 154, 60, 0.45); color: var(--tonic-soft); }
.scale-step.is-tonic small { color: var(--tonic); }
.scale-step.is-current {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(237, 200, 127, 0.9);
  color: #2a1b0d;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 16px rgba(237, 200, 127, 0.4);
}
.scale-step.is-current small { color: #4a3410; }
.scale-step.is-missing:not(.is-current) {
  border-style: dashed;
  border-color: rgba(181, 68, 52, 0.45);
  color: var(--faint);
  background: rgba(181, 68, 52, 0.06);
  opacity: 0.8;
}
.scale-step.is-missing b { text-decoration: line-through; text-decoration-thickness: 1px; }
.scale-step.is-missing small { color: rgba(181, 68, 52, 0.8); }
.practice-hint { margin: 11px 0 0; color: var(--faint); font-size: 9.5px; line-height: 1.55; }
.practice-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.practice-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 8.5px; }
.practice-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.practice-dot-root { background: var(--tonic); }
.practice-dot-tone { background: var(--teal); }
.practice-dot-current { background: var(--gold-soft); box-shadow: 0 0 0 2px rgba(237, 200, 127, 0.25); }
.practice-dot-missing { background: transparent; border: 1px dashed rgba(181, 68, 52, 0.8); }

.detect-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.detect-notes { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 240px; min-height: 28px; }
.detect-empty { color: var(--faint); font-size: 9.5px; font-style: italic; }
.note-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}
.note-chip b { font-weight: 700; }
.note-chip small { color: var(--faint); font-size: 10px; }
.note-chip:hover { border-color: rgba(216, 166, 74, 0.5); color: var(--ink); }
.note-chip.is-root { border-color: rgba(255, 154, 60, 0.5); color: var(--tonic-soft); }
.note-chip.is-extra { border-color: rgba(181, 68, 52, 0.7); color: var(--red-bright); background: rgba(181, 68, 52, 0.12); }
.detect-result {
  margin-top: 13px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}
.detect-eyebrow {
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.detect-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.detect-main b { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--gold-soft); line-height: 1; }
.detect-main span { color: var(--ink-soft); font-size: 12px; }
.detect-detail { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.detect-alts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.alt-label { color: var(--faint); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 3px; }
.alt-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}
.alt-chip b { font-family: var(--mono); font-size: 10px; }
.alt-chip small { color: var(--faint); font-size: 7.5px; }
.alt-chip.is-exact { border-color: rgba(90, 165, 150, 0.5); color: var(--teal); }

.dictation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 166, 74, 0.25);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(216, 166, 74, 0.09), rgba(181, 68, 52, 0.05));
}
.dictation-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.dictation-title-row b { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--gold-soft); line-height: 1; }
.dictation-title-row span { color: var(--ink-soft); font-size: 12px; }
.dictation-formula { margin: 6px 0 0; color: var(--faint); font-family: var(--mono); font-size: 9px; }
.dictation-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dictation-stats span { color: var(--gold-soft); font-family: var(--mono); font-size: 16px; font-weight: 700; }
.dictation-stats small { color: var(--faint); font-size: 8.5px; white-space: nowrap; }
.dictation-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.dictation-feedback.is-correct {
  border-color: rgba(90, 165, 150, 0.7);
  color: #c8f3e9;
  background: rgba(90, 165, 150, 0.16);
}
.dictation-feedback.is-wrong {
  border-color: rgba(181, 68, 52, 0.7);
  color: #f3c3b8;
  background: rgba(181, 68, 52, 0.16);
}
.dictation-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; min-height: 26px; }
.dictation-missing { color: var(--faint); font-size: 9px; margin-left: 4px; }

/* --- Инструмент ---------------------------------------------------------- */

.instrument-card { padding-bottom: 15px; }
.instrument-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
}
.instrument-head h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 600; }
.model-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid rgba(216, 166, 74, 0.24);
  border-radius: 6px;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 9px;
  vertical-align: 4px;
  letter-spacing: 0.06em;
}
.instrument-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--faint); font-size: 8.5px; letter-spacing: 0.03em; }

.instrument {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  gap: 10px;
  width: min(calc(100% - 28px), 660px);
  margin: 0 auto;
  padding: 13px;
  border: 1px solid rgba(216, 166, 74, 0.24);
  border-radius: 19px;
  background:
    linear-gradient(180deg, rgba(112, 55, 36, 0.22), transparent 14%),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 7px),
    linear-gradient(135deg, #2f1b13, #1b110d 65%, #2b190f);
  box-shadow: inset 0 0 0 4px rgba(15, 9, 6, 0.3), inset 0 1px 0 rgba(255, 231, 193, 0.08), 0 18px 40px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.instrument-half {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 13px 8px 9px;
  border: 1px solid rgba(216, 166, 74, 0.14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 49%, transparent 0 76px, rgba(216, 166, 74, 0.08) 77px, transparent 78px),
    radial-gradient(circle at 50% 49%, transparent 0 55px, rgba(216, 166, 74, 0.055) 56px, transparent 57px),
    radial-gradient(120% 80% at 50% 0%, rgba(255, 225, 178, 0.06), transparent 60%),
    repeating-linear-gradient(94deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, rgba(64, 37, 24, 0.76), rgba(37, 23, 16, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.instrument-half::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 166, 74, 0.07);
  border-radius: 9px;
  pointer-events: none;
}
.half-head { width: 100%; padding: 0 4px 8px; text-align: center; }
.half-kicker { display: block; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.half-head h3 { margin: 3px 0 0; color: var(--ink-soft); font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: 0.02em; }
.keyboard-wrap {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 6px 0 2px;
}
.keyboard {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(10px, 1vw, 16px);
  padding: 4px 2px 2px;
  max-width: 100%;
}
.key-column { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.key-stack { display: flex; flex-direction: column; align-items: center; gap: var(--key-gap); }

/* Правая рука: две колонки, вторая смещена на полшага. */
.keyboard-melody .key-stack { gap: calc(var(--key-gap) * 0.7); }
.keyboard-melody .key-column.is-offset .key-stack {
  padding-top: calc((var(--key-size) + var(--key-gap) * 0.7) / 2);
}

/* Левая рука: три колонки. Басы слева, средняя колонка (II ряд) смещена
   вниз на полшага, правая (III ряд) выровнена по верхнему краю. */
.keyboard.keyboard-accompaniment {
  --acc-gap: clamp(6px, 0.6vw, 10px);
  align-items: stretch;
  height: calc(var(--key-size) * 14.2);
  gap: var(--acc-gap);
}
.keyboard-accompaniment .bass-column { height: 100%; }
.keyboard-accompaniment .bass-column .key-stack {
  height: 100%;
  justify-content: space-between;
  gap: 0;
}
.keyboard-accompaniment .chord-column { width: var(--key-size); }
.keyboard-accompaniment .chord-column .key-stack {
  gap: calc(var(--key-size) * 0.65);
}
.keyboard-accompaniment .chord-column-mid .key-stack {
  padding-top: calc(var(--key-size) * 0.825);
}

/* Зелёная зона на левой клавиатуре, как на схеме: накрывает правую часть,
   повторяет диагональ сверху и снизу и не перехватывает клики. */
.bass-zone {
  position: absolute;
  top: 0;
  right: -2px;
  bottom: 0;
  left: calc(var(--key-size) + var(--acc-gap) - 4px);
  z-index: 0;
  background: linear-gradient(180deg, rgba(32, 196, 141, 0.28), rgba(20, 138, 101, 0.20));
  clip-path: polygon(100% 19%, 100% 90%, 0 100%, 0 27%);
  pointer-events: none;
}

.garmon-key {
  position: relative;
  width: var(--key-size);
  height: var(--key-size);
  padding: 0;
  border: 1px solid rgba(76, 49, 28, 0.72);
  border-radius: 50%;
  color: #392616;
  background:
    radial-gradient(circle at 35% 27%, #fffdf6 0%, #efe2ca 42%, #d7c09d 72%, #ad8d65 100%);
  box-shadow:
    0 3px 0 #6a4c30,
    0 6px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 70ms ease, box-shadow 70ms ease, background 90ms ease, filter 120ms ease;
  outline: none;
}
.garmon-key:hover { filter: brightness(1.06); z-index: 2; }
.garmon-key:focus-visible { box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.5), 0 3px 0 #6a4c30; }
.garmon-key .key-inner { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.garmon-key .key-label {
  font-family: var(--mono);
  font-size: calc(var(--key-size) * 0.32);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}
.garmon-key .key-label sup { font-size: 0.55em; font-weight: 600; vertical-align: 0.55em; opacity: 0.62; }
.garmon-key .key-digit {
  position: absolute;
  top: -4px;
  left: -4px;
  z-index: 5;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border: 1px solid rgba(216, 166, 74, 0.6);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(18, 12, 9, 0.86);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  pointer-events: none;
}
.garmon-key .key-shine {
  position: absolute;
  top: 12%;
  left: 18%;
  width: 38%;
  height: 25%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
  opacity: 0.45;
  pointer-events: none;
}
.garmon-key.kind-melody { background: radial-gradient(circle at 35% 27%, #fffdf6 0%, #f0e4cc 42%, #dcc4a0 72%, #b39368 100%); }
.garmon-key.kind-bass {
  color: #f6ead6;
  border-color: rgba(24, 14, 9, 0.8);
  background: radial-gradient(circle at 35% 27%, #b59d7d 0%, #8e7557 43%, #614b35 78%, #3d2a1d 100%);
  box-shadow: 0 3px 0 #21130d, 0 6px 10px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.22);
}
.garmon-key.kind-chord {
  color: #f7e4c8;
  border-color: rgba(43, 14, 10, 0.82);
  background: radial-gradient(circle at 35% 27%, #d8785f 0%, #b84e3c 40%, #8e3025 76%, #5f1b14 100%);
  box-shadow: 0 3px 0 #3d100b, 0 6px 10px rgba(0, 0, 0, 0.46), inset 0 1px 1px rgba(255, 220, 190, 0.35);
}
.garmon-key .key-label-chord { font-size: calc(var(--key-size) * 0.27); letter-spacing: -0.05em; }
.garmon-key.is-extra {
  color: #263236;
  background: radial-gradient(circle at 35% 27%, #f2f8f8 0%, #cbd8d9 42%, #9aadb1 74%, #6b8085 100%);
  border-color: rgba(39, 56, 59, 0.8);
  box-shadow: 0 3px 0 #3e5155, 0 6px 10px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.7);
}
.garmon-key.kind-bass.is-extra { color: #263236; }
.garmon-key.is-fingering { z-index: 3; }
.garmon-key.is-fingering::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(216, 166, 74, 0.12), 0 0 18px rgba(237, 200, 127, 0.4);
  animation: keyGuidePulse 2.2s ease-in-out infinite;
  pointer-events: none;
}
.garmon-key.is-bass-guide::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px dashed rgba(243, 232, 210, 0.7);
  border-radius: 50%;
  pointer-events: none;
}
@keyframes keyGuidePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.garmon-key.is-active {
  transform: translateY(3px) scale(0.97);
  background: radial-gradient(circle at 38% 28%, #fff6dc 0%, #f1cd7c 45%, #d8a64a 78%, #a9701f 100%);
  color: #2a1a0b;
  box-shadow: 0 1px 0 #5d3b1a, 0 0 0 3px rgba(237, 200, 127, 0.35), 0 0 26px rgba(237, 200, 127, 0.65);
  filter: none;
}
.garmon-key.kind-chord.is-active {
  background: radial-gradient(circle at 38% 28%, #fff1cf 0%, #f0c069 45%, #d39132 80%, #9d5915 100%);
  color: #30190a;
}

.half-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(240, 220, 186, 0.07);
  width: 100%;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.bellows {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #2a1810, #140c08);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.bellows-body {
  position: absolute;
  inset: 24px 3px;
  border: 1px solid rgba(216, 166, 74, 0.23);
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, #1a0e09 0 4px, #4a2a18 4px 8px, #30190f 8px 12px, #160c08 12px 14px);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.65);
}
.bellows-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 22%, rgba(255, 214, 160, 0.1) 50%, transparent 78%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}
.bellows-body i { display: none; }
.bellows-label {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 4px 3px;
  border-top: 1px solid rgba(216, 166, 74, 0.24);
  border-bottom: 1px solid rgba(216, 166, 74, 0.24);
  color: rgba(216, 166, 74, 0.6);
  background: #190e09;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.bellows-edge { position: absolute; left: 0; right: 0; height: 9px; z-index: 2; background: linear-gradient(90deg, #8b642c, #e2b866 38%, #8a5f29 70%, #5b3b17); }
.edge-top { top: 0; border-radius: 8px 8px 0 0; }
.edge-bottom { bottom: 0; border-radius: 0 0 8px 8px; }

.instrument.is-playing .bellows-body { animation: bellowsBreathe 0.8s ease-in-out infinite alternate; }
@keyframes bellowsBreathe {
  from { transform: scaleX(0.93); filter: brightness(0.92); }
  to { transform: scaleX(1.06); filter: brightness(1.1); }
}

.instrument-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px 2px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}
.foot-note b { color: var(--muted); font-weight: 600; }
.foot-note-right { text-align: right; }

/* --- Сейчас звучит ------------------------------------------------------- */

.now-playing {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 102px;
  padding: 19px 24px;
  border: 1px solid rgba(216, 166, 74, 0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(100% 160% at 8% 0%, rgba(181, 68, 52, 0.22), transparent 55%),
    linear-gradient(160deg, rgba(51, 31, 22, 0.96), rgba(26, 17, 13, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.now-playing::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  opacity: 0.55;
}
.now-playing.is-idle { opacity: 0.82; }
.now-playing.is-live { border-color: rgba(216, 166, 74, 0.4); }
.now-left { min-width: 0; }
.now-eyebrow {
  display: block;
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.now-main { display: flex; align-items: baseline; gap: 13px; margin-top: 5px; min-width: 0; }
.now-note {
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-playing.is-live .now-note { color: var(--gold-soft); text-shadow: 0 0 26px rgba(237, 200, 127, 0.18); }
.now-en { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.now-meta { margin-top: 8px; color: var(--faint); font-size: 10px; letter-spacing: 0.015em; }
.now-right { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex: 0 0 auto; }
.reed-animation { display: flex; align-items: flex-end; gap: 3px; height: 29px; }
.reed-animation i { display: block; width: 3px; height: 7px; border-radius: 2px; background: rgba(216, 166, 74, 0.25); transition: background 0.2s ease; }
.reed-animation i:nth-child(2) { height: 14px; }
.reed-animation i:nth-child(3) { height: 22px; }
.reed-animation i:nth-child(4) { height: 17px; }
.reed-animation i:nth-child(5) { height: 10px; }
.now-playing.is-playing .reed-animation i { background: var(--gold-soft); animation: reedJump 0.55s ease-in-out infinite alternate; }
.now-playing.is-playing .reed-animation i:nth-child(2) { animation-delay: 0.08s; }
.now-playing.is-playing .reed-animation i:nth-child(3) { animation-delay: 0.16s; }
.now-playing.is-playing .reed-animation i:nth-child(4) { animation-delay: 0.12s; }
.now-playing.is-playing .reed-animation i:nth-child(5) { animation-delay: 0.2s; }
@keyframes reedJump { from { transform: scaleY(0.5); } to { transform: scaleY(1.12); } }
.now-count { color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }

/* --- Гитара --------------------------------------------------------------- */

.guitar-card { padding-bottom: 15px; }
.guitar-head { align-items: center; flex-wrap: wrap; padding-bottom: 4px; }
.guitar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.guitar-mode .seg-button { padding: 6px 10px; font-size: 9px; }
.guitar-heading { padding: 0 22px; }
.guitar-title-row { display: flex; align-items: baseline; gap: 11px; margin-top: 1px; }
#guitar-title {
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.05;
}
#guitar-subtitle { color: var(--muted); font-size: 10px; letter-spacing: 0.02em; }
.guitar-fretboard {
  margin: 10px 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(216, 166, 74, 0.18);
  border-radius: 12px;
  background: #25160f;
  scrollbar-color: rgba(216, 166, 74, 0.35) transparent;
}
.guitar-svg { display: block; width: 100%; min-width: 820px; height: auto; }
.guitar-variants { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 20px 0; }
.guitar-variant {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.guitar-variant:hover { border-color: rgba(216, 166, 74, 0.42); color: var(--ink); }
.guitar-variant b { color: var(--ink-soft); font-family: var(--mono); font-size: 9px; font-weight: 700; }
.guitar-variant small { color: var(--faint); font-size: 7px; }
.guitar-variant.is-selected {
  border-color: rgba(216, 166, 74, 0.65);
  background: rgba(216, 166, 74, 0.12);
  color: var(--gold-soft);
}
.guitar-variant.is-selected b { color: var(--gold-soft); }
.guitar-variant.is-selected small { color: var(--gold); }
.guitar-empty { color: var(--faint); font-size: 9px; font-style: italic; }
.guitar-caged-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 20px 0; }
.guitar-caged-legend:empty { display: none; }
.caged-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 7px;
  border: 1px solid rgba(240, 220, 186, 0.14);
  border-left: 3px solid var(--caged-color);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}
.caged-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--caged-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}
.caged-chip b { color: var(--caged-color); font-family: var(--mono); font-size: 9px; font-weight: 700; }
.caged-chip small { color: var(--faint); font-family: var(--mono); font-size: 7px; }
.guitar-hint { margin: 9px 20px 0; color: var(--faint); font-size: 9px; line-height: 1.5; }

.guitar-fret { stroke: rgba(216, 166, 74, 0.25); stroke-width: 1; }
.guitar-nut { stroke: rgba(216, 166, 74, 0.8); stroke-width: 4; }
.guitar-string { stroke: rgba(240, 220, 186, 0.45); stroke-width: 1; }
.guitar-string-1, .guitar-string-2 { stroke-width: 1.8; }
.guitar-string-5, .guitar-string-6 { stroke-width: 0.9; }
.guitar-string-label { fill: #c4a97c; font-family: var(--mono); font-size: 9px; }
.guitar-fret-label { fill: #8c7359; font-family: var(--mono); font-size: 8px; }
.guitar-marker { fill: rgba(240, 220, 186, 0.2); }
.guitar-neck-label { fill: #a58a65; font-family: var(--sans); font-size: 8px; letter-spacing: 0.12em; }
.guitar-caged-zone-label { font-family: var(--sans); font-size: 8px; font-weight: 700; letter-spacing: 0.05em; }
.guitar-caged-dot-label { fill: #1c100b; font-family: var(--mono); font-size: 7px; font-weight: 700; pointer-events: none; }
.guitar-dot { fill: #f3e8d2; stroke: #4a2b1b; stroke-width: 1; }
.guitar-dot.is-root { fill: var(--gold); stroke: #f2d59b; }
.guitar-dot-label { fill: #2a1b10; font-family: var(--mono); font-size: 7px; font-weight: 700; pointer-events: none; }
.guitar-open, .guitar-muted { fill: #e6d6b7; font-family: var(--serif); font-size: 15px; }
.guitar-muted { fill: #b98d7b; }
.guitar-note-dot { fill: rgba(216, 166, 74, 0.12); stroke: var(--gold-soft); stroke-width: 1.2; }
.guitar-note-dot.is-selected { fill: var(--gold-soft); stroke: #fff3d2; }
/* Тоника на грифе — тот же яркий цвет, что на гармоне и пианино. */
.guitar-svg .guitar-root-dot { fill: var(--tonic); stroke: var(--tonic-soft); }
.guitar-svg .guitar-root-dot.is-selected { fill: var(--tonic-soft); stroke: #fff5e6; }
.guitar-scale-dot { stroke: rgba(255, 248, 230, 0.55); stroke-width: 1; cursor: pointer; }
.guitar-scale-ghost {
  fill: rgba(255, 236, 200, 0.14);
  stroke: rgba(216, 166, 74, 0.42);
  stroke-width: 0.8;
  cursor: pointer;
  transition: fill 0.12s ease, stroke 0.12s ease;
}
.guitar-scale-ghost:hover {
  fill: rgba(255, 203, 128, 0.45);
  stroke: rgba(255, 238, 205, 0.9);
}
.guitar-scale-dot.is-root { fill: var(--tonic); stroke: var(--tonic-soft); }
.guitar-scale-dot.is-current {
  fill: #ffd08a;
  stroke: #fff3d2;
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(255, 208, 138, 0.95));
}
.guitar-svg [data-midi] { cursor: pointer; }
.guitar-svg [data-midi].is-pressed { filter: brightness(1.3) drop-shadow(0 0 5px rgba(255, 240, 210, 0.7)); }
.guitar-empty-svg { fill: #a58a65; font-family: var(--serif); font-size: 14px; font-style: italic; }

/* --- Фортепиано ---------------------------------------------------------- */

.piano-card { padding-bottom: 15px; }
.piano-head { align-items: center; flex-wrap: wrap; padding-bottom: 4px; }
.piano-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.piano-heading { padding: 0 22px; }
.piano-title-row { display: flex; align-items: baseline; gap: 11px; margin-top: 1px; }
#piano-title {
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.05;
}
#piano-subtitle { color: var(--muted); font-size: 10px; letter-spacing: 0.02em; }
.piano-wrap {
  margin: 10px 18px 0;
  padding: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(216, 166, 74, 0.18);
  border-radius: 12px;
  background: #25160f;
  scrollbar-color: rgba(216, 166, 74, 0.35) transparent;
}
.piano-svg { display: block; width: 100%; min-width: 720px; height: auto; }
.piano-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 22px 0;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}
.piano-legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.piano-legend-root { background: var(--tonic); }
.piano-legend-tone { background: #9edbca; }
.piano-legend-active { background: #5fb3a1; box-shadow: inset 0 0 0 1px rgba(230, 255, 249, 0.6); }
.piano-svg [data-midi] { cursor: pointer; }
.piano-svg [data-midi].is-pressed { filter: brightness(0.86) saturate(1.15); }
/* Тоника на клавиатуре — тот же цвет, что на гармоне и гитаре. */
.piano-white.is-root { fill: var(--tonic); }
.piano-black.is-root { fill: var(--tonic); }
.piano-white.is-root.is-active { fill: var(--tonic-soft); }
.piano-black.is-root.is-active { fill: var(--tonic-soft); }
.piano-hint { margin: 9px 20px 0; color: var(--faint); font-size: 9px; line-height: 1.5; }
.piano-key-label { font-family: var(--mono); font-size: 7px; fill: #6d5a44; pointer-events: none; }
.piano-key-label.is-light { fill: #f4e6cd; }
.piano-key-label.is-strong { fill: #2a1b10; font-weight: 700; }

/* --- Нотная тетрадь ------------------------------------------------------ */

.staff-card { padding-bottom: 14px; }
.staff-head { align-items: center; padding-bottom: 14px; }
.staff-actions { display: flex; align-items: center; gap: 12px; }
.staff-count { color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; }
.staff-paper { position: relative; margin: 0 18px; }
.staff-scroll {
  margin: 0;
  border: 1px solid rgba(74, 53, 34, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(100% 100% at 0% 0%, rgba(255, 255, 255, 0.4), transparent 55%),
    linear-gradient(180deg, #f7eedc, #eddfc4);
  box-shadow: inset 0 0 30px rgba(96, 61, 27, 0.12), 0 10px 22px rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(88, 63, 35, 0.36) transparent;
  scrollbar-width: thin;
}
.staff-scroll::-webkit-scrollbar { height: 8px; }
.staff-scroll::-webkit-scrollbar-thumb { background: rgba(88, 63, 35, 0.32); border-radius: 5px; }
.staff-host { width: max-content; min-width: 100%; }
.staff-svg { display: block; height: 330px; }
.staff-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  color: #8b765c;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.staff-empty-overlay span { font-family: var(--serif); font-size: 16px; font-style: italic; }
.staff-empty-overlay small { color: #a28e73; font-family: var(--sans); font-size: 8px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.staff-empty-overlay.is-hidden { opacity: 0; visibility: hidden; }

.staff-line { stroke: #6e5a42; stroke-width: 0.85; opacity: 0.75; }
.staff-ledger { stroke: #4a3926; stroke-width: 1; opacity: 0.8; }
.staff-bar { stroke: #8d7658; stroke-width: 1.1; opacity: 0.75; }
.staff-divider { stroke: #6e5a42; stroke-width: 0.7; opacity: 0.35; stroke-dasharray: 2 5; }
.staff-brace { fill: none; stroke: #34271b; stroke-width: 2.1; stroke-linecap: round; opacity: 0.8; }
.staff-guide { stroke: #9b866b; stroke-width: 0.6; stroke-dasharray: 1 5; opacity: 0.45; }
.staff-note { fill: #9e2f28; }
.staff-note.note-left { fill: #23675c; }
.staff-stem { stroke: #7d231d; stroke-width: 1.35; }
.staff-stem.note-left { stroke: #1c554c; }
.staff-accidental { fill: #2d2117; font-family: Georgia, serif; font-size: 19px; }
.clef { fill: #2d2117; font-family: "Bravura", "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; font-size: 57px; }
.bass-clef { font-size: 50px; }
.staff-key { fill: #7b654c; font-family: var(--sans); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.staff-key-right { letter-spacing: 0.03em; }
.staff-label { font-family: var(--mono); font-size: 9px; font-weight: 600; }
.staff-label.note-right { fill: #9e2f28; }
.staff-label.note-left { fill: #23675c; }
.staff-source.note-right { fill: #b54434; opacity: 0.65; }
.staff-source.note-left { fill: #2d7b6e; opacity: 0.65; }
.staff-empty { fill: #8b765c; font-family: var(--serif); font-size: 15px; font-style: italic; }
.staff-empty-small { fill: #a28e73; font-family: var(--sans); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }

.staff-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 22px 0;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}
.staff-foot-hint { margin-left: auto; }

/* --- Подвал и тост ------------------------------------------------------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 25px;
  padding: 16px 3px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer-credit { margin-left: auto; }
.footer-support-link {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted rgba(216, 166, 74, 0.4);
  color: var(--gold);
  background: transparent;
  font: inherit;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.footer-support-link:hover { color: var(--gold-soft); }
.footer-legal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  text-transform: none;
  letter-spacing: 0.02em;
}
.footer-legal a {
  color: var(--faint);
  text-decoration: none;
  border-bottom: 1px dotted rgba(216, 166, 74, 0.35);
}
.footer-legal a:hover { color: var(--gold); }
.footer-credit a { color: var(--faint); text-decoration: none; border-bottom: 1px dotted rgba(216, 166, 74, 0.35); }
.footer-credit a:hover { color: var(--gold); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  max-width: min(500px, calc(100vw - 32px));
  padding: 11px 17px;
  border: 1px solid rgba(216, 166, 74, 0.38);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(33, 22, 16, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Музыкальная теория --------------------------------------------------- */

body.theory-open { overflow: hidden; }

.theory-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
}
.theory-modal[hidden] { display: none; }

.theory-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(181, 68, 52, 0.18), transparent 70%),
    rgba(9, 6, 4, 0.78);
  backdrop-filter: blur(5px);
}

.theory-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(88vh, 920px);
  border: 1px solid rgba(216, 166, 74, 0.3);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(181, 68, 52, 0.13), transparent 55%),
    linear-gradient(160deg, rgba(44, 30, 22, 0.99), rgba(23, 16, 12, 0.995));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: theoryIn 0.2s ease-out;
}
@keyframes theoryIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.theory-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(216, 166, 74, 0.05), transparent);
}
.theory-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.theory-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.theory-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--sans);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.theory-close:hover {
  color: var(--ink);
  border-color: rgba(216, 166, 74, 0.55);
  background: rgba(216, 166, 74, 0.08);
}

.theory-body {
  overflow-y: auto;
  padding: 22px 24px 28px;
  scrollbar-color: rgba(216, 166, 74, 0.35) transparent;
  scrollbar-width: thin;
}
.theory-body::-webkit-scrollbar { width: 8px; }
.theory-body::-webkit-scrollbar-thumb { background: rgba(216, 166, 74, 0.3); border-radius: 5px; }

.theory-section + .theory-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.theory-section h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.theory-section h4 {
  margin: 20px 0 8px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.theory-section p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.65;
}
.theory-section p + p { margin-top: 8px; }
.theory-section b { color: var(--ink); }

.theory-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}
.theory-card {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.theory-card b {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-soft);
  font-size: 11px;
}
.theory-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.theory-note {
  margin-top: 13px !important;
  padding: 10px 12px;
  border-left: 2px solid rgba(216, 166, 74, 0.5);
  border-radius: 0 8px 8px 0;
  background: rgba(216, 166, 74, 0.06);
  color: var(--muted) !important;
  font-size: 10px !important;
}

.theory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.theory-legend span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-size: 9px;
}
.theory-legend b {
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 10px;
}
.theory-intro { margin-bottom: 12px !important; }

.theory-table-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  overflow-x: auto;
}
.theory-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}
.theory-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.02);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.theory-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(240, 220, 186, 0.07);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  vertical-align: top;
}
.theory-table tr:last-child td { border-bottom: 0; }
.theory-table tr:hover td { background: rgba(216, 166, 74, 0.035); }
.theory-table td:first-child { color: var(--ink-soft); white-space: nowrap; }
.theory-table td:first-child b { color: var(--gold-soft); font-family: var(--mono); }
.theory-table td:nth-child(2),
.theory-table td:nth-child(3) {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.theory-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.theory-list li + li { margin-top: 5px; }
.theory-list b { color: var(--ink-soft); }

/* ==========================================================================
   ПРИОРИТЕТНЫЙ ЭКРАН: гармонь · аккорды · тренажёр
   ========================================================================== */

/* --- Верхняя навигация по главным разделам ------------------------------- */

.subbar.primary-nav {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0 18px;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}
.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.primary-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}
.primary-link.is-active {
  border-color: rgba(216, 166, 74, 0.34);
  background: linear-gradient(160deg, rgba(216, 166, 74, 0.13), rgba(181, 68, 52, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.primary-link-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(216, 166, 74, 0.34);
  border-radius: 50%;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.primary-link.is-active .primary-link-index {
  color: #2a1b0d;
  border-color: var(--gold-soft);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
}
.primary-link-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.primary-link-copy b { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.primary-link.is-active .primary-link-copy b { color: var(--ink); }
.primary-link-copy small { color: var(--faint); font-size: 8px; letter-spacing: 0.02em; }
.primary-link.is-active .primary-link-copy small { color: var(--muted); }

/* --- Общие акценты трёх главных карточек --------------------------------- */

.instrument-card,
.chord-card,
.practice-card { border-color: rgba(240, 220, 186, 0.17); }

.instrument-card::before,
.chord-card::before,
.practice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--gold-soft)), transparent);
  opacity: 0.55;
}
.instrument-card { --card-accent: var(--gold-soft); border-color: rgba(216, 166, 74, 0.24); }
.chord-card { --card-accent: var(--gold-soft); border-color: rgba(216, 166, 74, 0.2); }
.practice-card { --card-accent: var(--teal); border-color: rgba(90, 165, 150, 0.22); }

/* --- Гармонь: главный инструмент ----------------------------------------- */

.instrument-card {
  --key-size: clamp(30px, 2.8vw, 42px);
  --key-gap: clamp(6px, 0.62vw, 9px);
}
.instrument-head {
  align-items: flex-start;
  gap: 22px;
  padding: 22px 24px 12px;
}
.instrument-title { min-width: 0; }
.instrument-title .kicker { color: var(--gold-soft); }
.instrument-title h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}
.instrument-sub {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* Живой индикатор ноты внутри шапки героя. */
.instrument-live {
  flex: 0 0 344px;
  width: 344px;
  max-width: 344px;
  min-height: 0;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.instrument-live .now-left { min-width: 0; }
.instrument-live .now-main { gap: 8px; margin-top: 4px; align-items: baseline; }
.instrument-live .now-note { font-size: 21px; line-height: 1.05; }
.instrument-live .now-en {
  max-width: 116px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.instrument-live .now-meta { margin-top: 5px; font-size: 8.5px; line-height: 1.45; }
.instrument-live .now-right { gap: 6px; }
.instrument-live .reed-animation { height: 23px; }
.instrument-live .now-count { font-size: 7px; }

.instrument-legend {
  padding: 0 24px 10px;
  justify-content: flex-start;
  gap: 14px;
}
.instrument {
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  gap: 12px;
  width: min(calc(100% - 36px), 900px);
  padding: 14px;
}
.keyboard { gap: clamp(16px, 2.4vw, 44px); }
.keyboard.keyboard-accompaniment { --acc-gap: clamp(8px, 1vw, 16px); }
.instrument-foot { padding: 12px 24px 2px; }

/* --- Аккорды: правая вертикаль ------------------------------------------- */

.chord-card { padding-bottom: 20px; }
.chord-card .card-head { padding: 20px 20px 0; }
.chord-card .chord-symbol { font-size: 42px; }
.chord-card .chord-focus { padding: 16px; }
.chord-card .chord-builder { margin: 14px 20px 0; }
.chord-card .root-grid { gap: 6px; }
.chord-card .quality-grid { gap: 6px; }
.chord-card .category-tabs { gap: 6px; }

/* --- Тренажёр: широкая полоса под гармонью ------------------------------- */

.practice-card { padding-bottom: 20px; border-color: rgba(90, 165, 150, 0.24); }
.practice-card .card-head { padding: 22px 24px 0; }
.practice-card .kicker { color: var(--teal); }
.practice-card .card-head h2 {
  margin-top: 5px;
  font-size: clamp(27px, 2.5vw, 34px);
}
.practice-card .practice-tabs .seg-button { padding: 8px 14px; font-size: 10px; }
.practice-card .practice-pane { padding: 14px 24px 0; }
.practice-card .practice-lead { max-width: 760px; font-size: 11.5px; }
.practice-card .practice-play {
  margin-left: auto;
  padding: 10px 22px;
  color: #2a1b0d;
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.practice-card .practice-play:hover { color: #2a1b0d; filter: brightness(1.06); }
.practice-card .scale-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}
.practice-card .scale-step { min-width: 0; padding: 7px 7px 5px; }
.practice-card .scale-step b { font-size: 12px; }
.practice-card .practice-legend { margin-top: 12px; }

/* --- Дополнительные инструменты ------------------------------------------ */

.extras {
  border: 1px dashed rgba(216, 166, 74, 0.24);
  border-radius: var(--radius-lg);
  background: rgba(13, 9, 7, 0.3);
  overflow: hidden;
}
.extras[open] {
  border-style: solid;
  border-color: rgba(216, 166, 74, 0.32);
  background: rgba(13, 9, 7, 0.44);
}
.extras-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 22px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease;
}
.extras-summary::-webkit-details-marker { display: none; }
.extras-summary:hover { background: rgba(255, 255, 255, 0.028); }
.extras-summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.primary-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.instrument-card, .guitar-card, .piano-card, .chord-card, .practice-card, .theory-page-card, .extras { scroll-margin-top: 16px; }
.extras-plus {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(216, 166, 74, 0.35);
  border-radius: 50%;
  background: rgba(216, 166, 74, 0.07);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.extras-plus::before,
.extras-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  background: var(--gold-soft);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}
.extras-plus::before { width: 13px; height: 1.5px; }
.extras-plus::after { width: 1.5px; height: 13px; }
.extras[open] .extras-plus { border-color: rgba(216, 166, 74, 0.55); background: rgba(216, 166, 74, 0.12); }
.extras[open] .extras-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.extras-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.extras-copy b { color: var(--ink-soft); font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.extras-copy small { color: var(--faint); font-size: 9.5px; }
.extras-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-left: 6px; }
.extras-tags i {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-style: normal;
  font-size: 7.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.extras-action {
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid rgba(216, 166, 74, 0.35);
  border-radius: 999px;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.extras-close-label { display: none; }
.extras[open] .extras-open-label { display: none; }
.extras[open] .extras-close-label { display: inline; }

.extras-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 18px 18px;
}
.extras-body > .guitar-card,
.extras-body > .piano-card,
.extras-body > .sound-card { grid-column: 1 / -1; }
.extras-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 4px 0;
}
.extras-toolbar-note { color: var(--faint); font-size: 9px; }
.extras .card { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18); }
.extras .card::before { display: none; }

/* --- Инструменты: режимы, позиции и обращения ---------------------------- */

.chord-head-actions { flex-wrap: wrap; justify-content: flex-end; }

.instrument-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 22px 0;
}
.instrument-toolbar .seg-button,
.piano-mode .seg-button,
.garmon-mode .seg-button { padding: 6px 10px; font-size: 9px; }
.instrument-selection {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}
.instrument-toolbar .ghost-button.small,
.guitar-actions .ghost-button.small,
.piano-actions .ghost-button.small,
.chord-head-actions .ghost-button.small {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}
.instrument-voicings { margin: 10px 22px 0; }
.instrument-voicings .voicing-chips { margin-top: 0; }
.instrument-voicings:empty { display: none; }
.instrument-voicings .voicing-empty { font-size: 9px; }
.instrument-hand-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 8px 22px 0;
}
.instrument-mode-hint {
  margin: 10px 22px 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

/* --- Быстрый выбор аккорда и гаммы --------------------------------------- */

.quick-picker { position: relative; flex: 1 1 220px; min-width: 0; }
.instrument-toolbar .quick-picker { flex: 1 1 240px; }
.guitar-actions .quick-picker,
.piano-actions .quick-picker { flex: 0 1 220px; }

.quick-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.028);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.quick-trigger:hover { border-color: rgba(216, 166, 74, 0.45); background: rgba(216, 166, 74, 0.06); }
.quick-trigger.is-open { border-color: rgba(216, 166, 74, 0.72); background: rgba(216, 166, 74, 0.09); }
.quick-trigger-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.quick-trigger-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.quick-trigger-kicker {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.quick-trigger-main {
  min-width: 0;
  overflow: hidden;
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-trigger-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-chevron { flex: 0 0 auto; color: var(--gold); font-size: 12px; line-height: 1; }
.quick-trigger:focus-visible,
.quick-close:focus-visible,
.quick-tab:focus-visible,
.quick-root:focus-visible,
.quick-cat:focus-visible,
.quick-option:focus-visible,
.quick-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

body.quick-open { overflow: hidden; }

.quick-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 34px);
}
.quick-modal[hidden] { display: none; }
.quick-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(181, 68, 52, 0.16), transparent 70%),
    rgba(9, 6, 4, 0.78);
  backdrop-filter: blur(5px);
}
.quick-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(88vh, 760px);
  padding: 20px;
  border: 1px solid rgba(216, 166, 74, 0.32);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(181, 68, 52, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(44, 30, 22, 0.995), rgba(23, 16, 12, 0.998));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: auto;
  animation: quickIn 0.18s ease-out;
}
@keyframes quickIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.quick-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quick-dialog-copy { min-width: 0; }
.quick-dialog-copy h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.quick-dialog-copy p { margin: 5px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.quick-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.quick-close:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.5); }
.quick-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 14px 0 0; }
.quick-tab {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.quick-tab:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.4); }
.quick-tab.is-active {
  border-color: rgba(216, 166, 74, 0.7);
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.12);
}
.quick-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 15px 0 7px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.quick-section-badge {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid rgba(216, 166, 74, 0.28);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.07);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  text-transform: none;
}
.quick-roots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.quick-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 40px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quick-root b { color: var(--ink-soft); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.quick-root small { color: var(--faint); font-size: 7px; line-height: 1; }
.quick-root:hover { border-color: rgba(216, 166, 74, 0.45); color: var(--ink); }
.quick-root.is-selected {
  border-color: rgba(216, 166, 74, 0.75);
  background: rgba(216, 166, 74, 0.14);
}
.quick-root.is-selected b { color: var(--gold-soft); }
.quick-root.is-unavailable, .quick-root:disabled { opacity: 0.4; cursor: not-allowed; }
.quick-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.quick-cat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-size: 8.5px;
  cursor: pointer;
}
.quick-cat b { font-weight: 700; }
.quick-cat small { color: var(--faint); font-family: var(--mono); font-size: 7px; }
.quick-cat:hover { border-color: rgba(216, 166, 74, 0.4); color: var(--ink); }
.quick-cat.is-selected { border-color: rgba(216, 166, 74, 0.68); color: var(--gold-soft); background: rgba(216, 166, 74, 0.1); }
.quick-cat.is-selected small { color: var(--gold); }
.quick-grid { display: grid; gap: 5px; }
.quick-chords { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.quick-scales { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quick-option b {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-option small {
  max-width: 100%;
  overflow: hidden;
  color: var(--faint);
  font-size: 7.5px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-option:hover { border-color: rgba(216, 166, 74, 0.45); color: var(--ink); }
.quick-option.is-selected { border-color: rgba(216, 166, 74, 0.72); background: rgba(216, 166, 74, 0.12); }
.quick-option.is-selected b { color: var(--gold-soft); }
.quick-option.is-selected small { color: var(--gold); }
.quick-option.is-unavailable { opacity: 0.45; }
.quick-option:disabled { cursor: not-allowed; }
.quick-option.is-unavailable:hover { opacity: 0.7; }
.quick-more {
  width: 100%;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px dashed rgba(216, 166, 74, 0.35);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.04);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.quick-more:hover { background: rgba(216, 166, 74, 0.1); border-style: solid; }
.quick-foot { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8.5px; line-height: 1.5; }

.half-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.half-head-copy { flex: 1; min-width: 0; }
.half-play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: -3px;
  border: 1px solid rgba(216, 166, 74, 0.3);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.06);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.half-play .play-glyph { font-size: 8px; }
.half-play:hover { border-color: rgba(216, 166, 74, 0.65); background: rgba(216, 166, 74, 0.16); color: var(--gold); }
.half-play:disabled { opacity: 0.3; cursor: not-allowed; background: transparent; border-color: var(--line); color: var(--faint); }

.position-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.position-field select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 92px;
  padding: 6px 20px 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-soft);
  background:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%) calc(100% - 11px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) calc(100% - 8px) 50% / 4px 4px no-repeat,
    rgba(12, 8, 6, 0.4);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
.position-field select:focus-visible { border-color: var(--gold); }
.guitar-position-label {
  fill: #ffcf9a;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: none;
}
.guitar-svg .guitar-caged-dot.is-selected-shape {
  filter: drop-shadow(0 0 7px rgba(255, 214, 150, 0.85));
}
.guitar-scale-ghost.is-outside { opacity: 0.32; }
.guitar-scale-ghost.is-outside:hover { opacity: 0.8; }

/* Перенос ноты гаммы из другого регистра на гармони. */
.garmon-key.kind-melody.is-scale-tone.is-scale-substitute:not(.is-active) {
  border-color: rgba(216, 166, 74, 0.9);
  box-shadow:
    0 3px 0 #3d6a60,
    0 6px 10px rgba(0, 0, 0, 0.36),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(216, 166, 74, 0.24);
}
.garmon-key.is-scale-substitute::before {
  content: "↕";
  position: absolute;
  top: 2px;
  right: 3px;
  z-index: 3;
  color: #6b4a16;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
}
.garmon-key.kind-melody.is-note-tone:not(.is-active) {
  color: #123c35;
  border-color: rgba(36, 93, 83, 0.85);
  background: radial-gradient(circle at 35% 27%, #f4fffc 0%, #d3f0e8 44%, #96cfc0 74%, #5f9f90 100%);
  box-shadow:
    0 3px 0 #3d6a60,
    0 6px 10px rgba(0, 0, 0, 0.36),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(90, 165, 150, 0.16);
}
.garmon-key.is-note-current { z-index: 4; }
.garmon-key.is-note-current::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(216, 166, 74, 0.16), 0 0 20px rgba(237, 200, 127, 0.65);
  pointer-events: none;
}

/* Ступень гаммы, перенесённая из другого регистра. */
.scale-step { position: relative; }
.practice-dot-shift { background: var(--gold); box-shadow: 0 0 0 1px rgba(255, 236, 210, 0.45); }
.scale-step.is-transposed:not(.is-current) {
  border-color: rgba(216, 166, 74, 0.55);
  background: rgba(216, 166, 74, 0.07);
}
.scale-step-shift {
  position: absolute;
  top: 1px;
  right: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* --- Теория на странице -------------------------------------------------- */

.theory-page-card { padding-bottom: 20px; }
.theory-page-head { align-items: center; }
.theory-live { margin: 14px 22px 0; }
.theory-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  margin: 16px 22px 0;
}
.theory-panel h4 {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}
.theory-live .theory-table-wrap { margin-top: 8px; }
.scale-theory-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.scale-theory-title { display: block; color: var(--gold-soft); font-family: var(--serif); font-size: 17px; }
.scale-theory-formula {
  padding: 4px 8px;
  border: 1px solid rgba(90, 165, 150, 0.35);
  border-radius: 6px;
  color: #bfe8dd;
  background: rgba(90, 165, 150, 0.08);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.scale-theory-lead { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.scale-theory-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 9px;
}
.scale-theory-facts b { color: var(--ink-soft); }
.scale-theory-table { margin-top: 10px; }
.theory-chord-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.theory-chord-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.theory-chord-chip:hover { border-color: rgba(216, 166, 74, 0.6); color: var(--gold-soft); }
.theory-chord-chip b { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.theory-chord-chip small { color: var(--faint); font-family: var(--mono); font-size: 7px; }
.scale-theory-tip {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(90, 165, 150, 0.5);
  color: var(--muted);
  background: rgba(90, 165, 150, 0.05);
  font-size: 9px;
  line-height: 1.5;
}
.scale-theory { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.scale-theory:empty { display: none; }
.scale-theory .theory-table { min-width: 620px; }

/* --- Адаптив ------------------------------------------------------------- */

@media (max-width: 1320px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; }
  .brand h1 { font-size: 40px; }
  .top-actions { gap: 12px; }
  .select-wrap select { min-width: 170px; }
  .sound-toggle { min-width: 150px; }
  .chord-chips { padding: 13px 16px 14px; }
  .card-lead, .chord-focus, .chord-tip { margin-left: 16px; margin-right: 16px; }
  .card-head { padding-left: 16px; padding-right: 16px; }
  .slider-row, input[type="range"], .switch-row, .audio-meter, .ghost-button, .sound-caption, .sample-credit { margin-left: 16px; margin-right: 16px; }
  .ghost-button { width: calc(100% - 32px); }
  .guitar-actions .ghost-button.small, .piano-actions .ghost-button.small { width: auto; }
  input[type="range"] { width: calc(100% - 32px); }
  .sound-group { margin-left: 16px; margin-right: 16px; }
  .sound-group .slider-row,
  .sound-group input[type="range"] { margin-left: 0; margin-right: 0; }
  .sound-group input[type="range"] { width: 100%; }
}

@media (max-width: 1120px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 20px; }
  .theory-columns { grid-template-columns: minmax(0, 1fr); }
  .guitar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .top-actions { justify-content: flex-start; width: 100%; }
  .workspace,
  .workspace.is-sheet-closed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: var(--order-areas-mobile);
  }
  .instrument-head { align-items: flex-start; }
  .instrument-legend { justify-content: flex-start; max-width: none; }
  .subbar.primary-nav { flex-wrap: wrap; }
  .subbar-hint { display: none; }
  .extras-body { grid-template-columns: minmax(0, 1fr); }
  .extras-body > .guitar-card,
  .extras-body > .piano-card,
  .extras-body > .sound-card,
  .extras-toolbar { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app { padding: 18px 12px 24px; }
  .instrument-toolbar,
  .instrument-voicings,
  .instrument-mode-hint,
  .instrument-hand-actions,
  .theory-live,
  .theory-columns { margin-left: 14px; margin-right: 14px; }
  .instrument-toolbar { gap: 8px; }
  .instrument-selection { flex-basis: 100%; }
  .guitar-actions { width: 100%; justify-content: flex-start; }
  .position-field { width: 100%; justify-content: space-between; }
  .position-field select { flex: 1 1 auto; }
  .theory-columns { gap: 14px; }
  .scale-theory .theory-table { min-width: 560px; }
  .brand { gap: 12px; }
  .brand-mark { width: 52px; height: 52px; }
  .brand-key-a { top: 17px; left: 17px; }
  .brand-key-b { top: 17px; left: 28px; }
  .brand-key-c { top: 29px; left: 21px; }
  .brand-key-d { top: 29px; left: 32px; }
  .brand h1 { font-size: 34px; }
  .brand p { font-size: 10px; }
  .top-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .top-field:first-child { grid-column: span 1; }
  .top-field:nth-child(2) { grid-column: span 1; }
  .sound-toggle, .guitar-toggle { grid-column: span 1; min-width: 0; }
  .select-wrap select { width: 100%; min-width: 0; }
  .segmented { width: 100%; }
  .seg-button { flex: 1; padding: 8px 8px; }
  .subbar { flex-wrap: wrap; gap: 8px 10px; font-size: 8px; }
  .subbar-spacer, .subbar-hint, .subbar-sep { display: none; }
  .instrument { grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); gap: 6px; padding: 8px; }
  .instrument-half { padding: 10px 4px 7px; }
  .keyboard { gap: 18px; padding-top: 4px; }
  .half-head h3 { font-size: 14px; }
  .half-kicker { font-size: 7px; }
  .bellows-label { font-size: 6px; }
  .instrument-head { flex-direction: column; gap: 10px; padding: 16px 16px 12px; }
  .instrument-legend { justify-content: flex-start; }
  .instrument-foot { flex-direction: column; gap: 4px; padding: 10px 16px 0; }
  .foot-note-right { text-align: left; }
  .now-playing { padding: 16px; align-items: flex-start; }
  .now-right { display: none; }
  .now-main { gap: 8px; }
  .now-note { font-size: 25px; }
  .now-en { font-size: 10px; }
  .staff-paper { margin: 0 10px; }
  .guitar-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .guitar-actions { width: 100%; justify-content: space-between; }
  .guitar-fretboard { margin: 8px 10px 0; }
  .guitar-caged-legend, .guitar-hint { margin-left: 12px; margin-right: 12px; }
  .guitar-heading { padding: 0 14px; }
  .guitar-title-row { gap: 8px; }
  #guitar-title { font-size: 28px; }
  .piano-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .piano-actions { width: 100%; justify-content: flex-end; }
  .piano-wrap { margin: 8px 10px 0; }
  .piano-heading { padding: 0 14px; }
  .piano-title-row { gap: 8px; }
  #piano-title { font-size: 28px; }
  .piano-legend, .piano-hint { margin-left: 12px; margin-right: 12px; }
  .staff-head { align-items: flex-start; flex-direction: column; }
  .staff-actions { width: 100%; justify-content: space-between; }
  .staff-foot { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px 0; }
  .staff-foot-hint { margin-left: 0; }
  .footer { flex-direction: column; gap: 6px; }
  .hand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chord-picker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .primary-nav { flex-wrap: wrap; gap: 6px; padding: 10px 0 14px; }
  .primary-link { padding: 6px 9px 6px 6px; }
  .primary-link-index { width: 24px; height: 24px; font-size: 7px; }
  .primary-link-copy b { font-size: 10px; }
  .primary-link-copy small { font-size: 7.5px; }

  .instrument-live {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }
  .instrument-live .now-note { font-size: 20px; }
  .instrument-legend { padding: 0 16px 10px; gap: 10px 14px; }
  .instrument { width: calc(100% - 24px); }

  .practice-card .card-head { padding: 18px 16px 0; }
  .practice-card .practice-pane { padding: 12px 16px 0; }
  .practice-card .practice-tabs { width: 100%; }
  .practice-card .scale-step { min-width: 36px; }

  .extras-summary { flex-wrap: wrap; gap: 10px 12px; padding: 14px 16px; }
  .extras-copy { flex: 1 1 200px; }
  .extras-copy b { font-size: 12.5px; }
  .extras-tags { display: none; }
  .extras-action { margin-left: 0; }
  .extras-body { gap: 14px; padding: 0 12px 12px; }
  .extras-toolbar { gap: 8px; }
  .extras-toolbar-note { display: none; }
  .extras .card-head { padding-left: 14px; padding-right: 14px; }
  .extras .guitar-card, .extras .piano-card, .extras .sound-card, .extras .staff-card { border-radius: 16px; }
}

@media (max-width: 420px) {
  :root { --key-size: 26px; --key-gap: 5px; }
  .guitar-actions { flex-direction: column; align-items: stretch; }
  .guitar-actions .ghost-button.small { width: 100%; }
  .piano-actions { flex-direction: column; align-items: stretch; }
  .piano-actions .ghost-button.small { width: 100%; }
  .brand h1 { font-size: 30px; }
  .brand p { display: none; }
  .top-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .top-field, .sound-toggle, .theme-toggle { grid-column: span 1; min-width: 0; }
  .select-wrap select { min-width: 0; padding-right: 28px; }
  .sound-toggle, .theme-toggle { width: 100%; }
  .instrument { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); }
  .instrument-card { --key-size: 27px; --key-gap: 5px; }
  .instrument-legend { display: none; }
  .primary-link-copy small { display: none; }
  .extras-action { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Выбранная, но недоступная опция ------------------------------------- */

.root-chip.is-selected:disabled,
.quality-chip.is-selected:disabled {
  opacity: 0.9;
  filter: none;
  border-style: dashed;
}

/* --- Светлая тема --------------------------------------------------------- */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2e8d5;
  --bg-deep: #e7d9c1;
  --panel: #fbf4e7;
  --panel-2: #f4ead8;
  --panel-3: #eadcc4;
  --ink: #2b1e14;
  --ink-soft: #3f2c1e;
  --muted: #65503e;
  --faint: #8a7159;
  --gold: #a87419;
  --gold-soft: #c58f2c;
  --gold-deep: #7e5410;
  --red: #a43b2c;
  --red-bright: #bf4e39;
  --red-deep: #74261c;
  --teal: #2f7d70;
  --teal-deep: #1f5f55;
  --paper: #fffaf0;
  --paper-2: #f6eedf;
  --paper-ink: #2c2118;
  --line: rgba(70, 48, 31, 0.16);
  --line-strong: rgba(70, 48, 31, 0.28);
  --shadow: 0 24px 60px rgba(80, 55, 35, 0.16);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(191, 125, 72, 0.18), transparent 60%),
    radial-gradient(900px 600px at -12% 30%, rgba(168, 116, 25, 0.12), transparent 62%),
    linear-gradient(165deg, #f8eedd 0%, #efe2cc 55%, #e6d5bc 100%);
}
html[data-theme="light"] body::before {
  opacity: 0.1;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(74, 53, 39, 0.04) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(74, 53, 39, 0.035) 5px 6px);
}
html[data-theme="light"] ::selection { background: var(--gold); color: #fffaf0; }
html[data-theme="light"] .ambient-one { background: rgba(181, 106, 61, 0.14); }
html[data-theme="light"] .ambient-two { background: rgba(168, 116, 25, 0.1); }

html[data-theme="light"] .topbar { border-bottom-color: var(--line); }
html[data-theme="light"] .segmented {
  background: rgba(255, 250, 240, 0.72);
  box-shadow: inset 0 2px 8px rgba(80, 55, 35, 0.08);
}
html[data-theme="light"] .seg-button:hover { background: rgba(70, 48, 31, 0.06); }
html[data-theme="light"] .seg-button.is-active {
  color: #fdf6e8;
  background: linear-gradient(180deg, #bb8430, #9c6716);
  box-shadow: 0 2px 8px rgba(80, 55, 35, 0.18);
}
html[data-theme="light"] .select-wrap select {
  background: linear-gradient(180deg, #fffaf0, #f1e3cd);
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(80, 55, 35, 0.1);
}
html[data-theme="light"] .sound-toggle,
html[data-theme="light"] .guitar-toggle,
html[data-theme="light"] .theme-toggle {
  background: linear-gradient(180deg, #fffaf0, #f0e2cb);
}
html[data-theme="light"] .theory-toggle {
  border-color: rgba(168, 116, 25, 0.42);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.8), transparent 55%),
    linear-gradient(180deg, #fffaf0, #f0e2cb);
}
html[data-theme="light"] .sound-icon,
html[data-theme="light"] .guitar-glyph {
  border-color: rgba(168, 116, 25, 0.36);
  background: rgba(168, 116, 25, 0.1);
}
html[data-theme="light"] .sound-icon span,
html[data-theme="light"] .guitar-glyph i { background: var(--gold); }
html[data-theme="light"] .guitar-glyph i:nth-child(1),
html[data-theme="light"] .guitar-glyph i:nth-child(6) { background: rgba(168, 116, 25, 0.55); }
html[data-theme="light"] .guitar-glyph i:nth-child(2),
html[data-theme="light"] .guitar-glyph i:nth-child(5) { background: rgba(168, 116, 25, 0.78); }

html[data-theme="light"] .card {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(191, 145, 74, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(255, 252, 246, 0.99), rgba(245, 234, 216, 0.99));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="light"] .card::after { box-shadow: inset 0 0 0 1px rgba(168, 116, 25, 0.07); }
html[data-theme="light"] .badge {
  border-color: rgba(168, 116, 25, 0.36);
  background: rgba(168, 116, 25, 0.08);
}
html[data-theme="light"] .badge-soft {
  color: var(--teal);
  border-color: rgba(47, 125, 112, 0.34);
  background: rgba(47, 125, 112, 0.08);
}
html[data-theme="light"] .chord-focus {
  border-color: rgba(168, 116, 25, 0.25);
  background:
    radial-gradient(110% 90% at 85% 0%, rgba(164, 59, 44, 0.08), transparent 60%),
    rgba(255, 250, 240, 0.72);
}
html[data-theme="light"] .chord-notebook-standalone {
  border-color: rgba(168, 116, 25, 0.25);
  background: rgba(255, 250, 240, 0.72);
}
html[data-theme="light"] .caged-chip { background: rgba(70, 48, 31, 0.035); }
html[data-theme="light"] .caged-chip b { filter: brightness(0.72); }
html[data-theme="light"] .chord-note,
html[data-theme="light"] .hand-note,
html[data-theme="light"] .root-chip,
html[data-theme="light"] .quality-chip,
html[data-theme="light"] .category-tab,
html[data-theme="light"] .voicing-chip,
html[data-theme="light"] .guitar-variant {
  background: rgba(70, 48, 31, 0.035);
}
html[data-theme="light"] .formula-step {
  border-color: rgba(47, 125, 112, 0.34);
  background: rgba(47, 125, 112, 0.07);
  color: #2f6f63;
}
html[data-theme="light"] .formula-step.is-tonic {
  border-color: rgba(168, 85, 18, 0.55);
  background: rgba(168, 85, 18, 0.08);
  color: #a85512;
}
html[data-theme="light"] .chord-degree {
  background: rgba(47, 125, 112, 0.1);
  color: #2f6f63;
}
html[data-theme="light"] .chord-note.is-tonic {
  border-color: rgba(168, 85, 18, 0.38);
  background: rgba(168, 85, 18, 0.06);
}
html[data-theme="light"] .root-chip:hover,
html[data-theme="light"] .quality-chip:hover,
html[data-theme="light"] .category-tab:hover,
html[data-theme="light"] .voicing-chip:hover,
html[data-theme="light"] .guitar-variant:hover {
  background: rgba(168, 116, 25, 0.06);
}
html[data-theme="light"] .category-tab.is-selected {
  border-color: rgba(168, 116, 25, 0.65);
  background: rgba(168, 116, 25, 0.12);
}
html[data-theme="light"] .category-tab.is-selected small { color: var(--gold); }
html[data-theme="light"] .quality-chip.is-jazz { color: #a5523e; border-color: rgba(164, 59, 44, 0.25); }
html[data-theme="light"] .quality-chip.is-jazz.is-selected {
  border-color: rgba(164, 59, 44, 0.55);
  background: rgba(164, 59, 44, 0.1);
}
html[data-theme="light"] .chord-availability.is-warning { color: #9a4d28; }
html[data-theme="light"] .mini-keyboard { background: rgba(70, 48, 31, 0.06); }
html[data-theme="light"] .mini-dot.mini-melody { background: #b8a17f; border-color: rgba(70, 48, 31, 0.28); }
html[data-theme="light"] .mini-dot.mini-extra { background: #91a6a9; border-color: rgba(70, 48, 31, 0.3); }
html[data-theme="light"] .mini-dot.mini-chord { background: #b45a48; border-color: rgba(164, 59, 44, 0.45); }
html[data-theme="light"] .mini-dot.mini-bass { background: #8d7658; border-color: rgba(70, 48, 31, 0.3); }
html[data-theme="light"] .hand-block { background: rgba(70, 48, 31, 0.045); }
html[data-theme="light"] .sample-credit { color: var(--faint); }
html[data-theme="light"] .sample-credit a { color: var(--muted); }
html[data-theme="light"] input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--fill, 50%), rgba(70, 48, 31, 0.14) var(--fill, 50%));
}
html[data-theme="light"] input[type="range"]::-moz-range-track { background: rgba(70, 48, 31, 0.14); }
html[data-theme="light"] .switch span {
  background: rgba(70, 48, 31, 0.12);
  border-color: rgba(70, 48, 31, 0.22);
}
html[data-theme="light"] .switch span::after { background: var(--muted); }
html[data-theme="light"] .ghost-button:hover { background: rgba(70, 48, 31, 0.05); }

html[data-theme="light"] .instrument {
  --ink: #f3e7d2;
  --ink-soft: #dcc9ac;
  --muted: #b39c7f;
  --faint: #8c7359;
  --gold: #d8a64a;
  --gold-soft: #edc87f;
  --line: rgba(240, 220, 186, 0.12);
  --line-strong: rgba(240, 220, 186, 0.22);
}
html[data-theme="light"] .now-playing {
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(168, 116, 25, 0.1), transparent 55%),
    linear-gradient(160deg, rgba(255, 252, 246, 0.99), rgba(245, 234, 216, 0.99));
  box-shadow: 0 18px 44px rgba(80, 55, 35, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
html[data-theme="light"] .now-playing.is-live { border-color: rgba(168, 116, 25, 0.42); }
html[data-theme="light"] .guitar-fretboard { background: #25160f; }
html[data-theme="light"] .practice-field select {
  color: var(--ink);
  background-color: rgba(255, 250, 240, 0.72);
}
html[data-theme="light"] .note-chip,
html[data-theme="light"] .alt-chip,
html[data-theme="light"] .scale-step,
html[data-theme="light"] .detect-result {
  background: rgba(70, 48, 31, 0.035);
}
html[data-theme="light"] .scale-step.is-current {
  color: #2a1b0d;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
}
html[data-theme="light"] .dictation-feedback.is-correct {
  color: #1f5f55;
  background: rgba(47, 125, 112, 0.12);
}
html[data-theme="light"] .dictation-feedback.is-wrong {
  color: #8e3025;
  background: rgba(164, 59, 44, 0.1);
}
html[data-theme="light"] .dictation-head {
  background: linear-gradient(140deg, rgba(168, 116, 25, 0.08), rgba(164, 59, 44, 0.04));
}
html[data-theme="light"] .footer { color: var(--faint); }
html[data-theme="light"] .footer-credit a { color: var(--faint); }
html[data-theme="light"] .toast {
  color: var(--ink);
  background: rgba(255, 250, 240, 0.97);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(80, 55, 35, 0.18);
}

html[data-theme="light"] .theory-backdrop {
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(191, 125, 72, 0.16), transparent 70%),
    rgba(70, 48, 31, 0.38);
}
html[data-theme="light"] .theory-dialog {
  border-color: rgba(168, 116, 25, 0.32);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(164, 59, 44, 0.07), transparent 55%),
    linear-gradient(160deg, rgba(255, 252, 246, 0.995), rgba(244, 234, 216, 0.995));
  box-shadow: 0 40px 100px rgba(80, 55, 35, 0.28), inset 0 1px 0 #fff;
}
html[data-theme="light"] .theory-head {
  background: linear-gradient(180deg, rgba(168, 116, 25, 0.06), transparent);
}
html[data-theme="light"] .theory-close {
  background: rgba(70, 48, 31, 0.035);
}
html[data-theme="light"] .theory-close:hover {
  background: rgba(168, 116, 25, 0.08);
}
html[data-theme="light"] .theory-card {
  background: rgba(70, 48, 31, 0.035);
}
html[data-theme="light"] .theory-legend span {
  background: rgba(70, 48, 31, 0.035);
}
html[data-theme="light"] .theory-table-wrap {
  background: rgba(255, 250, 240, 0.58);
}
html[data-theme="light"] .theory-table th {
  background: rgba(70, 48, 31, 0.04);
}
html[data-theme="light"] .theory-table td {
  border-bottom-color: rgba(70, 48, 31, 0.1);
}
html[data-theme="light"] .theory-table tr:hover td {
  background: rgba(168, 116, 25, 0.05);
}
html[data-theme="light"] .theory-note {
  background: rgba(168, 116, 25, 0.08);
}

/* Приоритетный экран в светлой теме */
html[data-theme="light"] .primary-link.is-active {
  border-color: rgba(168, 116, 25, 0.38);
  background: linear-gradient(160deg, rgba(168, 116, 25, 0.14), rgba(164, 59, 44, 0.05));
}
html[data-theme="light"] .primary-link:hover { background: rgba(70, 48, 31, 0.05); }
html[data-theme="light"] .extras {
  border-color: rgba(168, 116, 25, 0.28);
  background: rgba(255, 250, 240, 0.5);
}
html[data-theme="light"] .extras[open] {
  border-color: rgba(168, 116, 25, 0.36);
  background: rgba(255, 250, 240, 0.82);
}
html[data-theme="light"] .extras-summary:hover { background: rgba(70, 48, 31, 0.04); }
html[data-theme="light"] .extras-plus {
  border-color: rgba(168, 116, 25, 0.4);
  background: rgba(168, 116, 25, 0.09);
}
html[data-theme="light"] .extras-plus::before,
html[data-theme="light"] .extras-plus::after { background: var(--gold); }
html[data-theme="light"] .extras-action { border-color: rgba(168, 116, 25, 0.4); }
html[data-theme="light"] .extras-tags i { background: rgba(70, 48, 31, 0.035); }
html[data-theme="light"] .instrument-live {
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(168, 116, 25, 0.1), transparent 55%),
    rgba(255, 250, 240, 0.72);
  box-shadow: inset 0 1px 0 #fff;
}
html[data-theme="light"] .instrument-card { border-color: rgba(168, 116, 25, 0.3); }
html[data-theme="light"] .guitar-card,
html[data-theme="light"] .piano-card,
html[data-theme="light"] .theory-page-card { border-color: rgba(168, 116, 25, 0.28); }
html[data-theme="light"] .instrument-selection { color: #6f5a43; }
html[data-theme="light"] .position-field select {
  color: #3f2d1d;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%) calc(100% - 11px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) calc(100% - 8px) 50% / 4px 4px no-repeat,
    rgba(255, 250, 240, 0.85);
}
html[data-theme="light"] .theory-chord-chip {
  border-color: rgba(168, 116, 25, 0.22);
  background: rgba(255, 250, 240, 0.6);
}
html[data-theme="light"] .theory-chord-chip:hover { border-color: rgba(168, 116, 25, 0.55); color: #8a5b0e; }
html[data-theme="light"] .practice-card { border-color: rgba(47, 125, 112, 0.3); }
html[data-theme="light"] .extras .card { box-shadow: 0 14px 34px rgba(80, 55, 35, 0.1); }

/* Диктант: режим без подсказок — прячем названия нот и аккордов на клавишах. */
body.hide-key-labels .garmon-key .key-label,
body.hide-key-labels .piano-key-label {
  display: none;
}

@media (max-width: 760px) {
  .theme-toggle { grid-column: span 1; min-width: 0; }
  .theory-modal { padding: 8px; }
  .theory-dialog { max-height: 94vh; border-radius: 18px; }
  .theory-head { padding: 16px 16px 14px; gap: 12px; }
  .theory-head h2 { font-size: 24px; }
  .theory-head p { font-size: 10px; }
  .theory-body { padding: 16px 16px 20px; }
  .theory-cards { grid-template-columns: minmax(0, 1fr); }
  .theory-table { min-width: 520px; }
}

/* ==========================================================================
   ЯЗЫК, ПОДДЕРЖКА ПРОЕКТА И ФИНАЛЬНАЯ ПОЛИРОВКА
   ========================================================================== */

/* --- Переключатель языка -------------------------------------------------- */
.lang-switch { padding: 4px; }
.lang-switch .seg-button {
  padding: 7px 10px;
  font-size: 10px;
  letter-spacing: 0.09em;
}
.lang-field { flex: 0 0 auto; }

/* --- Кнопка «Поддержать» в шапке ----------------------------------------- */
.support-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 152px;
  padding: 9px 13px;
  border: 1px solid rgba(216, 166, 74, 0.42);
  border-radius: 13px;
  color: var(--ink);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(181, 68, 52, 0.24), transparent 60%),
    linear-gradient(180deg, rgba(62, 33, 26, 0.94), rgba(32, 20, 15, 0.96));
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.support-button:hover {
  border-color: rgba(237, 200, 127, 0.75);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}
.support-heart {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #ffd9c8;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 210, 190, 0.35), transparent 60%),
    rgba(181, 68, 52, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 170, 140, 0.35);
  font-size: 13px;
  animation: heartBeat 4.2s ease-in-out infinite;
}
@keyframes heartBeat {
  0%, 87%, 100% { transform: scale(1); }
  90% { transform: scale(1.12); }
  93% { transform: scale(0.98); }
  96% { transform: scale(1.06); }
}

.support-nav-link .primary-link-index { border-color: rgba(181, 68, 52, 0.42); }

/* --- Полоса поддержки под основным экраном ------------------------------- */
.support-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(216, 166, 74, 0.28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(181, 68, 52, 0.2), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(216, 166, 74, 0.12), transparent 60%),
    linear-gradient(150deg, rgba(48, 32, 23, 0.98), rgba(26, 18, 13, 0.99));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.support-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(237, 200, 127, 0.55), transparent);
  pointer-events: none;
}
.support-banner-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(216, 166, 74, 0.4);
  border-radius: 50%;
  color: var(--gold-soft);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 232, 190, 0.22), transparent 55%),
    linear-gradient(145deg, rgba(116, 50, 38, 0.95), rgba(45, 23, 17, 0.95));
  box-shadow: inset 0 0 0 4px rgba(15, 9, 7, 0.32), 0 10px 26px rgba(0, 0, 0, 0.3);
  font-size: 22px;
}
.support-banner-copy { flex: 1 1 auto; min-width: 0; }
.support-banner-copy b {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.support-banner-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  max-width: 72ch;
}
.support-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  flex: 0 0 auto;
}
.support-banner-button {
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  color: #2b1c0f;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.support-banner-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: brightness(1.04);
}
.support-banner-link {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px dotted rgba(216, 166, 74, 0.35);
}
.support-banner-link:hover { color: var(--gold); }

/* --- Модальное окно поддержки -------------------------------------------- */
body.support-open { overflow: hidden; }

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
}
.support-modal[hidden] { display: none; }

.support-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(181, 68, 52, 0.22), transparent 70%),
    rgba(9, 6, 4, 0.8);
  backdrop-filter: blur(5px);
}

.support-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(90vh, 880px);
  border: 1px solid rgba(216, 166, 74, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(181, 68, 52, 0.15), transparent 55%),
    linear-gradient(160deg, rgba(44, 30, 22, 0.99), rgba(23, 16, 12, 0.995));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: theoryIn 0.22s ease-out;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(216, 166, 74, 0.06), transparent);
}
.support-head-copy h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.support-head-copy p {
  margin: 8px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.support-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--sans);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.support-close:hover {
  color: var(--ink);
  border-color: rgba(216, 166, 74, 0.55);
  background: rgba(216, 166, 74, 0.08);
}

.support-body {
  overflow-y: auto;
  padding: 18px 24px 8px;
  scrollbar-color: rgba(216, 166, 74, 0.35) transparent;
  scrollbar-width: thin;
}
.support-body::-webkit-scrollbar { width: 8px; }
.support-body::-webkit-scrollbar-thumb { background: rgba(216, 166, 74, 0.3); border-radius: 5px; }

.support-free {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(90, 165, 150, 0.3);
  border-radius: 16px;
  background:
    radial-gradient(100% 140% at 0% 0%, rgba(90, 165, 150, 0.14), transparent 60%),
    rgba(90, 165, 150, 0.05);
}
.support-free-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(90, 165, 150, 0.45);
  border-radius: 50%;
  color: #bff0e4;
  background: rgba(36, 93, 83, 0.45);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.support-free-copy b {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
}
.support-free-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.support-methods {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.support-method {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.support-method:hover {
  border-color: rgba(216, 166, 74, 0.55);
  background: rgba(216, 166, 74, 0.07);
  transform: translateY(-1px);
}
.support-method.is-primary {
  border-color: rgba(216, 166, 74, 0.44);
  background: linear-gradient(180deg, rgba(216, 166, 74, 0.14), rgba(216, 166, 74, 0.04));
}
.support-method-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(216, 166, 74, 0.36);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.08);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}
.support-method-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-method-copy b { font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; }
.support-method-copy small { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.support-method-go { color: var(--faint); font-size: 14px; }
.support-method:hover .support-method-go { color: var(--gold); }

/* QR-код оплаты: та же форма CloudTips, но с телефона */
.support-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.support-qr-card {
  display: block;
  width: 168px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
  line-height: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.support-qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
}
.support-qr-card img { display: block; width: 100%; height: auto; border-radius: 5px; }
.support-qr-copy b { display: block; margin-top: 4px; color: var(--ink); font-size: 12.5px; }
.support-qr-copy p { margin: 6px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

.support-note {
  margin: 15px 0 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(216, 166, 74, 0.5);
  border-radius: 0 8px 8px 0;
  background: rgba(216, 166, 74, 0.06);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.support-legal {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}
.support-legal a {
  color: var(--gold-soft);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dotted rgba(216, 166, 74, 0.4);
}
.support-legal a:hover { color: var(--gold); }
.support-thanks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}
.support-thanks span[aria-hidden="true"] { color: var(--red-bright); }
.support-thanks a {
  margin-left: auto;
  color: var(--gold-soft);
  font-size: 10px;
  text-decoration: none;
  border-bottom: 1px dotted rgba(216, 166, 74, 0.4);
}
.support-thanks a:hover { color: var(--gold); }

.support-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}
.support-foot-button {
  padding: 9px 14px;
  border: 1px solid rgba(216, 166, 74, 0.42);
  border-radius: 10px;
  color: #2b1c0f;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
}
.support-foot-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.support-foot-button.is-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line-strong);
  font-weight: 600;
}
.support-foot-button.is-ghost:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.5); }

/* --- Навигация по теории -------------------------------------------------- */
.theory-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -22px -24px 20px;
  padding: 12px 24px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 26, 19, 0.99) 65%, rgba(38, 26, 19, 0.9));
  backdrop-filter: blur(6px);
}
.theory-nav-link {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.theory-nav-link:hover {
  color: var(--gold-soft);
  border-color: rgba(216, 166, 74, 0.5);
  background: rgba(216, 166, 74, 0.08);
}
.theory-section { scroll-margin-top: 64px; }

/* --- FAQ и финальная плашка теории --------------------------------------- */
.theory-faq {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}
.theory-faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  padding: 0 14px;
}
.theory-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.theory-faq summary::-webkit-details-marker { display: none; }
.theory-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 14px;
}
.theory-faq details[open] summary::after { content: "–"; }
.theory-faq details[open] summary { color: var(--ink); }
.theory-faq p {
  margin: 0;
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}
.theory-final-note { margin-top: 26px !important; }

/* --- Общая полировка ------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.card { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.card:hover { border-color: var(--line-strong); }

.instrument-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(237, 200, 127, 0.55), transparent);
  pointer-events: none;
  z-index: 1;
}
.practice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 165, 150, 0.5), transparent);
  pointer-events: none;
  z-index: 1;
}
.toast { z-index: 220; }

svg:focus-visible, circle:focus-visible { outline: none; }

/* --- Адаптив для новых блоков -------------------------------------------- */
@media (max-width: 1120px) {
  .support-banner { flex-wrap: wrap; }
  .support-banner-actions { align-items: flex-start; flex: 1 1 100%; flex-direction: row; }
}
@media (max-width: 760px) {
  .lang-field { grid-column: span 1; min-width: 0; }
  .support-button { grid-column: span 1; width: 100%; min-width: 0; }
  .support-banner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 16px; }
  .support-banner-mark { width: 46px; height: 46px; font-size: 18px; }
  .support-banner-copy b { font-size: 17px; }
  .support-banner-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .support-banner-button { width: 100%; }
  .support-banner-link { text-align: center; border-bottom: 0; }
  .support-dialog { max-height: 94vh; border-radius: 18px; }
  .support-head { padding: 16px 16px 14px; gap: 12px; }
  .support-body { padding: 14px 16px 6px; }
  .support-qr { grid-template-columns: 1fr; justify-items: center; gap: 12px; padding: 14px; text-align: center; }
  .support-qr-copy p { max-width: 46ch; }
  .support-foot { padding: 12px 16px 16px; flex-wrap: wrap; }
  .support-foot-button { flex: 1 1 auto; }
  .theory-nav {
    top: 0;
    margin: -16px -16px 16px;
    padding: 10px 16px 8px;
    gap: 5px;
  }
  .theory-nav-link { font-size: 8px; padding: 4px 7px; }
}
@media (max-width: 420px) {
  .support-button { grid-column: span 1; }
  .support-button .sound-copy small { display: none; }
  .support-methods { gap: 7px; }
  .support-method { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 9px 10px; }
  .support-method-icon { width: 32px; height: 32px; font-size: 12px; }
  .support-free { padding: 12px; gap: 10px; }
  .support-free-badge { width: 44px; height: 44px; font-size: 14px; }
  .support-qr-card { width: 148px; }
}

/* --- Светлая тема: новые блоки ------------------------------------------- */
html[data-theme="light"] .support-button {
  border-color: rgba(164, 59, 44, 0.32);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(164, 59, 44, 0.12), transparent 60%),
    linear-gradient(180deg, #fffaf0, #f4ead8);
}
html[data-theme="light"] .support-heart { color: #8c2c1e; background: rgba(164, 59, 44, 0.12); }
html[data-theme="light"] .support-banner {
  border-color: rgba(168, 116, 25, 0.3);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(164, 59, 44, 0.1), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(168, 116, 25, 0.12), transparent 60%),
    linear-gradient(150deg, #fffaf0, #f4ead8);
  box-shadow: 0 18px 44px rgba(80, 55, 35, 0.14), inset 0 1px 0 #fff;
}
html[data-theme="light"] .support-banner-mark {
  color: #8c2c1e;
  background: linear-gradient(145deg, #f7e2d4, #efd9c2);
  box-shadow: inset 0 0 0 3px #fdf6e9, 0 8px 20px rgba(80, 55, 35, 0.12);
}
html[data-theme="light"] .support-dialog {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(164, 59, 44, 0.07), transparent 55%),
    linear-gradient(160deg, #fffaf0, #f4ead8);
  box-shadow: 0 40px 100px rgba(80, 55, 35, 0.3), inset 0 1px 0 #fff;
}
html[data-theme="light"] .support-free {
  border-color: rgba(47, 125, 112, 0.28);
  background: rgba(47, 125, 112, 0.06);
}
html[data-theme="light"] .support-free-badge { color: #1f5f55; background: rgba(47, 125, 112, 0.12); }
html[data-theme="light"] .support-method { background: rgba(255, 255, 255, 0.55); }
html[data-theme="light"] .support-method:hover { background: rgba(168, 116, 25, 0.08); }
html[data-theme="light"] .support-method.is-primary {
  background: linear-gradient(180deg, rgba(168, 116, 25, 0.12), rgba(168, 116, 25, 0.04));
}
html[data-theme="light"] .support-qr { background: rgba(255, 255, 255, 0.5); }
html[data-theme="light"] .support-qr-card { box-shadow: 0 8px 18px rgba(80, 55, 35, 0.18); }
html[data-theme="light"] .support-foot { background: rgba(255, 255, 255, 0.4); }
html[data-theme="light"] .theory-nav { background: linear-gradient(180deg, rgba(251, 244, 231, 0.99) 65%, rgba(251, 244, 231, 0.9)); }
html[data-theme="light"] .theory-nav-link { background: rgba(255, 255, 255, 0.5); }
html[data-theme="light"] .theory-faq details { background: rgba(255, 255, 255, 0.45); }


/* --- Быстрый выбор: адаптив и светлая тема ------------------------------- */
@media (max-width: 760px) {
  .quick-picker,
  .instrument-toolbar .quick-picker,
  .guitar-actions .quick-picker,
  .piano-actions .quick-picker { flex: 1 1 100%; }
  .quick-dialog { width: 100%; max-height: 90vh; border-radius: 20px 20px 0 0; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); }
  .quick-modal { align-items: flex-end; padding: 0; }
  .quick-dialog-copy h3 { font-size: 21px; }
  .quick-chords { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-scales { grid-template-columns: minmax(0, 1fr); }
  .quick-root { min-height: 42px; }
}
@media (max-width: 420px) {
  .quick-roots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-chords { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-cat { justify-content: center; }
}
html[data-theme="light"] .quick-trigger {
  background: linear-gradient(180deg, #fffaf0, #f6ecd9);
  border-color: rgba(168, 116, 25, 0.28);
}
html[data-theme="light"] .quick-trigger:hover,
html[data-theme="light"] .quick-trigger.is-open { background: rgba(168, 116, 25, 0.09); }
html[data-theme="light"] .quick-dialog {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(164, 59, 44, 0.06), transparent 55%),
    linear-gradient(160deg, #fffaf0, #f2e6d2);
  box-shadow: 0 40px 100px rgba(80, 55, 35, 0.28), inset 0 1px 0 #fff;
}
html[data-theme="light"] .quick-root,
html[data-theme="light"] .quick-option,
html[data-theme="light"] .quick-cat,
html[data-theme="light"] .quick-tab { background: rgba(255, 255, 255, 0.55); }
html[data-theme="light"] .quick-root:hover,
html[data-theme="light"] .quick-option:hover,
html[data-theme="light"] .quick-cat:hover,
html[data-theme="light"] .quick-tab:hover { background: rgba(168, 116, 25, 0.08); }
html[data-theme="light"] .quick-option.is-selected,
html[data-theme="light"] .quick-root.is-selected,
html[data-theme="light"] .quick-cat.is-selected,
html[data-theme="light"] .quick-tab.is-active { background: rgba(168, 116, 25, 0.13); }
html[data-theme="light"] .quick-option b,
html[data-theme="light"] .quick-root b { color: #3c2a1d; }
html[data-theme="light"] .quick-option.is-selected b,
html[data-theme="light"] .quick-root.is-selected b { color: #8a5a13; }
html[data-theme="light"] .half-play { background: rgba(168, 116, 25, 0.06); }
html[data-theme="light"] .half-play:hover { background: rgba(168, 116, 25, 0.14); }

/* --- Свёрнутая шпаргалка, порядок инструментов и тетрадь рядом ----------- */

.sheet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  cursor: pointer;
  text-transform: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.sheet-toggle:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.45); background: rgba(216, 166, 74, 0.06); }
.sheet-toggle.is-active { color: var(--gold-soft); border-color: rgba(216, 166, 74, 0.6); background: rgba(216, 166, 74, 0.1); }
.sheet-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  border: 1px solid rgba(216, 166, 74, 0.28);
  border-radius: 5px;
  color: var(--gold-soft);
  font-size: 11px;
  line-height: 1;
}
.sheet-toggle-copy { display: flex; flex-direction: column; gap: 1px; align-items: flex-start; }
.sheet-toggle-copy b { color: var(--ink-soft); font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sheet-toggle-copy small { color: var(--faint); font-size: 7.5px; letter-spacing: 0.03em; text-transform: none; }
.chord-sheet-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.chord-sheet-close:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.5); }

.order-controls { display: inline-flex; gap: 3px; }
.mini-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.mini-tool:hover { color: var(--gold-soft); border-color: rgba(216, 166, 74, 0.5); background: rgba(216, 166, 74, 0.08); }
.mini-tool:disabled { opacity: 0.3; cursor: not-allowed; }
.notebook-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.notebook-toggle:hover { color: var(--ink); border-color: rgba(216, 166, 74, 0.45); }
.notebook-toggle.is-active {
  color: var(--gold-soft);
  border-color: rgba(216, 166, 74, 0.6);
  background: rgba(216, 166, 74, 0.1);
}
.notebook-toggle-glyph { color: var(--gold); font-size: 11px; line-height: 1; }
.instrument-notebook {
  margin: 14px 22px 0;
  padding: 10px;
  border: 1px solid rgba(216, 166, 74, 0.2);
  border-radius: 12px;
  background: rgba(8, 5, 4, 0.28);
}
.instrument-notebook .notebook-head { margin-bottom: 7px; }
.instrument-notebook .notebook-paper {
  width: 100%;
  margin: 0;
  border-radius: 8px;
}

/* --- Квинтовый круг ------------------------------------------------------- */

.circle-of-fifths { display: block; width: 100%; height: auto; overflow: visible; }
.circle-seg { cursor: pointer; outline: none; }
.circle-seg path {
  fill: rgba(255, 255, 255, 0.035);
  stroke: rgba(216, 166, 74, 0.17);
  stroke-width: 0.8;
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.circle-seg:hover path { fill: rgba(216, 166, 74, 0.12); stroke: rgba(216, 166, 74, 0.4); }
.circle-seg.is-related path { fill: rgba(90, 165, 150, 0.1); stroke: rgba(90, 165, 150, 0.35); }
.circle-seg.is-selected path { fill: rgba(216, 166, 74, 0.24); stroke: rgba(216, 166, 74, 0.8); stroke-width: 1.5; }
.circle-seg.is-unavailable { opacity: 0.32; cursor: not-allowed; }
.circle-seg:focus-visible path { stroke: var(--gold-soft); stroke-width: 2.2; }
.circle-note {
  fill: var(--ink-soft);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.circle-note-minor { fill: var(--muted); font-size: 11px; }
.circle-minor-mark { font-size: 8px; fill: var(--faint); }
.circle-seg.is-selected .circle-note { fill: var(--gold-soft); }
.circle-seg.is-selected .circle-minor-mark { fill: var(--gold); }
.circle-center { fill: rgba(8, 5, 4, 0.46); stroke: rgba(216, 166, 74, 0.28); stroke-width: 1; }
.circle-center-note { fill: var(--gold-soft); font-family: var(--serif); font-size: 26px; font-weight: 600; pointer-events: none; }
.circle-center-sub { fill: var(--muted); font-family: var(--sans); font-size: 7.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none; }
.circle-center-sig { fill: var(--faint); font-family: var(--mono); font-size: 7px; pointer-events: none; }

/* --- Быстрый выбор: круг + настройки -------------------------------------- */

.quick-dialog { width: min(780px, 100%); }
.quick-layout {
  display: grid;
  grid-template-columns: minmax(0, 292px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}
.quick-circle-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}
.quick-circle { width: min(266px, 100%); margin: 0 auto; }
.quick-circle-hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}
.quick-selection {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(216, 166, 74, 0.2);
  border-radius: 9px;
  background: rgba(216, 166, 74, 0.06);
  text-align: center;
}
.quick-selection b { display: block; color: var(--gold-soft); font-family: var(--mono); font-size: 17px; font-weight: 700; }
.quick-selection small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.quick-options-panel { min-width: 0; }
.quick-options-panel .quick-section-title:first-child { margin-top: 0; }
.quick-foot-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.quick-sheet-link {
  padding: 7px 10px;
  border: 1px dashed rgba(216, 166, 74, 0.4);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(216, 166, 74, 0.05);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.quick-sheet-link:hover { border-style: solid; background: rgba(216, 166, 74, 0.1); }

/* --- Теория: круг на главной --------------------------------------------- */

.theory-circle-block {
  margin: 0 24px 18px;
  padding: 16px;
  border: 1px solid rgba(216, 166, 74, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(216, 166, 74, 0.07), transparent 60%),
    rgba(8, 5, 4, 0.22);
}
.circle-theory {
  display: grid;
  grid-template-columns: minmax(220px, 316px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.circle-theory-wheel { width: 100%; max-width: 316px; margin: 0 auto; }
.circle-theory-copy { min-width: 0; }
.circle-theory-title {
  display: block;
  margin-top: 3px;
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}
.circle-theory-lead { margin: 8px 0 10px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.circle-pair { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.circle-pair-major,
.circle-pair-minor {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}
.circle-pair-major b { color: var(--gold-soft); font-size: 10px; }
.circle-pair-minor b { color: var(--teal-soft, #9ad4c7); font-size: 10px; }
.circle-pair small { color: var(--faint); font-family: var(--mono); font-size: 7px; }
.circle-facts { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 10px; color: var(--faint); font-size: 9px; }
.circle-facts b { color: var(--ink-soft); }
.circle-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.circle-actions .ghost-button { width: auto; margin: 0; }

/* --- Светлая тема для новых блоков --------------------------------------- */

html[data-theme="light"] .sheet-toggle,
html[data-theme="light"] .mini-tool,
html[data-theme="light"] .notebook-toggle,
html[data-theme="light"] .chord-sheet-close {
  background: rgba(255, 255, 255, 0.6);
}
html[data-theme="light"] .instrument-notebook,
html[data-theme="light"] .quick-circle-panel,
html[data-theme="light"] .theory-circle-block {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(168, 116, 25, 0.08), transparent 60%),
    rgba(255, 250, 240, 0.6);
}
html[data-theme="light"] .quick-selection { background: rgba(168, 116, 25, 0.08); }
html[data-theme="light"] .quick-selection b { color: #8a5a13; }
html[data-theme="light"] .circle-seg path { fill: rgba(70, 48, 31, 0.04); stroke: rgba(168, 116, 25, 0.22); }
html[data-theme="light"] .circle-seg:hover path { fill: rgba(168, 116, 25, 0.12); }
html[data-theme="light"] .circle-seg.is-related path { fill: rgba(47, 125, 112, 0.12); stroke: rgba(47, 125, 112, 0.4); }
html[data-theme="light"] .circle-seg.is-selected path { fill: rgba(168, 116, 25, 0.2); stroke: rgba(168, 116, 25, 0.8); }
html[data-theme="light"] .circle-note { fill: #3c2a1d; }
html[data-theme="light"] .circle-note-minor { fill: #7b644d; }
html[data-theme="light"] .circle-center { fill: rgba(255, 250, 240, 0.84); stroke: rgba(168, 116, 25, 0.3); }
html[data-theme="light"] .circle-center-note { fill: #8a5a13; }
html[data-theme="light"] .circle-pair-major,
html[data-theme="light"] .circle-pair-minor { background: rgba(70, 48, 31, 0.035); }
html[data-theme="light"] .circle-pair-minor b { color: #2f6f63; }
html[data-theme="light"] .quick-sheet-link {
  color: #8a5a13;
  border-color: rgba(168, 116, 25, 0.4);
  background: rgba(168, 116, 25, 0.06);
}

@media (max-width: 1120px) {
  .quick-layout { grid-template-columns: minmax(0, 264px) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .quick-dialog { width: min(560px, 100%); }
  .quick-layout { grid-template-columns: minmax(0, 1fr); }
  .quick-circle { width: min(250px, 100%); }
  .quick-circle-panel { padding: 10px; }
  .instrument-notebook { margin: 10px 14px 0; }
  .theory-circle-block { margin: 0 14px 16px; padding: 12px; }
  .circle-theory { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .circle-theory-wheel { max-width: 280px; }
  .circle-theory-title { font-size: 20px; }
}
@media (max-width: 420px) {
  .quick-circle { width: min(220px, 100%); }
  .circle-theory-wheel { max-width: 240px; }
  .circle-actions .ghost-button { width: 100%; }
}


