* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #000;
  background: #fff;
  color-scheme: light;
}

[hidden] { display: none !important; }

main {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* MIRRORED UI, pending on iOS: SoftChord/SoftChord/ContentView.swift does
   not have this row yet. It will be the songbook name, ▾, grey "Not saved",
   and Sign in, with Search below, on the song list only. The name truncates
   first; the arrow, the indicator and Sign in stay on screen. */
.songbook-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 2px;
  min-width: 0;
}

.songbook-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

#songbook-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  border: 0;
  background: none;
  padding: 4px 2px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

#songbook-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.songbook-caret { flex: none; }

#songbook-indicator {
  flex: none;
  color: #8e8e93;
  font-size: 13px;
  white-space: nowrap;
}

.sign-in-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  min-width: 0;
  max-width: 46%;
}

#sign-in-offline {
  flex: none;
  color: #8e8e93;
  font-size: 13px;
  white-space: nowrap;
}

#sign-in {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 4px 2px;
  color: #007aff;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}

#sign-in:disabled {
  opacity: 0.45;
  cursor: default;
}

#songbook-menu-button:focus-visible,
#sign-in:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: 4px;
}

.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px 6px;
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
}

#song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

#song-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid #e5e5ea;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

#song-list button:hover,
#song-list button:focus-visible {
  background: #f2f2f7;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e5ea;
}

#back {
  flex: none;
  border: 0;
  background: none;
  color: #007aff;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  padding: 4px 2px;
}

#song-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-group {
  display: flex;
  gap: 2px;
}

.tool-sep {
  width: 1px;
  height: 22px;
  background: #d1d1d6;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #1c1c1e;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tool svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool:hover { background: #f2f2f7; border-color: #d1d1d6; }

.tool:active { background: #e5e5ea; }

.tool:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 1px;
}

#transpose-down:hover, #transpose-up:hover { color: #007aff; }

.tool:disabled { opacity: 0.35; cursor: default; }

.tool:disabled:hover { background: none; border-color: transparent; color: #1c1c1e; }

#back:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* MIRRORED UI: the iOS app mirrors this toolbar and how it wraps
   (softChord Viewer/softChord Viewer/SongToolbar.swift). The desktop editor
   (src/softchord_toolbar.py) mirrors the groups, the flat look and the
   wrapping rule, and keeps the separators between groups on a row. A change to
   the button sizes, gaps, groups or the wrapping rules below is made in all
   three apps.

   viewer.js layoutToolbar measures the widest segment (Chords, with
   Transpose, the chord buttons, and Discard and Save) so the rows do not
   move when the segment changes:
   - One row (no class): Back, the title and the buttons share one row when
     that segment's buttons fit next to Back and a short title.
   - .narrow: otherwise Back and the title share the first row and the buttons
     get rows of their own below, with smaller buttons and no separators. When
     the widest segment's buttons fit on one row there, they are on one row
     in every segment.
   - .narrow.edit-row: when they do not, the Chords/Lyrics switch and the
     groups after it (chord buttons, Undo and Redo, Discard and Save) start
     the next row in every segment. The groups before them, and those groups
     among themselves, wrap whole onto the next row when they do not fit, so
     every button stays inside the window and never scrolls off it.
   Lyrics stays on small screens: the editor is a plain textarea and works
   there. */
.tool-break { display: none; }

.toolbar.narrow { flex-wrap: wrap; row-gap: 2px; padding: 6px 8px; }
.toolbar.narrow #back { order: 1; }
.toolbar.narrow #song-title {
  order: 2;
  font-size: 16px;
  padding-right: 44px; /* keeps the title centred, balancing the Back button */
}
.toolbar.narrow .toolbar-actions {
  order: 3;
  flex: 1 1 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* The 2px between rows is each item's top margin (the row gap would also
     come before the line of the break below). */
  gap: 0 12px;
  margin-top: -2px;
}
.toolbar.narrow .toolbar-actions > * { margin-top: 2px; }
.toolbar.narrow .tool-sep { display: none; }
.toolbar.narrow .tool-group { gap: 0; flex: none; }
.toolbar.narrow #edit-actions { margin-left: 0; gap: 6px; }
.toolbar.narrow .tool { width: 34px; height: 34px; }
.toolbar.narrow .segment-btn { height: 34px; }
/* A line of its own with no height: what follows starts the next row. */
.toolbar.narrow.edit-row .tool-break {
  display: block;
  flex: 0 0 100%;
  height: 0;
  margin-top: 0;
}

@media (max-width: 360px) {
  .toolbar.narrow .tool { width: 30px; height: 30px; }
  .toolbar.narrow .segment-btn { height: 30px; padding: 0 8px; }
  .toolbar.narrow .toolbar-actions { column-gap: 8px; }
}

/* While viewer.js measures the groups: every group shows, on one line,
   including ones the open segment hides (Transpose on Lyrics). */
.toolbar.measuring .toolbar-actions { flex-wrap: nowrap; width: max-content; }
.toolbar.measuring .toolbar-actions > .tool-group[hidden] { display: flex !important; }
.toolbar.measuring:not(.narrow) .tool-sep[hidden] { display: block !important; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

#sheet-scroll {
  flex: 1;
  overflow: auto;
  background: #fff;
}

/* The sheet and the editor that lies over it while the text is edited are set
   in exactly the same type, so that every letter of one is under the same
   letter of the other. Kerning and ligatures are off for both, because the
   sheet draws each letter on its own and the textarea draws a run of text. */
#sheet, #sheet-editor {
  font-family: "Times New Roman", Times, serif;
  /* Zoom changes only this font size. The chords and the line gaps are in em,
     so they scale with it and stay over their letters. */
  font-size: calc(20px * var(--zoom, 1));
  line-height: 1.2;
  color: #000;
  font-kerning: none;
  font-variant-ligatures: none;
  font-feature-settings: "kern" 0, "liga" 0, "clig" 0;
  letter-spacing: normal;
  word-spacing: normal;
  text-indent: 0;
  tab-size: 8;
}

#sheet {
  padding: 16px 32px 40px;
}

#sheet-wrap { position: relative; }

/* Editing, on screen only. Every line keeps room for its chords, so a line does
   not move when the first chord lands on it or the last one leaves, and the
   textarea can use one even line height: the room for the chords (--edit-gap)
   plus the line (1.2em). The first line is moved down by half the room, because
   a textarea centres its letters in its line box and the sheet puts them at the
   bottom of its own. --edit-gap is an even number of whole pixels, about 1.15em,
   set by viewer.js with the zoom. With a whole-pixel half the browser rounds the
   letters of the textarea and of the sheet to the same pixel row. With 1.15em
   they differed by a pixel at some zoom levels. */
@media screen {
  #sheet-wrap.editing .line { margin-top: var(--edit-gap, 1.15em); }

  #sheet-editor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    margin: 0;
    border: 0;
    outline: none;
    resize: none;
    overflow: hidden;
    padding: calc((16px + var(--edit-gap, 1.15em) / 2) * var(--boost, 1))
      calc(32px * var(--boost, 1)) calc(40px * var(--boost, 1));
    line-height: calc(1.2em + var(--edit-gap, 1.15em) * var(--boost, 1));
    white-space: pre;
    overflow-wrap: normal;
    background: transparent;
    /* The letters under it show through. Only the caret and the selection
       are drawn by the textarea. */
    color: transparent;
    -webkit-text-fill-color: transparent;
    caret-color: #000;
  }

  /* iPhone Safari zooms the page when a text field under 16px gets focus. Below
     80% zoom the sheet's font is under 16px, so the textarea is laid out with a
     font of 16px (--boost, set by viewer.js, is the ratio that makes it 16px) and
     every length of it multiplied by the same number, then scaled back down to
     cover the sheet exactly. --boost is 1 and there is no transform at 80% and up. */
  #sheet-wrap {
    --boost: 1;
  }

  #sheet-editor {
    font-size: max(16px, calc(20px * var(--zoom, 1) * var(--boost, 1)));
  }

  #sheet-wrap.boosted #sheet-editor {
    transform: scale(calc(1 / var(--boost, 1)));
    transform-origin: 0 0;
  }

  #sheet-editor::selection {
    background: rgba(0, 122, 255, 0.3);
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

#edit-actions { gap: 6px; margin-left: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Edit chords, on screen only. The lines keep room for chords like in Edit text
   (the rule above for .editing), so a line does not move when its first chord is
   added or its last one is taken away. The sheet is not text to select here:
   a press on a chord drags it. */
@media screen {
  #sheet-wrap.chord-mode #sheet {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* A chord reaches 6px past its own box, the same slop as in the iPhone app, so it
     is easy to hit and to grab. It is measured in screen pixels, not in em, so it
     does not shrink with the zoom. */
  #sheet-wrap.chord-mode .chord { touch-action: none; }

  #sheet-wrap.chord-mode .chord::before {
    content: "";
    position: absolute;
    top: -6px;
    right: -6px;
    bottom: -6px;
    left: -6px;
  }

  /* The selected letter and its chord, like the selection of the other apps. */
  #sheet-wrap.chord-mode .char.selected {
    background: rgba(0, 122, 255, 0.2);
    border-radius: 3px;
  }

  #sheet-wrap.chord-mode .char.selected .chord {
    background: rgba(0, 122, 255, 0.25);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25), 0 0 0 3px #007aff;
    border-radius: 2px;
  }

  /* A chord in the hand is lifted a little, and the hand is closed everywhere. */
  #sheet-wrap.chord-mode .chord.dragging {
    background: rgba(90, 169, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(90, 169, 255, 0.4), 0 0 0 3px #007aff, 0 3px 8px rgba(0, 0, 0, 0.25);
    border-radius: 2px;
    z-index: 2;
  }

  #sheet-wrap.chord-mode.dragging,
  #sheet-wrap.chord-mode.dragging * { cursor: grabbing !important; }

  #sheet-wrap.chord-mode #sheet:focus { outline: none; }

  #sheet-wrap.chord-mode #sheet:focus-visible {
    outline: 1px solid rgba(0, 122, 255, 0.5);
    outline-offset: -1px;
  }
}

/* Under a mouse (not on a touch screen, where there is no hover): the chord the
   pointer is over is a light-blue pill with a thin outline and the cursor of a hand
   that can grab it, and its letter has a faint grey box, like the hover of the
   desktop app. A letter with no chord gets only the faint box. */
@media screen and (hover: hover) {
  #sheet-wrap.chord-mode .char { cursor: pointer; }

  #sheet-wrap.chord-mode:not(.dragging) .char:hover {
    background: rgba(60, 60, 67, 0.09);
    border-radius: 3px;
  }

  #sheet-wrap.chord-mode .chord { cursor: grab; }

  #sheet-wrap.chord-mode:not(.dragging) .chord:hover {
    background: rgba(90, 169, 255, 0.28);
    box-shadow: 0 0 0 2px rgba(90, 169, 255, 0.28), 0 0 0 3px #4f9cff;
    border-radius: 2px;
  }

  /* The selection stays blue under the pointer. */
  #sheet-wrap.chord-mode:not(.dragging) .char.selected:hover {
    background: rgba(0, 122, 255, 0.2);
  }
}

#chord-entry {
  position: fixed;
  z-index: 30;
  width: 260px;
  box-sizing: border-box;
  padding: 12px;
  background: #fff;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

#chord-entry[hidden] { display: none; }

/* 16px or more: below that a phone zooms the page in when the field is focused. */
#chord-entry-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 18px;
  color: #1c1c1e;
}

#chord-entry-field:focus { outline: 2px solid #007aff; outline-offset: -1px; }

#chord-entry-field.invalid {
  border-color: #ff3b30;
  background: #fff5f4;
  color: #d70015;
}

#chord-entry-field.invalid:focus { outline-color: #ff3b30; }

#chord-entry-note {
  min-height: 1.3em;
  margin: 6px 2px 10px;
  font-size: 13px;
  color: #6c6c70;
}

#chord-entry-field.invalid + #chord-entry-note { color: #d70015; }

.chord-entry-buttons { display: flex; justify-content: flex-end; gap: 8px; }

#chord-entry-ok {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
  font-weight: 600;
}

#chord-entry-ok:disabled { opacity: 0.4; cursor: default; filter: none; }

/* A narrow window: the entry is a sheet at the bottom, above the keyboard of a
   phone (the script sets --keyboard from the visual viewport), and the song gets
   room to scroll the selected letter clear of it. */
@media (max-width: 760px) {
  #chord-entry {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: var(--keyboard, 0px);
    width: auto;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
  }

  #sheet-wrap.entry-open { margin-bottom: 45vh; }
}

#segment-switch { gap: 0; }

.segment-btn {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #c7c7cc;
  background: #fff;
  color: #1c1c1e;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

#segment-chords { border-radius: 8px 0 0 8px; }

#segment-lyrics { border-radius: 0 8px 8px 0; border-left-width: 0; }

.segment-btn[aria-pressed="true"] {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
  font-weight: 600;
}

#segment-lyrics[aria-pressed="true"] { border-left-width: 1px; }

.segment-btn:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 1px;
  position: relative;
  z-index: 1;
}

.tool-text {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: #1c1c1e;
  cursor: pointer;
}

#edit-save {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
  font-weight: 600;
}

.tool-text:hover { filter: brightness(0.96); }

.tool-text:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 1px;
}

.line {
  display: flex;
  white-space: pre;
  min-height: 1.2em;
}

.line.has-chords { margin-top: 1.15em; }

.char { position: relative; }

/* A tab is as wide as viewer.js (fitTabs) sets it, not 8 spaces. */
.char.tab { flex: none; }

.chord {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 0.6em;
  color: blue;
  white-space: nowrap;
  line-height: 1;
}

/* Text in a chord position that is not a chord (cut to 7 characters). */
.chord.unrecognized { color: red; }

.accidental {
  font-family: Arial, "Arial Unicode MS", sans-serif;
  position: relative;
  top: -0.12em;
}

#persist-note {
  margin: 0;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  color: #6e6e73;
  border-top: 1px solid #e5e5ea;
  background: #fff;
}

.error, .status {
  padding: 16px;
  margin: 0;
}

.error { color: #c00; }

.status { color: #6e6e73; }

.menu {
  position: fixed;
  z-index: 10;
  min-width: 240px;
  background: #fff;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
}

.menu button:hover,
.menu button:focus-visible {
  background: #f2f2f7;
}

#songbook-menu {
  z-index: 30;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
}

.menu-label {
  padding: 6px 14px 2px;
  font-size: 12px;
  font-weight: 600;
  color: #8e8e93;
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: #e5e5ea;
}

.menu button.songbook-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.menu-check {
  flex: none;
  width: 1.1em;
  text-align: center;
}

.menu-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#notice {
  border: none;
  border-radius: 12px;
  padding: 20px;
  max-width: 360px;
}

#notice h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

#notice p { margin: 0 0 16px; }

#notice button {
  font: inherit;
  float: right;
}

#sign-in-panel {
  border: none;
  border-radius: 12px;
  padding: 20px;
  max-width: 360px;
  width: min(360px, calc(100vw - 32px));
}

#sign-in-panel h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

#sign-in-panel p { margin: 0 0 12px; }

#sign-in-panel label {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
}

#sign-in-email {
  display: block;
  width: 100%;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  margin: 0 0 12px;
}

#sign-in-address { overflow-wrap: anywhere; }

#sign-in-panel .error { padding: 0; }

.sign-in-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#sign-in-send,
#sign-in-resend {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
  font-weight: 600;
}

#account-menu {
  z-index: 30;
  min-width: 220px;
}

#leave-confirm {
  border: none;
  border-radius: 12px;
  padding: 20px;
  max-width: 340px;
}

#leave-confirm h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

#leave-confirm p { margin: 0 0 16px; }

.leave-confirm-buttons { display: flex; justify-content: flex-end; gap: 8px; }

#leave-confirm-discard { margin-right: auto; }

#leave-confirm-discard { color: #d70015; }

#leave-confirm-save {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
  font-weight: 600;
}

/* Printing and "Save as PDF": only the song is printed (title, lyrics and chords),
   black on white. The size is fixed (12 pt lyrics, chords 0.6 times that) and
   ignores the on-screen zoom, so a page looks the same however the screen was
   zoomed. The song is printed as it is shown, so a transposed song prints
   transposed. A chord line and its lyric line are kept together on one page.
   The white border is set twice. @page is the browser's page margin, and it is
   ignored when the print dialog says Margins: None (the text then touched the
   paper's edge). So the printed content also has its own padding, repeated on
   every page. With the browser's default margins the two add up, a little wider
   than either alone, which is fine on paper. */
@page { margin: 10mm; }

@media print {
  html, body, main {
    height: auto;
    background: #fff;
    color: #000;
  }

  #list-view, #songbook-header, #songbook-menu, #account-menu, #back, .toolbar-actions, #persist-note,
  #toast, #menu, #notice, #sign-in-panel, #leave-confirm,
  #song-error, #sheet-editor, #chord-live, #chord-entry {
    display: none !important;
  }

  main {
    display: block;
    padding: 10mm;
    /* Each page gets the padding at its top and bottom, not only the first
       and last. */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .toolbar {
    display: block;
    padding: 0 0 8pt;
    border: 0;
  }

  #song-title {
    margin: 0;
    font-family: "Times New Roman", Times, serif;
    font-size: 18pt;
    text-align: left;
    white-space: normal;
    overflow: visible;
    break-after: avoid;
  }

  #sheet-scroll {
    overflow: visible;
    flex: none;
  }

  #sheet {
    padding: 0;
    font-size: 12pt;
  }

  /* The chords sit above their line, so give the room as padding inside the line
     (a margin would be dropped at the top of a page and cut the chords off). */
  /* A line longer than the page wraps (the screen scrolls sideways instead). Each
     letter is a flex item, so it wraps between letters. The chords of a wrapped
     row sit in the gap above it, so the gap is the same room as the padding. */
  .line {
    break-inside: avoid;
    flex-wrap: wrap;
  }

  .line.has-chords {
    margin-top: 0;
    padding-top: 1.15em;
    row-gap: 1.15em;
  }

  .chord { color: #000; }
  /* Red may print as grey, so the text is also in italics. */
  .chord.unrecognized { color: #c00; font-style: italic; }
}
