/* Метроном guitarscribe.ai/metronome/ (02.12.2026). Цвета и шрифты — из /styles.css сайта. */
body.tool-page::after { content: none; display: none; }

.mt-hero { padding: 40px 0 6px; }
.mt-hero h1 { font-size: clamp(28px, 6vw, 52px); line-height: 1.1; }
.mt-hero .lead { margin-top: 12px; }
.mt-tool-wrap { padding: 22px 0 36px; }

.mt {
  max-width: 980px; margin: 0 auto; display: grid; gap: 18px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  box-shadow: 0 30px 80px -40px rgb(0 0 0 / .9);
}

/* Темп */
.mt-tempo { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.mt-bpm { display: flex; align-items: baseline; gap: 6px; }
.mt-bpm-num {
  width: 3.4ch; padding: 0; border: 0; background: transparent; color: var(--text); text-align: center;
  font: 400 64px/1.1 var(--head); -moz-appearance: textfield; appearance: textfield; border-radius: 10px;
}
.mt-bpm-num::-webkit-inner-spin-button, .mt-bpm-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mt-bpm-num:focus { outline: none; background: var(--panel); }
.mt.live .mt-bpm-num { color: var(--lime); }
.mt-bpm-unit { color: var(--text-3); font-size: 13px; letter-spacing: .12em; }

.mt-round {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--text);
  font: 400 24px/1 var(--body); transition: border-color .15s, color .15s;
}
.mt-round:hover { border-color: var(--lime); color: var(--lime); }
.mt-round.sm { width: 32px; height: 32px; font-size: 18px; }

.mt-play {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: var(--lime);
  transition: background .15s, box-shadow .2s;
}
.mt-play:hover { background: var(--lime-hot); box-shadow: 0 0 32px -4px rgb(182 227 74 / .6); }
.mt-play-ico { width: 0; height: 0; margin-left: 6px; border-left: 22px solid var(--ink); border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.mt.on .mt-play-ico { width: 22px; height: 22px; margin: 0; border: 0; border-radius: 3px; background: var(--ink); }

.mt-chip {
  height: 36px; padding: 0 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text-2);
  font: 500 14px/1 var(--body); transition: color .15s, border-color .15s, background .15s;
}
.mt-chip:hover { color: var(--text); border-color: #3b424b; }
.mt-chip.on { background: rgb(182 227 74 / .14); border-color: var(--lime); color: var(--lime); }
.mt-tap { height: 44px; padding: 0 20px; }
.mt-tap.hit { background: var(--lime); color: var(--ink); border-color: var(--lime); transition: none; }

/* Ползунки — как в программе: тонкая линия, сплошная точка */
.mt-range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.mt-range::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(var(--lime), var(--lime)) 0 / var(--p) 100% no-repeat, var(--line); }
.mt-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border: 0; border-radius: 50%; background: var(--lime); }
.mt-range::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line); }
.mt-range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--lime); }
.mt-range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--lime); }
.mt-range-sm { width: auto; flex: 1 1 140px; max-width: 260px; }

.mt-status { min-height: 20px; margin: -14px 0 -6px; text-align: center; color: var(--text-2); font-size: 14px; }

/* Строки настроек */
.mt-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.mt-row-tight { gap: 8px 12px; }
.mt-label { min-width: 118px; color: var(--text-3); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.mt-label-vol { min-width: 0; margin-left: 8px; }
.mt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-val { min-width: 44px; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.mt-sig { display: flex; align-items: center; gap: 8px; }
.mt-sig-num { min-width: 1.4ch; text-align: center; font: 400 24px/1 var(--head); }
.mt-sig-slash { color: var(--text-3); font-size: 22px; }
.mt-unit { height: 32px; min-width: 40px; padding: 0 10px; color: var(--text); font: 400 17px/1 var(--head); }

/* Simple / Pro */
.mt-mode { justify-self: center; display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.mt-mode-btn { height: 32px; padding: 0 20px; cursor: pointer; border: 0; border-radius: 999px; background: none; color: var(--text-2); font: 500 14px/1 var(--body); }
.mt-mode-btn.on { background: var(--lime); color: var(--ink); }
.mt.simple .mt-pro { display: none; }

/* Ноты под рисунком (шрифт GS Notes — переименованная часть Bravura, OFL) */
@font-face { font-family: 'GS Notes'; font-display: block; src: url('/fonts/gs-notes.woff') format('woff'); }
.mt-notes { display: block; width: 100%; height: 74px; overflow: visible; color: #c9ced6; }
.mt-notes text { font-family: 'GS Notes'; fill: currentColor; }
.mt-notes .ln { stroke: var(--line); stroke-width: 1; }
.mt-notes .st { stroke: currentColor; stroke-width: 1.1; }
.mt-notes .bm { fill: currentColor; }
.mt-notes .tie, .mt-notes .br { fill: none; stroke: currentColor; stroke-width: 1.1; }
.mt-notes .tn { fill: var(--text-3); }
.mt-notes .ac { fill: var(--lime); }
.mt-notes g.now { color: var(--lime); }
.mt-notes g.now text { fill: var(--lime); }

/* Рисунок */
.mt-pattern { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.mt-pattern-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.mt-pattern-head .mt-label { min-width: 0; }
.mt-hint { color: var(--text-3); font-size: 13px; }
.mt-grid { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.mt-beat { flex: 1 1 0; display: grid; gap: 8px; }
.mt-beat-h { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mt-beat-num {
  width: 30px; height: 30px; flex: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text-2);
  font: 400 12px/1 var(--head); transition: background .1s, box-shadow .1s;
}
.mt-beat-num.acc { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.mt-beat.now .mt-beat-num { box-shadow: 0 0 0 3px rgb(182 227 74 / .35); }
.mt-beat-sub { height: 24px; padding: 0 6px; cursor: pointer; border: 0; border-radius: 6px; background: none; color: var(--text-3); font: 500 12px/1 var(--body); }
.mt-beat-sub:hover { color: var(--text); background: var(--panel); }
.mt-steps { display: flex; gap: 4px; height: 112px; touch-action: none; user-select: none; -webkit-user-select: none; }
.mt-step { position: relative; flex: 1 1 0; min-width: 9px; overflow: hidden; cursor: ns-resize; border-radius: 6px; background: var(--panel); }
.mt-step i {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h, 0) * 100%);
  border-radius: 5px 5px 0 0; background: linear-gradient(to top, rgb(182 227 74 / .30), rgb(182 227 74 / .62));
}
.mt-step.first i { background: linear-gradient(to top, rgb(182 227 74 / .55), var(--lime)); }
.mt-step.zero::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: 8px; height: 2px; border-radius: 1px; background: var(--text-3); opacity: .6; }
.mt-step.now { box-shadow: inset 0 0 0 1.5px var(--text); }
.mt-step.now i { background: linear-gradient(to top, #dcf59a, #f4fbe2); }
.mt.silent .mt-grid { opacity: .4; }
.mt-presets .mt-chip, .mt-mine .mt-chip { height: 32px; padding: 0 12px; font-size: 13px; }
.mt-mine:empty { display: none; }
.mt-mine .x { margin-left: 8px; padding: 0 2px; color: var(--text-3); }
.mt-mine .x:hover { color: var(--text); }
.mt-save { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-input { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 500 15px/1 var(--body); }
.mt-input:focus { outline: none; border-color: var(--lime); }
.mt-save .mt-input { flex: 1 1 160px; max-width: 260px; background: var(--bg-2); }
.mt-input.num { width: 64px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.mt-input.num::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Тренажёр и тихие такты */
.mt-box { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.mt-box-body { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--text-2); font-size: 14px; }
.mt-box-body label { display: inline-flex; align-items: center; gap: 8px; }
.mt-box:not(.on) .mt-box-body { opacity: .45; }
.mt-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; justify-self: start; }
.mt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mt-switch span { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .15s; }
.mt-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: left .15s, background .15s; }
.mt-switch input:checked + span { background: var(--lime); }
.mt-switch input:checked + span::after { left: 19px; background: var(--ink); }
.mt-switch input:focus-visible + span { outline: 2px solid var(--lime-hot); outline-offset: 2px; }
.mt-switch b { font-weight: 600; font-size: 15px; }

.mt-keys { margin: 0; text-align: center; color: var(--text-3); font-size: 13px; }
.mt-keys kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--text-2); font: 500 12px/1.4 var(--body); }

/* Текст под метрономом */
.mt-text p, .mt-app p { color: var(--text-2); }
.mt-text p b { color: var(--text); }
.mt-text h2 + p { margin-top: 20px; }
.mt-app .btn { margin-top: 10px; }

@media (hover: none) { .mt-keys { display: none; } }
@media (max-width: 640px) {
  .mt { padding: 14px; border-radius: 16px; gap: 16px; }
  .mt-tempo { gap: 10px; }
  .mt-bpm-num { font-size: 50px; }
  .mt-play { width: 64px; height: 64px; }
  .mt-label { min-width: 0; width: 100%; }
  .mt-label-vol { width: auto; margin-left: 0; }
  .mt-pattern { padding: 12px; }
  .mt-steps { height: 92px; gap: 3px; }
  .mt-step { min-width: 6px; border-radius: 4px; }
  .mt-grid { gap: 12px 8px; }
}

/* Вариант «ноты вместо слов» (?v=2): значки-ноты на кнопках */
.mt-ico { display: block; flex: none; overflow: visible; }
.mt-ico text { font-family: 'GS Notes'; fill: currentColor; }
.mt-ico .st { stroke: currentColor; stroke-width: 1; }
.mt-ico .bm { fill: currentColor; }
.mt-ico .tie, .mt-ico .br { fill: none; stroke: currentColor; stroke-width: 1; }
.mt-ico .tn { fill: currentColor; opacity: .8; }
.mt-ico .ac { fill: currentColor; }
.mt.v2 #subs .mt-chip, .mt.v2 .mt-presets .mt-chip, .mt.v2 #meters .mt-chip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 52px; padding: 0 14px;
}
.mt.v2 #meters .mt-chip { min-width: 40px; padding: 0 10px; }
/* значок доли не раздвигает колонку: стоит поверх кнопки и сжимается вместе с ней */
.mt.v2 .mt-beat-sub { position: relative; flex: 1 1 auto; min-width: 24px; height: 32px; padding: 0; overflow: hidden; }
.mt.v2 .mt-beat-sub .mt-ico { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); max-width: calc(100% - 20px); height: auto; }
.mt-caret { position: absolute; right: 3px; top: 50%; margin-top: -3px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) {
  .mt.v2 #subs .mt-chip, .mt.v2 .mt-presets .mt-chip, .mt.v2 #meters .mt-chip { height: 46px; min-width: 44px; padding: 0 9px; }
  .mt.v2 #subs .mt-ico, .mt.v2 .mt-presets .mt-ico { height: 26px; width: auto; }
}

/* Ноты (по умолчанию) и прежний вид со словами (?v=1) */
.mt:not(.v2) .mt-v2only { display: none !important; }
.mt.v2 .mt-v1only { display: none !important; }
.mt.v2 .mt-notes { cursor: pointer; border-radius: 8px; transition: background .12s; }
.mt.v2 .mt-notes:hover { background: rgb(255 255 255 / .035); }
.mt.v2 .mt-notes:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.mt.v2 .mt-beat-sub:hover { color: var(--text); }

/* Группы */
.mt-groups, .mt-build { display: grid; gap: 10px; }
.mt-build { padding-top: 16px; border-top: 1px solid var(--line); }
.mt-gchip, .mt-key { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.mt-gchip, .mt.v2 .mt-key { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 52px; padding: 0 14px; }
.mt-gchip { cursor: grab; }
.mt-gsep { align-self: center; margin: 0 2px 0 10px; color: var(--text-3); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.mt-gchip .x, .mt-dbeat .x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--text-3); font: 500 13px/18px var(--body); text-align: center;
}
.mt-gchip .x:hover, .mt-dbeat .x:hover { color: var(--text); border-color: var(--text-3); }

/* Сборка своей группы */
.mt-keys-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-key:disabled { opacity: .28; cursor: default; }
.mt-key:disabled:hover { color: var(--text-2); border-color: var(--line); }
.mt-key.tog.on { background: rgb(182 227 74 / .14); border-color: var(--lime); color: var(--lime); }
.mt-kdot { font-size: 22px; line-height: 1; }
.mt-ktrip { font: italic 600 19px/1 Georgia, 'Times New Roman', serif; }
.mt-kback { font-size: 18px; line-height: 1; }
.mt-kclear { font-size: 14px; }
.mt-ksep { width: 1px; height: 30px; margin: 0 6px; background: var(--line); }
.mt-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 78px; padding: 10px; cursor: grab; border: 1px dashed var(--line); border-radius: 12px; -webkit-user-select: none; user-select: none; }
.mt-draft:empty { cursor: default; }
.mt-draft:empty::before { content: attr(data-empty); color: var(--text-3); font-size: 14px; }
.mt-dbeat { position: relative; display: flex; align-items: center; justify-content: center; min-width: 76px; height: 56px; padding: 0 16px; border: 1px solid #3b424b; border-radius: 10px; background: var(--panel); color: var(--text); }
.mt-dbeat.part { border-style: dashed; }
.mt-build-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mt-chip:disabled { opacity: .35; cursor: default; }
.mt-save-label { min-width: 0; align-self: center; margin-right: 6px; }

/* Перетаскивание */
.mt-dragging, .mt-dragging * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
.mt-ghost { position: fixed; z-index: 1000; pointer-events: none; padding: 8px 12px; border: 1px solid var(--lime); border-radius: 12px; background: var(--panel); color: var(--lime); transform: translate(-50%, -125%); box-shadow: 0 10px 30px rgb(0 0 0 / .45); }
.mt-beat.drop .mt-steps { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 8px; }
.mt-beat.drop .mt-notes { background: rgb(182 227 74 / .08); }

/* Выбор ритма доли */
.mt-pop { position: absolute; z-index: 900; max-width: min(560px, calc(100vw - 16px)); padding: 14px; border: 1px solid #3b424b; border-radius: 14px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / .5); }
.mt-pop-h { margin-bottom: 10px; color: var(--text-3); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.mt-pop .mt-gchip { cursor: pointer; background: var(--bg); }
.mt-pop .mt-gchip.on { background: rgb(182 227 74 / .14); border-color: var(--lime); color: var(--lime); }
@media (max-width: 640px) {
  .mt-gchip, .mt.v2 .mt-key { min-width: 46px; height: 46px; padding: 0 10px; }
  .mt-gchip .mt-ico, .mt.v2 .mt-key .mt-ico { height: 30px; width: auto; }
  .mt-ksep { display: none; }
}
