/* Main Styles - Rechord */
/* Компонентные стили и компоновка */

/* Body and Layout */
body {
  background-color: var(--color-neutral-950);
  color: var(--color-neutral-200);
  font-family: var(--font-family-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Global two-theme support */
html[data-theme='light'] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html[data-theme='light'] header {
  border-bottom-color: rgba(148, 163, 184, 0.45);
}

@supports (backdrop-filter: blur(8px)) {
  html[data-theme='light'] header {
    background-color: rgba(248, 250, 252, 0.78);
  }
}

@supports not (backdrop-filter: blur(8px)) {
  html[data-theme='light'] header {
    background-color: rgba(248, 250, 252, 0.92);
  }
}

html[data-theme='light'] #mobileMenuPanel {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme='light'] #mobileMenuBackdrop {
  background: rgba(15, 23, 42, 0.28) !important;
}

html[data-theme='light'] .bg-neutral-950,
html[data-theme='light'] .bg-neutral-950\/95,
html[data-theme='light'] .bg-neutral-950\/90,
html[data-theme='light'] .bg-neutral-950\/80,
html[data-theme='light'] .bg-neutral-900,
html[data-theme='light'] .bg-neutral-900\/80,
html[data-theme='light'] .bg-neutral-900\/70,
html[data-theme='light'] .bg-neutral-900\/60,
html[data-theme='light'] .bg-neutral-900\/50,
html[data-theme='light'] .bg-neutral-900\/40,
html[data-theme='light'] .bg-neutral-900\/30 {
  background-color: #ffffff !important;
}

html[data-theme='light'] .bg-neutral-800,
html[data-theme='light'] .bg-neutral-800\/80,
html[data-theme='light'] .bg-neutral-800\/60,
html[data-theme='light'] .bg-neutral-800\/50,
html[data-theme='light'] .bg-neutral-800\/40,
html[data-theme='light'] .bg-neutral-800\/30 {
  background-color: #f1f5f9 !important;
}

html[data-theme='light'] .border-neutral-900,
html[data-theme='light'] .border-neutral-800,
html[data-theme='light'] .border-neutral-800\/90,
html[data-theme='light'] .border-neutral-800\/60,
html[data-theme='light'] .border-neutral-700,
html[data-theme='light'] .border-neutral-700\/90 {
  border-color: rgba(148, 163, 184, 0.55) !important;
}

html[data-theme='light'] .text-white,
html[data-theme='light'] .text-neutral-200,
html[data-theme='light'] .text-neutral-300,
html[data-theme='light'] .text-neutral-400 {
  color: #1e293b !important;
}

html[data-theme='light'] .text-neutral-500,
html[data-theme='light'] .text-neutral-600 {
  color: rgba(15, 23, 42, 0.62) !important;
}

html[data-theme='light'] .hover\:text-white:hover {
  color: #0f172a !important;
}

html[data-theme='light'] .hover\:bg-neutral-800\/80:hover,
html[data-theme='light'] .hover\:bg-neutral-800\/90:hover,
html[data-theme='light'] .hover\:bg-neutral-800\/60:hover,
html[data-theme='light'] .hover\:bg-neutral-800:hover,
html[data-theme='light'] .hover\:bg-neutral-700:hover {
  background-color: #e2e8f0 !important;
}

html[data-theme='light'] .sign-cta {
  background: #0f172a !important;
  color: #f8fafc !important;
}

/* Light theme: ensure primary text is solid (90%), secondary only for sublines */
html[data-theme='light'] h1,
html[data-theme='light'] h2,
html[data-theme='light'] h3,
html[data-theme='light'] h4,
html[data-theme='light'] h5,
html[data-theme='light'] h6,
html[data-theme='light'] .font-semibold,
html[data-theme='light'] .font-bold,
html[data-theme='light'] .chord-name,
html[data-theme='light'] #resultsTitle {
  color: rgba(15, 23, 42, 0.9) !important;
}

/* Light theme: remove dark/translucent black plates in key work areas */
html[data-theme='light'] .chord-card,
html[data-theme='light'] .collection-card,
html[data-theme='light'] .group-card,
html[data-theme='light'] .song-tab-staff-wrap,
html[data-theme='light'] .song-tab-fretboard-wrap,
html[data-theme='light'] .song-tab-bottom-dock,
html[data-theme='light'] .song-tab-fx-rail,
html[data-theme='light'] .song-tab-fx-key,
html[data-theme='light'] .song-tab-dock-btn,
html[data-theme='light'] .song-tab-toolbar-btn,
html[data-theme='light'] .song-tab-rail-btn,
html[data-theme='light'] .song-tab-title-input,
html[data-theme='light'] .song-tab-insert-btn,
html[data-theme='light'] .song-tab-sel-pop,
html[data-theme='light'] .song-tab-sel-more-pop,
html[data-theme='light'] .tab-fretboard,
html[data-theme='light'] .tab-ascii-toolbar,
html[data-theme='light'] .tab-fx-btn,
html[data-theme='light'] .tab-redo-btn,
html[data-theme='light'] .tab-fret-tick,
html[data-theme='light'] .chord-recipe-card,
html[data-theme='light'] .chord-recipe-add-chip,
html[data-theme='light'] .chord-recipe-icon-btn,
html[data-theme='light'] .nb-submode-segment,
html[data-theme='light'] .mobile-drawer__nav-item {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(148, 163, 184, 0.58) !important;
  color: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme='light'] .chord-card:hover,
html[data-theme='light'] .group-card:hover,
html[data-theme='light'] .collection-card:hover,
html[data-theme='light'] .song-tab-dock-btn:hover,
html[data-theme='light'] .song-tab-fx-key:hover,
html[data-theme='light'] .song-tab-rail-btn:hover,
html[data-theme='light'] .song-tab-toolbar-btn:hover,
html[data-theme='light'] .tab-fx-btn:hover,
html[data-theme='light'] .tab-redo-btn:hover,
html[data-theme='light'] .tab-fret-tick:hover,
html[data-theme='light'] .chord-recipe-icon-btn:hover {
  background: rgba(241, 245, 249, 0.98) !important;
}

html[data-theme='light'] .song-tab-ref-cell-txt,
html[data-theme='light'] .song-tab-ref-name,
html[data-theme='light'] .song-tab-dock-ico,
html[data-theme='light'] .song-tab-fx-key-main,
html[data-theme='light'] .song-tab-fx-rail-label,
html[data-theme='light'] .song-tab-title-ghost.has-value,
html[data-theme='light'] .card-action-btn,
html[data-theme='light'] .voicing-type {
  color: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme='light'] .song-tab-fx-key-sub,
html[data-theme='light'] .song-tab-title-ghost,
html[data-theme='light'] .song-tab-check-text,
html[data-theme='light'] #resultsSubtitle,
html[data-theme='light'] .text-\[11px\],
html[data-theme='light'] .text-xs {
  color: rgba(15, 23, 42, 0.62) !important;
}

/* Header */
header {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(38, 38, 38, 0.6);
}

@supports (backdrop-filter: blur(8px)) {
  header {
    background-color: rgba(10, 10, 10, 0.7);
  }
}

@supports not (backdrop-filter: blur(8px)) {
  header {
    background-color: rgba(10, 10, 10, 0.8);
  }
}

/* Main Container */
main {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* Sidebar */
#sidebar {
  background-color: rgba(10, 10, 10, 0.6);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-xl);
}

@media (min-width: 768px) {
  #sidebar {
    position: sticky;
    top: 5rem;
    height: fit-content;
  }
}

/* Form Controls */
select, input[type="text"], input[type="number"] {
  background-color: rgba(23, 23, 23, 0.7);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  transition: all var(--transition-normal);
}

select:hover, input[type="text"]:hover, input[type="number"]:hover {
  border-color: var(--color-neutral-700);
}

html[data-theme='light'] select,
html[data-theme='light'] input[type="text"],
html[data-theme='light'] input[type="number"],
html[data-theme='light'] input[type="url"],
html[data-theme='light'] textarea {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(148, 163, 184, 0.6) !important;
  color: rgba(15, 23, 42, 0.9) !important;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.3);
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  outline: 1px solid var(--color-neutral-800);
}

input[type="range"]::-webkit-slider-track {
  background: var(--color-neutral-800);
  height: 0.5rem;
  border-radius: 0.25rem;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--color-teal-400);
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  background: var(--color-neutral-800);
  height: 0.5rem;
  border-radius: 0.25rem;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  background-color: var(--color-teal-400);
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Target Fret slider: маленький круглый бегунок, удобный тач на мобильном */
.fret-slider {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
  border: none !important;
}
.fret-slider::-webkit-slider-runnable-track {
  position: relative;
  z-index: 0;
}
.fret-slider::-webkit-slider-thumb {
  position: relative;
  z-index: 2;
}
.fret-slider::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--landing-brand, #eecf42) !important;
  border: none;
  box-shadow: 0 0 0 2px rgba(20, 20, 20, 0.9);
  cursor: grab;
  position: relative;
  z-index: 2;
}
.fret-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
}
.fret-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--landing-brand, #eecf42) !important;
  border: none;
  box-shadow: 0 0 0 2px rgba(20, 20, 20, 0.9);
  cursor: grab;
}
.fret-slider:active::-moz-range-thumb {
  cursor: grabbing;
}
@media (pointer: coarse) {
  .fret-slider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -2px;
    background: var(--landing-brand, #eecf42) !important;
  }
  .fret-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--landing-brand, #eecf42) !important;
  }
}

/* Иконки в селектах Root, Chord Type, Tuning — уменьшены */
.select-icon {
  width: 0.875rem !important;
  height: 0.875rem !important;
}

/* Filter Options */
.shape-filters-content label {
  background-color: rgba(23, 23, 23, 0.4);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.shape-filters-content label:hover {
  border-color: var(--color-neutral-700);
}

/* Tip Box */
.tip-box {
  background-color: rgba(23, 23, 23, 0.4);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

#tipBoxWrap.tip-dismissed {
  display: none !important;
}

/* Results Section */
#resultsTitle {
  font-family: 'SoehneBreit', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.125rem !important; /* text-lg - такой же как Controls */
  color: white !important;
  margin: 0 !important;
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Заголовок диаграмм на мобильном — полный текст, без обрезки */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Мобильный: заголовок диаграмм без обрезки — текст влезает */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Заголовок диаграмм на мобильном — полный текст, без обрезки */
@media (max-width: 768px) {
  #resultsTitle {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

#resultsSubtitle {
  font-size: 0.875rem;
  color: var(--color-neutral-400);
}

/* Modal Headers */
.modal-header {
  border-bottom: 1px solid var(--color-neutral-800);
  padding: var(--spacing-md);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

/* Profile modal: заголовок и крестик на одной линии */
#profileModal .profile-modal__header {
  min-height: 3.25rem;
}
#profileModal .profile-modal__close {
  margin-top: 0;
  align-self: center;
}

#profileModal .profile-modal__header {
  position: sticky;
  top: 0;
  z-index: 10;
}

#profileModal .profile-overview__hero {
  align-items: flex-start !important;
  text-align: left !important;
}

/* Top-level nav now controls generator vs chord builder. */
#nodeConstructorToggle {
  display: none !important;
}

.modal-body {
  padding: var(--spacing-md);
}

.modal-footer {
  border-top: 1px solid var(--color-neutral-800);
  padding: var(--spacing-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

/* Cover Options Grid */
.cover-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
}
.cover-option {
  border: 2px solid transparent;
  padding: 0;
  min-height: 0;
  line-height: 0;
}
.cover-option.active {
  border-color: rgba(168, 85, 247, 0.8);
}

/* Groups List in Modal */
#groupsList {
  max-height: 15rem;
  overflow-y: auto;
}

#groupsList label {
  background-color: rgba(23, 23, 23, 0.4);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

#groupsList label:hover {
  border-color: var(--color-neutral-700);
}

/* Community: published group → Chord chart (detail modal) larger measures */
.community-chord-chart--lg .chord-chart-section { margin-top: 0; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.community-chord-chart--lg .chord-chart-section:last-child { padding-bottom: 0; }
.community-chord-chart--lg .chord-chart-section:first-child { margin-top: 0; }
.community-chord-chart--lg .chord-chart-section-title {
  margin-bottom: 0.6rem !important;
  text-decoration: none !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}
.community-chord-chart--lg .chord-chart-grid { border-radius: 0.95rem; }
.community-chord-chart--lg .chord-chart-measure {
  border-right: 0 !important; /* dividers live on slots */
}
.community-chord-chart--lg .chord-chart-measure:last-child {
  border-right: 0 !important;
  border-right-width: 0 !important;
  border-right-style: none !important;
}
.community-chord-chart--lg .chord-chart-slot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.7rem 1.05rem !important;
  font-size: 1.05rem !important;
  min-width: 5rem !important;
  line-height: 1.1 !important;
  border-right: 1px solid rgba(255,255,255,0.14) !important;
}
.community-chord-chart--lg .chord-chart-grid > .chord-chart-measure:last-child .chord-chart-slot { border-right: 0 !important; }

/* Mobile wrapped systems */
@media (max-width: 640px) {
  .community-chord-chart--lg .chord-chart-scroll { overflow-x: hidden !important; }
  .community-chord-chart--lg .chord-chart-systems { display: flex; flex-direction: column; gap: 10px; }
  .community-chord-chart--lg .chord-chart-system {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-neutral-800);
    background: rgba(23, 23, 23, 0.45);
    border-radius: 0.95rem;
    overflow: hidden;
    width: max-content;
    max-width: 100%;
  }
  /* Wrapped rows: first row keeps left rounding, subsequent rows start “cut” (no left rounding) */
  .community-chord-chart--lg .chord-chart-system:not(.is-first) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .community-chord-chart--lg .chord-chart-system:not(.is-last) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  /* Keep dividers everywhere; remove ONLY the very last divider at row end */
  .community-chord-chart--lg .chord-chart-system > .chord-chart-measure:last-child .chord-chart-slot:last-child { border-right: 0 !important; }
  .community-chord-chart--lg .chord-chart-system:not(.is-last)::after {
    content: '';
    width: 1px;
    background: rgba(255,255,255,0.14);
  }
  .community-chord-chart--lg .chord-chart-section.has-reprise .chord-chart-system.is-last::after {
    content: '';
    width: 12px;
    height: 26px;
    margin-right: 10px;
    background:
      radial-gradient(circle at 50% 35%, rgba(255,255,255,0.65) 2px, transparent 3px),
      radial-gradient(circle at 50% 65%, rgba(255,255,255,0.65) 2px, transparent 3px);
    align-self: center;
    opacity: 0.9;
  }
}

/* Group view: Chord chart panel (matches the “Let it be” view) */
#groupChordChartPanel .chord-chart-section, #rechordPdfChordChartHost .chord-chart-section, #songStudioChordChartHost .chord-chart-section { margin-top: 0; padding-top: 1.5rem; padding-bottom: 1.5rem; }
#groupChordChartPanel .chord-chart-section:last-child, #rechordPdfChordChartHost .chord-chart-section:last-child, #songStudioChordChartHost .chord-chart-section:last-child  { padding-bottom: 0; }
#groupChordChartPanel .chord-chart-section:first-child, #rechordPdfChordChartHost .chord-chart-section:first-child, #songStudioChordChartHost .chord-chart-section:first-child  { margin-top: 0; }
#groupChordChartPanel .chord-chart-section-title, #rechordPdfChordChartHost .chord-chart-section-title, #songStudioChordChartHost .chord-chart-section-title  {
  margin-bottom: 0.6rem !important;
  text-decoration: none !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}
#groupChordChartPanel .chord-chart-grid, #rechordPdfChordChartHost .chord-chart-grid, #songStudioChordChartHost .chord-chart-grid  {
  border-radius: 0.95rem;
  overflow: hidden;
}
#groupChordChartPanel .chord-chart-measure, #rechordPdfChordChartHost .chord-chart-measure, #songStudioChordChartHost .chord-chart-measure  {
  border-right: 0 !important; /* dividers live on slots */
}
#groupChordChartPanel .chord-chart-measure:last-child, #rechordPdfChordChartHost .chord-chart-measure:last-child, #songStudioChordChartHost .chord-chart-measure:last-child  {
  border-right: 0 !important;
  border-right-width: 0 !important;
  border-right-style: none !important;
}
#groupChordChartPanel .chord-chart-slot, #rechordPdfChordChartHost .chord-chart-slot, #songStudioChordChartHost .chord-chart-slot  {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.7rem 1.05rem !important;
  font-size: 1.05rem !important;
  min-width: 5rem !important;
  line-height: 1.1 !important;
  border-right: 1px solid rgba(255,255,255,0.14) !important;
}
#groupChordChartPanel .chord-chart-grid > .chord-chart-measure:last-child .chord-chart-slot, #rechordPdfChordChartHost .chord-chart-grid > .chord-chart-measure:last-child .chord-chart-slot, #songStudioChordChartHost .chord-chart-grid > .chord-chart-measure:last-child .chord-chart-slot  { border-right: 0 !important; }

@media (max-width: 640px) {
  #groupChordChartPanel .chord-chart-scroll, #rechordPdfChordChartHost .chord-chart-scroll, #songStudioChordChartHost .chord-chart-scroll  { overflow-x: hidden !important; }
  #groupChordChartPanel .chord-chart-systems, #rechordPdfChordChartHost .chord-chart-systems, #songStudioChordChartHost .chord-chart-systems  { display: flex; flex-direction: column; gap: 10px; }
  #groupChordChartPanel .chord-chart-system, #rechordPdfChordChartHost .chord-chart-system, #songStudioChordChartHost .chord-chart-system  {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-neutral-800);
    background: rgba(23, 23, 23, 0.45);
    border-radius: 0.95rem;
    overflow: hidden;
    width: max-content;
    max-width: 100%;
  }
  #groupChordChartPanel .chord-chart-system:not(.is-first), #rechordPdfChordChartHost .chord-chart-system:not(.is-first), #songStudioChordChartHost .chord-chart-system:not(.is-first)  {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  #groupChordChartPanel .chord-chart-system:not(.is-last), #rechordPdfChordChartHost .chord-chart-system:not(.is-last), #songStudioChordChartHost .chord-chart-system:not(.is-last)  {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  #groupChordChartPanel .chord-chart-system > .chord-chart-measure:last-child .chord-chart-slot:last-child, #rechordPdfChordChartHost .chord-chart-system > .chord-chart-measure:last-child .chord-chart-slot:last-child, #songStudioChordChartHost .chord-chart-system > .chord-chart-measure:last-child .chord-chart-slot:last-child  { border-right: 0 !important; }
  #groupChordChartPanel .chord-chart-system:not(.is-last)::after, #rechordPdfChordChartHost .chord-chart-system:not(.is-last)::after, #songStudioChordChartHost .chord-chart-system:not(.is-last)::after  {
    content: '';
    width: 1px;
    background: rgba(255,255,255,0.14);
  }
  #groupChordChartPanel .chord-chart-section.has-reprise .chord-chart-system.is-last::after, #rechordPdfChordChartHost .chord-chart-section.has-reprise .chord-chart-system.is-last::after, #songStudioChordChartHost .chord-chart-section.has-reprise .chord-chart-system.is-last::after  {
    content: '';
    width: 12px;
    height: 26px;
    margin-right: 10px;
    background:
      radial-gradient(circle at 50% 35%, rgba(255,255,255,0.65) 2px, transparent 3px),
      radial-gradient(circle at 50% 65%, rgba(255,255,255,0.65) 2px, transparent 3px);
    align-self: center;
    opacity: 0.9;
  }
  /* Редактор песни: рамка только на chord-row, не вокруг −/+ */
  #songStudioChordChartHost .chord-chart-system:has(.chord-chart-editor-chord-row) {
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  #songStudioChordChartHost .chord-chart-editor-chord-row > .chord-chart-measure:last-child .chord-chart-slot:last-child {
    border-right: 0 !important;
  }
}

/* Song editor: strip-open больше не срезает скругление chord-row — «пилюля» справа как слева; Done рядом через gap */
#songStudioChordChartHost .chord-chart-grid--strip-open:not(.chord-chart-editor-grid) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
#songStudioChordChartHost .chord-chart-systems--strip-open:not(:has(.chord-chart-editor-measure)) > .chord-chart-system:last-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
/* Song editor: wrap measures into systems at any viewport (same idea as final chart on narrow width) */
#songStudioChordChartHost .chord-chart-scroll {
  overflow-x: hidden;
}
/* Outer wrapper: no second “plaque” — border/bg live on each .chord-chart-system row only */
#songStudioChordChartHost .chord-chart-systems {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#songStudioChordChartHost .chord-chart-system {
  display: inline-flex;
  align-items: stretch;
  border: 0;
  background: transparent;
  border-radius: 0 !important;
  overflow: visible;
  width: max-content;
  max-width: 100%;
}
/* Редактор: колонка «аккорды + −/+»; если есть Done — строка stack | Done */
#songStudioChordChartHost .chord-chart-system:has(.chord-chart-editor-chord-row):not(:has(.chord-chart-editor-done)) {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
#songStudioChordChartHost .chord-chart-system:has(.chord-chart-editor-done) {
  flex-direction: row;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
}
#songStudioChordChartHost .chord-chart-editor-system-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 0;
}
#songStudioChordChartHost .chord-chart-system:not(.is-first) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}
#songStudioChordChartHost .chord-chart-system:not(.is-last) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
#songStudioChordChartHost .chord-chart-system > .chord-chart-measure:last-child .chord-chart-slot:last-child,
#songStudioChordChartHost .chord-chart-editor-chord-row > .chord-chart-measure:last-child .chord-chart-slot:last-child {
  border-right: 0 !important;
}
#songStudioChordChartHost .chord-chart-system:not(.is-last)::after {
  content: '';
  flex: 0 0 1px;
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.14);
}
/* После общего правила: у редактора такты только внутри chord-row */
#songStudioChordChartHost .chord-chart-system:has(.chord-chart-editor-chord-row):not(.is-last)::after {
  display: none !important;
  content: none !important;
  width: 0 !important;
  flex: 0 0 0 !important;
}
#songStudioChordChartHost .chord-chart-section.has-reprise .chord-chart-system.is-last::after {
  content: '';
  width: 12px;
  height: 26px;
  margin-right: 10px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.65) 2px, transparent 3px),
    radial-gradient(circle at 50% 65%, rgba(255, 255, 255, 0.65) 2px, transparent 3px);
  align-self: center;
  opacity: 0.9;
}
/* До layout: сетка без внешней «второй» рамки; после hoist рамка на .chord-chart-editor-chord-row */
#songStudioChordChartHost .chord-chart-grid.chord-chart-editor-grid {
  gap: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  box-shadow: none !important;
}
/* Один сплошной ряд аккордов; скругления по is-first / is-last (завершённый vs перенос) */
#songStudioChordChartHost .chord-chart-editor-chord-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  overflow: hidden;
  background: rgba(18, 18, 18, 0.72);
}
/* Один ряд на секцию — сильное скругление с обеих сторон */
#songStudioChordChartHost .chord-chart-system.is-first.is-last .chord-chart-editor-chord-row {
  border-radius: 1rem;
}
/* Первый ряд при переносе: сильно слева, слабо справа (линия «рвётся») */
#songStudioChordChartHost .chord-chart-system.is-first:not(.is-last) .chord-chart-editor-chord-row {
  border-top-left-radius: 1rem;
  border-bottom-left-radius: 1rem;
  border-top-right-radius: 0.2rem;
  border-bottom-right-radius: 0.2rem;
}
/* Продолжение после переноса — слабо с обеих сторон */
#songStudioChordChartHost .chord-chart-system:not(.is-first):not(.is-last) .chord-chart-editor-chord-row {
  border-radius: 0.2rem;
}
/* Последний ряд после переноса: слабо слева, сильно справа (завершение сегмента) */
#songStudioChordChartHost .chord-chart-system:not(.is-first).is-last .chord-chart-editor-chord-row {
  border-top-left-radius: 0.2rem;
  border-bottom-left-radius: 0.2rem;
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}
#songStudioChordChartHost .chord-chart-editor-tools-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: stretch;
  gap: 0;
  margin-top: 0.22rem;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
}
#songStudioChordChartHost .chord-chart-editor-tools-strip > .chord-chart-editor-cell-tools {
  flex: 1 1 0;
  min-width: 0;
}
#songStudioChordChartHost .chord-chart-editor-measure {
  position: relative;
  border: 0;
  background: transparent;
  min-width: 4.8rem;
  flex: 0 0 auto;
  gap: 0;
  justify-content: flex-start;
  align-items: stretch;
}
/* Такты: вертикаль между каждыми двумя тактами (не на краю капсулы) */
#songStudioChordChartHost .chord-chart-editor-chord-row > .chord-chart-editor-measure:not(:first-child)::before,
#songStudioChordChartHost .chord-chart-grid.chord-chart-editor-grid > .chord-chart-editor-measure:not(:first-child)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  z-index: 1;
}
#songStudioChordChartHost .chord-chart-editor-plaque {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  padding: 0.2rem 0.2rem 0.35rem;
  border: 0;
}
#songStudioChordChartHost .chord-chart-editor-measure .chord-chart-slot.chord-chart-editor-slot {
  flex: 0 0 auto !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 0.25rem;
  width: 4.8rem !important;
  min-width: 4.8rem !important;
  max-width: 4.8rem !important;
  padding-left: 0.6rem !important;
  padding-right: 0.6rem !important;
  padding-top: 0.35rem !important;
  padding-bottom: 0.3rem !important;
  border-right: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}
#songStudioChordChartHost .chord-chart-editor-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  font: inherit !important;
  font-size: inherit !important;
  line-height: 1.2;
  color: rgb(245 245 245);
  background: transparent !important;
  border: 0 !important;
  padding: 0.1rem 0.25rem 0;
  margin: 0 auto;
  box-shadow: none !important;
}
#songStudioChordChartHost .chord-chart-editor-input:focus {
  outline: none;
}
#songStudioChordChartHost .chord-chart-editor-line {
  display: none;
}
#songStudioChordChartHost .chord-chart-editor-cell-tools {
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-top: 0;
  background: transparent;
  box-shadow: none;
  min-height: 2.2rem;
  padding-top: 0.12rem;
  padding-bottom: 0.32rem;
  gap: 0.5rem;
}
#songStudioChordChartHost .chord-chart-editor-grip {
  min-width: 1.625rem;
  min-height: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0.2rem;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}
#songStudioChordChartHost .chord-chart-editor-grip:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
}
#songStudioChordChartHost .chord-chart-editor-grip:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
#songStudioChordChartHost .chord-chart-editor-measure.is-active .chord-chart-editor-plaque {
  overflow: hidden;
  background: rgba(88, 28, 135, 0.22);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.28);
}
#songStudioChordChartHost .chord-chart-editor-measure.is-active .chord-chart-slot {
  background: transparent !important;
  box-shadow: none !important;
}
#songStudioChordChartHost .chord-chart-section-title .chord-chart-editor-kind-select {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}
#songStudioChordChartHost .chord-chart-editor-kind-row {
  gap: 0.06rem;
  width: max-content;
  max-width: 100%;
}
#songStudioChordChartHost .chord-chart-editor-section-title {
  column-gap: 0.75rem;
  row-gap: 0.25rem;
}
#songStudioChordChartHost .chord-chart-editor-kind-select,
#songStudioChordChartHost .chord-chart-editor-kind-select:focus,
#songStudioChordChartHost .chord-chart-editor-kind-select:focus-visible {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0;
  width: auto;
  min-width: 0;
  max-width: none;
  field-sizing: content;
}
#songStudioChordChartHost .chord-chart-editor-kind-chevron {
  display: inline-flex;
  align-items: center;
  margin-left: -0.05rem;
}
#songStudioChordChartHost .chord-chart-editor-repeat-label {
  padding: 4px 2px;
}

/* Group view: make all icon buttons match Share buttons (dark blurred, no outline) */
#groupView .btn-icon {
  border: 0 !important;
  background: rgba(10, 10, 10, 0.65) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgba(245, 245, 245, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 16px 32px -28px rgba(0, 0, 0, 0.9);
}
#groupView .btn-icon:hover {
  background: rgba(23, 23, 23, 0.72) !important;
  color: #fff;
}

/* Measure hint: subtle tint + click affordance */
.chord-chart-measure.has-hint {
  background: rgba(168, 85, 247, 0.10);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.18) inset;
  cursor: pointer;
}
.chord-chart-measure.has-hint:hover {
  background: rgba(168, 85, 247, 0.14);
}

/* Tab-hint measure tint: follow grid rounding on first/last measure */
#groupChordChartPanel .chord-chart-grid > .chord-chart-measure:first-child.has-hint, #rechordPdfChordChartHost .chord-chart-grid > .chord-chart-measure:first-child.has-hint, #songStudioChordChartHost .chord-chart-grid > .chord-chart-measure:first-child.has-hint  {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}
#groupChordChartPanel .chord-chart-grid > .chord-chart-measure:last-child.has-hint, #rechordPdfChordChartHost .chord-chart-grid > .chord-chart-measure:last-child.has-hint, #songStudioChordChartHost .chord-chart-grid > .chord-chart-measure:last-child.has-hint  {
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}
#groupChordChartPanel .chord-chart-grid > .chord-chart-measure:only-child.has-hint, #rechordPdfChordChartHost .chord-chart-grid > .chord-chart-measure:only-child.has-hint, #songStudioChordChartHost .chord-chart-grid > .chord-chart-measure:only-child.has-hint  {
  border-radius: 0.5rem;
}
@media (max-width: 640px) {
  #groupChordChartPanel .chord-chart-system.is-first > .chord-chart-measure:first-child.has-hint, #rechordPdfChordChartHost .chord-chart-system.is-first > .chord-chart-measure:first-child.has-hint, #songStudioChordChartHost .chord-chart-system.is-first > .chord-chart-measure:first-child.has-hint  {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
  }
  #groupChordChartPanel .chord-chart-system.is-last > .chord-chart-measure:last-child.has-hint, #rechordPdfChordChartHost .chord-chart-system.is-last > .chord-chart-measure:last-child.has-hint, #songStudioChordChartHost .chord-chart-system.is-last > .chord-chart-measure:last-child.has-hint  {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
  }
}

/* Hint popover */
.measure-hint-popover {
  position: fixed;
  z-index: 9999;
  box-sizing: border-box;
  width: max-content;
  max-width: min(520px, calc(100vw - 16px));
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 24px 70px -48px rgba(0,0,0,0.95);
  padding: 14px 16px 12px;
  color: rgba(245,245,245,0.92);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.measure-hint-popover .hint-title {
  font-size: 12px;
  color: rgba(163, 163, 163, 0.95);
  margin-bottom: 8px;
  width: 100%;
  text-align: left;
}
.measure-hint-popover-staff {
  margin: 0;
  padding: 12px 12px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-start;
}
.measure-hint-popover-staff .song-tab-staff-wrap {
  border: none;
  padding: 0;
  background: transparent;
}

/* Chord chart: один компактный слой у курсора (как lyric-chord hint), без внешней тёмной «рамки» */
.measure-hint-popover--float {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.measure-hint-popover--float .measure-hint-popover-staff {
  padding: 0.38rem 0.5rem 0.32rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(38, 38, 38, 0.98);
  background: rgb(5, 5, 7);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.58);
}

/* Measure hint modal: не даём широкому грифу раздувать весь диалог — горизонтальный скролл только у блока грифа */
.modal-content:has(.measure-hint-editor) {
  overflow-x: hidden;
  min-width: 0;
}
.measure-hint-editor {
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
}
.measure-hint-editor .tab-ascii-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.measure-hint-editor .measure-hint-fretboard-wrap--hint {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.measure-hint-editor .song-fret-editor-outer {
  overflow-x: visible;
  margin-left: 0;
  margin-right: 0;
}
.measure-hint-editor.is-measure-hint-playing .song-hint-col-highlight {
  transition: none !important;
}
.measure-hint-editor.is-measure-hint-playing #measureHintFretCaretCol {
  transition: none;
}
@media (min-width: 640px) {
  .measure-hint-editor .measure-hint-fx-side {
    max-width: none;
  }
  .measure-hint-editor .measure-hint-fx-keys {
    flex-wrap: nowrap;
  }
}

/* Measure hint editor: tab staff без отдельной «плашки» — как в Song editor (только сетка) */
.measure-hint-editor .measure-hint-staff-panel {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 6px 2px 8px 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.measure-hint-tab-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.45rem;
  min-width: 0;
}
.measure-hint-fx-side {
  flex: 0 0 auto;
  width: max-content;
  max-width: min(220px, 42vw);
}
.measure-hint-fx-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(163, 163, 163, 0.95);
  margin-bottom: 0.35rem;
}
.measure-hint-editor .measure-hint-staff-panel--grow {
  flex: 1 1 auto;
  min-width: 0;
}
/* Tighter string-name gutter (was 34px) — aligns visually with compact fret editor */
.measure-hint-editor .song-tab-ref-names {
  width: 22px;
  min-width: 22px;
}
.measure-hint-editor .song-tab-ref-name {
  font-size: 11px;
  padding-right: 2px;
}
.measure-hint-editor .song-tab-ref-nut {
  margin: 0 2px 0 1px;
}
.measure-hint-editor #measureHintFretEditor {
  --song-fret-lbl: 22px;
}
.measure-hint-fretboard-wrap--hint.song-tab-fretboard-wrap {
  position: relative;
  bottom: auto;
  padding-top: 10px;
  margin-top: 0.5rem;
}
.measure-hint-staff-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.measure-hint-editor .song-tab-staff-wrap,
.measure-hint-popover-staff .song-tab-staff-wrap {
  border: none;
  padding: 0;
  background: transparent;
}
.measure-hint-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
}
.measure-hint-toolbar-row--fx {
  padding-top: 0.15rem;
}
.measure-hint-toolbar-row--fx .song-tab-fx-key {
  padding: 0.28rem 0.4rem;
}

.measure-hint-editor .song-tab-ref-grid-wrap,
.measure-hint-popover-staff .song-tab-ref-grid-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.measure-hint-editor .song-hint-col-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  z-index: 2;
  pointer-events: none;
  transform: translateX(0);
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.2);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.3) inset;
  transition: transform 120ms ease, width 120ms ease;
}
.measure-hint-editor .song-tab-ref-cell.is-selected {
  z-index: 1;
  position: relative;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.38);
}

/* Library covers: Collection = color required + optional faint B/W image; Group = image only */
.collection-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.10;
  filter: grayscale(1) saturate(0) contrast(1.05);
  transform: scale(1.02);
  pointer-events: none;
}

/* Tab editor: fretboard-style chooser (strings x frets) */
.tab-fretboard {
  margin-top: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}
.tab-fretboard-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-fretboard-grid {
  display: grid;
  grid-auto-rows: 30px;
  gap: 6px;
  padding: 10px;
  min-width: 740px; /* ensures horizontal scroll on small screens */
}
.tab-fretboard-row {
  display: grid;
  grid-template-columns: 24px repeat(25, minmax(22px, 1fr));
  gap: 6px;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: rgba(245,245,245,0.86);
}
.tab-fretboard-row-label {
  color: rgba(163,163,163,0.95);
  text-align: right;
  padding-right: 2px;
}
.tab-fretboard-cell {
  height: 30px;
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.34);
  border: 1px solid rgba(38, 38, 38, 0.65);
  color: rgba(245,245,245,0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}
.tab-fretboard-cell:hover {
  background: rgba(23, 23, 23, 0.55);
  border-color: rgba(64, 64, 64, 0.9);
  color: #fff;
}
.tab-fretboard-cell.is-active-fret {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
}
.tab-fretboard-cell.is-zero {
  color: rgba(245,245,245,0.75);
}

/* Mini tab editor (ASCII-like) */
.tab-ascii-wrap { display: grid; gap: 10px; }
.tab-ascii-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tab-undo-btn,
.tab-redo-btn {
  height: 30px;
  width: 34px;
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.55);
  border: 1px solid rgba(38, 38, 38, 0.85);
  color: rgba(245,245,245,0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab-undo-btn svg,
.tab-redo-btn svg { width: 16px; height: 16px; }
.tab-undo-btn:hover,
.tab-redo-btn:hover { background: rgba(23, 23, 23, 0.72); color: #fff; }
.tab-undo-btn:disabled,
.tab-redo-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.tab-fret-step,
.tab-del-btn,
.tab-space-col-btn,
.tab-add-tick-btn,
.tab-fx-btn {
  height: 30px;
  min-width: 30px;
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.55);
  border: 1px solid rgba(38, 38, 38, 0.85);
  color: rgba(245,245,245,0.92);
  font-size: 13px;
  line-height: 1;
}
.tab-fret-step:hover,
.tab-del-btn:hover,
.tab-space-col-btn:hover,
.tab-add-tick-btn:hover,
.tab-fx-btn:hover { background: rgba(23, 23, 23, 0.72); color: #fff; }
.tab-fx-btn.is-on {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.45);
}
.tab-fret-val {
  min-width: 28px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #fff;
  font-size: 13px;
}
.tab-fx-sep {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.10);
  margin: 0 2px;
}
.tab-fret-ruler {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.tab-fret-tick {
  height: 22px;
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.38);
  border: 1px solid rgba(38, 38, 38, 0.65);
  color: rgba(245,245,245,0.75);
  font-size: 11px;
  line-height: 1;
}
.tab-fret-tick:hover { background: rgba(23, 23, 23, 0.62); color: #fff; }
.tab-fret-tick[data-fret="0"] { color: rgba(245,245,245,0.92); }
.tab-fret-tick.is-active {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.45);
  color: #fff;
}

.tab-ascii {
  position: relative;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 10px 10px 12px;
  overflow: hidden;
}
.tab-row {
  display: grid;
  grid-template-columns: 18px 1fr 10px;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: rgba(245,245,245,0.92);
}
.tab-row-label, .tab-row-suffix { color: rgba(163,163,163,0.95); }
.tab-row-cells {
  display: grid;
  grid-template-columns: repeat(var(--tab-cols, 8), minmax(0, 1fr));
  gap: 6px;
}
.tab-cell {
  height: 28px;
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.34);
  border: 1px solid rgba(38, 38, 38, 0.65);
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.tab-cell.is-selected {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.18);
}
.tab-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background:
    repeating-linear-gradient(
      to right,
      rgba(255,255,255,0.08) 0px,
      rgba(255,255,255,0.08) 10px,
      transparent 10px,
      transparent 18px
    );
  mix-blend-mode: screen;
  pointer-events: none;
}
.tab-cell-val {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 600;
}
.tab-col-highlight {
  position: absolute;
  top: 10px;
  bottom: 12px;
  left: 34px; /* after label + gap; adjusted dynamically in JS */
  width: 40px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.18);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.22) inset;
  pointer-events: none;
  transform: translateX(0);
  transition: transform 120ms ease, width 120ms ease;
}

/* Song studio (standalone chart + tabs + lyrics) — tab staff matches reference: monospace, nut, dashed string, blue caret */
.song-studio-tablist-plain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.song-studio-chart-pane {
  padding: 0;
  border: none;
  background: transparent;
}
.song-studio-tab-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  color: rgba(212, 212, 212, 0.95);
  font-size: 12px;
  font-weight: 500;
  background: rgba(23, 23, 23, 0.35);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.song-studio-tab-btn:hover {
  color: #fff;
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.45);
}
.song-studio-tab-btn.is-active {
  color: rgba(216, 180, 254, 0.98);
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(88, 28, 135, 0.22);
}
.song-studio-tabs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
  width: 100%;
}
.song-studio-tabs-toolbar-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.song-tab-toolbar-auto {
  flex-shrink: 0;
}
.song-tab-check-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(212, 212, 212, 0.92);
}
.song-tab-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.song-tab-check-box {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgb(64, 64, 64);
  background: rgba(23, 23, 23, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.song-tab-check-label:hover .song-tab-check-box {
  border-color: rgb(82, 82, 82);
  background: rgba(38, 38, 38, 0.65);
}
.song-tab-check-input:focus-visible + .song-tab-check-box {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.9), 0 0 0 4px rgba(168, 85, 247, 0.45);
}
.song-tab-check-input:checked + .song-tab-check-box {
  background: rgba(88, 28, 135, 0.55);
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.song-tab-check-input:checked + .song-tab-check-box::after {
  content: '';
  width: 4px;
  height: 8px;
  margin-top: -1px;
  border: solid rgb(233, 213, 255);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.song-tab-check-text {
  line-height: 1.2;
}
.song-tab-toolbar-btn {
  min-height: 32px;
  height: auto;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.4);
  color: rgba(212, 212, 212, 0.95);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.song-tab-toolbar-btn:hover {
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.55);
  color: #fff;
}
.song-tab-toolbar-btn.song-tab-toolbar-btn--on {
  border-color: rgba(168, 85, 247, 0.65);
  background: rgba(88, 28, 135, 0.34);
  color: #faf5ff;
}
/* Tab Builder Pro (AlphaTab MVP shell) */
.tab-builder-pro-toggle {
  min-height: 32px;
  padding: 0.34rem 0.62rem;
  font-size: 0.72rem;
}
#tabbuilder .tab-builder-pro-toggle {
  min-height: var(--tb-song-toolbar-h, 34px);
  box-sizing: border-box;
  border-color: var(--tb-chrome-border, rgba(52, 52, 60, 0.94)) !important;
  background: var(--tb-chrome-surface, rgba(14, 14, 17, 0.82)) !important;
}
.tab-builder-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--tb-chrome-border, rgba(52, 52, 60, 0.94));
  border-radius: 8px;
  background: var(--tb-chrome-rail-surface, rgba(10, 10, 13, 0.55));
}
#tabbuilder .tab-builder-view-switch .tab-builder-view-switch__btn {
  min-height: 30px;
  height: 30px;
  padding: 0 0.72rem !important;
  border: 0 !important;
  border-radius: 6px;
  background: transparent !important;
  color: rgb(148, 148, 156);
}
#tabbuilder .tab-builder-view-switch .tab-builder-view-switch__btn.song-tab-toolbar-btn--on {
  background: var(--tb-chrome-accent-surface, rgba(88, 28, 135, 0.34)) !important;
  color: rgb(253, 250, 255);
  box-shadow: inset 0 0 0 1px var(--tb-chrome-accent-border, rgba(168, 85, 247, 0.65));
}
#tabbuilder .tab-builder-pro-toggle:hover {
  border-color: var(--tb-chrome-border-hover, rgba(82, 82, 94, 0.95)) !important;
  background: var(--tb-chrome-surface-raised, rgba(18, 18, 22, 0.94)) !important;
}
#tabbuilder.tab-builder-pro-mode #tabBuilderHost {
  display: none !important;
}
#tabbuilder.tab-builder-pro-mode #tabBuilderTopTempo {
  /* Сохраняем место в шапке, чтобы при переключении Classic/Pro сетка не «подпрыгивала». */
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.tab-builder-pro {
  margin-top: 0.35rem;
  border: 1px solid var(--tb-chrome-border, rgba(52, 52, 60, 0.94));
  border-radius: var(--tb-chrome-radius-panel, 12px);
  background: var(--tb-chrome-surface-raised, rgba(18, 18, 22, 0.94));
  overflow: hidden;
}
/* Геометрия Pro близка к Classic (у Classic staff рамка слегка смещена влево в design-system). */
#tabbuilder .tab-builder-pro {
  margin-left: -0.5rem;
  border-radius: var(--tb-chrome-radius-float, 16px);
  background: var(--tb-chrome-surface-float, rgba(12, 12, 15, 0.94));
  box-shadow: var(--tb-chrome-shadow-float, 0 12px 40px rgba(0, 0, 0, 0.42));
  backdrop-filter: blur(8px);
}
#tabbuilder #tabBuilderProToggle.song-tab-toolbar-btn--on {
  border-color: var(--tb-chrome-accent-border, rgba(168, 85, 247, 0.65)) !important;
  background: var(--tb-chrome-accent-surface, rgba(88, 28, 135, 0.34)) !important;
  color: rgb(253, 250, 255);
}
.tab-builder-pro__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--tb-chrome-border-soft, rgba(42, 42, 48, 0.88));
  min-height: 46px;
}
.tab-builder-pro__toolbar--primary {
  justify-content: space-between;
  gap: 0.45rem 0.7rem;
}
.tab-builder-pro__toolbar-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tab-builder-pro__toolbar-group .song-tab-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.tab-builder-pro__toolbar-group--right {
  margin-left: auto;
}
#tabbuilder .tab-builder-pro__toolbar .song-tab-toolbar-btn {
  min-height: var(--tb-song-toolbar-h, 34px);
  box-sizing: border-box;
  border-color: var(--tb-chrome-border, rgba(52, 52, 60, 0.94)) !important;
  background: var(--tb-chrome-surface, rgba(14, 14, 17, 0.82)) !important;
}
#tabbuilder .tab-builder-pro__toolbar .song-tab-toolbar-btn:hover {
  border-color: var(--tb-chrome-border-hover, rgba(82, 82, 94, 0.95)) !important;
  background: var(--tb-chrome-surface-raised, rgba(18, 18, 22, 0.94)) !important;
}
#tabbuilder .tab-builder-pro__toolbar--primary {
  background: var(--tb-chrome-rail-surface, rgba(10, 10, 13, 0.55));
  border-bottom: 1px solid var(--tb-chrome-border, rgba(52, 52, 60, 0.94));
  padding: 0.55rem 0.65rem;
  gap: 0.5rem 0.65rem;
}
#tabbuilder .tab-builder-pro__toolbar .song-tab-toolbar-btn.song-tab-toolbar-btn--on {
  border-color: var(--tb-chrome-accent-border, rgba(168, 85, 247, 0.65)) !important;
  background: var(--tb-chrome-accent-surface, rgba(88, 28, 135, 0.34)) !important;
  color: rgb(253, 250, 255);
}
#tabbuilder .tab-builder-pro__btn-accent {
  border-color: rgba(168, 85, 247, 0.5) !important;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.12);
}
#tabbuilder .tab-builder-pro__btn-accent:hover {
  border-color: var(--tb-chrome-accent-border, rgba(168, 85, 247, 0.65)) !important;
  background: var(--tb-chrome-accent-surface, rgba(88, 28, 135, 0.34)) !important;
  color: rgb(253, 250, 255);
}
.tab-builder-pro__advanced {
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tab-builder-pro__advanced > summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: rgba(203, 213, 225, 0.86);
  user-select: none;
}
.tab-builder-pro__advanced > summary::-webkit-details-marker {
  color: rgba(168, 85, 247, 0.8);
}
.tab-builder-pro__advanced-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.12rem;
}
.tab-builder-pro__advanced--edit {
  width: 100%;
  flex-basis: 100%;
}
.tab-builder-pro__help {
  width: 100%;
  flex-basis: 100%;
  padding: 0.4rem 0.72rem 0.55rem;
  border-bottom: 1px solid rgba(52, 52, 52, 0.9);
  background: rgba(8, 8, 10, 0.55);
}
.tab-builder-pro__help > summary {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(212, 212, 212, 0.98);
  list-style-position: outside;
}
.tab-builder-pro__help > summary::-webkit-details-marker {
  color: rgba(168, 85, 247, 0.85);
}
.tab-builder-pro__help-body {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(163, 163, 163, 0.96);
  max-width: 58rem;
}
.tab-builder-pro__help-lead {
  margin: 0 0 0.4rem;
}
.tab-builder-pro__help-body ul {
  margin: 0.15rem 0 0;
  padding-left: 1.1rem;
}
.tab-builder-pro__help-body li {
  margin: 0.2rem 0;
}
.tab-builder-pro__status {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(163, 163, 163, 0.95);
}
.tab-builder-pro__status--inline {
  margin-left: 0;
  flex: 0 1 auto;
  padding: 0;
  border-bottom: none;
  font-size: 0.66rem;
  text-align: right;
  max-width: 22rem;
}
.tab-builder-pro__status.is-error {
  color: rgba(248, 113, 113, 0.94);
}
.tab-builder-pro__canvas {
  min-height: min(72vh, 720px);
  /* «Бумага» как в Songsterr / GP: светлый фон вокруг партитуры */
  background: #e8e8ec;
  overflow: auto;
  padding: clamp(14px, 2vw, 28px);
}
/*
 * AlphaTab (CssFontSvgCanvas) часто красит символы через fill: currentColor.
 * На странице body — text-neutral-200, из‑за наследования нотация становится почти белой на белом листе → «пустая» партитура.
 */
#tabbuilder .tab-builder-pro__canvas {
  border-radius: 0 0 var(--tb-chrome-radius-float, 16px) var(--tb-chrome-radius-float, 16px);
}
#tabBuilderProContainer {
  color: rgb(23, 23, 23) !important;
  isolation: isolate;
}
#tabBuilderProContainer svg {
  color: inherit;
}
/* AlphaTab рисует в SVG; белый лист + жёлтый курсор как в десктопных таб-редакторах */
.tab-builder-pro__canvas .at-surface,
.tab-builder-pro__canvas .at-surface-svg {
  background: #ffffff !important;
}
.tab-builder-pro__canvas .at-highlight {
  fill: rgba(255, 224, 60, 0.4) !important;
}
.tab-builder-pro__canvas .at-cursor-beat path,
.tab-builder-pro__canvas .at-cursor-beat rect,
.tab-builder-pro__canvas .at-cursor-bar path,
.tab-builder-pro__canvas .at-cursor-bar rect {
  fill: rgba(255, 215, 52, 0.22) !important;
  stroke: rgba(234, 179, 8, 0.85) !important;
  stroke-width: 1px !important;
}
.tab-builder-pro__editbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(38, 38, 38, 0.55);
  background: rgba(12, 12, 12, 0.65);
}
.tab-builder-pro__editbar--inspector {
  display: block;
  padding: 0.5rem 0.65rem 0.55rem;
  border-bottom: 1px solid rgba(38, 38, 38, 0.55);
  background: linear-gradient(180deg, rgba(22, 22, 28, 0.98) 0%, rgba(12, 12, 14, 0.92) 100%);
}
.tab-builder-pro__inspector-shell {
  max-width: 72rem;
  margin: 0 auto;
}
.tab-builder-pro__note-card {
  border: 1px solid rgba(72, 72, 82, 0.55);
  border-radius: 0.75rem;
  background: radial-gradient(120% 80% at 10% 0%, rgba(88, 28, 135, 0.12) 0%, transparent 55%), rgba(10, 10, 14, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 0.55rem 0.6rem 0.58rem;
}
.tab-builder-pro__note-head {
  margin-bottom: 0.45rem;
  padding-bottom: 0.42rem;
  border-bottom: 1px solid rgba(55, 55, 62, 0.45);
}
.tab-builder-pro__note-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
}
.tab-builder-pro__selection-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(216, 180, 254, 0.98);
  line-height: 1.25;
}
.tab-builder-pro__inspector-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10.5rem, 15rem);
  gap: 0.65rem 0.85rem;
  align-items: stretch;
}
.tab-builder-pro__inspector-main {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}
.tab-builder-pro__inspector-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}
.tab-builder-pro__inspector-row--modes {
  justify-content: flex-start;
  gap: 0.45rem 0.55rem;
}
.tab-builder-pro__inspector-row--metrics {
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
  flex-wrap: wrap;
}
.tab-builder-pro__metric-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
}
.tab-builder-pro__metric-block--grow {
  flex: 1 1 12rem;
  min-width: 0;
}
.tab-builder-pro__metric-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}
.tab-builder-pro__add-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
#tabbuilder #tabBuilderProPanel .song-tab-beat-denom-bar {
  min-height: var(--tb-song-toolbar-h, 34px);
  box-sizing: border-box;
  align-items: center;
}
#tabbuilder #tabBuilderProPanel .song-tab-beat-denom-btn {
  min-height: calc(var(--tb-song-toolbar-h, 34px) - 8px);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
#tabbuilder #tabBuilderProPanel #tabBuilderProMeterSelect {
  min-height: var(--tb-song-toolbar-h, 34px);
  box-sizing: border-box;
  border-radius: var(--tb-song-toolbar-radius, 0.5rem);
}
.tab-builder-pro__beat-eq-btn {
  min-width: 1.85rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}
.tab-builder-pro__inline-label {
  flex: 0 0 auto;
  width: 3.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
}
.tab-builder-pro__inline-label--fret {
  width: auto;
  margin-left: 0.15rem;
}
.tab-builder-pro__segmented {
  display: inline-flex;
  align-items: stretch;
  border-radius: 0.55rem;
  border: 1px solid rgba(62, 62, 72, 0.85);
  overflow: hidden;
  background: rgba(6, 6, 8, 0.65);
}
.tab-builder-pro__segmented .tab-builder-pro__seg-btn {
  min-height: 2rem;
  min-width: 2.35rem;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  font-size: 0.72rem !important;
  font-weight: 600;
  padding: 0 0.5rem !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.tab-builder-pro__segmented .tab-builder-pro__seg-btn + .tab-builder-pro__seg-btn {
  border-left: 1px solid rgba(55, 55, 62, 0.95) !important;
}
.tab-builder-pro__segmented .tab-builder-pro__seg-btn.song-tab-toolbar-btn--on {
  background: rgba(88, 28, 135, 0.42) !important;
  color: rgba(250, 245, 255, 0.98) !important;
}
.tab-builder-pro__segmented .tab-builder-pro__seg-btn:not(.song-tab-toolbar-btn--on) {
  opacity: 0.82;
}
.tab-builder-pro__insert-commit {
  min-height: 2rem;
  font-size: 0.72rem !important;
  font-weight: 600;
  padding: 0 0.65rem !important;
}
.tab-builder-pro__tech-rail {
  border-radius: 0.62rem;
  border: 1px solid rgba(55, 55, 62, 0.65);
  background: rgba(8, 8, 10, 0.55);
  padding: 0.45rem 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}
.tab-builder-pro__tech-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}
.tab-builder-pro__tech-rail-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.92);
}
.tab-builder-pro__tech-rail-hint {
  font-size: 0.58rem;
  color: rgba(148, 163, 184, 0.75);
}
.tab-builder-pro__snippets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding-top: 0.08rem;
}
.tab-builder-pro__snippets--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem;
  padding: 0;
}
.tab-builder-pro__chips--strings .tab-builder-pro__chip-btn {
  font-weight: 700;
  font-size: 0.7rem !important;
  letter-spacing: 0.02em;
}
.tab-builder-pro__chips--beats .tab-builder-pro__chip-btn {
  min-width: 2rem;
}
.tab-builder-pro__field {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.tab-builder-pro__field-label {
  font-size: 0.62rem;
  color: rgba(148, 163, 184, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.tab-builder-pro__field-body {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.tab-builder-pro__techniques {
  border: 1px solid rgba(55, 55, 62, 0.75);
  border-radius: 0.58rem;
  background: rgba(10, 10, 12, 0.5);
  padding: 0.25rem 0.45rem 0.45rem;
}
.tab-builder-pro__techniques > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(163, 163, 163, 0.95);
  user-select: none;
  margin-bottom: 0.35rem;
}
.tab-builder-pro__techniques > summary::-webkit-details-marker {
  display: none;
}
.tab-builder-pro__chips {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-width: 0;
}
.tab-builder-pro__chip-btn {
  min-height: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0 0.36rem !important;
  font-size: 0.68rem !important;
  border-radius: 0.42rem !important;
}
.tab-builder-pro__icon-btn {
  min-width: 2rem;
  width: 2rem;
  font-size: 0.78rem !important;
  justify-content: center !important;
}
.tab-builder-pro__stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.06rem 0.2rem;
  border: 1px solid rgba(55, 55, 62, 0.75);
  border-radius: 0.45rem;
  background: rgba(10, 10, 10, 0.35);
}
.tab-builder-pro__stepper-value {
  min-width: 1.85rem;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(229, 231, 235, 0.98);
}
.tab-builder-pro__mini-input {
  height: 1.9rem;
  min-height: 1.9rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 0.4rem;
  min-width: 4rem;
}
.tab-builder-pro__mini-btn {
  min-height: 1.9rem;
  padding: 0 0.5rem !important;
  font-size: 0.72rem !important;
}
@media (max-width: 900px) {
  .tab-builder-pro__inspector-body {
    grid-template-columns: 1fr;
  }
  .tab-builder-pro__tech-rail {
    order: 1;
  }
  .tab-builder-pro__inspector-main {
    order: 0;
  }
}
.tab-builder-pro--preview-only .tab-builder-pro__toolbar--preview {
  border-bottom: 1px solid var(--tb-chrome-border-soft, rgba(42, 42, 48, 0.88));
}
#tabbuilder .tab-builder-pro__preview-stack {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  background: rgba(8, 8, 10, 0.38);
  border: 0;
  border-bottom: 1px solid var(--tb-chrome-border-soft, rgba(42, 42, 48, 0.88));
  box-shadow: none;
}
#tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__preview-hint {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.74rem;
  line-height: 1.48;
  color: rgba(203, 213, 225, 0.88);
}
#tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__preview-hint strong {
  color: rgba(253, 250, 255, 0.96);
  font-weight: 600;
}
#tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__status--preview {
  display: inline-flex;
  align-items: center;
  margin: 0;
  margin-left: 0;
  padding: 0;
  border-top: 0;
  font-size: 0.7rem;
  color: rgba(186, 198, 216, 0.88);
  text-align: left;
  max-width: none;
}
#tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__status--preview::before {
  content: '';
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: rgb(74, 222, 128);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.09);
}
#tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__status--preview.is-error::before {
  background: rgb(248, 113, 113);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.09);
}
#tabbuilder .tab-builder-pro--source-open .tab-builder-pro__source-wrap {
  border-bottom-color: var(--tb-chrome-border, rgba(52, 52, 60, 0.94));
  background: var(--tb-chrome-rail-surface, rgba(10, 10, 13, 0.55));
}
#tabbuilder .tab-builder-pro__source-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(203, 213, 225, 0.82);
}
#tabbuilder .tab-builder-pro__textarea.input {
  border-color: var(--tb-chrome-border, rgba(52, 52, 60, 0.94)) !important;
  background: var(--tb-chrome-surface, rgba(14, 14, 17, 0.82)) !important;
  color: rgba(248, 250, 252, 0.94);
  border-radius: var(--tb-chrome-radius-panel, 12px);
}
.tab-builder-pro__preview-hint {
  margin: 0 0.72rem 0.35rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.42;
  color: rgba(148, 163, 184, 0.94);
  border-radius: 0.48rem;
  background: rgba(8, 8, 12, 0.48);
  border: 1px solid rgba(55, 55, 62, 0.55);
}
.tab-builder-pro__preview-hint strong {
  color: rgba(226, 232, 240, 0.96);
  font-weight: 600;
}
.tab-builder-pro__status--preview {
  margin: 0 0.72rem 0.45rem;
  padding: 0 0.15rem;
  font-size: 0.68rem;
  color: rgba(163, 163, 163, 0.96);
}
.tab-builder-pro__canvas {
  position: relative;
}
.tab-builder-pro__canvas--clickable {
  cursor: crosshair;
}
.tab-builder-pro__click-marker {
  position: absolute;
  width: 2px;
  min-height: 14px;
  height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 1px;
  border: none;
  background: rgba(168, 85, 247, 0.95);
  box-shadow:
    0 0 0 1px rgba(250, 250, 252, 0.85),
    0 0 8px rgba(168, 85, 247, 0.35);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 6;
}
.tab-builder-pro__canvas .tab-builder-pro-note-selected {
  fill: rgb(168, 85, 247) !important;
  stroke: rgba(250, 250, 252, 0.95) !important;
  stroke-width: 0.6px !important;
  paint-order: stroke fill;
}
.tab-builder-pro__snippets-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(115, 115, 115, 0.98);
}
.tab-builder-pro__snippet-btn {
  min-height: 1.95rem;
  min-width: 0;
  width: 100%;
  padding: 0.12rem 0.25rem !important;
  font-size: 0.72rem !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  line-height: 1.2;
  justify-content: center;
  border-radius: 0.42rem !important;
}
.tab-builder-pro__snippet-btn--wide {
  grid-column: span 2;
}
.tab-builder-pro__source-wrap {
  padding: 0.55rem 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(38, 38, 38, 0.88);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tab-builder-pro__bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.28rem 0.65rem 0.38rem;
  border-bottom: 1px solid rgba(38, 38, 38, 0.65);
  background: rgba(8, 8, 10, 0.45);
}
.tab-builder-pro__help--dock {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.tab-builder-pro__help--dock > summary {
  font-size: 0.66rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.95);
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.tab-builder-pro__help--dock > summary::-webkit-details-marker {
  display: none;
}
.tab-builder-pro__help--dock > summary::before {
  content: '▸ ';
  display: inline-block;
  width: 0.85rem;
  color: rgba(167, 139, 250, 0.85);
  font-size: 0.62rem;
}
.tab-builder-pro__help--dock[open] > summary::before {
  content: '▾ ';
}
.tab-builder-pro__help--dock .tab-builder-pro__help-body {
  margin-top: 0.35rem;
  padding: 0.45rem 0.5rem 0.48rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(55, 55, 62, 0.55);
  background: rgba(12, 12, 16, 0.88);
  max-width: 42rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(163, 163, 163, 0.96);
}
.tab-builder-pro__help--dock .tab-builder-pro__help-lead {
  margin: 0 0 0.4rem;
}
.tab-builder-pro__help--dock .tab-builder-pro__help-body ul {
  margin: 0.15rem 0 0;
  padding-left: 1.1rem;
}
.tab-builder-pro__help--dock .tab-builder-pro__help-body li {
  margin: 0.2rem 0;
}
.tab-builder-pro__command-palette {
  margin: 0.5rem 0.7rem 0.65rem;
  padding: 0.45rem;
  border: 1px solid rgba(52, 52, 58, 0.9);
  border-radius: 0.62rem;
  background: rgba(11, 11, 14, 0.92);
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: min(42rem, calc(100vw - 2rem));
  z-index: 170;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}
.tab-builder-pro__command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}
.tab-builder-pro__command-hint {
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.9);
}
.tab-builder-pro__command-input {
  width: 100%;
  min-height: 2rem;
  font-size: 0.74rem;
  margin-bottom: 0.28rem;
}
.tab-builder-pro__command-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 12rem;
  overflow: auto;
}
.tab-builder-pro__command-group-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.88);
  padding: 0.24rem 0.2rem 0.08rem;
}
.tab-builder-pro__command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.32rem 0.42rem;
  border: 1px solid rgba(55, 55, 62, 0.72);
  border-radius: 0.48rem;
  background: rgba(13, 13, 17, 0.72);
  color: rgba(226, 232, 240, 0.96);
  font-size: 0.72rem;
  cursor: pointer;
}
.tab-builder-pro__command-item:hover,
.tab-builder-pro__command-item.is-active {
  border-color: rgba(168, 85, 247, 0.62);
  background: rgba(88, 28, 135, 0.28);
}
.tab-builder-pro__command-item-desc {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.65rem;
}
.tab-builder-pro__source-wrap.hidden {
  display: none;
}
.tab-builder-pro__source-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(163, 163, 163, 0.95);
}
.tab-builder-pro__textarea {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  border-radius: 0.5rem;
}
.tab-builder-pro--source-open .tab-builder-pro__canvas {
  min-height: min(52vh, 560px);
}
.song-tab-blocks {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 16px;
}
.song-tab-insert-gap {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}
.song-tab-block {
  border: none;
  background: transparent;
  padding: 0;
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.song-tab-title-wrap {
  margin: 4px 0;
  min-height: 2rem;
  opacity: 1;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.song-tab-title-input {
  min-width: 9.5rem;
  max-width: min(14rem, 92vw);
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.4);
  color: rgba(212, 212, 212, 0.95);
  padding: 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.1;
}
.song-tab-title-wrap.is-idle .song-tab-title-input {
  border-color: transparent;
  background: transparent;
  color: rgba(163, 163, 163, 0.58) !important;
  caret-color: rgba(148, 163, 184, 0.72);
  opacity: 1;
}
.song-tab-title-ghost {
  min-width: 9.5rem;
  max-width: min(14rem, 92vw);
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(148, 163, 184, 0.42);
  padding: 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  cursor: text;
}
.song-tab-title-ghost.has-value {
  color: rgba(163, 163, 163, 0.62);
}
.song-tab-title-ghost:hover {
  border-color: rgba(71, 85, 105, 0.22);
}
.song-tab-title-ghost:focus-visible {
  outline: none;
  border-color: rgba(100, 116, 139, 0.4);
}
.song-tab-title-wrap.is-idle {
  min-height: 2rem;
  margin: 4px 0;
}
.song-tab-title-wrap.is-idle .song-tab-title-input::placeholder {
  color: rgba(148, 163, 184, 0.42);
}
.song-tab-title-wrap.is-idle .song-tab-title-input:focus {
  color: rgba(212, 212, 212, 0.95);
  border-color: rgb(64, 64, 64);
  background: rgba(23, 23, 23, 0.48);
  opacity: 1;
}
.song-tab-title-wrap.is-idle .song-tab-title-input:focus::placeholder {
  color: rgba(148, 163, 184, 0.45);
}
.song-tab-title-input::placeholder {
  color: rgba(148, 163, 184, 0.46);
}
.song-tab-title-input:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.72);
  background: rgba(30, 58, 138, 0.14);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.22);
}
.song-tab-block.is-active {
  outline: none;
  box-shadow: none;
}
.song-tab-block.is-active .song-tab-staff-wrap {
  /* no framed panel — subtle focus only */
  box-shadow: none;
}
.song-tab-block-frame {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0 10px;
  min-width: 0;
  /* Иконки справа сразу после сетки: строка не растягивается на всю ширину блока */
  width: max-content;
  max-width: 100%;
}
.song-tab-staff-wrap {
  position: relative;
  flex: 0 1 auto;
  flex-grow: 0;
  align-self: flex-start;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 3px 4px 3px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: none;
  background: transparent;
  border-radius: 0;
}
.song-tab-staff-chunks {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}
/* Reference-style staff: one nut line, monospace; empty beat = short string segment bar */
.song-tab-ref-staff {
  --song-tab-row-h: 19px;
  --song-tab-col-w: 16px;
  /* Совпадает с `songTabGridGapPxForDocument` в Tab Builder (там 0). */
  --song-tab-grid-gap: 2px;
  --song-tab-pm-h: 15px;
  --song-tab-rhythm-h: 28px;
  --song-tab-stroke-h: 15px;
  width: max-content;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.song-tab-ref-leading {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: stretch;
  align-self: stretch;
}
.song-tab-ref-leading-pm {
  flex: 0 0 auto;
  min-height: 0;
}
.song-tab-ref-staff--has-pm .song-tab-ref-leading-pm {
  min-height: var(--song-tab-pm-h);
}
.song-tab-ref-staff--no-rhythm .song-tab-ref-leading-rhythm {
  min-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.song-tab-ref-staff--no-rhythm .song-tab-ref-leading-stroke {
  min-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.song-tab-ref-staff--no-rhythm .song-tab-ref-rhythm-strip,
.song-tab-ref-staff--no-rhythm .song-tab-ref-stroke-strip {
  display: none;
}
.song-tab-ref-staff--has-stroke .song-tab-ref-leading-stroke {
  min-height: var(--song-tab-stroke-h);
}
.song-tab-ref-leading-tabs {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
}
.song-tab-ref-leading-rhythm {
  flex: 0 0 auto;
  min-height: var(--song-tab-rhythm-h);
}
.song-tab-ref-leading-stroke {
  flex: 0 0 auto;
  min-height: 0;
}
.song-tab-ref-tracks {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-width: 0;
}
.song-tab-ref-pm-strip {
  display: grid;
  column-gap: var(--song-tab-grid-gap, 2px);
  align-items: center;
  box-sizing: border-box;
}
.song-tab-ref-staff--has-pm .song-tab-ref-pm-strip {
  min-height: var(--song-tab-pm-h);
  margin-bottom: 1px;
}
.song-tab-ref-pm-run {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 0;
  box-sizing: border-box;
}
.song-tab-ref-pm-label {
  flex-shrink: 0;
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1;
  user-select: none;
}
.song-tab-ref-pm-line {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 6px;
  border-bottom: 1px dashed #6b6b6bb3;
  transform: translateY(-1px);
  pointer-events: none;
}
.song-tab-ref-rhythm-strip {
  display: grid;
  column-gap: var(--song-tab-grid-gap, 2px);
  min-height: var(--song-tab-rhythm-h);
  margin-top: 2px;
  padding-bottom: 0;
  align-items: flex-end;
  box-sizing: border-box;
}
/* Ширина задаётся inline (vbw) — совпадает с суммой колонок таба; не растягивать на всю строку grid. */
.song-tab-rhythm-span {
  min-height: var(--song-tab-rhythm-h);
  pointer-events: none;
  overflow: visible;
}
.song-tab-rhythm-strip-svg {
  display: block;
  width: 100%;
  height: var(--song-tab-rhythm-h);
  overflow: visible;
}
.song-tab-ref-stroke-strip {
  display: grid;
  column-gap: var(--song-tab-grid-gap, 2px);
  min-height: var(--song-tab-stroke-h);
  margin-top: 0;
  margin-bottom: 1px;
  align-items: center;
  justify-items: center;
  box-sizing: border-box;
}
.song-tab-ref-stroke-cell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: rgba(226, 232, 240, 0.88);
  user-select: none;
  pointer-events: none;
}
.song-tab-ref-stroke-cell.is-empty {
  opacity: 0;
}
.song-tab-ref-gutter {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
}
.song-tab-ref-names {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(var(--song-tab-row-h) * 6);
  flex-shrink: 0;
  /* align fret editor --song-fret-lbl with nut + names (see .song-fret-editor) */
  width: 34px;
  min-width: 34px;
  box-sizing: border-box;
}
.song-tab-ref-name {
  height: var(--song-tab-row-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(163, 163, 163, 0.95);
  text-align: right;
  padding-right: 4px;
  box-sizing: border-box;
  user-select: none;
}
.song-tab-ref-nut {
  width: 1px;
  align-self: stretch;
  height: calc(var(--song-tab-row-h) * 6);
  min-height: calc(var(--song-tab-row-h) * 6);
  margin: 0 4px 0 2px;
  background: rgba(248, 250, 252, 0.88);
  flex-shrink: 0;
  border-radius: 0;
}
/* Song Studio / Tab Builder: rhythmic value for active column (toolbar; layout stays fixed-width). */
.song-tab-beat-denom-bar {
  display: inline-flex;
  align-items: stretch;
  gap: 1px;
  padding: 2px;
  border-radius: 0.5rem;
  background: rgba(23, 23, 23, 0.72);
  border: 1px solid rgba(55, 55, 62, 0.95);
}
.song-tab-beat-denom-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 2px 5px !important;
  border-radius: 0.35rem !important;
  border: none !important;
  color: rgba(203, 213, 225, 0.55);
  background: transparent !important;
  line-height: 0;
}
.song-tab-beat-denom-btn:hover {
  color: rgba(248, 250, 252, 0.88);
  background: rgba(64, 64, 74, 0.45) !important;
}
.song-tab-beat-denom-btn[aria-pressed='true'],
.song-tab-beat-denom-btn.song-tab-beat-denom-btn--active {
  color: rgb(253, 250, 255);
  background: rgba(147, 51, 234, 0.32) !important;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.45);
}
.song-tab-beat-denom-ico {
  display: block;
  width: 1.05rem;
  height: 1.3rem;
  flex-shrink: 0;
}
.song-tab-beat-denom-ico--whole {
  width: 1.25rem;
  height: 0.92rem;
}

.song-tab-ref-grid {
  display: grid;
  grid-template-columns: repeat(16, var(--song-tab-col-w));
  grid-template-rows: repeat(6, var(--song-tab-row-h));
  column-gap: var(--song-tab-grid-gap, 2px);
  row-gap: 0;
  position: relative;
  align-content: start;
}
.song-tab-ref-cell {
  /* Fill grid track: inline grid-template-columns may be wider than --song-tab-col-w (beat duration). */
  width: 100%;
  min-width: 0;
  height: var(--song-tab-row-h);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* Cells are `.btn`; shared `.btn { border-radius }` rounds corners so inset bar looks like "(" per row — force square cells for straight bar-line. */
button.song-tab-ref-cell.btn {
  border-radius: 0 !important;
}
.song-tab-ref-cell.is-empty .song-tab-ref-cell-txt {
  display: none;
}
.song-tab-ref-cell.is-empty::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Span the cell so string lines stay continuous when columns are wider than --song-tab-col-w */
  width: min(92%, calc(100% - 6px));
  height: 1px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.36);
  pointer-events: none;
  z-index: 0;
}
/* Measure boundary sits between rhythmic columns and never consumes or shifts a note column. */
.song-tab-ref-cell.song-tab-ref-cell--bar-before::after {
  content: '';
  position: absolute;
  left: -1px;
  transform: none;
  width: 2px;
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
  background: rgba(248, 250, 252, 0.5);
}
.song-tab-ref-cell.song-tab-ref-cell--bar-before[data-r='0']::after {
  top: 3px;
  bottom: 0;
}
.song-tab-ref-cell.song-tab-ref-cell--bar-before[data-r='5']::after {
  top: 0;
  bottom: 3px;
}
.song-tab-ref-cell.song-tab-ref-cell--bar-before:not([data-r='0']):not([data-r='5'])::after {
  top: 0;
  bottom: 0;
}
.song-tab-ref-cell:not(.is-empty)::before {
  content: none;
}
.song-tab-ref-cell-txt {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  line-height: 1;
  text-align: center;
}
.song-tab-ref-cell-txt .song-tab-slide-dn {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  margin: 0 1px;
}
.song-tab-slide-dn__svg {
  display: block;
  width: 0.58rem;
  height: 0.82rem;
  flex-shrink: 0;
}
.song-tab-fx-key-main--glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.1rem;
}

.song-tab-readonly-wrap .song-tab-ref-cell {
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.song-tab-dock-labeled {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.song-tab-dock-paren {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(248, 250, 252, 0.92);
  line-height: 1;
}
.song-tab-caret-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  margin: 0;
  padding: 0;
  height: 0;
  min-height: 0;
  border: none;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.38);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.12s ease;
}
.song-tab-staff-wrap .song-tab-ref-staff {
  --song-tab-row-h: 19px;
  --song-tab-col-w: 16px;
}
.song-tab-rail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 0;
  padding: 4px 0 0 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.song-tab-rail.is-visible {
  width: 36px;
  padding: 4px 0 0 2px;
  opacity: 1;
}
.song-tab-rail-btn {
  width: 30px;
  height: 30px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.4);
  color: rgba(212, 212, 212, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.song-tab-rail-btn:hover {
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.55);
  color: #fff;
}
.song-tab-rail-btn--danger:hover {
  border-color: rgba(248, 113, 113, 0.45);
  color: rgb(252, 165, 165);
}
.song-tab-rail-ico {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
  vector-effect: non-scaling-stroke;
}
.song-tab-insert-btn {
  align-self: flex-start;
  margin: 2px 0 0 2px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.4);
  color: rgba(212, 212, 212, 0.95);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.song-tab-insert-btn:hover {
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.55);
  color: #fff;
}
.song-studio-tabs-root {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.song-tab-fretboard-wrap {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 0 8px;
  margin-top: 6px;
  background: transparent;
}

/* Song studio: scrollable neck, string lines, fret grid + inlays behind rows */
.song-fret-editor-outer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding: 2px 2px 2px;
  max-width: 100%;
}
.song-studio-tabs-root .song-fret-editor-outer {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.song-fret-editor {
  /* Match .song-tab-ref-names width (34px) so open-string labels sit under tab string letters */
  --song-fret-lbl: 34px;
  /* column track wider than note dot — shows fret separation like a neck */
  --song-fret-column: 34px;
  --song-fret-gap: 5px;
  --song-fret-node-size: 23px;
  position: relative;
  min-width: calc(var(--song-fret-lbl) + 25 * var(--song-fret-column) + 24 * var(--song-fret-gap) + 16px);
  border-radius: 0.75rem;
  border: 1px solid rgb(38, 38, 38);
  background-color: rgba(23, 23, 23, 0.35);
  /* Tighter left padding shifts only inner staff left; frame stays put */
  padding: 12px 12px 22px 6px;
}
.song-fret-ruler,
.song-fret-row {
  display: grid;
  grid-template-columns: var(--song-fret-lbl) repeat(25, var(--song-fret-column));
  column-gap: var(--song-fret-gap);
  align-items: center;
}
.song-fret-neck {
  position: relative;
  margin-top: 4px;
  isolation: isolate;
}
.song-fret-caret-col {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.34);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.song-fret-ruler {
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(38, 38, 38);
  justify-items: center;
}
.song-fret-ruler-spacer {
  display: block;
  justify-self: stretch;
}
.song-fret-ruler-n {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(163, 163, 163, 0.95);
  text-align: center;
  line-height: 1.1;
}
.song-fret-open {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  font-weight: 600;
  color: rgba(212, 212, 212, 0.48);
  text-align: right;
  padding-right: 4px;
  user-select: none;
}
/* Fret columns + inlays sit behind all string rows (real neck spacing). */
.song-fret-fretlines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--song-fret-lbl) repeat(25, var(--song-fret-column));
  column-gap: var(--song-fret-gap);
  align-items: stretch;
  z-index: 0;
  pointer-events: none;
}
.song-fret-fretlines-spacer {
  grid-column: 1;
}
.song-fret-fretlines-cell {
  position: relative;
  border-right: 1px solid rgba(64, 64, 64, 0.55);
}
.song-fret-fretlines-cell[data-fretline='0'] {
  border-right: 1px solid rgba(212, 212, 212, 0.22);
}
/* Legacy: inlays moved to `.song-fret-inlays-rail` under the neck. */
.song-fret-fretlines-cell.is-inlay::after {
  display: none;
}
.song-fret-inlays-rail {
  display: grid;
  grid-template-columns: var(--song-fret-lbl) repeat(25, var(--song-fret-column));
  column-gap: var(--song-fret-gap);
  align-items: center;
  justify-items: center;
  margin-top: 6px;
  padding-top: 4px;
  min-height: 14px;
  border-top: 1px solid rgba(48, 48, 48, 0.9);
  pointer-events: none;
}
.song-fret-inlays-spacer {
  grid-column: 1;
  justify-self: stretch;
}
.song-fret-inlays-cell {
  position: relative;
  width: 100%;
  min-height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.song-fret-inlays-cell.has-inlay:not(.has-inlay--double)::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.88);
  box-shadow: 0 0 0 1px rgba(24, 24, 27, 0.5);
}
.song-fret-inlays-cell.has-inlay--double {
  flex-direction: column;
  gap: 2px;
  min-height: 14px;
}
.song-fret-inlays-cell.has-inlay--double::before,
.song-fret-inlays-cell.has-inlay--double::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.88);
  box-shadow: 0 0 0 1px rgba(24, 24, 27, 0.45);
  flex-shrink: 0;
}
.song-fret-row {
  position: relative;
  z-index: 1;
  padding: 2px 0;
  justify-items: center;
}
.song-fret-row .song-fret-open {
  justify-self: end;
}
.song-fret-row::after {
  content: '';
  position: absolute;
  left: calc(var(--song-fret-lbl) + var(--song-fret-gap));
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(167, 139, 250, 0.78);
  box-shadow: 0 0 0 0.5px rgba(168, 85, 247, 0.25);
  border-radius: 1px;
  pointer-events: none;
  z-index: 0;
}
.song-fret-row + .song-fret-row {
  margin-top: 0;
}
.song-fret-node {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: var(--song-fret-node-size);
  height: var(--song-fret-node-size);
  min-width: var(--song-fret-node-size);
  min-height: var(--song-fret-node-size);
  flex: 0 0 var(--song-fret-node-size);
  aspect-ratio: 1 / 1;
  max-width: none;
  border-radius: 999px;
  border: 1px solid rgba(48, 48, 54, 0.98);
  background-color: rgb(38, 38, 44);
  color: rgba(248, 250, 252, 0.96);
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.song-fret-node:hover {
  border-color: rgba(58, 58, 66, 0.98);
  background-color: rgb(46, 46, 52);
}
.song-fret-node--open {
  border-color: rgba(44, 44, 50, 0.98);
  background-color: rgb(34, 34, 40);
}
.song-fret-node-lbl {
  position: relative;
  z-index: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.song-fret-node.is-tab-note {
  background-color: rgb(168, 85, 247) !important;
  border-color: rgb(168, 85, 247) !important;
  color: rgb(250, 250, 250) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}
.song-fret-node.is-tab-note:hover {
  background-color: rgb(192, 132, 252) !important;
  border-color: rgb(192, 132, 252) !important;
  color: rgb(253, 250, 255) !important;
}
.song-tab-below-fret {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 10px;
  padding: 0;
  max-width: 100%;
}
.song-tab-techniques-block {
  margin-top: 14px;
  padding: 0;
  border: none;
  background: transparent;
}

/* Tabs pane: Tools + Techniques в одну линию на десктопе / широком планшете; две строки на узком */
@media (min-width: 768px) {
  .song-tab-below-fret {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 20px;
  }
  .song-tab-techniques-block {
    margin-top: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  .song-tab-dock-labeled {
    flex: 0 1 auto;
    min-width: 0;
  }
}

.song-tab-fx-rail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(163, 163, 163, 0.88);
  margin: 0 0 8px;
  padding: 0;
}
.song-tab-fx-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px 8px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  max-width: 100%;
}
.song-tab-bottom-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 6px 0 0;
  border: none;
  background: none;
  box-shadow: none;
  width: auto;
  max-width: 100%;
}
.song-tab-dock-btn {
  box-sizing: border-box;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.4);
  color: rgba(212, 212, 212, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.song-tab-dock-btn:hover {
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.55);
  color: #fff;
}
.song-tab-dock-ico {
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.song-tab-dock-btn svg {
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.song-tab-dock-btn svg,
.song-tab-dock-btn svg * {
  stroke-width: 2.25;
}
.song-tab-drag-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
  display: none;
}
.song-tab-drag-overlay.is-visible {
  display: block;
}
.song-tab-drag-overlay.is-committed {
  display: block;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.32);
}
.song-tab-playhead-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
  display: none;
}
.song-tab-playhead-overlay.is-visible {
  display: block;
}
.song-tab-hover-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
  display: none;
}
.song-tab-hover-overlay.is-visible {
  display: block;
}
.song-tab-rail-ico,
.song-tab-rail-btn svg {
  pointer-events: none;
}
.song-tab-sel-pop {
  position: fixed;
  z-index: 220;
  display: none;
  flex-direction: row;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.95);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.song-tab-sel-pop.is-visible {
  display: flex;
}
.song-tab-sel-more-pop {
  position: fixed;
  z-index: 221;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.song-tab-sel-more-pop.is-visible {
  display: flex;
}
.song-tab-sel-more-pop button {
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.5);
  color: rgba(212, 212, 212, 0.95);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
}
.song-tab-sel-more-pop button:hover {
  border-color: rgb(64, 64, 64);
  color: #fff;
}
.song-tab-sel-pop button {
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.5);
  color: rgba(212, 212, 212, 0.95);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
}
.song-tab-sel-pop button:hover {
  border-color: rgb(64, 64, 64);
  color: #fff;
}
.song-tab-fx-key {
  box-sizing: border-box;
  min-width: 56px;
  height: auto;
  min-height: 44px;
  padding: 6px 10px 7px;
  border-radius: 0.375rem;
  border: 1px solid rgb(38, 38, 38);
  background: rgba(23, 23, 23, 0.55);
  color: rgba(248, 250, 252, 0.96);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
}
.song-tab-fx-key-main {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.song-tab-fx-key-sub {
  font-size: 9px;
  font-weight: 500;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.02em;
  color: rgba(163, 163, 163, 0.92);
  text-transform: lowercase;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.song-tab-fx-key:hover {
  border-color: rgb(64, 64, 64);
  background: rgba(38, 38, 38, 0.65);
  color: #fff;
}
.song-tab-fx-key:hover .song-tab-fx-key-sub {
  color: rgba(212, 212, 212, 0.95);
}
.song-tab-fx-key:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 2px rgba(10, 10, 10, 0.85),
    0 0 0 4px rgba(168, 85, 247, 0.35);
}
@media (max-width: 640px) {
  .song-tab-fx-rail {
    justify-content: flex-start;
  }
}

/* Footer */
footer {
  border-top: 1px solid rgba(38, 38, 38, 0.6);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  #sidebar {
    margin-bottom: var(--spacing-md);
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card-actions {
    flex-wrap: wrap;
  }
  
  .card-action-btn {
    height: 2.25rem;
    width: 2.25rem;
    padding: 0.5rem;
  }
  
  .card-action-btn i,
  .card-action-btn [data-lucide] {
    width: 1.125rem !important;
    height: 1.125rem !important;
  }

  /* Do not let Compact link-row shrink icons on small screens */
  .chord-card--compact .chord-link-row .card-action-btn svg,
  .chord-card--compact .chord-link-row .card-action-btn [data-lucide] {
    width: 1.05rem !important;
    height: 1.05rem !important;
  }
  
  .chord-card {
    padding: var(--spacing-sm);
  }
}

/* Print Styles */
@media print {
  .nav-tab,
  .btn-primary,
  .btn-secondary,
  .card-action-btn,
  #sidebar,
  footer {
    display: none !important;
  }
  
  .chord-card {
    break-inside: avoid;
    border: 1px solid #000;
    background: white;
    color: black;
  }
  
  .diagram-container {
    background: white;
    border: 1px solid #000;
  }
}

/* Fallback для заголовков */
.chord-name,
#resultsTitle,
.modal-header h3,
#library h2,
#library h3,
#community h2,
#community h3,
#groupView h1,
#groupView h2 {
  font-family: 'SoehneBreit', 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Отступ от хедера и меню до контента */
main {
  padding-top: 2.25rem !important;
}
@media (max-width: 767px) {
  main {
    padding-top: 0.65rem !important;
  }
}
.generator-top {
  padding-top: 1.75rem;
}
@media (min-width: 768px) {
  .generator-top {
    padding-top: 2rem;
  }
}

/* Burger menu: без фиолетовой полосы под пунктами (как в Riffkiller) */
#mobileMenuPanel .nav-tab.active::after {
  display: none !important;
}
#mobileMenuPanel .nav-tab.active {
  background: none !important;
}

/* Мобильный и планшет: логотип одинаковый, уменьшенный */
.mobile-logo {
  height: 1.5rem;
  width: auto;
  min-height: 24px;
  object-fit: contain;
}
@media (min-width: 768px) {
  .mobile-logo {
    display: none !important;
  }
}
/* Планшет: десктопный логотип уменьшен */
@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-logo {
    height: 1.25rem !important;
  }
}

/* Filter icon: 3 lines → 1 line при сворачивании */
.controls-toggle-btn .filter-line {
  transition: transform 0.22s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.22s ease;
}
.controls-toggle-btn.controls-collapsed .filter-line-top {
  transform: translateY(6px);
  opacity: 0;
}
.controls-toggle-btn.controls-collapsed .filter-line-bottom {
  transform: translateY(-6px);
  opacity: 0;
}
.controls-toggle-btn.controls-collapsed .filter-line-mid {
  opacity: 1;
}

/* Generator: анимация Hide/Show controls */
/* Desktop: grid columns анимируются — диаграммы плавно смещаются влево */
@media (min-width: 768px) {
  #generatorGrid {
    transition: grid-template-columns 520ms cubic-bezier(0.16, 1.15, 0.3, 1), column-gap 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  #generatorGrid.controls-collapsed {
    grid-template-columns: 0 1fr;
    column-gap: 0;
  }
  #controlsBlock {
    overflow: hidden;
  }
  #controlsBlock.controls-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }
}

/* Full Neck panel: аккуратное выравнивание и анимации */
#generatorResults {
  min-width: 0;
}

/* Loading skeletons: not a black void; works in light + dark */
#cards.chord-results--loading {
  display: grid;
  min-height: 12rem;
  align-content: start;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  #cards.chord-results--loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  #cards.chord-results--loading {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  #cards.chord-results--loading {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.chord-skeleton-card {
  border-radius: 0.75rem;
  border: 1px solid rgba(64, 64, 64, 0.45);
  background: rgba(23, 23, 23, 0.5);
  padding: 0.75rem;
  min-height: 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  box-sizing: border-box;
}
html[data-theme='light'] .chord-skeleton-card {
  border-color: rgba(203, 213, 225, 0.75);
  background: rgba(248, 250, 252, 0.9);
}
.chord-skeleton-card__header,
.chord-skeleton-card__title,
.chord-skeleton-card__diagram {
  border-radius: 0.25rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(64, 64, 64, 0.18) 0%, rgba(64, 64, 64, 0.28) 40%, rgba(64, 64, 64, 0.18) 80%);
  background-size: 200% 100%;
  animation: chordSkeletonShimmer 1.1s ease-in-out infinite;
}
html[data-theme='light'] .chord-skeleton-card__header,
html[data-theme='light'] .chord-skeleton-card__title,
html[data-theme='light'] .chord-skeleton-card__diagram {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.2) 0%, rgba(148, 163, 184, 0.32) 45%, rgba(148, 163, 184, 0.2) 80%);
  background-size: 200% 100%;
  animation: chordSkeletonShimmer 1.1s ease-in-out infinite;
}
.chord-skeleton-card__header {
  height: 0.5rem;
  width: 38%;
  align-self: flex-end;
  opacity: 0.9;
}
.chord-skeleton-card__title {
  height: 1.25rem;
  width: 58%;
  opacity: 0.85;
}
.chord-skeleton-card__diagram {
  flex: 1;
  min-height: 4.5rem;
  width: 100%;
  border-radius: 0.5rem;
  opacity: 0.7;
}
@keyframes chordSkeletonShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Compact / Dense: reliable taps on mobile */
.compact-toggle-btn,
.density-toggle-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Align main tab toolbars / titles so pages don’t jump vertically */
#tabbuilder .mb-2.w-full,
#resultsToolbar.results-toolbar {
  min-height: 2.75rem;
}
#tabbuilder .mb-2.w-full > .flex {
  min-height: 2.75rem;
  align-items: center;
}
#resultsToolbar.results-toolbar {
  align-items: center;
}

.full-neck-panel {
  width: 100%;
  align-self: stretch;
  overflow: hidden;
  will-change: transform, opacity, max-height;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

#resultsToolbar {
  width: 100%;
  min-width: 0;
}

#generatorGrid.full-neck-active #generatorResults {
  transition: transform 520ms cubic-bezier(0.16, 1.15, 0.3, 1);
}

#generatorGrid.full-neck-active #cards {
  margin-top: 1rem;
}

/* Full Neck (mobile): remove dark panel feel, shift fretboard left,
   and fade out right edge into page background. */
@media (max-width: 768px) {
  .full-neck-panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #tablatureDiagram {
    position: relative;
    margin-left: -10px;
    padding-right: 12px;
    overflow: hidden;
  }

  #tablatureDiagram::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, rgb(10 10 10) 0%, rgba(10, 10, 10, 0) 100%);
  }
  html[data-theme='light'] #tablatureDiagram::after {
    background: linear-gradient(to left, rgba(248, 250, 252, 1) 0%, rgba(248, 250, 252, 0) 100%) !important;
  }
}

/*
 * Compact: denser grid — same breakpoints as Tailwind on #cards
 * (1→2, sm 2→3, lg 3→4, xl 4→5) so more diagrams fit per row.
 */
#cards.chord-results--compact {
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  #cards.chord-results--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #cards.chord-results--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  #cards.chord-results--compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Library group view: denser grid when Compact is on */
#groupChordsContainer.group-chords-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 640px) {
  #groupChordsContainer.group-chords-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #groupChordsContainer.group-chords-grid--compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1536px) {
  #groupChordsContainer.group-chords-grid--compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  /* Library group: одна колонка на мобилке, кнопка Expand */
  #groupChordsContainer.group-chords-grid--mobile-expanded {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Mobile: не обрезать верхние скругления — отступ сверху и overflow */
  #generator.tab-content,
  #generatorLayout,
  #generatorGrid {
    overflow: visible !important;
  }
  #generatorLayout.generator-top {
    padding-top: 0.5rem !important;
  }
  main,
  section#generator {
    overflow: visible !important;
  }
  #controlsBlock {
    max-height: 700px;
    transition: max-height 0.28s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.28s ease;
    overflow: visible !important;
  }
  #controlsBlock.controls-collapsed {
    max-height: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }
  /* Карточки плавно поднимаются при скрытии контролов */
  #generatorResults {
    transition: margin-top 0.28s cubic-bezier(0.33, 1, 0.68, 1);
  }
  /* Mobile: фильтр и карточки на всю ширину, карточки по центру */
  #generatorLayout {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
  }
  #generatorGrid {
    width: 100%;
    max-width: 100%;
  }
  #controlsBlock {
    width: 100% !important;
    max-width: 100% !important;
  }
  #generatorGrid #cards {
    width: 100%;
    justify-items: stretch;
  }
  #generatorGrid #cards .chord-card {
    width: 100%;
    min-width: 0;
  }
  /* Mobile: не обрезать верхние скругления блока фильтров */
  #generator.tab-content,
  #generatorLayout,
  #generatorGrid {
    overflow: visible !important;
  }
  #controlsBlock {
    overflow: visible !important;
  }
  #controlsBlock.controls-collapsed {
    overflow: hidden !important;
  }
}

/* Cover image editor (library modals) */
.cover-image-editor-stage {
  cursor: grab;
}
.cover-image-editor-stage:active {
  cursor: grabbing;
}

/* Chord chart grid editor (+ bar / bar options popover) */
.chart-grid-ui-menu {
  position: fixed;
  z-index: 10050;
  min-width: 200px;
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(64 64 64);
  background-color: rgb(23 23 23);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}
.chart-grid-ui-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 0.35rem;
  font-size: 0.8125rem;
  color: rgb(229 229 229);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.chart-grid-ui-menu-item:hover {
  background-color: rgba(64, 64, 64, 0.55);
  color: rgb(250 250 250);
}

/* ===== Light theme hard overrides (pass 2) ===== */
html[data-theme='light'] .modal-content,
html[data-theme='light'] #profileModal .modal-content,
html[data-theme='light'] #nodeConstructorModal .modal-content,
html[data-theme='light'] #chordCatalogModal .modal-content {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.58) !important;
  color: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme='light'] #profileModal .profile-modal__header {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: rgba(148, 163, 184, 0.58) !important;
}

html[data-theme='light'] .site-header,
html[data-theme='light'] .site-header__bar,
html[data-theme='light'] .site-header__middle,
html[data-theme='light'] .site-header__nav {
  color: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme='light'] .site-header a,
html[data-theme='light'] .site-header button,
html[data-theme='light'] .nav-tab,
html[data-theme='light'] .site-header__inline-actions button,
html[data-theme='light'] .profile-tab,
html[data-theme='light'] .mobile-drawer__nav-item,
html[data-theme='light'] .song-tab-toolbar-btn,
html[data-theme='light'] .song-tab-dock-btn,
html[data-theme='light'] .song-tab-fx-key,
html[data-theme='light'] .song-tab-rail-btn,
html[data-theme='light'] .card-action-btn,
html[data-theme='light'] .compact-toggle-btn,
html[data-theme='light'] .density-toggle-btn,
html[data-theme='light'] .tablature-toggle-btn {
  color: rgba(15, 23, 42, 0.9) !important;
}

/* Reverse hover for light mode: text becomes lighter, not darker */
html[data-theme='light'] .site-header a:hover,
html[data-theme='light'] .site-header button:hover,
html[data-theme='light'] .nav-tab:hover,
html[data-theme='light'] .profile-tab:hover,
html[data-theme='light'] .mobile-drawer__nav-item:hover,
html[data-theme='light'] .song-tab-toolbar-btn:hover,
html[data-theme='light'] .song-tab-dock-btn:hover,
html[data-theme='light'] .song-tab-fx-key:hover,
html[data-theme='light'] .song-tab-rail-btn:hover,
html[data-theme='light'] .card-action-btn:hover,
html[data-theme='light'] .compact-toggle-btn:hover,
html[data-theme='light'] .density-toggle-btn:hover,
html[data-theme='light'] .tablature-toggle-btn:hover {
  color: rgba(15, 23, 42, 0.72) !important;
}

html[data-theme='light'] .song-tab-fretboard-wrap,
html[data-theme='light'] .song-tab-staff-wrap,
html[data-theme='light'] .song-tab-bottom-dock,
html[data-theme='light'] .song-tab-fx-rail,
html[data-theme='light'] .tab-fretboard,
html[data-theme='light'] #controlsBlock,
html[data-theme='light'] #generatorGrid #cards .chord-card {
  background: #f8fafc !important;
}

html[data-theme='light'] .tab-builder-pro {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.62);
}
html[data-theme='light'] .tab-builder-pro__toolbar {
  border-bottom-color: rgba(148, 163, 184, 0.55);
}
html[data-theme='light'] .tab-builder-pro__help {
  background: rgba(241, 245, 249, 0.75);
  border-bottom-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='light'] .tab-builder-pro__help > summary {
  color: rgba(30, 41, 59, 0.92);
}
html[data-theme='light'] .tab-builder-pro__help-body {
  color: rgba(71, 85, 105, 0.92);
}
html[data-theme='light'] .tab-builder-pro__status {
  color: rgba(71, 85, 105, 0.9);
}
html[data-theme='light'] .tab-builder-pro__status--inline {
  color: rgba(71, 85, 105, 0.9);
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__preview-stack {
  background: var(--tb-chrome-rail-surface, rgba(248, 250, 252, 0.9));
  border-color: var(--tb-chrome-border-soft, rgba(15, 23, 42, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__preview-hint {
  color: rgba(71, 85, 105, 0.92);
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__preview-hint strong {
  color: rgba(15, 23, 42, 0.94);
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__preview-stack .tab-builder-pro__status--preview {
  color: rgba(71, 85, 105, 0.9);
  border-top-color: var(--tb-chrome-border-soft, rgba(15, 23, 42, 0.1));
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__textarea.input {
  border-color: var(--tb-chrome-border, rgba(15, 23, 42, 0.14)) !important;
  background: var(--tb-chrome-surface-float, rgba(255, 255, 255, 0.94)) !important;
  color: rgba(15, 23, 42, 0.92);
}
html[data-theme='light'] #tabbuilder .tab-builder-pro--source-open .tab-builder-pro__source-wrap {
  background: var(--tb-chrome-rail-surface, rgba(248, 250, 252, 0.9));
}
html[data-theme='light'] #tabbuilder .tab-builder-pro__source-label {
  color: rgba(51, 65, 85, 0.9);
}
html[data-theme='light'] .tab-builder-pro__preview-hint {
  color: rgba(71, 85, 105, 0.92);
  background: rgba(248, 250, 252, 0.88);
  border-color: rgba(148, 163, 184, 0.5);
}
html[data-theme='light'] .tab-builder-pro__preview-hint strong {
  color: rgba(30, 41, 42, 0.95);
}
html[data-theme='light'] .tab-builder-pro__status--preview {
  color: rgba(71, 85, 105, 0.9);
}
html[data-theme='light'] .tab-builder-pro__bottom-bar {
  background: rgba(248, 250, 252, 0.78);
  border-bottom-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='light'] .tab-builder-pro__help--dock > summary {
  color: rgba(71, 85, 105, 0.92);
}
html[data-theme='light'] .tab-builder-pro__help--dock .tab-builder-pro__help-body {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(71, 85, 105, 0.92);
}
html[data-theme='light'] .tab-builder-pro__editbar--inspector {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.9) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='light'] .tab-builder-pro__tech-rail {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.72);
}
html[data-theme='light'] .tab-builder-pro__tech-rail-title {
  color: rgba(51, 65, 85, 0.92);
}
html[data-theme='light'] .tab-builder-pro__tech-rail-hint {
  color: rgba(100, 116, 139, 0.85);
}
html[data-theme='light'] .tab-builder-pro__inline-label {
  color: rgba(100, 116, 139, 0.9);
}
html[data-theme='light'] .tab-builder-pro__segmented {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(248, 250, 252, 0.9);
}
html[data-theme='light'] .tab-builder-pro__segmented .tab-builder-pro__seg-btn + .tab-builder-pro__seg-btn {
  border-left-color: rgba(148, 163, 184, 0.55) !important;
}
html[data-theme='light'] #tabbuilder #tabBuilderProPanel .song-tab-beat-denom-bar {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(148, 163, 184, 0.55);
}
html[data-theme='light'] #tabbuilder #tabBuilderProPanel #tabBuilderProMeterSelect {
  border-color: rgba(148, 163, 184, 0.6) !important;
  background: rgba(248, 250, 252, 0.92) !important;
  color: rgba(15, 23, 42, 0.92) !important;
}
html[data-theme='light'] .tab-builder-pro__metric-label {
  color: rgba(100, 116, 139, 0.9);
}
html[data-theme='light'] .tab-builder-pro__status.is-error {
  color: rgba(185, 28, 28, 0.92);
}
html[data-theme='light'] .tab-builder-pro__canvas {
  background: #eceff3;
}
html[data-theme='light'] #tabBuilderProContainer {
  color: rgb(15, 23, 42) !important;
}
html[data-theme='light'] .tab-builder-pro__canvas .at-highlight {
  fill: rgba(250, 204, 21, 0.38) !important;
}
html[data-theme='light'] .tab-builder-pro__editbar {
  background: rgba(241, 245, 249, 0.85);
  border-bottom-color: rgba(148, 163, 184, 0.45);
}
html[data-theme='light'] .tab-builder-pro__snippets-label {
  color: rgba(100, 116, 139, 0.92);
}
html[data-theme='light'] .tab-builder-pro__note-card {
  border-color: rgba(148, 163, 184, 0.58);
  background: radial-gradient(120% 80% at 10% 0%, rgba(167, 139, 250, 0.1) 0%, transparent 55%), rgba(255, 255, 255, 0.88);
}
html[data-theme='light'] .tab-builder-pro__field-label {
  color: rgba(100, 116, 139, 0.95);
}
html[data-theme='light'] .tab-builder-pro__selection-label {
  color: rgba(76, 29, 149, 0.9);
}
html[data-theme='light'] .tab-builder-pro__stepper {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(248, 250, 252, 0.85);
}
html[data-theme='light'] .tab-builder-pro__stepper-value {
  color: rgba(30, 41, 59, 0.92);
}
html[data-theme='light'] .tab-builder-pro__click-marker {
  background: rgba(124, 58, 237, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 8px rgba(124, 58, 237, 0.28);
}
html[data-theme='light'] .tab-builder-pro__canvas .tab-builder-pro-note-selected {
  fill: rgba(124, 58, 237, 0.95) !important;
  stroke: rgba(255, 255, 255, 0.96) !important;
}
html[data-theme='light'] .tab-builder-pro__source-wrap {
  border-bottom-color: rgba(148, 163, 184, 0.55);
}
html[data-theme='light'] .tab-builder-pro__command-palette {
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(248, 250, 252, 0.94);
}
html[data-theme='light'] .tab-builder-pro__command-item {
  border-color: rgba(148, 163, 184, 0.58);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(30, 41, 59, 0.94);
}
html[data-theme='light'] .tab-builder-pro__command-item-desc {
  color: rgba(100, 116, 139, 0.95);
}
html[data-theme='light'] .tab-builder-pro__command-group-title {
  color: rgba(100, 116, 139, 0.92);
}
html[data-theme='light'] .tab-builder-pro__command-item:hover,
html[data-theme='light'] .tab-builder-pro__command-item.is-active {
  border-color: rgba(124, 58, 237, 0.58);
  background: rgba(237, 233, 254, 0.85);
}
html[data-theme='light'] .tab-builder-pro__source-label {
  color: rgba(71, 85, 105, 0.88);
}

html[data-theme='light'] .song-tab-ref-cell.is-empty::before {
  background: rgba(15, 23, 42, 0.28) !important;
}

html[data-theme='light'] .song-tab-ref-cell.song-tab-ref-cell--bar-before::after {
  background: rgba(15, 23, 42, 0.32) !important;
}

html[data-theme='light'] .song-tab-ref-pm-label {
  color: rgba(51, 65, 85, 0.88);
}
html[data-theme='light'] .song-tab-ref-pm-line {
  border-bottom-color: rgba(100, 116, 139, 0.55);
}

html[data-theme='light'] .song-tab-beat-denom-bar {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(148, 163, 184, 0.55);
}
html[data-theme='light'] .song-tab-beat-denom-btn {
  color: rgba(71, 85, 105, 0.55);
}
html[data-theme='light'] .song-tab-beat-denom-btn:hover {
  color: rgba(15, 23, 42, 0.92);
  background: rgba(241, 245, 249, 0.95) !important;
}
html[data-theme='light'] .song-tab-beat-denom-btn[aria-pressed='true'],
html[data-theme='light'] .song-tab-beat-denom-btn.song-tab-beat-denom-btn--active {
  color: rgb(76, 29, 149);
  background: rgba(237, 233, 254, 0.95) !important;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55);
}

html[data-theme='light'] .song-tab-toolbar-btn.song-tab-toolbar-btn--on {
  border-color: rgba(124, 58, 237, 0.55) !important;
  background: rgba(221, 214, 254, 0.65) !important;
  color: rgba(76, 29, 149, 0.95) !important;
}

html[data-theme='light'] #sidebar {
  background: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.62) !important;
}

/* Light theme: Tab Builder lower fretboard must be fully inverted */
html[data-theme='light'] .song-fret-editor {
  background: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.62) !important;
}

html[data-theme='light'] .song-fret-ruler {
  border-bottom-color: rgba(148, 163, 184, 0.62) !important;
}

html[data-theme='light'] .song-fret-ruler-n,
html[data-theme='light'] .song-fret-open {
  color: rgba(15, 23, 42, 0.62) !important;
}

html[data-theme='light'] .song-fret-fretlines-cell {
  border-right-color: rgba(148, 163, 184, 0.5) !important;
}

html[data-theme='light'] .song-fret-fretlines-cell[data-fretline='0'] {
  border-right-color: rgba(71, 85, 105, 0.35) !important;
}

html[data-theme='light'] .song-fret-row::after {
  background: rgba(139, 92, 246, 0.55) !important;
  box-shadow: 0 0 0 0.5px rgba(139, 92, 246, 0.28) !important;
}

html[data-theme='light'] .song-fret-inlays-rail {
  border-top-color: rgba(148, 163, 184, 0.55) !important;
}

html[data-theme='light'] .song-fret-inlays-cell.has-inlay:not(.has-inlay--double)::after {
  background: rgba(124, 58, 237, 0.78) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) !important;
}

html[data-theme='light'] .song-fret-inlays-cell.has-inlay--double::before,
html[data-theme='light'] .song-fret-inlays-cell.has-inlay--double::after {
  background: rgba(124, 58, 237, 0.78) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.88) !important;
}

html[data-theme='light'] .song-fret-node {
  background-color: #cbd5e1 !important;
  border-color: rgba(71, 85, 105, 0.45) !important;
  color: rgba(15, 23, 42, 0.92) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

html[data-theme='light'] .song-fret-node:hover {
  background-color: #d8dee9 !important;
  border-color: rgba(71, 85, 105, 0.55) !important;
}

html[data-theme='light'] .song-fret-node--open {
  background-color: #bdc7d4 !important;
}

html[data-theme='light'] .song-fret-node.is-tab-note {
  background-color: rgb(139, 92, 246) !important;
  border-color: rgb(139, 92, 246) !important;
  color: rgb(255, 255, 255) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32) !important;
}

html[data-theme='light'] .song-fret-node.is-tab-note:hover {
  background-color: rgb(167, 139, 250) !important;
  border-color: rgb(167, 139, 250) !important;
}

html[data-theme='light'] .song-tab-fx-key,
html[data-theme='light'] .song-tab-fx-key:hover,
html[data-theme='light'] .song-tab-fx-key:focus-visible {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.68) !important;
  color: rgba(15, 23, 42, 0.9) !important;
  box-shadow: none !important;
}

/* Light theme: controls, toggles, pills and buttons must be consistent */
html[data-theme='light'] .btn-secondary,
html[data-theme='light'] .btn-primary,
html[data-theme='light'] .compact-toggle-btn,
html[data-theme='light'] .density-toggle-btn,
html[data-theme='light'] .tablature-toggle-btn,
html[data-theme='light'] .controls-toggle-btn,
html[data-theme='light'] .mobile-drawer__nav-item,
html[data-theme='light'] .accordion-header {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.68) !important;
  color: rgba(15, 23, 42, 0.9) !important;
  box-shadow: none !important;
}

html[data-theme='light'] .btn-secondary:hover,
html[data-theme='light'] .btn-primary:hover,
html[data-theme='light'] .compact-toggle-btn:hover,
html[data-theme='light'] .density-toggle-btn:hover,
html[data-theme='light'] .tablature-toggle-btn:hover,
html[data-theme='light'] .controls-toggle-btn:hover,
html[data-theme='light'] .mobile-drawer__nav-item:hover,
html[data-theme='light'] .accordion-header:hover {
  background: #f8fafc !important;
  color: rgba(15, 23, 42, 0.72) !important;
}

html[data-theme='light'] #controlsBlock label.flex.items-center.gap-2.p-2.rounded-md {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.62) !important;
}

html[data-theme='light'] #controlsBlock input.peer + span {
  background: #e2e8f0 !important;
  outline-color: rgba(148, 163, 184, 0.68) !important;
}

html[data-theme='light'] #controlsBlock input.peer:checked + span {
  background: rgba(139, 92, 246, 0.24) !important;
}

html[data-theme='light'] #controlsBlock input.peer + span > span {
  background: #ffffff !important;
  top: 1px !important;
  left: 1px !important;
}

html[data-theme='light'] #controlsBlock input.peer:checked + span > span {
  transform: translateX(11px) !important;
}

html[data-theme='light'] #controlsBlock [class*='bg-neutral-900'],
html[data-theme='light'] #controlsBlock [class*='bg-neutral-800'] {
  background-color: #ffffff !important;
}

html[data-theme='light'] #controlsBlock [class*='text-neutral-200'],
html[data-theme='light'] #controlsBlock [class*='text-neutral-300'],
html[data-theme='light'] #controlsBlock [class*='text-neutral-400'] {
  color: rgba(15, 23, 42, 0.9) !important;
}
