.song-sheet-editor-page {
  --song-sheet-editor-surface: var(--jm-surface-bg, var(--bs-card-bg));
  --song-sheet-editor-raised: var(--jm-surface-raised, var(--bs-card-bg));
  --song-sheet-editor-muted: var(--jm-surface-muted, var(--bs-tertiary-bg));
  --song-sheet-editor-border: var(--jm-border-soft, var(--bs-border-color));
  --song-sheet-editor-shadow: var(--jm-shadow-lifted, var(--jm-shadow-soft));
  max-width: 1800px;
}

.song-sheet-document__eyebrow {
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.song-sheet-workspace {
  overflow: hidden;
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 1.1rem;
  background: var(--song-sheet-editor-surface);
  box-shadow: var(--song-sheet-editor-shadow);
}

.song-sheet-workspace__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--song-sheet-editor-border);
}

.song-sheet-workspace__identity {
  display: grid;
  grid-template-columns: minmax(10rem, 0.65fr) minmax(14rem, 1fr);
  min-width: 0;
  flex: 1;
  gap: 0.75rem;
}

.song-sheet-workspace__identity .form-control {
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 0.65rem;
  background: var(--song-sheet-editor-raised);
  box-shadow: none;
}

.song-sheet-workspace__identity .form-control:hover {
  border-color: color-mix(in srgb, var(--bs-primary) 45%, var(--song-sheet-editor-border));
}

.song-sheet-workspace__identity .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary) 18%, transparent);
}

.song-sheet-workspace__artist {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
  font-weight: 700;
}

.song-sheet-workspace__title {
  font-size: 1.15rem;
  font-weight: 700;
}

.song-sheet-workspace__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.song-sheet-visibility {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.song-sheet-visibility .form-check.form-switch {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.song-sheet-visibility .song-sheet-visibility__input {
  width: 2.65rem;
  height: 1.45rem;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
  border-color: color-mix(in srgb, var(--bs-secondary-color) 55%, transparent);
}

.song-sheet-visibility .song-sheet-visibility__input:checked {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}

.song-sheet-visibility__label {
  margin: 0;
  cursor: pointer;
  line-height: 1.1;
}

.song-sheet-visibility__state {
  padding-left: 0.55rem;
  border-left: 1px solid var(--song-sheet-editor-border);
  color: var(--bs-secondary-color);
  font-size: 0.68rem;
  font-weight: 600;
}

.song-sheet-workspace__meta {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) repeat(3, minmax(6rem, 0.55fr));
  gap: 1px;
  border-bottom: 1px solid var(--song-sheet-editor-border);
  background: var(--song-sheet-editor-border);
}

.song-sheet-workspace__meta > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: var(--song-sheet-editor-muted);
}

.song-sheet-workspace__meta label {
  margin: 0;
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.song-sheet-workspace__meta .form-control,
.song-sheet-workspace__meta .form-select {
  min-height: 2rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border: 0;
  background-color: transparent;
  box-shadow: none;
}

.song-sheet-workspace__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 64vh;
}

.song-sheet-document,
.song-sheet-output {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.song-sheet-document {
  border-right: 1px solid var(--song-sheet-editor-border);
}

.song-sheet-document__toolbar,
.song-sheet-output__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--song-sheet-editor-border);
  background: var(--song-sheet-editor-muted);
}

.song-sheet-document__snippets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.song-sheet-document__snippets button {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 0.5rem;
  background: var(--song-sheet-editor-raised);
  color: var(--bs-body-color);
  font-size: 0.76rem;
}

.song-sheet-document__snippets button:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.song-sheet-document__syntax-help {
  display: flex;
  gap: 0.85rem;
  padding: 0.55rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--song-sheet-editor-border);
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  white-space: nowrap;
}

.song-sheet-document__input.form-control {
  min-height: 64vh;
  flex: 1;
  padding: 1.25rem;
  border: 0;
  border-radius: 0;
  background: var(--song-sheet-editor-raised);
  font-family: "Oxygen Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.94rem;
  line-height: 1.8;
  resize: vertical;
  tab-size: 2;
  box-shadow: none;
}

.song-sheet-document__source {
  min-height: 64vh;
  flex: 1;
  padding: 1.25rem;
  background: var(--song-sheet-editor-raised);
  color: var(--bs-body-color);
}

.song-sheet-source-editor {
  display: grid;
  gap: 0.4rem;
}

.song-sheet-source-editor__hint {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.song-sheet-source-editor__input {
  width: 100%;
  min-height: calc(64vh - 5rem);
  padding: 0.75rem;
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 0.4rem;
  background: transparent;
  color: inherit;
  font-family: "Oxygen Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.94rem;
  line-height: 1.8;
  tab-size: 2;
  resize: vertical;
}

.song-sheet-source-editor__input:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.song-sheet-output {
  background: var(--song-sheet-editor-muted);
}

.song-sheet-output__paper {
  width: min(100% - 2rem, 48rem);
  min-height: calc(64vh - 2rem);
  margin: 1rem auto;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--song-sheet-editor-border);
  border-radius: 0.75rem;
  background: var(--song-sheet-editor-raised);
  box-shadow: var(--song-sheet-editor-shadow);
}

.song-sheet-output__heading {
  display: grid;
  gap: 0.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--song-sheet-editor-border);
}

.song-sheet-output__heading > span {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.song-sheet-output__heading h3 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.song-sheet-output__heading small {
  color: var(--bs-secondary-color);
}

.song-sheet-syntax-preview {
  min-height: 24rem;
  padding-top: 1.25rem;
  font-family: "Oxygen Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.song-sheet-syntax-preview__section {
  margin: 1.35rem 0 0.65rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.song-sheet-syntax-preview__spacer {
  height: 0.8rem;
}

@media (max-width: 991.98px) {
  .song-sheet-workspace__split {
    grid-template-columns: 1fr;
  }

  .song-sheet-document {
    border-right: 0;
    border-bottom: 1px solid var(--song-sheet-editor-border);
  }
}

@media (max-width: 767.98px) {
  .song-sheet-workspace__bar,
  .song-sheet-document__toolbar,
  .song-sheet-output__toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .song-sheet-workspace__identity,
  .song-sheet-workspace__meta {
    grid-template-columns: 1fr;
  }

  .song-sheet-workspace__actions {
    justify-content: space-between;
  }

  .song-sheet-document__snippets {
    justify-content: flex-start;
  }
}
