/* ════════════════════════════════════════════════════════════════════
   CHORD ↔ LYRIC SPACING — SINGLE SOURCE OF TRUTH. DO NOT SCATTER.
   ════════════════════════════════════════════════════════════════════
   The vertical relationship between a floating chord and the lyric it
   sits above is defined ONCE here as a RATIO, then inherited by every
   context (screen, mobile, print, plain-text, large/small). Because the
   values are unitless / em-based, they SCALE with whatever font-size each
   context sets — so the proportional look is identical everywhere without
   re-tuning per view.

   Three tokens, three jobs:
     --clh : lyric line-height as a UNITLESS multiplier. This is the
             vertical room each lyric line gets; the chord floats inside
             it. Unitless = scales with font-size automatically.
     --ctop: how high the chord floats above its lyric, in em (relative to
             the chord-text's own font). em = scales with chord size.
     --cfont: chord size relative to lyric (em).

   TO CHANGE THE SPACING ANYWHERE: change it HERE. One value, all views.
   A context that MUST differ overrides ONLY the token (one line), never
   the whole rule. Historically these numbers were hardcoded in ~12 places
   (base, mobile, plain-text, print, large/small) and drifted constantly;
   that is the bug this block exists to prevent. If you find yourself
   typing a raw line-height or chord `top` in a chord rule, STOP — change
   the token instead.

   Canonical values below are the long-standing desktop look.

   PER-THEME / PER-CONTEXT OVERRIDE: a theme or context that needs a
   slightly different ratio overrides ONLY the token in its own scope, e.g.
       .lyric-sheet-container.cp-theme-classic { --ctop: -0.50em; }
       .lyric-sheet-container.cp-theme-industrial { --clh: 1.9; }
   — never by editing the chord/lyric rules themselves. Clean theme uses
   the canonical defaults (it's the unscoped default theme).
   ════════════════════════════════════════════════════════════════════ */
:root {
  --clh: 2.0;       /* lyric line-height multiplier — the real Clean look (3rem ÷ 1.5rem base) */
  --ctop: -0.45em;  /* chord float height above its lyric — tuned on Clean */
  --cfont: 0.85em;  /* chord size relative to lyric */
}

/* Container */
.lyric-sheet-container {
  font-family: Calibri, Arial, sans-serif;
  font-size: 1.5rem; /* Use rem (relative to root <html>) for consistent sizing */
  line-height: 1.5rem; /* Reduced base - lyrics will override */
  margin: 20px 0;
  position: relative; /* anchor for the absolutely-positioned section rail */
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
  overflow-x: hidden;
  white-space: normal;
}

/* Injected title plate is hidden by default; only themes that style a plate
   (Industrial / Classic) reveal it. Keeps Clean / unthemed charts unchanged. */
.lyric-title-plate { display: none; }
/* Injected ornament (Industrial registration marks, Classic fleuron corners)
   is hidden by default; each theme reveals only its own. */
.cp-ornament { display: none; }
.cp-theme-industrial .cp-reg { display: block; }
.cp-theme-classic .cp-corner { display: block; }

/* Inline chord spans - default behavior (for lyrics) */
.lyrics span.chord,
.harmonies span.chord,
.style-lyrics span.chord,
.style-harmonies span.chord {
  height: 1.2em;
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}

.lyrics span.chord span.chord-text,
.harmonies span.chord span.chord-text,
.style-lyrics span.chord span.chord-text,
.style-harmonies span.chord span.chord-text {
  position: absolute;
  display: block;
  top: var(--ctop); /* canonical token — see :root SINGLE SOURCE OF TRUTH */
  left: 0;
  font-weight: bold;
  color: #d35400;
  font-size: var(--cfont); /* canonical token */
  line-height: 1; /* CRITICAL: prevent chord-text from inheriting lyrics' large line-height, which would make its box extend down onto the lyric */
  white-space: nowrap;
}

/* Lower chords for large size to reduce excessive spacing */
.large-size .lyrics span.chord span.chord-text,
.large-size .style-lyrics span.chord span.chord-text {
  top: -0.25em; /* Much lower for large sizes */
}

/* Raise chords slightly for small size to use the space */
.small-size .lyrics span.chord span.chord-text,
.small-size .style-lyrics span.chord span.chord-text {
  top: -0.95em; /* Higher for small sizes */
}

/* Chord-only and songmsg contexts - DON'T raise up */
.chords span.chord,
.songmsg span.chord,
.style-chords span.chord,
.style-songmsg span.chord {
  height: auto;
  display: inline;
  position: static;
}

.chords span.chord span.chord-text,
.songmsg span.chord span.chord-text,
.style-chords span.chord span.chord-text,
.style-songmsg span.chord span.chord-text {
  position: static;
  display: inline;
  top: auto;
  font-weight: bold;
  color: #d35400;
  font-size: 0.85em; /* Match inline chord size */
  white-space: nowrap;
}

/* Old module style classes - LIGHT MODE
   REFACTOR: colors now read from theme variables with the ORIGINAL value as
   fallback, so an unthemed chart looks byte-identical to before. !important is
   retained to preserve the original override-safety; because the value is a
   var(), an active theme still wins by redefining the token. Revert = load the
   previous zip. */
.lyrics {
  color: var(--lyric, #000000) !important; /* was #000000 */
  line-height: var(--clh) !important; /* canonical multiplier — SINGLE SOURCE OF TRUTH */
  margin-top: 0;
}

.chords,
.style-chords {
  color: var(--chord, #d35400) !important; /* was #d35400 */
  line-height: var(--chord-line-height, 1.3rem) !important;
}

.songmsg,
.style-songmsg {
  color: var(--songmsg, #16a085) !important; /* was #16a085 */
  font-style: italic;
  line-height: 1.5rem;
}

.harmonies,
.style-harmonies {
  color: var(--harmony, #000000) !important; /* was #000000 */
  text-decoration: underline;
}

/* Chord spans - light mode */
span.chord span.chord-text {
  color: var(--chord, #d35400); /* was #d35400 */
}

/* Personal notes */
.personal-note {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
  padding: 1px 2px; /* Minimal padding - tight box */
  margin: 0 4px; /* Original margin */
  border-radius: 2px;
  font-size: 0.9em;
  display: inline-block;
  cursor: help;
}

/* Set-specific notes (light green to distinguish from song notes) */
.personal-note.note-source-set {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

/* Hide field labels */
.field__label,
.field--name-body > .field__label,
.field--type-text-with-summary > .field__label,
.lyric-sheet-container + .field__label,
.field__label:has(+ .lyric-sheet-container),
.page-header .field__label,
.node__title .field__label {
  display: none !important;
}

/* Hide contextual links */
.contextual-region .contextual {
  display: none !important;
}

/* Alternative: Move them down if you want to keep them */
/* 
.contextual-region .contextual {
  top: 30px !important;
}
*/

/* Base lyric and chord lines */
.lyric-line,
.chord-line {
  font-family: Calibri, Arial, sans-serif;
  white-space: pre;
  line-height: 1.4em;
  padding: 2px 5px !important;
  transition: background-color 0.2s;
  position: relative;
  font-size: 1.75em; /* Increased from 1.25em for better readability (28px at base 16px) */
  margin: 0 !important; /* Override theme margins */
}

/* Container padding — gives lyrics breathing room from page edges.
   Was previously `padding: 0 !important` which killed left margin AND
   prevented mobile right-padding from working (chords overflowed off-screen). */
.lyric-sheet-container {
  padding: 0 15px;
}

/* Add visual space for blank lines (sections separator).
   Driven by --section-gap so the spacing slider can target these big gaps
   FIRST (they're the worst offenders — an empty line otherwise inherits the
   tall lyric line-height AND its own margin). */
.lyric-line:empty,
.lyric-line:has(> :only-child:empty) {
  height: auto;
  line-height: 0;
  margin: var(--section-gap, 18px) 0;
}

.lyric-line:hover,
.chord-line:hover {
  background-color: #f8f9fa;
}

.chord-line {
  font-weight: bold;
  color: #009900 !important;  /* Green to match style-chords - override theme */
  font-size: 1.6em;  /* Increased from 1.5em - slightly bigger */
  margin-top: 0 !important;  /* Remove all top margin */
  margin-bottom: 0 !important;  /* Remove bottom margin - tight to lyrics */
  padding-top: 0 !important;  /* Remove top padding to tighten spacing */
  padding-bottom: 0 !important;
  white-space: pre;  /* Keep chords on one line */
}

.lyric-line {
  color: #000;
  font-size: 1.75em;  /* Lyrics stay larger */
  margin-top: 0 !important;  /* No space above - tight to chords */
  margin-bottom: 0 !important;  /* Tight spacing between lines */
  padding-top: 0 !important;  /* Remove top padding */
  padding-bottom: 1px !important;  /* Tiny bit of space for readability */
  word-wrap: break-word;  /* Wrap when zoomed */
  overflow-wrap: break-word;
  white-space: normal;  /* Allow wrapping */
}

/* Control Panel.
   Now uses the collapsible tools-toggle / tools-panel pattern in all
   contexts. The outer .lyric-controls is a column so the toggle sits
   above the panel; the panel itself wraps controls horizontally when
   open. */
.lyric-controls {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Tools toggle button — small, unobtrusive affordance. */
.lyric-controls .tools-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--muted, #999);
  border: 1px solid var(--border, #555);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lyric-controls .tools-toggle:hover,
.lyric-controls .tools-toggle:focus-visible,
.lyric-controls .tools-toggle[aria-expanded="true"] {
  background: #b8470a; /* slightly deeper orange on hover/open, like Play */
  color: #fff;
}

/* Tools panel — revealed when the toggle is open. Wraps so it stays
   manageable on narrow viewports. */
.lyric-controls .tools-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}
.lyric-controls .tools-panel[hidden] {
  display: none;
}

/* Accidentals toggle (♯/♭ preference) — same minimal styling as the
   tools toggle. Becomes accent-colored when an explicit preference is
   set (vs. 'auto'). */
.lyric-controls .toggle-accidentals {
  background: transparent;
  color: var(--muted, #999);
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lyric-controls .toggle-accidentals:hover,
.lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-controls .toggle-accidentals[data-pref="flats"] {
  color: var(--accent, #e8c760);
  border-color: var(--accent, #e8c760);
}

/* Transpose controls */
.transpose-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.transpose-controls button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 40px;
}

.transpose-controls button:hover {
  background-color: #0056b3;
}

.transpose-controls button:active {
  background-color: #004085;
}

.transpose-display {
  font-weight: bold;
  color: #333;
  min-width: 120px;
  text-align: center;
  font-size: 14px;
}

/* Chord visibility controls */
.chord-visibility-controls {
  display: inline-flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #000;  /* Changed from #f5f5f5 to black */
  border-radius: 4px;
  border: 1px solid #333;  /* Darker border too */
}

.toggle-chords {
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-chords:hover {
  background-color: #218838;
}

.toggle-chords:active {
  background-color: #1e7e34;
}

/* Zoom controls */
.size-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  background-color: #000;  /* Match other controls */
  border-radius: 4px;
  border: 1px solid #333;
}

.size-controls label {
  color: #e8e8e8;
  font-size: 14px;
  margin-right: 8px;
  font-weight: 500;
}

.size-controls button {
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 60px;
}

.size-controls button:hover {
  background-color: #5a6268;
}

.size-controls button.active {
  background-color: #28a745;  /* Green for active */
}

.size-controls button:active {
  background-color: #545b62;
}

/* Theme controls */
.theme-controls {
  display: inline-flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.toggle-theme {
  background-color: #343a40;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-theme:hover {
  background-color: #23272b;
}

.toggle-theme:active {
  background-color: #1d2124;
}

/* Fullscreen controls */
.plaintext-controls {
  display: inline-flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.toggle-plaintext {
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-plaintext:hover {
  background-color: #5a6268;
}

.toggle-plaintext:active {
  background-color: #545b62;
}

/* Notes */
.note-line {
  padding: 5px;
  margin: 5px 0;
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
  font-size: 0.9em;
}

.global-note,
.personal-note,
.lyrics .personal-note,
.style-lyrics .personal-note {
  display: inline-block;
  padding: 1px 2px; /* Tight box */
  margin-right: 2px; /* Minimal spacing */
  border-radius: 2px;
  font-weight: bold;
  line-height: 1em !important; /* Don't inherit tall line-height from .lyrics */
}

.global-note {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.personal-note {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b8daff;
}

/* Note markers */
.note-marker {
  cursor: pointer;
  font-size: 16px;
  margin-right: 5px;
  display: inline-block;
  transition: transform 0.2s;
}

.note-marker:hover {
  transform: scale(1.2);
}

.note-marker.note-global {
  filter: hue-rotate(0deg);
}

.note-marker.note-personal {
  filter: hue-rotate(200deg);
}

/* Note dialog */
.note-dialog,
.add-note-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.note-dialog-content,
.add-note-dialog-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.note-dialog-content h3,
.add-note-dialog-content h3 {
  margin-top: 0;
  color: #333;
}

.note-dialog-content p {
  margin: 15px 0;
  color: #555;
}

.note-info {
  font-size: 0.9em;
  color: #666;
  margin: 5px 0 10px 0;
  font-style: italic;
}

.note-dialog-content button,
.add-note-dialog-content button {
  padding: 8px 16px;
  margin: 5px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.delete-note-btn {
  background-color: #dc3545;
  color: white;
}

.delete-note-btn:hover {
  background-color: #c82333;
}

.close-dialog-btn,
.cancel-note-btn {
  background-color: #6c757d;
  color: white;
}

.close-dialog-btn:hover,
.cancel-note-btn:hover {
  background-color: #5a6268;
}

.save-note-btn {
  background-color: #28a745;
  color: white;
}

.save-note-btn:hover {
  background-color: #218838;
}

#note-text {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  margin-bottom: 10px;
  resize: vertical;
}

.note-type-selector {
  margin: 10px 0;
}

.note-type-selector label {
  display: block;
  margin: 5px 0;
  cursor: pointer;
}

.note-type-selector input[type="radio"] {
  margin-right: 8px;
}

/* ============================================
   CKEditor Style Classes - ESSENTIAL STYLES
   ============================================ */

/* Lyrics - Standard lyric text */
.style-lyrics {
  font-family: Calibri, Arial, sans-serif;
  color: #000;
  line-height: 1.8em;
  font-size: 18px;
}

/* Chords with Brackets - For chords positioned above lyrics [C] [Am] */
.style-chords-bracketed .chord-line {
  color: #0066cc;
  font-weight: bold;
  font-size: 18px;
  background-color: #e6f2ff;
  padding: 5px;
  border-left: 3px solid #0066cc;
}

.style-chords-bracketed .lyric-line {
  font-size: 18px;
}

/* Chords Plain - For chord-only sections without lyrics */
span.style-chords {
  display: inline;  /* Changed from block to inline */
  color: #009900;  /* Green - better contrast with orange song messages */
  font-weight: bold;  /* Bold for visibility */
  font-size: 20px;  /* Back to 20px */
  background-color: #e6ffe6;  /* Light green background */
  padding: 2px 6px;  /* Reduced padding for inline use */
  border-left: 3px solid #009900;  /* Green border to match */
  font-family: 'Courier New', monospace;
  white-space: nowrap;  /* Changed from pre to nowrap for inline */
  margin: 0 3px;  /* Reduced margin for inline */
}

/* Song Message - Inline (colored text in the middle of lyrics) */
.style-songmsg {
  color: #cc6600;
  font-weight: bold;
  font-style: italic;
  font-size: 20px;
}

/* Song Message Block - Full instruction box on its own line */
.style-songmsg-block {
  display: block;
  background-color: #fff8dc;
  border-left: 4px solid #ffa500;
  padding: 10px 15px;
  margin: 10px 0;
  font-style: italic;
  color: #664400;
  font-size: 18px;
}

/* Harmonies - For harmony vocals or multiple singers */
.style-harmonies {
  font-size: 20px;
}

/* Underline only the lyric lines with harmony class */
.lyric-line.style-harmonies {
  text-decoration: underline;
}

/* Make sure chord lines with harmony class don't get underlined */
.chord-line.style-harmonies {
  text-decoration: none !important;
}

/* Section Headers - Verse, Chorus, Bridge labels */
.style-section-header {
  font-weight: bold;
  font-size: 20px; /* Increased from 1.2em */
  color: #333;
  text-transform: uppercase;
  margin: var(--section-gap, 15px) 0 5px 0;
  border-bottom: 2px solid #333;
  padding-bottom: 3px;
  display: block;
}

/* Font Size Options */
.style-text-small {
  font-size: 14px; /* Increased from 12px */
}

.style-text-large {
  font-size: 22px; /* Increased from 20px */
}

.style-text-xlarge {
  font-size: 26px; /* Increased from 24px */
}

/* ============================================
   DARK MODE (Better colors for stage/performance)
   ============================================ */

.lyric-sheet-container.dark-mode:not([class*="cp-theme-"]) {
  background-color: #000 !important;  /* Pure black for stage */
  color: #d4d4d4;  /* Softer gray instead of bright white */
  padding: 0;  /* Remove padding so it doesn't shrink */
  border-radius: 0;
}

/* Dark mode controls - black background */
.dark-mode .lyric-controls,
.dark-mode .transpose-controls,
.dark-mode .chord-controls,
.dark-mode .size-controls,
.dark-mode .theme-controls,
.dark-mode .plaintext-controls {
  background-color: #000 !important;
  border-color: #333 !important;
}

/* Dark mode colors - softer for eyes
   REFACTOR: core text colors read theme vars with the ORIGINAL dark value as
   fallback. Unthemed .dark-mode is byte-identical; an active theme's dark
   variant overrides via the token. */
.dark-mode .lyrics {
  color: var(--lyric, #88bbff) !important; /* was #88bbff */
}

.dark-mode .chords,
.dark-mode .style-chords {
  color: var(--chord, #ffcc66) !important; /* was #ffcc66 */
}

.dark-mode .songmsg,
.dark-mode .style-songmsg {
  color: var(--songmsg, #66ff66) !important; /* was #66ff66 */
}

.dark-mode .harmonies,
.dark-mode .style-harmonies {
  color: var(--harmony, #88bbff) !important; /* was #88bbff */
  text-decoration: underline;
}

.dark-mode span.chord span.chord-text {
  color: var(--chord, #ffcc66) !important; /* was #ffcc66 */
}

/* Chord-only and songmsg in dark mode */
.dark-mode .chords span.chord span.chord-text,
.dark-mode .songmsg span.chord span.chord-text,
.dark-mode .style-chords span.chord span.chord-text,
.dark-mode .style-songmsg span.chord span.chord-text {
  color: var(--chord, #ffcc66) !important; /* was #ffcc66 */
}

/* Dark mode for individual songs AND setlists */
.dark-mode .lyric-line,
.dark-mode .chord-line,
.setlist-dark-mode .lyric-line,
.setlist-dark-mode .chord-line {
  color: #d4d4d4 !important;  /* Add !important to override base styles */
}

.dark-mode .lyric-line:hover,
.dark-mode .chord-line:hover,
.setlist-dark-mode .lyric-line:hover,
.setlist-dark-mode .chord-line:hover {
  background-color: #2a2a2a;
}

.dark-mode .chord-line,
.setlist-dark-mode .chord-line {
  color: #00ff00;  /* Bright green to match style-chords in dark mode */
  font-weight: bold;
}

.dark-mode .style-songmsg {
  background-color: #3a3000;
  border-left-color: #ffa500;
  color: #ffcc66;
}

.dark-mode .style-section-header {
  color: #ffa500;  /* Orange headers */
  border-bottom-color: #666;
}

.dark-mode span.style-chords {
  background-color: #1a2a1a;  /* Dark green background */
  border-left-color: #00ff00;  /* Bright green border */
  color: #00ff00;  /* Bright green text - stands out on dark background */
}

.dark-mode .personal-note {
  background-color: #2a2a1a;
  border-color: #6a6a4a;
  color: #d4d4d4;
}

.dark-mode .personal-note.note-source-set {
  background-color: #2a3a2a !important;
  border-color: #4a6a4a !important;
  color: #90ee90 !important;
}

/* Transpose display readout — light text against the dark controls bar. */
.dark-mode .transpose-display {
  color: #d4d4d4 !important;
}

/* Block-level songmsg container — same scheme as inline .style-songmsg
   above (dark green-brown panel, gold text, orange accent border). */
.dark-mode .style-songmsg-block {
  background-color: #3a3000 !important;
  border-left-color: #ffa500 !important;
  color: #ffcc66 !important;
}

/* ============================================
   FULLSCREEN MODE (for live performance)
   ============================================ */

/* Plain Text Mode - Simple black on white for individual songs */
.lyric-sheet-container.plain-text-mode {
  background-color: #fff !important;
  color: #000 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 20px !important; /* Add padding for printing/readability */
  /* Typewriter font — plain text mode mimics a typed lyric sheet. */
  font-family: 'Courier New', 'Courier', monospace !important;
  /* Default to normal reading size. Base is 1.5rem (24px) which is too
     large for a typewriter chart; the Size buttons in the controls bar
     still scale this up/down for stage use. */
  font-size: 1rem !important;
  line-height: 1.4 !important;
}

/* Plain-text mode: bring per-element line-heights in line with the new
   smaller base, so lyrics + chords don't feel sparse. */
.lyric-sheet-container.plain-text-mode .lyrics,
.lyric-sheet-container.plain-text-mode .style-lyrics {
  line-height: 1.8 !important;
}

.lyric-sheet-container.plain-text-mode .chord-line {
  color: #000 !important;
  font-weight: bold !important;
}

.lyric-sheet-container.plain-text-mode .lyric-line {
  color: #000 !important;
}

.lyric-sheet-container.plain-text-mode .lyric-controls {
  background-color: #f5f5f5 !important;
}

/* All text black in plain text mode */
.lyric-sheet-container.plain-text-mode .lyrics,
.lyric-sheet-container.plain-text-mode .chords,
.lyric-sheet-container.plain-text-mode .style-chords,
.lyric-sheet-container.plain-text-mode .songmsg,
.lyric-sheet-container.plain-text-mode .style-songmsg,
.lyric-sheet-container.plain-text-mode .harmonies,
.lyric-sheet-container.plain-text-mode .style-harmonies {
  color: #000 !important;
  background: none !important;
  border: none !important;
  text-decoration: none !important;
}

.lyric-sheet-container.plain-text-mode span.chord span.chord-text {
  color: #000 !important;
}

/* ============================================
   MOBILE / RESPONSIVE STYLES
   ============================================ */

/* Responsive - smooth scaling without breakpoints */
@media screen and (max-width: 1200px) {
  .lyric-sheet-container {
    font-size: 1.8em;
  }
}

@media screen and (max-width: 768px) {
  .lyric-sheet-container {
    font-size: 1.5em;
  }
  
  .lyric-controls {
    flex-direction: column;
    gap: 10px;
  }
}

@media screen and (max-width: 480px) {
  .lyric-sheet-container {
    font-size: 1.2em;
    padding: 0 25px 0 15px; /* Extra right padding so long chord names don't clip */
    overflow-x: hidden;
  }
  
  .lyric-sheet-container.plain-text-mode {
    padding: 0 25px 0 15px; /* Match in plain text mode */
    overflow-x: hidden;
  }
  
  /* Extra padding for large size on mobile */
  .lyric-sheet-container.large-size {
    padding-right: 40px; /* Even more right padding for large size */
  }
  
  .lyric-sheet-container.plain-text-mode.large-size {
    padding-right: 40px;
  }
  
  .lyrics {
    line-height: 2.5rem !important; /* Widened to give chord-text breathing room above */
  }
  
  .lyrics span.chord span.chord-text {
    top: -0.7em; /* Tuned for line-height:1 on mobile */
  }
  
  /* Large size on mobile needs even lower chords */
  .large-size .lyrics span.chord span.chord-text,
  .large-size .style-lyrics span.chord span.chord-text {
    top: -0.15em; /* Much lower for mobile large size */
  }
}

/* ============================================
   LIGHT MODE — affects ONLY the lyric area itself.
   The surrounding page/node keeps the dragonfly
   dark theme. The lyric-sheet-container gets a
   warm cream background so it reads like a paper
   chart sitting in a dark frame.
   ============================================ */
.lyric-sheet-container {
  background-color: #f4ecd8; /* Warm cream — default light mode */
}

/* Print styles */
@media print {
  /* Hide ALL interactive elements */
  .lyric-controls,
  .transpose-controls,
  .chord-visibility-controls,
  .note-marker,
  .personal-note,
  button {
    display: none !important;
  }
  
  /* Hide page titles, field labels, and headers */
  h1.page-title,
  .page-header,
  .field__label,
  .node__title,
  .block-page-title-block,
  #page-title,
  .region-header,
  header {
    display: none !important;
  }
  
  /* Remove extra spacing */
  body {
    margin: 0;
    padding: 0;
  }
  
  /* Clean background for printing */
  body,
  .lyric-sheet-container {
    color: #000;
    background: #fff;
    margin: 0;
    padding: 0;
  }
  
  /* Compact spacing for print */
  .lyric-line,
  .chord-line {
    page-break-inside: avoid;
    font-size: 12pt;
    line-height: 1.4;
    padding: 1px 0;
    margin: 0;
  }
  
  .chord-line {
    font-size: 11pt;
    font-weight: bold;
    margin-bottom: 1px;
  }
  
  /* Keep styles visible but print-friendly */
  .style-songmsg {
    background-color: #f5f5f5 !important;
    border-left: 3px solid #000 !important;
    color: #000 !important;
    padding: 6px 10px !important;
    page-break-inside: avoid;
    margin: 8px 0 !important;
    font-size: 11pt !important;
  }
  
  .style-section-header {
    font-size: 14pt !important;
    border-bottom: 2px solid #000 !important;
    page-break-after: avoid;
    margin: 12px 0 4px 0 !important;
    padding: 0 0 2px 0 !important;
  }
  
  span.style-chords {
    background-color: #f0f0f0 !important;
    border-left: 3px solid #000 !important;
    color: #000 !important;
    font-size: 11pt !important;
    page-break-inside: avoid;
    padding: 4px 6px !important;
    margin: 4px 0 !important;
  }
  
  .style-chords-bracketed .chord-line {
    background: none !important;
    border: none !important;
    color: #000 !important;
    padding: 0 !important;
  }
  
  /* Ensure sections stay together */
  .style-section-header + .lyric-line,
  .style-section-header + .chord-line {
    page-break-before: avoid;
  }
  
  /* Compact page margins */
  @page {
    margin: 0.5in;
    size: letter portrait;
  }
  
  /* Remove hover effects */
  .lyric-line:hover,
  .chord-line:hover {
    background-color: transparent !important;
  }
  
  /* Remove cursor changes */
  * {
    cursor: default !important;
  }
}

/* ============================================
   DARK MODE BACKGROUND COLORS
   Force black backgrounds when dark mode is active
   ============================================ */

/* Individual song dark mode */
body:has(.lyric-sheet-container.dark-mode) .field__item,
body:has(.lyric-sheet-container.dark-mode) .field--name-field-lyrics-and-chords,
body:has(.lyric-sheet-container.dark-mode) .text-formatted,
body:has(.lyric-sheet-container.dark-mode) .clearfix,
body:has(.lyric-sheet-container.dark-mode) .node__content,
body:has(.lyric-sheet-container.dark-mode) .node,
body:has(.lyric-sheet-container.dark-mode) article,
body:has(.lyric-sheet-container.dark-mode) .main-content-card,
body:has(.lyric-sheet-container.dark-mode) .content-wrapper,
body:has(.lyric-sheet-container.dark-mode) .container {
  background-color: #000 !important;
  background: #000 !important;
}

/* Setlist dark mode */
body:has(.setlist-container.setlist-dark-mode) .main-content-card,
body:has(.setlist-container.setlist-dark-mode) .node,
body:has(.setlist-container.setlist-dark-mode) article,
body:has(.setlist-container.setlist-dark-mode) .content-wrapper {
  background-color: #000 !important;
}

/* ============================================================
   METADATA STRIP — Key / BPM / Capo / Time + state pill

   Sits at the top of every chart (above lyrics, below the tools).
   Designed to read like a dashboard ribbon — monospaced labels in
   muted color, values in stronger accent, hairline rules above and
   below to separate it from the lyric area without shouting.
   ============================================================ */
.lyric-meta-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 22px 0;
  padding: 8px 0;
  border-top: 0.5px solid #D6C9A9;
  border-bottom: 0.5px solid #D6C9A9;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #6B5938;
  letter-spacing: 0.04em;
  user-select: none;
}

.lyric-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-left: 0.5px solid #D6C9A9;
  line-height: 1.6;
}
.lyric-meta-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.lyric-meta-label {
  color: #8A7755;
  text-transform: uppercase;
  font-size: 11px;
}

.lyric-meta-value {
  color: #2A2419;
  font-weight: 500;
}

.lyric-meta-key .lyric-meta-value {
  color: #B8581D;  /* accent rust — KEY is the headline value */
}

.lyric-meta-time-select {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: 0;
  color: #2A2419;
  font-weight: 500;
  cursor: pointer;
  padding: 0 2px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}
.lyric-meta-time-select:focus {
  outline: 1px solid #B8581D;
  outline-offset: 1px;
}

.lyric-meta-spacer {
  flex: 1;
  min-width: 8px;
}

/* State pill — appears when any override is active (transpose != 0,
   capo > 0, accidentals overridden, Nashville on). Click to reset. */
.lyric-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  margin-right: 2px;
  border-radius: 999px;
  background: #B8581D;
  color: #F4ECD8;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lyric-state-pill:hover {
  background: #9C4A18;
}

/* Dark mode meta strip — reverse the warm palette to readable cool. */
.dark-mode .lyric-meta-strip,
.lyric-sheet-container.dark-mode .lyric-meta-strip {
  border-color: #3a3a3a;
  color: #888;
}
.dark-mode .lyric-meta-item,
.lyric-sheet-container.dark-mode .lyric-meta-item {
  border-left-color: #3a3a3a;
}
.dark-mode .lyric-meta-label,
.lyric-sheet-container.dark-mode .lyric-meta-label {
  color: #777;
}
.dark-mode .lyric-meta-value,
.lyric-sheet-container.dark-mode .lyric-meta-value {
  color: #d4d4d4;
}
.dark-mode .lyric-meta-key .lyric-meta-value,
.lyric-sheet-container.dark-mode .lyric-meta-key .lyric-meta-value {
  color: #e8c760;
}
.dark-mode .lyric-meta-time-select,
.lyric-sheet-container.dark-mode .lyric-meta-time-select {
  color: #d4d4d4;
}

/* Plain text mode — strip down to a single line, no chrome. */
.lyric-sheet-container.plain-text-mode + .lyric-meta-strip,
.plain-text-mode .lyric-meta-strip {
  display: none;
}

/* ============================================================
   SECTION COLORING — verse / chorus / bridge etc.

   The base .style-section-header keeps its bold uppercase look;
   we add a left color bar via data-section-type so the band can
   recognize sections in peripheral vision. Each type gets its own
   accent — verses warm umber, choruses muted teal, bridges plum,
   intro/outro neutral gray, etc.
   ============================================================ */
.style-section-header[data-section-type] {
  border-left: 4px solid #888;
  border-bottom: 0;
  padding: 4px 0 4px 12px;
  margin: 22px 0 8px 0;
  background: rgba(0, 0, 0, 0.02);
}

.style-section-header[data-section-type="verse"]    { border-left-color: #8A5A1F; color: #6B4818; }
.style-section-header[data-section-type="chorus"]   { border-left-color: #2E6B5A; color: #1F4A3F; }
.style-section-header[data-section-type="bridge"]   { border-left-color: #7A4B82; color: #5A3361; }
.style-section-header[data-section-type="pre"]      { border-left-color: #9C7820; color: #6B5215; }
.style-section-header[data-section-type="intro"]    { border-left-color: #6B6B6B; color: #4A4A4A; }
.style-section-header[data-section-type="outro"]    { border-left-color: #6B6B6B; color: #4A4A4A; }
.style-section-header[data-section-type="tag"]      { border-left-color: #3A6B9C; color: #2A4F75; }
.style-section-header[data-section-type="solo"]     { border-left-color: #A04E2B; color: #783A20; }
.style-section-header[data-section-type="instr"]    { border-left-color: #6B7A2B; color: #4F5A20; }

/* Dark mode — lighten the section colors so they read on black. */
.dark-mode .style-section-header[data-section-type],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type] {
  background: rgba(255, 255, 255, 0.03);
}
.dark-mode .style-section-header[data-section-type="verse"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="verse"] {
  color: #d4a35e; border-left-color: #d4a35e;
}
.dark-mode .style-section-header[data-section-type="chorus"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="chorus"] {
  color: #6FBFA1; border-left-color: #6FBFA1;
}
.dark-mode .style-section-header[data-section-type="bridge"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="bridge"] {
  color: #C098CC; border-left-color: #C098CC;
}
.dark-mode .style-section-header[data-section-type="pre"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="pre"] {
  color: #DDB458; border-left-color: #DDB458;
}
.dark-mode .style-section-header[data-section-type="intro"],
.dark-mode .style-section-header[data-section-type="outro"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="intro"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="outro"] {
  color: #999; border-left-color: #999;
}
.dark-mode .style-section-header[data-section-type="tag"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="tag"] {
  color: #7AABDB; border-left-color: #7AABDB;
}
.dark-mode .style-section-header[data-section-type="solo"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="solo"] {
  color: #D87E5C; border-left-color: #D87E5C;
}
.dark-mode .style-section-header[data-section-type="instr"],
.lyric-sheet-container.dark-mode .style-section-header[data-section-type="instr"] {
  color: #B4C25E; border-left-color: #B4C25E;
}

/* ============================================================
   SECTION NAV RAIL — jump-to-section affordance

   Only rendered by JS when a song has >=3 sections AND it's NOT
   inside a setlist (setlists have their own per-song jump nav).
   Sits as a thin sticky column on the right edge on wide viewports;
   collapses to a horizontal strip below the meta on narrow ones.
   ============================================================ */
.lyric-section-rail {
  /* DEPRECATED: the vertical side rail is replaced by a horizontal bottom
     ribbon (.lyric-section-ribbon--bottom). This element is no longer
     created by the JS; the rule is neutralized so any stale cached markup
     can't reserve height. */
  display: none;
}

/* Bottom jump ribbon — same horizontal chips as the top ribbon, placed at
   the foot of the chart with a separating rule above it. Horizontal
   flex-wrap reserves only one row of height (no more 1181px void). */
.lyric-section-ribbon--bottom {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 0.5px solid var(--paper-edge, #D6C9A9);
}

.lyric-section-rail-item {
  display: block;
  text-align: center;
  padding: 4px 0;
  color: #8A7755;
  text-decoration: none;
  border-radius: 4px;
  border: 0.5px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lyric-section-rail-item:hover {
  background: rgba(184, 88, 29, 0.08);
  color: #B8581D;
  border-color: rgba(184, 88, 29, 0.3);
}

.lyric-section-rail-item[data-section-type="chorus"] { color: #2E6B5A; }
.lyric-section-rail-item[data-section-type="bridge"] { color: #7A4B82; }
.lyric-section-rail-item[data-section-type="pre"]    { color: #9C7820; }
.lyric-section-rail-item[data-section-type="tag"]    { color: #3A6B9C; }
.lyric-section-rail-item[data-section-type="solo"]   { color: #A04E2B; }
.lyric-section-rail-item[data-section-type="instr"]  { color: #6B7A2B; }

/* Dark mode rail */
.dark-mode .lyric-section-rail-item,
.lyric-sheet-container.dark-mode .lyric-section-rail-item {
  color: #888;
}
.dark-mode .lyric-section-rail-item:hover,
.lyric-sheet-container.dark-mode .lyric-section-rail-item:hover {
  background: rgba(232, 199, 96, 0.1);
  color: #e8c760;
  border-color: rgba(232, 199, 96, 0.3);
}

/* On narrow viewports the rail's right-margin trick would push it
   off-screen. Collapse to a horizontal scrollable strip at the top. */
@media screen and (max-width: 900px) {
  .lyric-section-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    float: none;
    margin: 0 0 16px 0;
    width: auto;
    overflow-x: auto;
    padding: 4px 0;
  }
  .lyric-section-rail-item {
    min-width: 36px;
  }
}

/* ============================================================
   NEW TOOLS PANEL CONTROLS — capo, target key, Nashville, reset

   Match the existing minimal style of the tools panel buttons
   (transparent bg, muted color, accent on hover/active).
   ============================================================ */
.lyric-controls .capo-controls,
.lyric-controls .playin-controls,
.lyric-controls .nashville-controls,
.lyric-controls .reset-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lyric-controls .capo-controls label,
.lyric-controls .playin-controls label {
  font-size: 12px;
  color: var(--muted, #999);
  font-family: inherit;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.lyric-controls .capo-up,
.lyric-controls .capo-down {
  background: transparent;
  color: var(--muted, #999);
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  min-width: 24px;
}
.lyric-controls .capo-up:hover,
.lyric-controls .capo-down:hover {
  color: var(--accent, #e8c760);
  border-color: var(--accent, #e8c760);
}

.lyric-controls .capo-display {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  color: var(--accent, #e8c760);
  min-width: 18px;
  text-align: center;
  font-weight: 500;
}

.lyric-controls .playin-select {
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  color: var(--accent, #e8c760);
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-weight: 500;
}
.lyric-controls .playin-select:hover,
.lyric-controls .playin-select:focus {
  border-color: var(--accent, #e8c760);
  outline: none;
}

.lyric-controls .toggle-nashville {
  background: transparent;
  color: var(--muted, #999);
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lyric-controls .toggle-nashville:hover,
.lyric-controls .toggle-nashville.active {
  color: var(--accent, #e8c760);
  border-color: var(--accent, #e8c760);
}

.lyric-controls .reset-overrides {
  background: transparent;
  color: var(--muted, #999);
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-left: 8px;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lyric-controls .reset-overrides:hover {
  opacity: 1;
  color: #B8581D;
  border-color: #B8581D;
}

/* Light-mode-specific control coloring (the lyric chart paper is
   warm cream by default, so we want warmer mute/accent values that
   read on cream — not the dark-mode CSS-var fallbacks above). */
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-up,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-down,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .playin-select,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .toggle-nashville,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .reset-overrides {
  color: #6B5938;
  border-color: #C9BC9C;
}
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-up:hover,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-down:hover,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .playin-select:hover,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .toggle-nashville:hover,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .toggle-nashville.active {
  color: #B8581D;
  border-color: #B8581D;
}
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-display {
  color: #B8581D;
}
.lyric-sheet-container:not(.dark-mode) .lyric-controls .playin-select {
  color: #B8581D;
}
.lyric-sheet-container:not(.dark-mode) .lyric-controls .capo-controls label,
.lyric-sheet-container:not(.dark-mode) .lyric-controls .playin-controls label {
  color: #8A7755;
}

/* Reset hides in plain-text mode (everything's already maximally
   stripped — the override pill on the meta strip can do the work) */
.plain-text-mode .lyric-controls,
.lyric-sheet-container.plain-text-mode .lyric-controls {
  /* Existing rule keeps controls hidden in plain text; nothing extra needed */
}

/* Print: hide all the new chrome */
@media print {
  .lyric-meta-strip,
  .lyric-state-pill,
  .lyric-section-rail,
  .capo-controls,
  .playin-controls,
  .nashville-controls,
  .reset-controls {
    display: none !important;
  }
}

/* ============================================================
   DESIGN TOKENS — the chart's single source of truth

   Every recurring part of the chart (tools, metadata, section
   headers, dividers, accents) pulls colors from these custom
   properties. Dark mode just flips the same names.

   Why this exists: previous iterations had three different
   palettes — the legacy tool buttons in muted grey/gold, the
   new tool buttons in warm umber/rust, and the setlist global
   bar in something else again. Variables let us nail the look
   in one place and have it propagate.
   ============================================================ */
.lyric-sheet-container {
  --paper:        #F4ECD8;   /* warm cream chart bg */
  --paper-edge:   #D6C9A9;   /* hairline rules + frame border */
  --paper-tint:   rgba(184, 88, 29, 0.03);  /* section bg wash */
  --ink:          #2A2419;   /* primary chord/lyric color */
  --ink-muted:    #6B5938;   /* tools, labels, metadata values */
  --ink-faint:    #8A7755;   /* labels, hints, less-important */
  --accent:       #B8581D;   /* chords, key, primary interactive */
  --accent-deep:  #9C4A18;   /* hover / pressed state */
  --accent-soft:  rgba(184, 88, 29, 0.1);  /* pill bg, hover bg */
  --tool-radius:  4px;
  --frame-radius: 8px;
}
.lyric-sheet-container.dark-mode {
  --paper:        #000;
  --paper-edge:   #2A2A2A;
  --paper-tint:   rgba(232, 199, 96, 0.04);
  --ink:          #d4d4d4;
  --ink-muted:    #999;
  --ink-faint:    #777;
  --accent:       #e8c760;
  --accent-deep:  #C9A748;
  --accent-soft:  rgba(232, 199, 96, 0.12);
}

/* === Chart frame === Subtle border so each chart reads as its own
   visual object, plus a touch of vertical breathing room. Skipped
   in setlist context where songs already have their own dividers.
   The cream bg sits inside the frame; dark mode keeps a thin edge
   so the chart doesn't fuse with the page. */
.lyric-sheet-container:not(.plain-text-mode) {
  border: 0.5px solid var(--paper-edge);
  border-radius: var(--frame-radius);
  padding: 24px 28px;
  margin: 1rem 0;
}
.setlist-container .lyric-sheet-container:not(.plain-text-mode) {
  /* Setlists already frame each song with the wrapper + divider;
     a per-chart border on top is too much. Keep the cream paper
     but drop the extra frame. */
  border: 0;
  border-radius: 0;
  padding: 12px 0 8px 0;
  margin: 0;
}

/* ============================================================
   UNIFIED TOOL BUTTONS — works in any context

   Controls live in different places depending on context:
   - Standalone song page: .lyric-controls is INSIDE .lyric-sheet-container
   - Setlist context: .lyric-controls is INSIDE .setlist-song-wrapper, ABOVE the chart

   Earlier scoped selectors (.lyric-sheet-container .lyric-controls ...)
   silently failed in setlist context because the controls weren't inside
   the container. New approach: define tokens on .lyric-controls itself
   AND target buttons with .lyric-controls .button-name (no parent
   container needed). Tokens flip for dark mode via two parent overrides
   (.dark-mode and .setlist-dark-mode) so both modes paint correctly.
   ============================================================ */
.lyric-controls {
  --tool-bg:       transparent;
  --tool-border:   #C9BC9C;        /* visible on cream paper */
  --tool-text:     #6B5938;
  --tool-accent:   #B8581D;
  --tool-radius:   4px;
}
/* Dark mode tokens — bumped border to a much lighter grey so buttons
   actually read as buttons against black, not as floating text. */
.dark-mode .lyric-controls,
.lyric-sheet-container.dark-mode .lyric-controls,
.setlist-container.setlist-dark-mode .lyric-controls,
.setlist-dark-mode .lyric-controls {
  --tool-border:   #555;
  --tool-text:     #BBB;
  --tool-accent:   #e8c760;
}

.lyric-controls .tools-toggle,
.lyric-controls .toggle-accidentals,
.lyric-controls .toggle-chords,
.lyric-controls .toggle-nashville,
.lyric-controls .reset-overrides,
.lyric-controls .bake-key,
.lyric-controls .transpose-up,
.lyric-controls .transpose-down,
.lyric-controls .capo-up,
.lyric-controls .capo-down,
.lyric-controls .playin-select,
.lyric-controls .size-btn,
.lyric-controls .toggle-theme,
.lyric-controls .toggle-plaintext {
  background: var(--tool-bg) !important;
  color: var(--tool-text) !important;
  border: 1px solid var(--tool-border) !important;
  border-radius: var(--tool-radius) !important;
  padding: 4px 10px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
  cursor: pointer !important;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease !important;
  line-height: 1.4 !important;
  min-width: auto !important;
  box-shadow: none !important;
  text-transform: none !important;
}
.lyric-controls .transpose-up,
.lyric-controls .transpose-down,
.lyric-controls .capo-up,
.lyric-controls .capo-down {
  min-width: 28px !important;
  padding: 4px 8px !important;
  font-size: 14px !important;
}

.lyric-controls .tools-toggle:hover,
.lyric-controls .toggle-accidentals:hover,
.lyric-controls .toggle-chords:hover,
.lyric-controls .toggle-nashville:hover,
.lyric-controls .reset-overrides:hover,
.lyric-controls .bake-key:hover,
.lyric-controls .transpose-up:hover,
.lyric-controls .transpose-down:hover,
.lyric-controls .capo-up:hover,
.lyric-controls .capo-down:hover,
.lyric-controls .playin-select:hover,
.lyric-controls .playin-select:focus,
.lyric-controls .size-btn:hover,
.lyric-controls .toggle-theme:hover,
.lyric-controls .toggle-plaintext:hover,
.lyric-controls .tools-toggle[aria-expanded="true"],
.lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-controls .toggle-accidentals[data-pref="flats"],
.lyric-controls .toggle-nashville.active,
.lyric-controls .size-btn.active {
  color: var(--tool-accent) !important;
  border-color: var(--tool-accent) !important;
  background: var(--tool-bg) !important;
  outline: none !important;
}

/* Kill the legacy .transpose-controls container box and .chord-visibility-controls
   container box — they used to wrap buttons in a grey/black panel that
   competed with the new minimal aesthetic. Now they're invisible
   wrappers, just flex layout. */
.lyric-controls .transpose-controls,
.lyric-controls .chord-visibility-controls,
.lyric-controls .accidentals-controls,
.lyric-controls .capo-controls,
.lyric-controls .playin-controls,
.lyric-controls .nashville-controls,
.lyric-controls .reset-controls,
.lyric-controls .size-controls,
.lyric-controls .theme-controls,
.lyric-controls .plaintext-controls {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Display values (transpose-display, capo-display) — monospace accent */
.lyric-controls .transpose-display,
.lyric-controls .capo-display {
  font-family: 'Menlo', 'Consolas', monospace !important;
  font-size: 12px !important;
  color: var(--tool-accent) !important;
  min-width: 32px !important;
  text-align: center !important;
  font-weight: 500 !important;
  padding: 0 4px !important;
  background: transparent !important;
}

.lyric-controls label {
  font-size: 11px !important;
  color: var(--tool-text) !important;
  opacity: 0.75;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  margin: 0 !important;
}

/* ============================================================
   CHORD-TEXT BREATHING ROOM

   The chord-text sits absolute-positioned above each lyric character
   via `top: -0.55em` (desktop) / `top: -0.7em` (mobile). With tight
   line-height it crowds the lyric ABOVE, which gets worse as lines
   wrap further down the chart. Solution: more generous line-height
   so chord-text has room to breathe between lyric lines.
   ============================================================ */
.lyric-sheet-container:not(.plain-text-mode) .lyrics,
.lyric-sheet-container:not(.plain-text-mode) .style-lyrics,
.lyric-sheet-container:not(.plain-text-mode) .harmonies,
.lyric-sheet-container:not(.plain-text-mode) .style-harmonies {
  line-height: var(--clh); /* canonical multiplier — SINGLE SOURCE OF TRUTH */
}
@media screen and (max-width: 768px) {
  .lyric-sheet-container:not(.plain-text-mode) .lyrics,
  .lyric-sheet-container:not(.plain-text-mode) .style-lyrics,
  .lyric-sheet-container:not(.plain-text-mode) .harmonies,
  .lyric-sheet-container:not(.plain-text-mode) .style-harmonies {
    line-height: var(--clh) !important; /* canonical multiplier scales with mobile font */
  }
  /* Chord-text offset inherits the canonical token; the unitless line-height
     above already scales the room for mobile, so the em offset stays correct
     without a separate mobile value. Scoped to non-plain-text. */
  .lyric-sheet-container:not(.plain-text-mode) .lyrics span.chord span.chord-text,
  .lyric-sheet-container:not(.plain-text-mode) .style-lyrics span.chord span.chord-text,
  .lyric-sheet-container:not(.plain-text-mode) .harmonies span.chord span.chord-text,
  .lyric-sheet-container:not(.plain-text-mode) .style-harmonies span.chord span.chord-text {
    top: var(--ctop) !important;
  }
}
@media screen and (max-width: 480px) {
  .lyric-sheet-container:not(.plain-text-mode) .lyrics,
  .lyric-sheet-container:not(.plain-text-mode) .style-lyrics,
  .lyric-sheet-container:not(.plain-text-mode) .harmonies,
  .lyric-sheet-container:not(.plain-text-mode) .style-harmonies {
    line-height: 3.4rem !important;
  }
  .lyric-sheet-container:not(.plain-text-mode) .large-size .lyrics,
  .lyric-sheet-container:not(.plain-text-mode) .large-size .style-lyrics {
    line-height: 4rem !important;
  }
}

/* ============================================================
   EXTENDED SECTION COLORING

   Users mark sections in two ways:
   - .style-section-header (a generic header)
   - .style-bridge / .style-chorus / .style-instrumental (per-type
     classes from the CKEditor style menu)

   Section coloring via data-section-type only catches the first
   case. Apply the same left-border accent treatment directly to the
   per-type classes too, so existing charts get colored without
   re-tagging anything.
   ============================================================ */
.style-bridge,
.style-chorus,
.style-instrumental {
  display: block;
  border-left: 4px solid #888;
  padding: 4px 0 4px 12px;
  margin: 22px 0 8px 0;
  background: rgba(0, 0, 0, 0.02);
  font-style: italic;
  font-weight: 500;
}
.style-chorus    { border-left-color: #2E6B5A; color: #1F4A3F; }
.style-bridge    { border-left-color: #7A4B82; color: #5A3361; }
.style-instrumental { border-left-color: #6B7A2B; color: #4F5A20; }

.dark-mode .style-bridge,
.dark-mode .style-chorus,
.dark-mode .style-instrumental,
.lyric-sheet-container.dark-mode .style-bridge,
.lyric-sheet-container.dark-mode .style-chorus,
.lyric-sheet-container.dark-mode .style-instrumental {
  background: rgba(255, 255, 255, 0.03);
}
.dark-mode .style-chorus,
.lyric-sheet-container.dark-mode .style-chorus {
  color: #6FBFA1; border-left-color: #6FBFA1;
}
.dark-mode .style-bridge,
.lyric-sheet-container.dark-mode .style-bridge {
  color: #C098CC; border-left-color: #C098CC;
}
.dark-mode .style-instrumental,
.lyric-sheet-container.dark-mode .style-instrumental {
  color: #B4C25E; border-left-color: #B4C25E;
}

/* === Unified metadata strip (overrides) ===
   Switch the earlier hard-coded colors to vars so dark mode flips
   automatically and the strip matches the rest of the chart. */
.lyric-sheet-container .lyric-meta-strip,
.lyric-meta-strip {
  border-top-color: var(--paper-edge, #D6C9A9);
  border-bottom-color: var(--paper-edge, #D6C9A9);
  color: var(--ink-muted, #6B5938);
}
.lyric-sheet-container .lyric-meta-item,
.lyric-meta-item {
  border-left-color: var(--paper-edge, #D6C9A9);
}
.lyric-sheet-container .lyric-meta-label,
.lyric-meta-label {
  color: var(--ink-faint, #8A7755);
}
.lyric-sheet-container .lyric-meta-value,
.lyric-meta-value {
  color: var(--ink, #2A2419);
}
.lyric-sheet-container .lyric-meta-key .lyric-meta-value,
.lyric-meta-key .lyric-meta-value {
  color: var(--accent, #B8581D);
}
.lyric-sheet-container .lyric-meta-time-select,
.lyric-meta-time-select {
  color: var(--ink, #2A2419);
}
.lyric-sheet-container .lyric-meta-time-select:focus,
.lyric-meta-time-select:focus {
  outline-color: var(--accent, #B8581D);
}
.lyric-sheet-container .lyric-state-pill,
.lyric-state-pill {
  background: var(--accent, #B8581D);
  color: var(--paper, #F4ECD8);
}
.lyric-sheet-container .lyric-state-pill:hover,
.lyric-state-pill:hover {
  background: var(--accent-deep, #9C4A18);
}

/* === Section headers — unify with vars + drop legacy bottom border
   when data-section-type is present (the left color bar already
   does the differentiation). === */
.lyric-sheet-container .style-section-header[data-section-type] {
  border-bottom: 0;
  background: var(--paper-tint);
}

/* === Rhythm / groove annotation ===
   New style for inline groove phrases above a section ("swing 8ths",
   "♩♩ ♩♩", "drop on the 4", "half-time feel"). Users wrap a phrase
   in <span class="style-rhythm">…</span> via the CKEditor style menu;
   it renders as a small italic accent-tinted line. Sits naturally
   above whatever follows (typically a section header), giving the
   rhythm section a quick cue without crowding the chord row.

   Two display modes:
   - Block (own line): margin-top so it floats above the next section.
   - Inline (in a chord row, e.g. above a chord-only bar): renders as
     a subscript-like tag. Detected by being inside .style-chords.
*/
.style-rhythm {
  display: block;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint, #8A7755);
  letter-spacing: 0.05em;
  margin: 16px 0 -4px 0;
  padding: 2px 10px 2px 12px;
  border-left: 2px solid var(--accent-soft, rgba(184, 88, 29, 0.3));
  background: var(--paper-tint, rgba(184, 88, 29, 0.03));
}
.style-rhythm::before {
  content: "♪ ";
  color: var(--accent, #B8581D);
  margin-right: 4px;
  font-style: normal;
}
.style-chords .style-rhythm,
span.style-rhythm {
  display: inline-block;
  margin: 0 8px 0 0;
  padding: 0 6px;
  border-left: 0;
  background: transparent;
  vertical-align: middle;
}

.dark-mode .style-rhythm,
.lyric-sheet-container.dark-mode .style-rhythm {
  color: var(--ink-faint, #777);
}

/* === Plain-text mode hygiene ===
   The whole chart drops to a stripped-down lyric reference. Kill the
   frame, meta strip, nav rail, section colors — leave the words. */
.lyric-sheet-container.plain-text-mode {
  border: 0;
  padding: 0;
  background: transparent;
}
.lyric-sheet-container.plain-text-mode .lyric-meta-strip,
.lyric-sheet-container.plain-text-mode .lyric-section-rail,
.lyric-sheet-container.plain-text-mode .lyric-state-pill {
  display: none;
}
.lyric-sheet-container.plain-text-mode .style-section-header[data-section-type] {
  border-left: 0;
  padding-left: 0;
  background: transparent;
  color: inherit;
}

/* ============================================================
   PRINT — chart designed to print as a clean one-page chart sheet

   Strategy: keep the metadata STRIP values (Key/BPM/Time) but
   strip every interactive control. Keep section colors as grayscale
   left-border bars (left-border prints fine on most printers).
   Hide nav rail, state pill, tools, capo controls. Force black ink
   on cream-or-white paper.
   ============================================================ */
@media print {
  .lyric-sheet-container {
    background: #fff !important;
    color: #000 !important;
    border: 0.5pt solid #999 !important;
    border-radius: 0 !important;
    padding: 0.4in 0.5in !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .lyric-controls,
  .lyric-section-rail,
  .lyric-state-pill,
  .lyric-meta-time-select::after,
  .capo-controls,
  .playin-controls,
  .nashville-controls,
  .reset-controls,
  .archive-floating-player,
  .archive-play-wrapper {
    display: none !important;
  }

  /* Meta strip: keep values, render as a tight top-of-page reference. */
  .lyric-meta-strip {
    border-top: 0 !important;
    border-bottom: 0.5pt solid #666 !important;
    padding: 4pt 0 6pt 0 !important;
    margin: 0 0 12pt 0 !important;
    color: #000 !important;
    font-size: 10pt !important;
    gap: 0 !important;
  }
  .lyric-meta-item {
    border-left-color: #666 !important;
    padding: 0 10pt !important;
  }
  .lyric-meta-item:first-child {
    padding-left: 0 !important;
  }
  .lyric-meta-label,
  .lyric-meta-value,
  .lyric-meta-key .lyric-meta-value {
    color: #000 !important;
  }
  /* Time signature in print — render as static text rather than a
     functional <select> dropdown (which prints an ugly OS chrome). */
  .lyric-meta-time-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: 0 !important;
    color: #000 !important;
    font-size: 10pt !important;
    padding: 0 !important;
  }
  .lyric-meta-spacer {
    display: none !important;
  }

  /* Section headers: kill color, keep the left bar as a grey line
     so the visual hierarchy survives without ink heroics. */
  .style-section-header[data-section-type] {
    color: #000 !important;
    background: transparent !important;
    border-left: 3pt solid #444 !important;
    border-bottom: 0 !important;
    padding: 2pt 0 2pt 8pt !important;
    margin: 10pt 0 4pt 0 !important;
    font-size: 11pt !important;
  }

  /* Chord text: BLACK + bold so chords sit firmly above lyrics on
     paper. Cream-mode accent rust doesn't carry well to print. */
  .style-lyrics span.chord span.chord-text,
  .style-harmonies span.chord span.chord-text {
    color: #000 !important;
    font-weight: 700 !important;
  }
  .style-chords span.chord,
  .style-songmsg span.chord {
    color: #000 !important;
    font-weight: 700 !important;
  }

  /* Rhythm phrase: italic grey works in print */
  .style-rhythm {
    color: #444 !important;
    background: transparent !important;
    border-left: 1pt solid #888 !important;
  }
  .style-rhythm::before {
    color: #000 !important;
  }

  /* Hide drawing canvases — they'd print as the raster overlay
     which is usually noise on paper. */
  .lsc-drawing-canvas {
    display: none !important;
  }
}

/* ============================================================
   ROUND 3 FIXES — chart frame, dark-mode meta visibility,
   duplicate-key removal, section-type win-by-attribute
   ============================================================ */

/* === Brighten dark-mode tokens so they actually read on black ===
   --paper-edge was #2A2A2A which is essentially invisible on a pure
   #000 background. Bumping it (and ink-muted/ink-faint) so the
   metadata strip, chart border, and hairlines all have visible
   contrast in dark mode. */
.lyric-sheet-container.dark-mode {
  --paper-edge:   #4A4A4A;
  --ink:          #EAEAEA;
  --ink-muted:    #B5B5B5;
  --ink-faint:    #888;
  --paper-tint:   rgba(232, 199, 96, 0.05);
}

/* === Restore a chart frame in setlist context ===
   Previously suppressed entirely; now a subtle hairline border so
   each chart reads as its own object. The wrapper + divider still
   separate songs, but each chart gets its own paper boundary. */
.setlist-container .lyric-sheet-container:not(.plain-text-mode) {
  border: 0.5px solid var(--paper-edge, #D6C9A9);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 0 0 16px 0;
  background: var(--paper, #F4ECD8);
}

/* === Suppress the duplicate inline key chip in setlist titles ===
   The metadata strip already shows KEY. Showing it next to the title
   too was redundant noise. */
.setlist-container .setlist-song-key-inline,
.setlist-song-title .setlist-song-key-inline {
  display: none !important;
}

/* === Make data-section-type colors WIN over per-class styling ===
   Users wrap section labels with various classes (.style-instrumental,
   .style-bridge, etc.) — the JS detects the actual section type from
   text content and tags data-section-type. These rules need to beat
   the per-class colors so a .style-instrumental wrapping "Verse 1"
   gets verse colors (umber), not generic instrumental colors (olive). */
[data-section-type="verse"] {
  border-left: 4px solid #8A5A1F !important;
  color: #6B4818 !important;
  background: rgba(184, 88, 29, 0.04) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="chorus"] {
  border-left: 4px solid #2E6B5A !important;
  color: #1F4A3F !important;
  background: rgba(46, 107, 90, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="bridge"] {
  border-left: 4px solid #7A4B82 !important;
  color: #5A3361 !important;
  background: rgba(122, 75, 130, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="pre"] {
  border-left: 4px solid #9C7820 !important;
  color: #6B5215 !important;
  background: rgba(156, 120, 32, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="intro"],
[data-section-type="outro"] {
  border-left: 4px solid #6B6B6B !important;
  color: #4A4A4A !important;
  background: rgba(0, 0, 0, 0.03) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="tag"] {
  border-left: 4px solid #3A6B9C !important;
  color: #2A4F75 !important;
  background: rgba(58, 107, 156, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="solo"] {
  border-left: 4px solid #A04E2B !important;
  color: #783A20 !important;
  background: rgba(160, 78, 43, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}
[data-section-type="instr"] {
  border-left: 4px solid #6B7A2B !important;
  color: #4F5A20 !important;
  background: rgba(107, 122, 43, 0.05) !important;
  padding: 4px 0 4px 12px !important;
  margin: 22px 0 8px 0 !important;
  border-bottom: 0 !important;
  display: block;
}

/* Dark-mode section colors — lighter ramps for readable contrast on black. */
.dark-mode [data-section-type="verse"],
.lyric-sheet-container.dark-mode [data-section-type="verse"] {
  border-left-color: #D4A35E !important;
  color: #E8B86A !important;
  background: rgba(212, 163, 94, 0.08) !important;
}
.dark-mode [data-section-type="chorus"],
.lyric-sheet-container.dark-mode [data-section-type="chorus"] {
  border-left-color: #6FBFA1 !important;
  color: #8FD4BB !important;
  background: rgba(111, 191, 161, 0.08) !important;
}
.dark-mode [data-section-type="bridge"],
.lyric-sheet-container.dark-mode [data-section-type="bridge"] {
  border-left-color: #C098CC !important;
  color: #D4B0E0 !important;
  background: rgba(192, 152, 204, 0.08) !important;
}
.dark-mode [data-section-type="pre"],
.lyric-sheet-container.dark-mode [data-section-type="pre"] {
  border-left-color: #DDB458 !important;
  color: #EDC871 !important;
  background: rgba(221, 180, 88, 0.08) !important;
}
.dark-mode [data-section-type="intro"],
.dark-mode [data-section-type="outro"],
.lyric-sheet-container.dark-mode [data-section-type="intro"],
.lyric-sheet-container.dark-mode [data-section-type="outro"] {
  border-left-color: #AAA !important;
  color: #CCC !important;
  background: rgba(255, 255, 255, 0.03) !important;
}
.dark-mode [data-section-type="tag"],
.lyric-sheet-container.dark-mode [data-section-type="tag"] {
  border-left-color: #7AABDB !important;
  color: #95C0E5 !important;
  background: rgba(122, 171, 219, 0.08) !important;
}
.dark-mode [data-section-type="solo"],
.lyric-sheet-container.dark-mode [data-section-type="solo"] {
  border-left-color: #D87E5C !important;
  color: #E89A7E !important;
  background: rgba(216, 126, 92, 0.08) !important;
}
.dark-mode [data-section-type="instr"],
.lyric-sheet-container.dark-mode [data-section-type="instr"] {
  border-left-color: #B4C25E !important;
  color: #C7D478 !important;
  background: rgba(180, 194, 94, 0.08) !important;
}

/* Italics preserved when the underlying class is .style-instrumental
   or similar — keeps the user's typographic intent without overriding
   the per-type COLOR. */
.style-bridge[data-section-type],
.style-chorus[data-section-type],
.style-instrumental[data-section-type] {
  font-style: italic;
  font-weight: 500;
}

/* ============================================================
   ROUND 4 — TOOLBAR GLOW-UP + SECTION RIBBON + CHORD CHEATS
   + PER-SECTION VOCALIST CHIPS
   ============================================================ */

/* === Tool panel as a proper card ===
   The panel itself gets a subtle paper-tinted background, soft border,
   inner padding, and gentle vertical separators between control groups.
   When opened, it reads as a deliberate tools tray instead of loose
   buttons drifting across the page. CRITICAL: only force display:flex
   when NOT [hidden] — otherwise the toggle button visually no-ops
   because the panel stays visible regardless of attribute state. */
.lyric-controls .tools-panel:not([hidden]) {
  background: rgba(184, 88, 29, 0.04) !important;
  border: 0.5px solid var(--tool-border, #C9BC9C) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  margin-top: 6px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0 !important;
}
.lyric-controls .tools-panel[hidden] {
  display: none !important;
}
.dark-mode .lyric-controls .tools-panel,
.lyric-sheet-container.dark-mode .lyric-controls .tools-panel,
.setlist-dark-mode .lyric-controls .tools-panel,
.setlist-container.setlist-dark-mode .lyric-controls .tools-panel {
  background: rgba(232, 199, 96, 0.05) !important;
  border-color: #555 !important;
}

/* Vertical separators between control groups inside the panel. */
.lyric-controls .tools-panel > div {
  padding: 0 12px !important;
  border-left: 0.5px solid var(--tool-border, #C9BC9C) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.lyric-controls .tools-panel > div:first-child {
  padding-left: 0 !important;
  border-left: 0 !important;
}
.dark-mode .lyric-controls .tools-panel > div,
.lyric-sheet-container.dark-mode .lyric-controls .tools-panel > div,
.setlist-dark-mode .lyric-controls .tools-panel > div,
.setlist-container.setlist-dark-mode .lyric-controls .tools-panel > div {
  border-left-color: #444 !important;
}

/* === Active-state fill — the "pop" the toolbar needed ===
   When a control is in an active/overridden state (Nashville on,
   accidentals overridden, size selected, tools-toggle open) it goes
   from outlined to FILLED with the accent color. Light mode: rust
   bg + cream text. Dark mode: gold bg + dark text. Reads instantly. */
.lyric-controls .tools-toggle[aria-expanded="true"],
.lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-controls .toggle-accidentals[data-pref="flats"],
.lyric-controls .toggle-nashville.active,
.lyric-controls .size-btn.active {
  background: var(--tool-accent, #B8581D) !important;
  color: #F4ECD8 !important;
  border-color: var(--tool-accent, #B8581D) !important;
}
.dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.dark-mode .lyric-controls .toggle-accidentals[data-pref="sharps"],
.dark-mode .lyric-controls .toggle-accidentals[data-pref="flats"],
.dark-mode .lyric-controls .toggle-nashville.active,
.dark-mode .lyric-controls .size-btn.active,
.lyric-sheet-container.dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-accidentals[data-pref="flats"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-nashville.active,
.lyric-sheet-container.dark-mode .lyric-controls .size-btn.active,
.setlist-dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.setlist-dark-mode .lyric-controls .toggle-nashville.active,
.setlist-container.setlist-dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.setlist-container.setlist-dark-mode .lyric-controls .toggle-nashville.active {
  background: #e8c760 !important;
  color: #1A1410 !important;
  border-color: #e8c760 !important;
}

/* Hover state: subtle bg tint so buttons feel tactile under the mouse. */
.lyric-controls .tools-toggle:not([aria-expanded="true"]):hover,
.lyric-controls .toggle-accidentals:not([data-pref="sharps"]):not([data-pref="flats"]):hover,
.lyric-controls .toggle-chords:hover,
.lyric-controls .toggle-nashville:not(.active):hover,
.lyric-controls .reset-overrides:hover,
.lyric-controls .transpose-up:hover,
.lyric-controls .transpose-down:hover,
.lyric-controls .capo-up:hover,
.lyric-controls .capo-down:hover,
.lyric-controls .size-btn:not(.active):hover,
.lyric-controls .toggle-theme:hover,
.lyric-controls .toggle-plaintext:hover {
  background: rgba(184, 88, 29, 0.08) !important;
}
.dark-mode .lyric-controls .tools-toggle:not([aria-expanded="true"]):hover,
.lyric-sheet-container.dark-mode .lyric-controls .tools-toggle:not([aria-expanded="true"]):hover,
.setlist-dark-mode .lyric-controls .tools-toggle:not([aria-expanded="true"]):hover {
  background: rgba(232, 199, 96, 0.1) !important;
}

/* Tools toggle button — when CLOSED, give it a subtle "click me"
   personality so it doesn't look like just text on a page. */
.lyric-controls .tools-toggle:not([aria-expanded="true"]) {
  padding: 5px 14px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}

/* ============================================================
   SECTION RIBBON — song-shape overview at the top of the chart
   ============================================================ */
.lyric-section-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0 18px 0;
  padding: 0;
}
.lyric-ribbon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 9px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 4px;
  border: 0.5px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
  cursor: pointer;
  /* Each chip's color comes from data-section-type rules below. */
}
.lyric-ribbon-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.lyric-ribbon-chip:active {
  transform: translateY(0);
}

/* Light-mode ribbon chip colors — solid type-color fill, paper text. */
.lyric-ribbon-chip[data-section-type="verse"]   { background: #8A5A1F; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="chorus"]  { background: #2E6B5A; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="bridge"]  { background: #7A4B82; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="pre"]     { background: #9C7820; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="intro"],
.lyric-ribbon-chip[data-section-type="outro"]   { background: #6B6B6B; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="tag"]     { background: #3A6B9C; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="solo"]    { background: #A04E2B; color: #F4ECD8; }
.lyric-ribbon-chip[data-section-type="instr"]   { background: #6B7A2B; color: #F4ECD8; }

/* Dark-mode ribbon chip colors — lighter section accent fills, dark text */
.dark-mode .lyric-ribbon-chip[data-section-type="verse"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="verse"]   { background: #D4A35E; color: #1A1410; }
.dark-mode .lyric-ribbon-chip[data-section-type="chorus"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="chorus"]  { background: #6FBFA1; color: #0F2A1F; }
.dark-mode .lyric-ribbon-chip[data-section-type="bridge"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="bridge"]  { background: #C098CC; color: #2A1F30; }
.dark-mode .lyric-ribbon-chip[data-section-type="pre"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="pre"]     { background: #DDB458; color: #2A1F10; }
.dark-mode .lyric-ribbon-chip[data-section-type="intro"],
.dark-mode .lyric-ribbon-chip[data-section-type="outro"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="intro"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="outro"]   { background: #AAA; color: #1A1410; }
.dark-mode .lyric-ribbon-chip[data-section-type="tag"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="tag"]     { background: #7AABDB; color: #0F1A2A; }
.dark-mode .lyric-ribbon-chip[data-section-type="solo"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="solo"]    { background: #D87E5C; color: #2A1410; }
.dark-mode .lyric-ribbon-chip[data-section-type="instr"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="instr"]   { background: #B4C25E; color: #1F2A10; }

/* ============================================================
   CHORD CHEAT ROW — all unique chords used in the song
   ============================================================ */
.lyric-chord-cheats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px 0;
  padding: 8px 0;
  border-top: 0.5px dashed var(--paper-edge, #D6C9A9);
}

.lyric-chord-cheats-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint, #8A7755);
  font-weight: 500;
  margin-right: 4px;
}

.lyric-chord-cheat {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #B8581D);
  background: rgba(184, 88, 29, 0.08);
  border: 0.5px solid rgba(184, 88, 29, 0.25);
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.dark-mode .lyric-chord-cheats,
.lyric-sheet-container.dark-mode .lyric-chord-cheats {
  border-top-color: #444;
}
.dark-mode .lyric-chord-cheats-label,
.lyric-sheet-container.dark-mode .lyric-chord-cheats-label {
  color: #888;
}
.dark-mode .lyric-chord-cheat,
.lyric-sheet-container.dark-mode .lyric-chord-cheat {
  color: #e8c760;
  background: rgba(232, 199, 96, 0.1);
  border-color: rgba(232, 199, 96, 0.3);
}

/* ============================================================
   PER-SECTION VOCALIST CHIP — small name pill after the section
   label when a section's lead vocalist is annotated inline like
   "Chorus (Brian)" or "Verse 2 (Stevie Mae)".
   ============================================================ */
.section-vocalist-chip {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 8px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-style: normal;
  text-transform: uppercase;
  color: var(--ink-faint, #8A7755);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  vertical-align: middle;
}
.section-vocalist-chip::before {
  content: "♪ ";
  margin-right: 2px;
  opacity: 0.6;
}
.dark-mode .section-vocalist-chip,
.lyric-sheet-container.dark-mode .section-vocalist-chip {
  color: #BBB;
  background: rgba(255, 255, 255, 0.06);
}

/* Print: hide ribbon + cheats + chip in print — too noisy on paper. */
@media print {
  .lyric-section-ribbon,
  .lyric-chord-cheats,
  .section-vocalist-chip {
    display: none !important;
  }
}

/* ============================================================

/* ============================================================
   ROUND 6 (REVISED) — GREEN ON NEW FEATURES ONLY

   Scope: only the things I added — tools panel, meta strip,
   section ribbon, chord cheats, vocalist chip. The chart itself
   (chord text color, lyric layout, original section styling) is
   NOT TOUCHED. Plus: dark-mode lyrics shift to soft blue.
   ============================================================ */

/* --- Container design tokens — green palette for new features
   that read these vars. Doesn't touch chord text or lyric text
   colors; those have their own explicit rules elsewhere. --- */
.lyric-sheet-container {
  --paper:        #F5F2EA;
  --paper-edge:   #C8C8B8;
  --paper-tint:   rgba(61, 115, 89, 0.05);
  --ink:          #1A1F1B;
  --ink-muted:    #5A6058;
  --ink-faint:    #8A908A;
  --accent:       #3D7359;
  --accent-deep:  #2A523F;
  --accent-soft:  rgba(61, 115, 89, 0.1);
}
.lyric-sheet-container.dark-mode {
  --paper:        #0A0E0C;
  --paper-edge:   #4A5448;
  --paper-tint:   rgba(111, 191, 161, 0.06);
  --ink:          #EFEFEF;
  --ink-muted:    #B5BCC5;
  --ink-faint:    #888;
  --accent:       #6FBFA1;
  --accent-deep:  #4FA08D;
  --accent-soft:  rgba(111, 191, 161, 0.1);
}

/* --- Tool tokens (so .lyric-controls outside the container gets
   the same palette in setlist contexts) --- */
.lyric-controls {
  --tool-border: #C8C8B8;
  --tool-text:   #5A6058;
  --tool-accent: #3D7359;
}
.dark-mode .lyric-controls,
.lyric-sheet-container.dark-mode .lyric-controls,
.setlist-dark-mode .lyric-controls,
.setlist-container.setlist-dark-mode .lyric-controls {
  --tool-border: #555;
  --tool-text:   #BBB;
  --tool-accent: #6FBFA1;
}

/* --- Dark-mode LYRICS → soft blue.
   Has to override the round-3/4 #d4d4d4 + #EFEFEF rules. Highest
   specificity + !important guarantees it wins regardless of file
   load order. --- */
.lyric-sheet-container.dark-mode .lyrics,
.lyric-sheet-container.dark-mode .style-lyrics,
.lyric-sheet-container.dark-mode .lyric-line,
.lyric-sheet-container.dark-mode .style-harmonies,
.lyric-sheet-container.dark-mode .harmonies,
.dark-mode .lyric-line,
.setlist-dark-mode .lyric-line,
.setlist-container.setlist-dark-mode .lyric-line {
  color: #B0C8DC !important;
}

/* --- Meta strip KEY value (NEW) — green --- */
.lyric-meta-key .lyric-meta-value {
  color: #3D7359 !important;
}
.dark-mode .lyric-meta-key .lyric-meta-value,
.lyric-sheet-container.dark-mode .lyric-meta-key .lyric-meta-value {
  color: #6FBFA1 !important;
}

/* --- State pill (NEW) — green --- */
.lyric-state-pill {
  background: #3D7359 !important;
  color: #F5F2EA !important;
}
.lyric-state-pill:hover { background: #2A523F !important; }
.dark-mode .lyric-state-pill,
.lyric-sheet-container.dark-mode .lyric-state-pill {
  background: #6FBFA1 !important;
  color: #0A1410 !important;
}
.dark-mode .lyric-state-pill:hover,
.lyric-sheet-container.dark-mode .lyric-state-pill:hover {
  background: #4FA08D !important;
}

/* --- Tool button active fills (NEW styling) — green --- */
.lyric-controls .tools-toggle[aria-expanded="true"],
.lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-controls .toggle-accidentals[data-pref="flats"],
.lyric-controls .toggle-nashville.active,
.lyric-controls .size-btn.active {
  background: #3D7359 !important;
  color: #F5F2EA !important;
  border-color: #3D7359 !important;
}
.dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.dark-mode .lyric-controls .toggle-accidentals[data-pref="sharps"],
.dark-mode .lyric-controls .toggle-accidentals[data-pref="flats"],
.dark-mode .lyric-controls .toggle-nashville.active,
.dark-mode .lyric-controls .size-btn.active,
.lyric-sheet-container.dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-accidentals[data-pref="sharps"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-accidentals[data-pref="flats"],
.lyric-sheet-container.dark-mode .lyric-controls .toggle-nashville.active,
.lyric-sheet-container.dark-mode .lyric-controls .size-btn.active,
.setlist-dark-mode .lyric-controls .tools-toggle[aria-expanded="true"],
.setlist-dark-mode .lyric-controls .toggle-nashville.active {
  background: #6FBFA1 !important;
  color: #0A1410 !important;
  border-color: #6FBFA1 !important;
}

/* --- Tool panel background + hover tints — green --- */
.lyric-controls .tools-panel:not([hidden]) {
  background: rgba(61, 115, 89, 0.04) !important;
}
.dark-mode .lyric-controls .tools-panel:not([hidden]),
.lyric-sheet-container.dark-mode .lyric-controls .tools-panel:not([hidden]),
.setlist-dark-mode .lyric-controls .tools-panel:not([hidden]) {
  background: rgba(111, 191, 161, 0.06) !important;
}
.lyric-controls .tools-toggle:not([aria-expanded="true"]):hover,
.lyric-controls .toggle-accidentals:not([data-pref="sharps"]):not([data-pref="flats"]):hover,
.lyric-controls .toggle-chords:hover,
.lyric-controls .toggle-nashville:not(.active):hover,
.lyric-controls .reset-overrides:hover,
.lyric-controls .transpose-up:hover,
.lyric-controls .transpose-down:hover,
.lyric-controls .capo-up:hover,
.lyric-controls .capo-down:hover,
.lyric-controls .size-btn:not(.active):hover,
.lyric-controls .toggle-theme:hover,
.lyric-controls .toggle-plaintext:hover {
  background: rgba(61, 115, 89, 0.08) !important;
}
.dark-mode .lyric-controls .tools-toggle:not([aria-expanded="true"]):hover,
.lyric-sheet-container.dark-mode .lyric-controls .tools-toggle:not([aria-expanded="true"]):hover {
  background: rgba(111, 191, 161, 0.1) !important;
}

/* --- Transpose/capo numeric display — green --- */
.lyric-controls .transpose-display,
.lyric-controls .capo-display {
  color: #3D7359 !important;
}
.dark-mode .lyric-controls .transpose-display,
.dark-mode .lyric-controls .capo-display,
.lyric-sheet-container.dark-mode .lyric-controls .transpose-display,
.lyric-sheet-container.dark-mode .lyric-controls .capo-display,
.setlist-dark-mode .lyric-controls .transpose-display,
.setlist-dark-mode .lyric-controls .capo-display {
  color: #6FBFA1 !important;
}

/* --- Chord cheat row pills (NEW) — green --- */
.lyric-chord-cheat {
  color: #3D7359 !important;
  background: rgba(61, 115, 89, 0.08) !important;
  border-color: rgba(61, 115, 89, 0.3) !important;
}
.dark-mode .lyric-chord-cheat,
.lyric-sheet-container.dark-mode .lyric-chord-cheat {
  color: #7ED4B0 !important;
  background: rgba(111, 191, 161, 0.1) !important;
  border-color: rgba(111, 191, 161, 0.3) !important;
}

/* --- Section ribbon chips (NEW) — shift warm-tone types to greens.
   Cool-tone types (chorus/bridge/tag/intro/outro) keep their existing
   colors from earlier rounds — they were never the problem. --- */
.lyric-ribbon-chip[data-section-type="verse"] { background: #4A6B3D !important; color: #F5F2EA !important; }
.lyric-ribbon-chip[data-section-type="pre"]   { background: #6B7A4B !important; color: #F5F2EA !important; }
.lyric-ribbon-chip[data-section-type="solo"]  { background: #4A8A6F !important; color: #F5F2EA !important; }
.lyric-ribbon-chip[data-section-type="instr"] { background: #5A6B3D !important; color: #F5F2EA !important; }

.dark-mode .lyric-ribbon-chip[data-section-type="verse"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="verse"] { background: #9CC287 !important; color: #1A2510 !important; }
.dark-mode .lyric-ribbon-chip[data-section-type="pre"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="pre"]   { background: #C2D58A !important; color: #25260F !important; }
.dark-mode .lyric-ribbon-chip[data-section-type="solo"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="solo"]  { background: #8FD4BB !important; color: #0F2A1F !important; }
.dark-mode .lyric-ribbon-chip[data-section-type="instr"],
.lyric-sheet-container.dark-mode .lyric-ribbon-chip[data-section-type="instr"] { background: #ACBA77 !important; color: #1F2510 !important; }

/* --- Section header data-section-type colors — only the warm-tone types
   shift to greens. Chorus/bridge/tag/intro/outro keep what they had. --- */
[data-section-type="verse"] { border-left-color: #4A6B3D !important; background: rgba(74, 107, 61, 0.05) !important; }
[data-section-type="pre"]   { border-left-color: #6B7A4B !important; background: rgba(107, 122, 75, 0.05) !important; }
[data-section-type="solo"]  { border-left-color: #4A8A6F !important; background: rgba(74, 138, 111, 0.06) !important; }
[data-section-type="instr"] { border-left-color: #5A6B3D !important; background: rgba(90, 107, 61, 0.06) !important; }

.lyric-sheet-container:not(.dark-mode) [data-section-type="verse"] { color: #2F4827 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="pre"]   { color: #424E2A !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="solo"]  { color: #2E5A48 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="instr"] { color: #3A4527 !important; }

.dark-mode [data-section-type="verse"],
.lyric-sheet-container.dark-mode [data-section-type="verse"] { color: #B5D69F !important; background: rgba(156, 194, 135, 0.08) !important; border-left-color: #9CC287 !important; }
.dark-mode [data-section-type="pre"],
.lyric-sheet-container.dark-mode [data-section-type="pre"]   { color: #D3E29A !important; background: rgba(194, 213, 138, 0.08) !important; border-left-color: #C2D58A !important; }
.dark-mode [data-section-type="solo"],
.lyric-sheet-container.dark-mode [data-section-type="solo"]  { color: #A8E0CB !important; background: rgba(143, 212, 187, 0.08) !important; border-left-color: #8FD4BB !important; }
.dark-mode [data-section-type="instr"],
.lyric-sheet-container.dark-mode [data-section-type="instr"] { color: #BFCD8C !important; background: rgba(172, 186, 119, 0.08) !important; border-left-color: #ACBA77 !important; }

/* ============================================================
   ROUND 7 — POLISH PASS

   1) Lyrics blue goes darker (was too pale).
   2) Chord cheat row redesigned — no pills, just refined
      monospace text with hairline separators. Quieter, pro.
   3) Drawing toolbar gets a divider when it joins the tools
      panel as the rightmost group.
   ============================================================ */

/* --- Darker blue lyrics in dark mode --- */
.lyric-sheet-container.dark-mode .lyrics,
.lyric-sheet-container.dark-mode .style-lyrics,
.lyric-sheet-container.dark-mode .lyric-line,
.lyric-sheet-container.dark-mode .style-harmonies,
.lyric-sheet-container.dark-mode .harmonies,
.dark-mode .lyric-line,
.setlist-dark-mode .lyric-line,
.setlist-container.setlist-dark-mode .lyric-line {
  color: #88A5C5 !important;
}

/* --- Chord cheat row — refined, not "cheap" --- */
.lyric-chord-cheats {
  display: flex !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  margin: 0 0 24px 0 !important;
  padding: 6px 0 !important;
  border-top: 0.5px solid var(--paper-edge) !important;
  border-bottom: 0 !important;
}
.lyric-chord-cheats-label {
  font-size: 10px !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: var(--ink-faint) !important;
  font-weight: 500 !important;
  margin-right: 14px !important;
  font-family: inherit !important;
}
/* Chord text: no pill bg, no border. Just monospace text with thin
   middle-dot separators between items via ::before on all but first. */
.lyric-chord-cheat {
  display: inline-block !important;
  padding: 0 9px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-family: 'Menlo', 'Consolas', monospace !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  color: #3D7359 !important;
  position: relative !important;
}
.lyric-chord-cheat + .lyric-chord-cheat::before {
  content: "·";
  position: absolute;
  left: -2px;
  color: var(--ink-faint);
  opacity: 0.5;
}
.dark-mode .lyric-chord-cheat,
.lyric-sheet-container.dark-mode .lyric-chord-cheat {
  color: #7ED4B0 !important;
  background: transparent !important;
  border: 0 !important;
}

/* --- Drawing controls inside the tools panel — same group treatment
   as other tool clusters: separator border on the left when not the
   first group, padding to match. --- */
.lyric-controls .tools-panel .draw-controls.drawing-group {
  padding: 0 12px !important;
  border-left: 0.5px solid var(--tool-border, #C8C8B8) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.lyric-controls .tools-panel .draw-controls.drawing-group:first-child {
  padding-left: 0 !important;
  border-left: 0 !important;
}
/* The drawing toolbar's own outer chrome (sticky positioning, panel
   background) is suppressed when it's inside the tools panel — it
   becomes plain inline content. */
.lyric-controls .tools-panel .lsc-drawing-toolbar {
  position: static !important;
  top: auto !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.lyric-controls .tools-panel .lsc-drawing-toolbar .lsc-settings-panel {
  /* Pop the settings panel out as an absolute overlay so it doesn't
     break the inline tools row when opened. */
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  margin-top: 6px !important;
  background: var(--paper, #F5F2EA) !important;
  border: 0.5px solid var(--paper-edge, #C8C8B8) !important;
  border-radius: 6px !important;
  padding: 10px 12px !important;
  z-index: 10 !important;
}

/* ============================================================
   ROUND 8 — CHART DESIGN POLISH

   Goals stated by Jay:
   - Space is valuable. Reclaim it from chrome (meta strip,
     section headers, cheat row) and give it to the lyrics.
   - Sections want graphics or better visual identity.
   - Make every element look intentional.

   Approach: tighter chrome, typographic glyphs per section type
   in place of large colored backgrounds, reduce section header
   padding, eliminate redundant hairlines.
   ============================================================ */

/* === Metadata strip — tighter, single hairline below only === */
.lyric-meta-strip {
  padding: 4px 0 6px 0 !important;
  margin: 0 0 4px 0 !important;
  border-top: 0 !important;
  border-bottom: 0.5px solid var(--paper-edge) !important;
  gap: 14px !important;
  font-size: 11px !important;
}
.lyric-meta-label {
  font-size: 9px !important;
  letter-spacing: 0.2em !important;
  margin-right: 2px !important;
}
.lyric-meta-value {
  font-size: 12px !important;
  font-weight: 500 !important;
}
.lyric-meta-time-select {
  padding: 0 2px !important;
  font-size: 11px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
}

/* === Section ribbon — slimmer, tighter gap === */
.lyric-section-ribbon {
  margin: 8px 0 12px 0 !important;
  gap: 4px !important;
}
.lyric-ribbon-chip {
  min-width: 28px !important;
  height: 22px !important;
  padding: 0 7px !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
}

/* === Chord cheats — tighter top margin, smaller text === */
.lyric-chord-cheats {
  margin: 0 0 16px 0 !important;
  padding: 4px 0 !important;
}
.lyric-chord-cheat {
  font-size: 11px !important;
  padding: 0 7px !important;
}

/* ============================================================
   SECTION HEADERS — typographic glyph per type + tighter spacing

   Drops the heavy colored-background tints (which used to be
   the only differentiator) in favor of a small glyph in the
   left margin that's specific to the section type. The glyph
   becomes part of the section's visual identity — verses get
   §, choruses get ¶, bridges get ◊, etc. Cleaner, more
   editorial, lets the lyrics breathe.
   ============================================================ */

[data-section-type] {
  position: relative !important;
  /* Tighter than the previous 22px top / 8px bottom — claims back
     ~16px per section, which adds up over a 6-section song. */
  margin: 14px 0 4px 0 !important;
  padding: 2px 0 2px 26px !important;
  border-left-width: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  font-style: normal !important;
  font-family: inherit !important;
  display: block !important;
}

/* Glyph in the left margin, sized + positioned to anchor the
   section header. Color matches the section type. */
[data-section-type]::before {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  font-family: 'Georgia', 'Cambria', serif;
  width: 20px;
  text-align: center;
  line-height: 1;
}

[data-section-type="verse"]::before  { content: "§"; color: #4A6B3D; }
[data-section-type="chorus"]::before { content: "¶"; color: #2E6B5A; }
[data-section-type="bridge"]::before { content: "◊"; color: #7A4B82; }
[data-section-type="pre"]::before    { content: "‡"; color: #6B7A4B; }
[data-section-type="intro"]::before  { content: "▸"; color: #6B6B6B; font-family: inherit; font-size: 13px; }
[data-section-type="outro"]::before  { content: "◂"; color: #6B6B6B; font-family: inherit; font-size: 13px; }
[data-section-type="tag"]::before    { content: "⊕"; color: #3A6B9C; font-family: inherit; font-size: 14px; }
[data-section-type="solo"]::before   { content: "✦"; color: #4A8A6F; font-family: inherit; font-size: 13px; }
[data-section-type="instr"]::before  { content: "♪"; color: #5A6B3D; font-family: inherit; font-size: 13px; }

/* Section text color — refined dark tones, not the heavy
   background-tint approach. */
.lyric-sheet-container:not(.dark-mode) [data-section-type="verse"]  { color: #2F4827 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="chorus"] { color: #1A3D33 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="bridge"] { color: #4A2A53 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="pre"]    { color: #424E2A !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="intro"],
.lyric-sheet-container:not(.dark-mode) [data-section-type="outro"]  { color: #4A4A4A !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="tag"]    { color: #1F3D62 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="solo"]   { color: #2E5A48 !important; }
.lyric-sheet-container:not(.dark-mode) [data-section-type="instr"]  { color: #3A4527 !important; }

/* Dark mode — brighter glyph colors against black. */
.dark-mode [data-section-type="verse"]::before,
.lyric-sheet-container.dark-mode [data-section-type="verse"]::before  { color: #9CC287 !important; }
.dark-mode [data-section-type="chorus"]::before,
.lyric-sheet-container.dark-mode [data-section-type="chorus"]::before { color: #6FBFA1 !important; }
.dark-mode [data-section-type="bridge"]::before,
.lyric-sheet-container.dark-mode [data-section-type="bridge"]::before { color: #C098CC !important; }
.dark-mode [data-section-type="pre"]::before,
.lyric-sheet-container.dark-mode [data-section-type="pre"]::before    { color: #C2D58A !important; }
.dark-mode [data-section-type="intro"]::before,
.dark-mode [data-section-type="outro"]::before,
.lyric-sheet-container.dark-mode [data-section-type="intro"]::before,
.lyric-sheet-container.dark-mode [data-section-type="outro"]::before  { color: #AAA !important; }
.dark-mode [data-section-type="tag"]::before,
.lyric-sheet-container.dark-mode [data-section-type="tag"]::before    { color: #7AABDB !important; }
.dark-mode [data-section-type="solo"]::before,
.lyric-sheet-container.dark-mode [data-section-type="solo"]::before   { color: #8FD4BB !important; }
.dark-mode [data-section-type="instr"]::before,
.lyric-sheet-container.dark-mode [data-section-type="instr"]::before  { color: #ACBA77 !important; }

/* Dark mode section text — softer than glyph for hierarchy. */
.dark-mode [data-section-type="verse"],
.lyric-sheet-container.dark-mode [data-section-type="verse"]  { color: #B5D69F !important; }
.dark-mode [data-section-type="chorus"],
.lyric-sheet-container.dark-mode [data-section-type="chorus"] { color: #8FD4BB !important; }
.dark-mode [data-section-type="bridge"],
.lyric-sheet-container.dark-mode [data-section-type="bridge"] { color: #D4B0E0 !important; }
.dark-mode [data-section-type="pre"],
.lyric-sheet-container.dark-mode [data-section-type="pre"]    { color: #D3E29A !important; }
.dark-mode [data-section-type="intro"],
.dark-mode [data-section-type="outro"],
.lyric-sheet-container.dark-mode [data-section-type="intro"],
.lyric-sheet-container.dark-mode [data-section-type="outro"]  { color: #CCC !important; }
.dark-mode [data-section-type="tag"],
.lyric-sheet-container.dark-mode [data-section-type="tag"]    { color: #95C0E5 !important; }
.dark-mode [data-section-type="solo"],
.lyric-sheet-container.dark-mode [data-section-type="solo"]   { color: #A8E0CB !important; }
.dark-mode [data-section-type="instr"],
.lyric-sheet-container.dark-mode [data-section-type="instr"]  { color: #C7D478 !important; }

/* The first section after the chord-cheats / ribbon shouldn't carry
   extra top margin — we already have the chrome above it. */
.lyric-chord-cheats + [data-section-type],
.lyric-section-ribbon + [data-section-type],
.lyric-meta-strip + [data-section-type] {
  margin-top: 8px !important;
}

/* The setlist context wraps each song chart in extra padding —
   inside there, the first section's margin should also be reduced. */
.setlist-container .lyric-sheet-container [data-section-type]:first-of-type {
  margin-top: 8px !important;
}

/* ============================================================
   PLAIN-TEXT MODE — mobile chord spacing fix

   In plain-text mode on mobile, chords were touching the lyric
   line ABOVE them. Cause: with tight 1.8 line-height and the
   base -0.55em chord-text offset, the absolutely-positioned
   chord lands inside the previous line's space. Fix: give plain-
   text mode mobile lyrics a more generous line-height AND lift
   the chord-text higher into the gap.
   ============================================================ */
@media screen and (max-width: 768px) {
  .lyric-sheet-container.plain-text-mode .lyrics,
  .lyric-sheet-container.plain-text-mode .style-lyrics,
  .lyric-sheet-container.plain-text-mode .harmonies,
  .lyric-sheet-container.plain-text-mode .style-harmonies {
    line-height: 2.4 !important;
  }
  .lyric-sheet-container.plain-text-mode .lyrics span.chord span.chord-text,
  .lyric-sheet-container.plain-text-mode .style-lyrics span.chord span.chord-text,
  .lyric-sheet-container.plain-text-mode .harmonies span.chord span.chord-text,
  .lyric-sheet-container.plain-text-mode .style-harmonies span.chord span.chord-text {
    top: -1em !important;
    line-height: 1 !important;
  }
}
@media screen and (max-width: 480px) {
  .lyric-sheet-container.plain-text-mode .lyrics,
  .lyric-sheet-container.plain-text-mode .style-lyrics,
  .lyric-sheet-container.plain-text-mode .harmonies,
  .lyric-sheet-container.plain-text-mode .style-harmonies {
    line-height: 2.6 !important;
  }
}

/* ============================================
   SECTION MARKERS  (dropped into the chart body via the '@@Name' syntax;
   rendered to .section-marker spans by SectionMarkerFilter)
   ============================================
   A marker is an explicit, in-place section boundary + label. It makes
   the chart's structure unambiguous for the outline button, the section
   ribbon/nav-rail, and (later) collapse/expand — replacing the old
   guess-from-styling heuristics.

   Coloring follows the retired chart-v2 design intent: FOCAL sections
   (chorus / head — the parts a singer anchors to) get a green treatment;
   structural sections (verse, bridge, solo, …) get purple; the bare
   divider is just a thin rule. */

/* The marker is its own block-level line in the chart flow. */
.lyric-sheet-container .section-marker {
  display: block;
  margin: var(--section-marker-gap-top, 18px) 0 var(--section-marker-gap-bottom, 6px);
  padding: 0;
  /* The marker breaks the line; the chart's <br>-flow continues after it.
     The margins are variable-driven so the per-song spacing slider can
     close the big between-section gaps — these section margins, NOT the
     <br> line-height, are what create the large vertical dead space. */
}
.lyric-sheet-container .section-marker:first-child {
  margin-top: 0;
}

/* Named header: a small uppercased pill on a left accent rail. */
.lyric-sheet-container .section-marker__name {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  font-size: 0.62em;          /* relative to the large lyric font */
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  vertical-align: middle;
  /* Structural (default) = purple. */
  background: rgba(122, 76, 168, 0.14);
  color: #6b3fa0;
  border-left: 3px solid rgba(122, 76, 168, 0.45);
  padding-left: 12px;
}

/* Focal sections (chorus / head) = green. */
.lyric-sheet-container .section-marker--focal .section-marker__name {
  background: rgba(44, 122, 74, 0.15);
  color: #2c7a4a;
  border-left-color: rgba(44, 122, 74, 0.5);
}

/* Inline performance note — italic, muted, rides beside the name. */
.lyric-sheet-container .section-marker__note {
  margin-left: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.5em;
  color: #777;
  vertical-align: middle;
}

/* Repeat chip — ×N, monospace pill. */
.lyric-sheet-container .section-marker__repeat {
  margin-left: 8px;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 0.46em;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(122, 76, 168, 0.14);
  color: #6b3fa0;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.lyric-sheet-container .section-marker--focal .section-marker__repeat {
  background: rgba(44, 122, 74, 0.15);
  color: #2c7a4a;
}

/* Bare divider — an unlabeled boundary. Renders as a thin centered rule
   so you can see a section break without a header bar. */
.lyric-sheet-container .section-marker--divider {
  margin: 14px 0;
  height: 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.22);
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
.lyric-sheet-container.dark-mode .section-marker__name {
  background: rgba(196, 168, 224, 0.16);
  color: #c4a8e0;
  border-left-color: rgba(196, 168, 224, 0.4);
}
.lyric-sheet-container.dark-mode .section-marker--focal .section-marker__name {
  background: rgba(168, 208, 184, 0.16);
  color: #a8d0b8;
  border-left-color: rgba(168, 208, 184, 0.45);
}
.lyric-sheet-container.dark-mode .section-marker__note {
  color: rgba(184, 210, 230, 0.6);
}
.lyric-sheet-container.dark-mode .section-marker__repeat {
  background: rgba(196, 168, 224, 0.16);
  color: #c4a8e0;
}
.lyric-sheet-container.dark-mode .section-marker--focal .section-marker__repeat {
  background: rgba(168, 208, 184, 0.16);
  color: #a8d0b8;
}
.lyric-sheet-container.dark-mode .section-marker--divider {
  border-top-color: rgba(184, 210, 230, 0.25);
}

/* Fit-to-screen button — sits with the size presets; shows active state
   when fit mode is on (it recomputes on resize while active). */
.lyric-controls .fit-btn.active {
  background: #2e6b5a;
  color: #fff;
  border-color: #2e6b5a;
}

/* ── ISOLATED UNIT — Metronome ───────────────────────────────────────── */
.metronome-controls { position: relative; display: inline-block; }
.lyric-controls .metronome-toggle {
  background: transparent; color: var(--muted, #999);
  border: 1px solid var(--border, #444); border-radius: 4px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  font-family: inherit; opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lyric-controls .metronome-toggle:hover,
.lyric-controls .metronome-toggle[aria-expanded="true"] {
  opacity: 1; color: #B8581D; border-color: #B8581D;
}
.metronome-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 180px; padding: 10px 12px;
  background: var(--chart-bg, #1c1c1c); border: 1px solid var(--border, #444);
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 8px;
}
.metronome-row { display: flex; align-items: center; gap: 8px; }
.metronome-row--sig label { font-size: 12px; color: var(--muted, #999); }
.metronome-bpm-display {
  font-size: 20px; font-weight: 600; min-width: 2.4em; text-align: center;
  font-variant-numeric: tabular-nums; color: var(--text, #eee);
}
.metronome-bpm-unit { font-size: 11px; letter-spacing: 0.08em; color: var(--muted, #999); }
.metronome-controls button {
  background: transparent; color: var(--muted, #999);
  border: 1px solid var(--border, #444); border-radius: 4px;
  padding: 4px 9px; font-size: 13px; font-family: inherit; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.metronome-controls button:hover { color: #B8581D; border-color: #B8581D; }
.metronome-bpm-down, .metronome-bpm-up { font-size: 16px; line-height: 1; min-width: 28px; }
.metronome-sig {
  background: transparent; color: var(--text, #eee);
  border: 1px solid var(--border, #444); border-radius: 4px;
  padding: 3px 6px; font-family: inherit; font-size: 13px;
}
.metronome-row--actions { margin-top: 2px; }
.metronome-start.is-running { color: #fff; background: #B8581D; border-color: #B8581D; }
.metronome-reset-bpm { margin-left: auto; }
.lyric-sheet-container:not(.dark-mode) .lyric-controls .metronome-toggle,
.lyric-sheet-container:not(.dark-mode) .metronome-controls button {
  color: #6b5d4f; border-color: #c9b89a;
}
.lyric-sheet-container:not(.dark-mode) .metronome-popover { background: #faf6ec; }
.lyric-sheet-container:not(.dark-mode) .metronome-bpm-display { color: #2c2418; }

/* ── PARKED TOOLBAR CONTROLS (per J, 2026-06-22) ───────────────────────
   Role picker, Spacing slider, and Bars View are half-built / non-functioning
   and hidden until reworked. Hidden here in CSS (not just inline markup) so the
   hide is independent of any JS bundle/aggregation state. Restorable: delete
   this block (and the inline display:none in the JS) to bring them back. */
.lyric-controls .chart-role-control,
.tools-panel .chart-role-control,
.lyric-controls .spacing-controls,
.tools-panel .spacing-controls,
.lyric-controls .toggle-chartview,
.tools-panel .toggle-chartview {
  display: none !important;
}
