:root { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: #f7f5ef; color: #23382f; font-family: system-ui, sans-serif; font-size: 17px; line-height: 1.6; }
header { padding: 20px 5%; border-bottom: 1px solid #deded2; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
a { color: #285e47; }
.brand { font-size: 24px; font-weight: 750; text-decoration: none; }
main { max-width: 1080px; padding: 56px 24px; margin: auto; }
h1 { font-family: Georgia, serif; font-size: 44px; line-height: 1.2; margin: 12px 0; }
h2 { font-size: 22px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; font-weight: bold; }
section { margin-top: 32px; padding: 28px; background: #fff; border: 1px solid #deded2; border-radius: 12px; }
button, input, textarea, select { font: inherit; }
button, input, select { min-height: 44px; }
:focus-visible { outline: 3px solid #986f1b; outline-offset: 3px; }
@media (max-width: 600px) { h1 { font-size: 34px; } main { padding-top: 32px; } header span { display: none; } }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
button { background: #285e47; color: white; padding: 10px 20px; border: 1px solid #285e47; border-radius: 6px; cursor: pointer; font-weight: 650; }
button:hover { background: #1e4936; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: transparent; color: #285e47; }
.secondary:hover { background: #eef1e8; }
.catalog-layout { display: block; }
.catalog-layout > section { min-width: 0; overflow-wrap: anywhere; }
.song-facts { margin: 20px 0; }
.song-facts dt { font-weight: 650; margin-top: 12px; }
.song-facts dd { margin: 0; }
.song-note { white-space: pre-wrap; }
summary { cursor: pointer; color: #285e47; font-weight: 650; padding: 12px 0; min-height: 44px; }
.guitar-summary { border-left: 3px solid #deded2; padding-left: 14px; margin: 14px 0; }
.guitar-summary p { margin: 4px 0; }
#version-list button { margin-right: 14px; }
#version-list [aria-pressed="true"] { font-weight: 750; text-decoration: underline; }
.catalog-layout section { margin-top: 16px; }
[hidden] { display: none !important; }
label { display: block; font-weight: 600; margin-top: 18px; margin-bottom: 6px; }
label span, small { color: #54635c; font-weight: normal; }
input, textarea, select { width: 100%; padding: 10px; color: #23382f; border: 1px solid #9da99f; border-radius: 5px; background: white; }
textarea { resize: vertical; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.song-list { list-style: none; padding: 0; margin: 0; }
.song-list li { padding: 10px 0; border-bottom: 1px solid #e4e6de; }
.song-button { border: none; background: transparent; color: #285e47; padding: 6px 0; text-align: left; }
.song-button:hover { background: transparent; text-decoration: underline; }
.song-list small { display: block; }
.error { color: #9f2929; }
.notice { color: #285e47; }
.empty { color: #54635c; }
.entity-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; margin-top: 24px; }
@media (max-width: 600px) { .entity-layout { grid-template-columns: 1fr; } }
#versions-panel { margin-top: 32px; }
#chordpro { font-family: ui-monospace, monospace; font-size: 15px; }
#version-preview { margin-top: 24px; }
.music-line { min-height: 1.8em; white-space: pre-wrap; }
.chord { display: inline-block; font-size: .85em; font-weight: 700; color: #285e47; padding: 0 3px; background: #edf2e9; vertical-align: super; }
hr { border: 0; border-top: 1px solid #deded2; }
.search-panel { margin-top: 32px; padding: 24px; background: #ebece2; border-radius: 10px; }
.search-panel > label { margin-top: 0; }
.filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 600px) { .filter-row { grid-template-columns: 1fr; gap: 0; } }
.key-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.config-row { border: 1px solid #b8c1b5; padding: 16px; margin: 16px 0; border-radius: 8px; }
.config-row button { margin-top: 16px; }
.transpose-tools { margin-top: 24px; }
.check-label { display: flex; align-items: center; gap: 12px; font-weight: normal; }
.check-label input { width: 22px; min-height: 22px; height: 22px; flex-shrink: 0; }
#song-people { margin-top: 24px; }
#sequence-list li { padding: 8px 0; }
#sequence-list button { padding: 5px 10px; margin-left: 8px; font-size: 14px; }
#setlist-panel { margin-top: 32px; }
#setlist-panel li { padding: 10px 0; }
#setlist-panel li button { margin-left: 8px; padding: 5px 10px; }
#setlist-panel details { margin: 12px 0; padding: 12px; border: 1px solid #deded2; }
.song-list li select { margin-bottom: 8px; }
.auth-panel { max-width: 520px; margin: 48px auto; }
.auth-panel button, #invite-submit { margin-top: 24px; }
header #logout { margin-left: auto; }
.pwa-tools { max-width: 1080px; margin: 16px auto; padding: 0 24px; font-size: 14px; }
.pwa-tools button { margin: 4px 8px 4px 0; }
#connection-panel { max-width: 700px; margin: 32px auto; }
#music-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
#music-fields:disabled { opacity: .75; }
.danger { background: #922e2e; border-color: #922e2e; }
.danger:hover { background: #702020; }
#delete-confirm { padding: 16px; border: 1px solid #922e2e; margin-top: 20px; }

.pen-action { display: flex; align-items: center; justify-content: center; min-height: 64px; width: 100%; padding: 16px; background: #285e47; color: #fff; border-radius: 8px; text-align: center; font-size: 20px; font-weight: 700; text-decoration: none; }
.pen-action:hover { background: #1e4936; }

/* One task at a time. Sections keep their forms in place when navigation changes. */
#application { padding-top: 16px; }
.app-navigation { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; border-bottom: 1px solid #c8d0c6; }
.app-navigation button { min-height: 52px; background: #fff; color: #285e47; }
.app-navigation button[aria-current="page"] { background: #285e47; color: #fff; box-shadow: inset 0 -4px #b9d6a3; }
.page-heading { margin: 24px 0 16px; }
.page-heading h1 { font-family: inherit; font-size: 30px; }
.page-heading p { margin: 8px 0; }
.song-open #catalog-results, .song-open #search-form { display: none; }
#editor { margin-top: 0; }
#editor-title { font-size: 28px; }
#version-list { display: flex; gap: 8px; flex-wrap: wrap; }
#version-list br { display: none; }
#version-list button { border: 1px solid #9da99f; padding: 8px 16px; margin: 0; }
#version-list button[aria-pressed="true"] { background: #e2edda; text-decoration: none; border-color: #285e47; }
#versions-panel { margin-top: 8px; }
#versions-panel > hr { display: none; }
.read-action { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 12px; border: 2px solid #285e47; border-radius: 8px; text-decoration: none; font-size: 20px; font-weight: 700; }
#document-panel { padding: 20px; background: #f4f7f0; }
#document-panel h3 { margin-top: 0; }
.score-details, #metadata-editor, #music-editor { border-top: 1px solid #deded2; margin-top: 20px; }
#version-preview { padding: 12px 0; }
.event-context { padding: 16px; margin: 16px 0; background: #e2edda; border-left: 4px solid #285e47; }
.event-context p { margin-top: 0; font-weight: 650; }
.event-context button { margin: 4px 8px 4px 0; }
#message:empty, #pwa-status:empty { display: none; }
@media (max-width: 600px) {
  main { padding: 16px 12px 40px; }
  section { padding: 18px; margin-top: 20px; }
  .app-navigation button { flex: 1 1 42%; padding: 10px; }
  .title-row { gap: 12px; }
  .search-panel { padding: 18px; margin-top: 16px; }
}
