/* Integration owns workspace geometry; each component owns its inner styles. */
.song-notebook [hidden], .song-notebook[hidden] { display: none !important; }
/* Author display rules must never expose the inactive legacy main. */
main.guitar-chordinator[hidden] { display: none !important; }
#notebook-header { padding-bottom: .75rem; border-bottom: 1px solid var(--music-border); }
.notebook-header-actions { display: flex; flex: 0 0 auto; gap: .5rem; align-items: center; }
.notebook-context-form {
  display: flex; flex-wrap: wrap; align-items: end; gap: .75rem;
  padding: 1rem; margin: .75rem 0; background: var(--music-panel);
  border: 1px solid var(--music-border); border-radius: var(--music-panel-radius);
}
.notebook-context-form label { display: grid; gap: .3rem; min-width: 0; font-size: .875rem; }
.notebook-context-form label:nth-child(2) { flex: 1 1 12rem; }
.song-notebook .notebook-context-form p { flex-basis: 100%; font-size: .85rem; margin-top: .25rem; }
.song-notebook .notebook-header-row { gap: .75rem; }
.song-notebook .notebook-header-row .notebook-title { width: auto; flex: 1 1 12rem; }

.notebook-workspace {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr);
  gap: 1.5rem;
}
.notebook-workspace > *, .notebook-details > * { min-width: 0; }
.notebook-collection { grid-column: 1; grid-row: 1 / span 2; }
.notebook-sections, .notebook-arrangement { grid-column: 2; }
.notebook-details { margin-top: 1.5rem; }
.song-notebook textarea { width: 100%; box-sizing: border-box; }
.song-notebook .notebook-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.song-notebook .notebook-muted { opacity: .65; }
.song-notebook .notebook-error { color: var(--music-error); }
.notebook-header-row, .notebook-song-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .8rem;
}
.notebook-header-row .notebook-title {
  flex: 1 1 14rem;
  min-width: 0;
  width: 100%;
  padding: .35rem .2rem;
  border: 0;
  border-bottom: 1px solid var(--music-border);
  background: transparent;
  font-size: 1.5rem;
  font-weight: 600;
}
.song-notebook select { min-width: 0; }
.song-notebook p { overflow-wrap: anywhere; }
.notebook-menu, .notebook-settings-form {
  padding: 1rem;
  margin: .75rem 0;
  border: 1px solid var(--music-border);
  border-radius: var(--music-panel-radius);
  background: var(--music-panel);
}
.notebook-menu > div { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.notebook-menu > label { display: block; margin: .75rem 0; }
.notebook-settings-form { min-width: 0; }
.song-notebook .notebook-settings-hint { margin: .3rem 0 .85rem; color: var(--music-muted); font-size: .875rem; }
.notebook-settings-preview:empty { display: none; }
.notebook-settings-preview { margin: 1rem 0; padding-top: .75rem; border-top: 1px solid var(--music-border); }
.song-notebook .notebook-settings-preview p { margin: .35rem 0; font-size: .875rem; }
.notebook-settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#notebook-status { min-height: 1.5rem; font-size: .9rem; margin: .7rem 0 1.2rem; }
#notebook-status button { margin: .4rem; }
#notebook-header > textarea { margin: .7rem 0; }
@media (max-width: 799px) {
  .notebook-workspace { display: flex; flex-direction: column; }
  .notebook-sections { order: 0; }
  .notebook-arrangement { order: 1; }
  .notebook-collection { order: 2; }
  .song-notebook .notebook-header-row .notebook-title { flex-basis: calc(100% - 7rem); }
  .notebook-header-actions { flex-basis: 100%; flex-wrap: wrap; }
  .notebook-header-actions button { flex: 1 1 auto; }
  .notebook-context-form { padding: .75rem; }
  .notebook-context-form label { flex: 1 1 8rem; }
  .notebook-settings-form { padding: .75rem; }
  .song-notebook { overflow-wrap: anywhere; }
}

@media print {
  body.song-notebook-active > header, body.song-notebook-active > .logo-readium,
  body.song-notebook-active > footer,
  body.song-notebook-active .guitar-chordinator,
  body.song-notebook-active #song-notebook > :not(#notebook-reading) { display: none !important; }
  body.song-notebook-active, body.song-notebook-active .page-content,
  body.song-notebook-active .wrapper { margin: 0; padding: 0; background: white; }
  body.song-notebook-active .content.song-notebook { max-width: none; margin: 0; padding: 0; }
  body.song-notebook-active #notebook-reading { display: block !important; }
}
