/* Tones — угольная студия.
   Горячий (ember) - то, что играешь: зажатые лады, активный аккорд, действия.
   Холодный (циан) - то, что подсказывает теория: гаммы, ступени, совпадения.
   Технические подписи - моно строчными, как шёлкография на панели усилителя. */
:root {
  --bg: #131518;
  --panel: #1a1d21;
  --panel-deep: #17191d;
  --raise: #22262b;
  --raise2: #2a2f35;
  --line: #2b3037;
  --line-soft: #23272d;
  --ink: #ecebe6;
  --muted: #9ba3a8;
  --hot: #ff5c38;
  --hot-ink: #1f0d07;
  --hot-soft: rgba(255, 92, 56, .13);
  --hot-line: rgba(255, 92, 56, .45);
  --cold: #43d9c9;
  --cold-ink: #06211e;
  --cold-soft: rgba(67, 217, 201, .12);
  --mono: "Cascadia Mono", Consolas, "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.013) 0 1px, transparent 1px 3px);
}
::selection { background: var(--hot); color: var(--hot-ink); }
[tabindex="0"]:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--hot); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------------- шапка: панель усилителя ---------------- */
header { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center;
         padding: 14px max(14px, 3vw); border-bottom: 1px solid var(--line);
         background: var(--panel-deep); }
.logo { font-family: var(--mono); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.logo span { color: var(--hot); }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav button { border: 0; background: none; color: var(--muted); font-family: var(--mono); font-size: 13.5px;
             padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
nav button:hover { color: var(--ink); }
nav button.on { color: var(--hot); }
nav button.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
                        background: var(--hot); }
.settings { margin-left: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.genre-group { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.genre-tunings { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; max-width: 340px; }
.gt-cap { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.gt-chip { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); background: var(--raise);
           color: var(--muted); border-radius: 999px; padding: 2px 8px; cursor: pointer; }
.gt-chip:hover { border-color: var(--hot-line); color: var(--hot); }
.gt-chip.on { background: var(--hot-soft); border-color: var(--hot-line); color: var(--hot); }
.ctl-stack { flex-direction: column; align-items: flex-start; gap: 4px; }
.ctl-row { display: flex; gap: 8px; align-items: center; }
.tuning-hint { font-family: var(--mono); font-size: 11px; line-height: 1.4; color: var(--muted);
               max-width: 250px; overflow-wrap: anywhere; }
.ctl { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--hot); width: 15px; height: 15px; }
select, input[type=number], input[type=text] {
  font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--raise);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px; max-width: 230px; }
input[type=number] { width: 60px; }
select:hover, input:hover { border-color: var(--raise2); }

/* ---------------- ползунки: тонкая дорожка, живая ember-заливка, круглая ручка.
   Заливка слева - linear-gradient по CSS-переменной --val, её двигает syncRange()
   из app.js на каждом вводе; Firefox красит пройденную часть сам. */
input[type=range] {
  --val: 50%;
  -webkit-appearance: none; appearance: none;
  height: 22px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--hot) var(--val), var(--line) var(--val));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--hot); border: 3px solid var(--hot-ink);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .55);
  transition: transform .12s ease;
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--hot); }
input[type=range]::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--hot); border: 3px solid var(--hot-ink);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .55);
  transition: transform .12s ease;
}
input[type=range]:hover::-moz-range-thumb { transform: scale(1.18); }

main { padding: 20px max(14px, 3vw) 70px; max-width: 1280px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
         box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.panel-deep { background: var(--panel-deep); }
h2 { font-family: var(--mono); font-size: 12.5px; font-weight: 400; color: var(--muted);
     margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 14px; height: 2px; background: var(--hot); flex: none; }
h2 .count { color: var(--ink); }
h3 { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--muted); margin: 16px 0 8px; }
h3 b { color: var(--ink); font-size: 14px; }
.panel-cap { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid2 > * , .stack > * { min-width: 0; }
.stack > * + * { margin-top: 14px; }
.col { display: grid; gap: 14px; align-content: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .settings { margin-left: 0; } }

button.primary { background: var(--hot); color: var(--hot-ink); border: 0; border-radius: 8px;
                 padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
button.primary:hover { background: #ff704f; }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.mini, .tools button { font-family: var(--mono); font-size: 12.5px; background: var(--raise); color: var(--ink);
                 border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
button.mini:hover, .tools button:hover { border-color: var(--hot-line); color: var(--hot); }
.err { color: var(--hot); font-size: 13.5px; margin-top: 10px; overflow-wrap: anywhere; }

/* ---------------- загрузка песни ---------------- */
#drop, #tab-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 36px 20px; text-align: center;
        cursor: pointer; background: var(--panel-deep); }
#drop.over, #tab-drop.over { border-color: var(--hot); background: var(--hot-soft); }
#drop b, #tab-drop b { display: block; font-size: 18px; margin-bottom: 6px; }
#drop.compact { padding: 10px 16px; border-width: 1px; text-align: left; display: flex; flex-wrap: wrap;
                align-items: center; gap: 4px 12px; }
#drop.compact b { display: inline; font-size: 14px; margin: 0; }
#drop.compact > span { font-size: 13px; }
#drop.compact #job, #drop.compact #song-err { flex-basis: 100%; }
#drop.compact #job-text { margin-top: 4px !important; }
.progress { height: 4px; background: var(--raise); border-radius: 2px; overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; width: 30%; background: var(--hot); border-radius: 2px;
              animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ---------------- как слушать: режим разбора и ручки ---------------- */
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.preset { font-family: var(--mono); font-size: 13px; border: 1px solid var(--line); background: var(--raise);
          color: var(--muted); border-radius: 8px; padding: 8px 18px; cursor: pointer; }
.preset:hover { border-color: var(--hot-line); color: var(--ink); }
.preset.on { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); font-weight: 700; }
.preset-desc { font-size: 13px; flex: 1 1 200px; min-width: 0; }
.knob-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px 24px; margin-top: 16px; }
.knob { display: grid; gap: 4px; align-content: start; min-width: 0; }
.knob-name { font-family: var(--mono); font-size: 12px; color: var(--ink);
             display: flex; justify-content: space-between; gap: 10px; }
.knob-name b { color: var(--hot); font-weight: 700; }
.knob-hint { font-size: 12px; color: var(--muted); }
.knob-extra { display: flex; gap: 10px 24px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.listen-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.listen-hint { font-size: 13px; }

/* ---------------- плеер: имя аккорда - герой ---------------- */
.player { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 14px 30px; align-items: center; }
.player .timeline { grid-column: 1 / -1; margin-top: 0; }
.now, .next { display: flex; align-items: center; gap: 16px; }
.label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hero { font-weight: 800; letter-spacing: -.03em; line-height: .95; overflow-wrap: anywhere; }
#now-chord { font-size: clamp(48px, 6.5vw, 84px); min-width: 3ch; }
#next-chord { font-size: 30px; display: block; line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.now svg.diagram { width: 108px; margin: 0; }
.next svg.diagram { width: 80px; margin: 0; opacity: .55; }
.controls { min-width: 0; }
audio { width: 100%; display: block; }
@media (min-width: 861px) and (min-height: 700px) {
  .player { position: sticky; top: 8px; z-index: 5; }
}
@media (max-width: 860px) {
  .player { grid-template-columns: auto minmax(0, 1fr); }
  .player .controls { grid-column: 1 / -1; }
  .now svg.diagram { width: 88px; } .next svg.diagram { width: 60px; }
}
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-family: var(--mono); font-size: 12px; background: var(--raise); border: 1px solid var(--line-soft);
        border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.chip.accent { background: var(--hot-soft); color: var(--hot); border-color: var(--hot-line); font-weight: 600; }

.timeline { position: relative; height: 52px; overflow-x: auto; overflow-y: hidden; margin-top: 14px;
            border-radius: 8px; background: var(--panel-deep); border: 1px solid var(--line-soft); }
.timeline .track { position: relative; height: 100%; }
.timeline .seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--bg);
                 display: flex; align-items: center; padding-left: 6px; font-family: var(--mono); font-size: 12.5px;
                 font-weight: 600; white-space: nowrap; overflow: hidden; cursor: pointer; color: var(--ink); }
.timeline .seg.none { color: var(--muted); font-weight: 400; }
.timeline .head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--hot);
                  pointer-events: none; }
.bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.bar { background: var(--raise); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 10px 8px;
       min-height: 50px; cursor: pointer; font-weight: 600; font-size: 16px; position: relative;
       scroll-margin: calc(var(--player-h, 0px) + 24px) 0 24px; overflow-wrap: anywhere; }
.bar small { position: absolute; top: 4px; right: 7px; font-family: var(--mono); font-size: 11px;
             color: var(--muted); font-weight: 400; }
.bar.on { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); }
.bar.on small { color: var(--hot-ink); }
.bar:hover { border-color: var(--hot-line); }
.timeline .seg:hover { filter: brightness(1.18); }

/* ---------------- карточки аккордов ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; cursor: pointer;
        background: var(--raise); }
.card:hover { border-color: var(--hot-line); }
.card.on { border-color: var(--hot); box-shadow: 0 0 0 1px var(--hot); }
.card .title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.card .sub { font-size: 12px; color: var(--muted); min-height: 1.3em; }
.card .alt { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.card { position: relative; }
.card .tag { position: absolute; top: -8px; left: 8px; border: 1px solid var(--panel); font-family: var(--mono);
             font-size: 11px; background: var(--hot); color: var(--hot-ink); border-radius: 999px; padding: 1px 7px; }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.cards.compact .card { padding: 8px 6px; }
.cards.compact .title { font-size: 16px; }
.cards.compact .sub { font-size: 11px; }
.cards.compact svg.diagram { max-width: 100px; }
svg.diagram { width: 100%; max-width: 132px; height: auto; display: block; margin: 4px auto; }
h3 b { font-size: 14px; }
.voicing-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
               scroll-snap-type: x proximity; }
.voicing-row > * { scroll-snap-align: start; }
.voicing-row > :last-child { scroll-snap-align: end; }
.voicing-row figure { margin: 0; text-align: center; min-width: 110px; }
.voicing-row figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
/* прокручиваемый ряд хватов: пока у правого края прячется карточка, app.js держит
   fade-r (и fade-l, когда прокрутили) - маска тушит край в фон, и обрез читается
   как «есть ещё», а не как поломка */
.voicing-row.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
                      mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); }
.voicing-row.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 26px);
                      mask-image: linear-gradient(to right, transparent, #000 26px); }
.voicing-row.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 26px, #000 calc(100% - 26px), transparent); }

/* ---------------- гриф ---------------- */
.board-wrap { overflow-x: auto; padding-bottom: 2px; }
table.board { border-collapse: collapse; margin: 4px 0; user-select: none; }
table.board td { width: 52px; height: 38px; text-align: center; position: relative; cursor: pointer; padding: 0; }
table.board td.nut { width: 38px; border-right: 4px solid #b9bfc6; font-family: var(--mono); font-weight: 700;
                     font-size: 13px; color: var(--muted); }
/* каподастр на доске: лады за ним глухие, на самом ладу - холодная полоса-защёлка */
table.board td.capped { opacity: .22; cursor: not-allowed; }
table.board td.capo-bar { background: color-mix(in srgb, var(--cold) 30%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cold) 70%, transparent); cursor: default; }
table.board td.fret { border-right: 2px solid var(--line); }
table.board td.fret[data-mark] { border-right-color: #3a4048; }
table.board td.fret::before { content: ""; position: absolute; left: 0; right: 0; top: 50%;
                              border-top: 2px solid #565e66; opacity: .55; }
table.board td.name { width: 30px; font-family: var(--mono); color: var(--muted); font-size: 13px; cursor: default; }
table.board tr.numbers td { height: 20px; font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: default; }
table.board tr.numbers td.mark { color: var(--hot); font-weight: 700; }
/* зажатый лад - горячая точка с тёмной буквой */
.dot { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
       background: var(--hot); color: var(--hot-ink); font-family: var(--mono); font-size: 11.5px; font-weight: 700;
       line-height: 26px; z-index: 2; }
table.board td.hit-scale .dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--cold); }
/* звучащая открытая струна в гамме - холодный кружок на порожке */
table.board td.hit-scale, table.board td.root { color: var(--cold); }
table.board td.hit-scale.root { font-weight: 700; }
/* нота гаммы - холодный контур; тоника залита */
.scale-dot { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
             border-radius: 50%; border: 1.5px solid var(--cold); color: var(--cold); font-family: var(--mono);
             font-size: 9.5px; line-height: 21px; z-index: 1; opacity: .85; }
table.board td.root .scale-dot { background: var(--cold); color: var(--cold-ink); font-weight: 700; }
.board-tools { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tools .hint { font-size: 13px; align-self: center; }
.scale-box { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center;
             border-left: 2px solid var(--cold); padding-left: 14px; }
.scale-info { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.scale-info b { color: var(--cold); font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-family: var(--mono);
          font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg-hot { background: var(--hot); }
.lg-cold { border: 1.5px solid var(--cold); }
.lg-root { background: var(--cold); }
.lg-off { border: 1.5px dashed var(--muted); }
.names { display: flex; flex-direction: column; gap: 6px; }
.name-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
            border-left: 3px solid transparent; }
.name-row:hover { background: var(--raise); }
.name-row.on { background: var(--hot-soft); border-left-color: var(--hot); }
.name-row b { font-size: 22px; min-width: 5ch; letter-spacing: -.02em; }
.name-row .muted { font-size: 12.5px; font-family: var(--mono); }

/* ---------------- что дальше / чем приправить ---------------- */
.next-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.next-card { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px;
             background: var(--raise); position: relative; overflow: hidden; }
.next-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 10px 12px 12px;
             cursor: pointer; color: var(--ink); font: inherit; display: grid; gap: 4px; }
.next-main:hover { background: var(--raise2); }
.next-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.next-top b { font-size: 22px; letter-spacing: -.02em; }
.next-deg { font-family: var(--mono); font-size: 11px; color: var(--cold); background: var(--cold-soft);
            border-radius: 8px; padding: 1px 8px; }
.next-reason { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.next-score { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--hot); }
.next-side { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted);
             font-family: var(--mono); font-size: 11px; padding: 0 10px; cursor: pointer; flex: none; }
.next-side:hover { color: var(--hot); background: var(--hot-soft); }
.next-status { font-size: 12.5px; margin-top: 8px; min-height: 1.2em; overflow-wrap: anywhere; }
/* кнопка «слышать»: щипковый страм аккорда (audio.js), форма - от карточки */
.hear { flex: none; border: 0; background: none; color: var(--muted); cursor: pointer;
        font-family: var(--mono); display: flex; align-items: center; justify-content: center;
        padding: 0; line-height: 1; }
.hear:hover { color: var(--hot); background: var(--hot-soft); }
.card .hear { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
              border: 1px solid var(--line); border-radius: 50%; background: var(--panel); font-size: 14px; }
.next-card .hear { border-left: 1px solid var(--line); font-size: 14px; padding: 0 12px; }
.spice-pack { display: inline-flex; max-width: 100%; }
.spice-pack .spice { border-radius: 8px 0 0 8px; border-right-width: 0; }
.spice-pack .hear { border: 1px solid var(--hot-line); border-radius: 0 8px 8px 0;
                    background: var(--hot-soft); color: var(--hot); font-size: 14px; padding: 0 8px; }
.spice-pack .hear:hover { background: var(--hot); color: var(--hot-ink); }
.spice-h { margin-top: 16px; }
.spice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.spice { display: flex; align-items: baseline; gap: 8px; max-width: 100%; text-align: left;
         font-family: var(--mono); border: 1px solid var(--hot-line); background: var(--hot-soft); color: var(--hot);
         border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.spice:hover { background: rgba(255, 92, 56, .22); }
.spice b { font-size: 14px; }
.spice-reason { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------------- гаммы под аккорд ---------------- */
.fit-row { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center;
           column-gap: 12px; row-gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.fit-row:last-child { border-bottom: 0; }
.fit-name { font-weight: 700; font-size: 15px; grid-column: 1; }
.fit-bar { width: 56px; height: 3px; background: var(--raise2); border-radius: 2px; overflow: hidden; }
.fit-bar i { display: block; height: 100%; background: var(--cold); }
.fit-match { font-family: var(--mono); font-size: 11px; color: var(--cold); }
.fit-row .mini { grid-column: 5; grid-row: 1; }
.fit-reason { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------------- тональность ---------------- */
.chips-input { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips-input input { flex: 1; min-width: 220px; }
.keys { display: flex; gap: 8px; flex-wrap: wrap; }
.keys button { font-family: var(--mono); font-size: 13.5px; border: 1px solid var(--line); background: var(--raise);
               color: var(--ink); border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.keys button:hover { border-color: var(--hot-line); }
.keys button.on { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); font-weight: 700; }
.keys-name { font-weight: 700; font-size: 22px; min-width: 70px; align-self: center; }

/* ---------------- соло и бас ---------------- */
.row-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row-controls label { display: flex; gap: 6px; align-items: center; }
pre.tab { font-family: var(--mono); font-size: 13px; line-height: 1.35; overflow-x: auto;
          background: var(--panel-deep); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; margin: 0; }

/* ---------------- табы: редактор табулатур ---------------- */
.tabs-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.tabs-tools:last-child { margin-bottom: 0; }
.tabs-cap { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tabs-cap b { color: var(--ink); }
.tabs-gap { flex: 1; }
#tabs-clear.armed { background: var(--hot); border-color: var(--hot); color: var(--hot-ink); }
.tabs-hint { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.tabs-hint b { color: var(--hot); }
.tabs-grid-wrap { overflow-x: auto; padding-bottom: 4px; }
.tabs-grid { width: max-content; min-width: 100%; user-select: none; }
.tabs-row { display: flex; }
.tabs-lbl { position: sticky; left: 0; z-index: 2; flex: none; width: 38px; display: flex; align-items: center;
            justify-content: flex-end; padding-right: 8px; background: var(--panel);
            font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tabs-cell { flex: none; width: 38px; height: 34px; display: flex; align-items: center; justify-content: center;
             font-family: var(--mono); font-size: 13.5px; cursor: pointer;
             border-left: 1px solid var(--line-soft); border-bottom: 2px solid #3a4048; }
.tabs-cell:last-child { border-right: 1px solid var(--line-soft); }
.tabs-cell:hover { background: var(--raise); }
/* строка-шапка: номера тактов */
.tabs-head .tabs-cell { height: 22px; font-size: 10.5px; color: var(--muted); cursor: default;
                        border-bottom: 0; align-items: flex-end; }
/* граница такта - заметнее и с небольшой отбивкой (класс barline, чтобы не
   пересекаться с .bar из сетки песни) */
.tabs-cell.barline { border-left: 2px solid #454d57; margin-left: 4px; }
.tabs-cell.filled { color: var(--hot); font-weight: 700; background: var(--hot-soft); }
.tabs-cell.filled.mute { opacity: .65; font-weight: 400; }
.tabs-cell.sel { box-shadow: inset 0 0 0 2px var(--hot); border-radius: 5px; background: var(--raise2); }
.tabs-cell.now { background: var(--hot); color: var(--hot-ink); }
.tabs-keys { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 14px;
             border-top: 1px solid var(--line-soft); padding-top: 12px; }
.tabs-keys button { min-width: 36px; padding: 8px 0; text-align: center; font-weight: 600; }
.tabs-keys button:hover { background: var(--hot-soft); }
.tabs-status { font-size: 12.5px; color: var(--muted); min-height: 1.2em; margin-top: 10px; overflow-wrap: anywhere; }
.tabs-voicing { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 6px;
                cursor: pointer; min-width: 112px; text-align: center; }
.tabs-voicing:hover { border-color: var(--hot); }
.tabs-voicing svg.diagram { max-width: 104px; }
.tabs-vcap { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tabs-bpm { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 12px;
            color: var(--muted); margin: 2px 0 14px; }
.tabs-bpm input[type=range] { flex: 1; min-width: 120px; max-width: 320px; }
.tabs-bpm b { color: var(--ink); font-size: 14px; min-width: 3ch; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .progress i { animation: none; width: 100%; }
  * { scroll-behavior: auto !important; }
}

/* мини-диаграмма (board.js): базовые заливки для студийной темы */
.mini .m-paper { fill: var(--panel); }
.mini .m-tint { fill: var(--hot); opacity: .10; }
.mini .m-frame { fill: none; stroke: var(--ink); stroke-width: 3; }
.mini .m-fret { stroke: var(--line); stroke-width: 2; }
.mini .m-string { stroke: var(--muted); stroke-width: 1.6; }
.mini .m-nut { fill: var(--ink); }
.mini .m-capo { fill: var(--cold); opacity: .9; }
.mini .m-dot { fill: var(--cold); stroke: var(--ink); stroke-width: 2; }
.mini .m-dot.is-root { fill: var(--hot); }
.mini .m-mark { fill: var(--muted); font: 600 11px var(--mono); text-anchor: middle; }
.mini .m-base { fill: var(--muted); font: 700 13px var(--font-display, sans-serif); }
.mini .m-barre { fill: var(--cold); stroke: var(--ink); stroke-width: 2; }
/* Размер относится ТОЛЬКО к SVG-диаграмме. Голое `.mini` ловило ещё и
   button.mini («убрать», «показать на грифе», клавиши ладов) и раздувало
   каждую такую кнопку до 112×132 — отсюда квадратные кнопки в обеих темах. */
svg.mini, svg.diagram { display: block; width: 112px; height: 132px; margin: 0; }

/* ---------------- свой выпадающий список (ui.js) ----------------
   Нативный <select> остаётся источником значения, но скрыт: попап родного
   select не стилизуется, а нам нужен свой шрифт в раскрытом списке. */
.xs { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
.xs-native { position: absolute !important; width: 1px; height: 1px; opacity: 0;
             padding: 0; border: 0; pointer-events: none; clip: rect(0 0 0 0); }
.xs-btn { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 280px;
          font-family: var(--mono); font-size: 13px; text-align: left; cursor: pointer;
          color: var(--ink); background: var(--raise); border: 1px solid var(--line);
          border-radius: 8px; padding: 8px 8px; }
.xs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-caret { flex: none; opacity: .6; font-size: 11px; }
.xs-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 90;
          min-width: 100%; max-width: 340px; max-height: 320px; overflow-y: auto;
          background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
          box-shadow: 0 10px 26px rgba(0,0,0,.35); padding: 4px; }
.xs-up .xs-pop { top: auto; bottom: calc(100% + 4px); }
.xs-group { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
            color: var(--muted); padding: 8px 8px 4px; }
.xs-opt { font-family: var(--mono); font-size: 13px; padding: 8px 10px; cursor: pointer;
          border-radius: 5px; color: var(--ink); white-space: nowrap; }
.xs-opt.xs-active { background: var(--raise2); }
.xs-opt.xs-on { color: var(--hot); font-weight: 600; }
.xs-opt.xs-disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- гриф в «студии» ----------------
   board.js рисует SVG .fb; без этих правил в тёмной теме он оставался
   чёрным по умолчанию и был не виден на тёмном фоне. */
.fb { display: block; width: 100%; min-width: 860px; height: auto; }
.fb .p-board { fill: var(--hot); opacity: .07; }
.fb .p-capo { fill: var(--cold); opacity: .5; }
.fb .p-fret { stroke: var(--cold); stroke-width: 4; opacity: .25; stroke-linecap: round; }
.fb .p-string { stroke: var(--hot); opacity: .2; stroke-linecap: round; }
.fb .p-inlay { fill: var(--cold); opacity: .35; }
.fb .p-note { fill: var(--hot); opacity: .5; }
.fb .p-note.is-root { fill: var(--cold); }
.fb .p-shade { fill: var(--cold); opacity: .05; }
.fb .k-board { fill: none; stroke: var(--line); stroke-width: 3; }
.fb .k-fret { stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; }
.fb .k-string { stroke: var(--muted); opacity: .55; stroke-linecap: round; }
.fb .k-nut { fill: var(--ink); opacity: .8; }
.fb .k-capo { fill: var(--cold); stroke: var(--bg); stroke-width: 2; }
.fb .k-inlay { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .5; }
.fb .k-shade-line { stroke: var(--line); stroke-width: 1.5; }
.fb .k-hatch { fill: none; }
.fb .k-dead { fill: var(--bg); opacity: .92; }
.fb .k-dead-hatch { fill: none; }
.fb .dead-chip { fill: var(--raise2); stroke: var(--line); stroke-width: 1.5; }
.fb .k-dead-edge { stroke: var(--cold); stroke-width: 2; stroke-dasharray: 5 4; opacity: .7; }
.fb .dead-cap { fill: var(--muted); font: 600 12px var(--mono); letter-spacing: .16em;
                text-transform: uppercase; text-anchor: middle; opacity: .7; }
.fb .capo-screw { fill: var(--bg); }
.fb .capo-badge rect { fill: var(--cold); }
.fb .capo-num { fill: var(--cold-ink); font: 700 12px var(--mono); letter-spacing: .1em; text-anchor: middle; }
.fb .fret-num { fill: var(--muted); font: 600 14px var(--mono); text-anchor: middle; }
.fb .fret-marker-bg { fill: var(--raise2); }
.fb .fret-num.is-marker { fill: var(--hot); }
.fb .fret-num.is-dead { opacity: .3; }
.fb .fret-num-alt { fill: var(--muted); opacity: .5; font: 400 10px var(--mono); text-anchor: middle; }
.fb .fret-row-cap { fill: var(--muted); font: 600 9px var(--mono); letter-spacing: .08em;
                    text-transform: uppercase; text-anchor: end; }
.fb .fret-row-cap.is-alt { opacity: .5; }
.fb .string-name { fill: var(--ink); font: 600 13px var(--mono); text-anchor: middle; }
.fb .string-name-alt { fill: var(--muted); opacity: .6; font: 400 10px var(--mono); text-anchor: middle; }
.fb .note { cursor: pointer; }
.fb .note .n-shadow { fill: rgba(0,0,0,.45); }
.fb .note .n-base { fill: var(--panel); }
.fb .note .n-outline { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.fb .note .n-label { fill: var(--ink); font: 600 12px var(--mono); text-anchor: middle; }
.fb .note .n-hover { fill: var(--hot); opacity: 0; }
.fb .note:hover .n-hover { opacity: .45; }
.fb .note.is-played .n-outline { stroke: var(--hot); stroke-width: 3.5; }
/* зажатое вне гаммы: пунктирный контур вместо горячего + глухая подпись */
.fb .note.is-off .n-outline { stroke: var(--muted); stroke-width: 3; stroke-dasharray: 7 5; }
.fb .note.is-off .n-label { fill: var(--muted); }
/* вердикт «аккорд в гамме» рядом с «Это X» */
.fit-verdict { margin-left: 8px; padding: 1px 7px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.fit-verdict.diatonic { color: var(--cold); background: var(--cold-soft); }
.fit-verdict.off { color: var(--hot); background: var(--hot-soft); }
.fb .note.is-ghost { opacity: .4; }
.fb .note.is-ghost .n-outline { stroke-width: 1.5; }
.fb .note.is-capped { opacity: .2; cursor: not-allowed; }

/* ---------------- режимы: подпись-пояснение под названием ---------------- */
nav button { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; }
nav button b { font: inherit; }
nav button i { font-style: normal; font-size: 11px; letter-spacing: .06em; opacity: .6; font-weight: 400; }
nav button.on i { opacity: .85; }

/* ---------------- капо: степпер ---------------- */
.capo-ctl { gap: 6px; }
.capo-step { display: inline-flex; align-items: stretch; }
.capo-step button { width: 26px; padding: 0; font-size: 15px; line-height: 1; cursor: pointer; }
.capo-step input { width: 42px; text-align: center; border-radius: 0; -moz-appearance: textfield; }
.capo-step input::-webkit-outer-spin-button, .capo-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.capo-modes { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.capo-modes-lab { font-family: var(--mono); font-size: 11px; opacity: .7; margin-right: 2px; }
.capo-modes button { font-size: 11px; padding: 4px 8px; cursor: pointer; }

/* ---------------- сквозной док ---------------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        display: flex; align-items: center; gap: 16px; padding: 10px 20px;
        background: var(--panel); border-top: 2px solid var(--line); min-height: 72px; }
.dock-chord { display: flex; flex-direction: column; min-width: 118px; }
.dock-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; opacity: .7; }
.dock-name { font: 700 26px var(--mono); line-height: 1.05; }
.dock-sound { font-size: 11px; opacity: .7; white-space: nowrap; }
.dock-neck { display: flex; align-items: center; }
.dock-neck svg.mini { width: 62px; height: 74px; }
.dock-neck.hidden { display: none; }
.dock-transport { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dock-play { width: 42px; height: 42px; font-size: 15px; cursor: pointer; }
.dock-loop { width: 34px; height: 34px; font-size: 15px; cursor: pointer; opacity: .65; }
.dock-loop.on { opacity: 1; }
.dock-rate { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.dock-rate input { width: 92px; }
.dock-rate b { font: 600 14px var(--mono); min-width: 34px; }
.dock-time { font: 500 12px var(--mono); opacity: .7; min-width: 86px; text-align: right; }
.dock-empty { font-size: 11px; opacity: .55; }
.dock-empty.hidden { display: none; }
.dock.has-chord .dock-empty { display: none; }
main { padding-bottom: 96px; }
@media (max-width: 860px) {
  .dock { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .dock-transport { width: 100%; margin-left: 0; }
  .dock-empty { display: none; }
  main { padding-bottom: 128px; }
}
@media (max-width: 620px) {
  .dock-rate input { width: 64px; }
  .dock-time { min-width: 0; font-size: 11px; }
  nav button i { display: none; }
}

/* ---------------- мобильная шапка ----------------
   В Mini App шапка не должна съедать пол-экрана: подсказка строя — в две
   строки, строи жанра — одной прокручиваемой лентой. */
@media (max-width: 620px) {
  .tuning-hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                 overflow: hidden; line-height: 1.35; }
  .genre-tunings { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .genre-tunings::-webkit-scrollbar { display: none; }
  .genre-tunings .chip, .genre-tunings button { flex: 0 0 auto; }
  .settings { gap: 8px; }
}

/* ---------------- док: перемотка и «дальше» ---------------- */
.dock-scrub { position: absolute; left: 0; right: 0; top: -2px; height: 8px; cursor: pointer;
              background: var(--raise2); touch-action: none; }
.dock-scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--hot); }
.dock-scrub-head { position: absolute; top: -3px; left: 0; width: 3px; height: 14px;
                   background: var(--ink); transform: translateX(-1px); }
.dock-scrub:focus-visible { outline: 2px solid var(--cold); outline-offset: 2px; }
.dock-next { font-size: 11px; opacity: .6; white-space: nowrap; }
