:root {
  color-scheme: light;
  --ink: #092f24;
  --paper: #ebe6d9;
  --panel: #fffaf0;
  --white: #fffdf7;
  --muted: #6e7066;
  --line: #d8d1bd;
  --accent: #f5b51b;
  --accent-dark: #07523b;
  --gold-text: #c98900;
  --green: #07523b;
  --shadow: 0 18px 60px rgba(42, 35, 25, .12);
  --sheet-font-size: 15px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2eadb;
  --paper: #0b110f;
  --panel: #111916;
  --white: #19231f;
  --muted: #a7aea8;
  --line: #34443d;
  --accent: #f3b61e;
  --accent-dark: #83d2af;
  --gold-text: #f3b61e;
  --green: #83d2af;
  --shadow: 0 18px 60px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { width: 100%; max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; overscroll-behavior-x: none; }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--panel); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overscroll-behavior-x: none; }
main { width: 100%; min-width: 0; max-width: 100%; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(7, 82, 59, .28); outline-offset: 2px; }

.public-header { position: absolute; inset: 0 0 auto; z-index: 5; height: 76px; padding: 16px clamp(20px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; }
.mini-brand, .compact-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mini-brand img { width: 38px; height: 38px; }
.mini-brand strong, .mini-brand small { display: block; }
.mini-brand strong { font: 850 17px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.035em; }
.mini-brand small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.brand-wordmark { display: inline-flex; align-items: baseline; gap: .14em; font-style: normal; }
.brand-wordmark span { color: var(--accent-dark); }
.brand-wordmark em { color: var(--gold-text); font-style: normal; }

.search-stage { width: 100%; min-width: 0; min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); padding: 24vh 20px 80px; display: flex; align-items: center; flex-direction: column; background-image: radial-gradient(circle at 50% 22%, rgba(245,181,27,.14), transparent 26%), linear-gradient(rgba(216,209,189,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(216,209,189,.14) 1px, transparent 1px); background-size: auto, 32px 32px, 32px 32px; transition: padding .25s ease, min-height .25s ease; }
.search-brand { text-align: center; }
.search-brand img { display: block; margin: 0 auto 18px; }
.search-brand h1 { margin: 0; font: 900 clamp(46px, 7vw, 76px)/.92 ui-sans-serif, system-ui, sans-serif; letter-spacing: -.065em; }
.search-brand p { margin: 16px 0 34px; color: var(--muted); font-size: 17px; }
.search-shell { position: relative; width: min(720px, 100%); display: flex; align-items: center; gap: 10px; }
.compact-brand { display: none; flex: 0 0 auto; }
.search-control { position: relative; flex: 1; min-width: 0; }
.search-box { height: 62px; padding: 0 18px; display: flex; align-items: center; gap: 13px; background: var(--white); border: 1px solid #cfc4b4; border-radius: 17px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--accent-dark); box-shadow: 0 18px 60px rgba(42,35,25,.13), 0 0 0 4px rgba(7,82,59,.1); }
.search-box svg { width: 22px; flex: 0 0 auto; fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 17px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 32px; height: 32px; padding: 0; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 24px; }
.search-clear:hover { color: var(--ink); background: var(--paper); }
.search-status { min-height: 20px; margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.suggestions { position: absolute; top: calc(100% + 9px); left: 0; right: 0; z-index: 30; max-height: min(520px, 60vh); overflow-y: auto; padding: 7px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(35,29,22,.18); }
.suggestion { width: 100%; padding: 12px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 14px; color: inherit; background: transparent; border: 0; border-radius: 9px; cursor: pointer; text-align: left; text-decoration: none; }
.suggestion:hover, .suggestion.active { background: #f7f0d9; }
.suggestion strong { overflow: hidden; font: 700 17px Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.suggestion small { grid-column: 1; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 10px; font-weight: 800; text-align: right; text-transform: uppercase; letter-spacing: .05em; }
.correction { display: block; margin-top: 3px; color: var(--accent-dark); font-size: 9px; }
.suggestion-empty { padding: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.suggestion-group-title { margin: 4px 6px 2px; padding: 8px 7px 6px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.suggestion-group-title:first-child { margin-top: 0; border-top: 0; }
.suggestion-group-title span { min-width: 22px; height: 22px; display: grid; place-items: center; color: var(--accent-dark); background: #f8e9ac; border-radius: 999px; letter-spacing: 0; }
.artist-suggestion { background: #eef5ef; }
.artist-suggestion strong { color: var(--accent-dark); }
.artist-suggestion .suggestion-meta { color: var(--accent-dark); }

.suggestions-open:not(.reading):not(.artist-view) .search-stage { min-height: calc(100vh - 48px); padding-top: clamp(92px, 9vh, 128px); align-items: center; }
.suggestions-open:not(.reading):not(.artist-view) .search-brand img { width: 68px; height: 68px; margin-bottom: 10px; }
.suggestions-open:not(.reading):not(.artist-view) .search-brand h1 { font-size: clamp(44px, 5.6vw, 62px); }
.suggestions-open:not(.reading):not(.artist-view) .search-brand p { margin: 12px 0 24px; font-size: 15px; }
.suggestions-open:not(.reading):not(.artist-view) .search-shell { align-items: flex-start; }
.suggestions-open:not(.reading):not(.artist-view) .suggestions { position: static; max-height: clamp(180px, calc(100dvh - 500px), 440px); margin-top: 9px; overflow-y: auto; overscroll-behavior: contain; }

.reading .public-header, .artist-view .public-header { display: none; }
.reading .search-stage, .artist-view .search-stage { position: sticky; top: 0; z-index: 20; min-height: 0; padding: 11px 20px; align-items: stretch; background: rgba(255,250,241,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.reading .search-brand, .artist-view .search-brand { display: none; }
.reading .search-shell, .artist-view .search-shell { width: min(1120px, 100%); margin: 0 auto; }
.reading .compact-brand, .artist-view .compact-brand { display: inline-flex; }
.reading .search-box, .artist-view .search-box { height: 48px; border-radius: 13px; box-shadow: none; }
.reading .search-status, .artist-view .search-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.artist-shell { min-height: calc(100vh - 72px); padding: 44px clamp(18px, 4vw, 62px) 100px; background-color: var(--panel); background-image: linear-gradient(rgba(216,208,195,.17) 1px, transparent 1px), linear-gradient(90deg, rgba(216,208,195,.12) 1px, transparent 1px); background-size: 30px 30px; }
.artist-page { width: min(1120px, 100%); margin: 0 auto; }
.artist-page-header { padding: 4px 0 30px; border-bottom: 2px solid var(--ink); }
.artist-page-header h2 { margin: 0; font: 700 clamp(48px, 7vw, 82px)/.94 Georgia, serif; letter-spacing: -.045em; }
.artist-page-meta { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.artist-catalog { padding-top: 28px; }
.artist-section-heading { margin-bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.artist-section-heading span { color: var(--accent-dark); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.artist-section-heading h3 { margin: 4px 0 0; font: 700 28px/1.05 Georgia, serif; }
.artist-section-heading .artist-song-count { color: var(--muted); letter-spacing: .06em; }
.artist-song-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.artist-song-card { min-width: 0; min-height: 78px; padding: 14px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; color: inherit; background: rgba(255,253,247,.88); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; text-decoration: none; transition: border-color .16s, background .16s, transform .16s; }
.artist-song-card:hover { background: #fff8e8; border-color: #b8aa94; transform: translateY(-1px); }
.artist-song-copy { min-width: 0; }
.artist-song-copy strong, .artist-song-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-song-copy strong { font: 700 18px/1.15 Georgia, serif; }
.artist-song-copy small { margin-top: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.artist-song-keys { color: var(--accent-dark); font: 800 11px ui-monospace, monospace; white-space: nowrap; }
.artist-song-arrow { color: var(--gold-text); font-size: 20px; }
.artist-load-sentinel { min-height: 54px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.artist-load-spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent-dark); border-radius: 50%; animation: artist-loading .7s linear infinite; }
@keyframes artist-loading { to { transform: rotate(360deg); } }
.artist-detail-link { display: inline-block; text-decoration: none; }
.artist-detail-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.reader-shell { width: 100%; min-width: 0; max-width: 100%; min-height: 80vh; padding: 44px clamp(18px, 4vw, 62px) 100px; overflow-x: hidden; background-color: var(--panel); background-image: linear-gradient(rgba(216,208,195,.17) 1px, transparent 1px), linear-gradient(90deg, rgba(216,208,195,.12) 1px, transparent 1px); background-size: 30px 30px; }
.song-reader { width: min(1320px, 100%); min-width: 0; max-width: 100%; margin: 0 auto; }
.breadcrumbs { margin-bottom: 22px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.breadcrumbs a { color: var(--accent-dark); text-decoration: none; font-weight: 800; }
.song-header { padding-bottom: 26px; display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; border-bottom: 2px solid var(--ink); }
.song-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.print-cifra-button { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; gap: 7px; color: var(--accent-dark); background: var(--white); border: 1px solid #b9cbbd; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.correct-cifra-button { min-height: 42px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; color: #6f6a61; background: transparent; border: 1px solid #d8d0c3; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.correct-cifra-button:hover { color: var(--panel); background: var(--accent-dark); border-color: var(--accent-dark); }
.print-cifra-button span { font-size: 17px; line-height: 1; }
.print-cifra-button:hover { color: var(--panel); background: var(--accent-dark); border-color: var(--accent-dark); }
.print-cifra-button:disabled { cursor: wait; opacity: .55; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; }
.song-header h2 { margin: 0; font: 700 clamp(42px, 6vw, 74px)/.95 Georgia, serif; letter-spacing: -.035em; }
.composers { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.version-switcher { padding: 18px 0; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.section-heading strong { color: var(--accent-dark); }
.version-list { display: flex; flex-wrap: wrap; gap: 7px; }
.version-button { padding: 8px 10px; display: inline-flex; gap: 8px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 11px; }
.version-button.active { color: var(--panel); background: var(--ink); border-color: var(--ink); }
.version-key { font-weight: 900; }

.reader-toolbar { position: static; z-index: 15; margin: 18px 0; padding: 9px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; background: rgba(235,227,214,.94); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(43,35,25,.08); backdrop-filter: blur(12px); }
.tool-cluster { min-height: 38px; padding: 0 12px; display: flex; align-items: center; flex: 0 0 auto; gap: 7px; border-right: 1px solid #ccc2b3; }
.tool-cluster:first-child { padding-left: 0; }
.tool-cluster:last-child { padding-right: 0; border-right: 0; }
.tool-label { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.stepper { display: flex; overflow: hidden; background: var(--white); border: 1px solid #c9bdae; border-radius: 7px; }
.stepper button, .square-button, .layout-button { height: 34px; min-width: 34px; padding: 0 9px; color: var(--accent-dark); background: var(--white); border: 0; cursor: pointer; font-weight: 900; }
.stepper button:hover, .square-button:hover, .layout-button:hover { color: var(--ink); background: var(--accent); }
.stepper output { min-width: 52px; height: 34px; display: grid; place-items: center; color: var(--panel); background: var(--ink); font: 800 13px ui-monospace, monospace; }
.text-button, .tool-button { height: 34px; padding: 0 11px; color: var(--accent-dark); background: var(--white); border: 1px solid #b9cbbd; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.tool-button[aria-pressed="true"] { color: var(--white); background: var(--accent-dark); border-color: var(--accent-dark); }
.primary-tool { color: var(--panel); background: var(--ink); border-color: var(--ink); }
.primary-tool:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.speed-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.speed-control input { width: 76px; accent-color: var(--accent); }
.font-output { min-width: 24px; color: var(--muted); font: 700 10px ui-monospace, monospace; text-align: center; }
.segmented-control { display: flex; overflow: hidden; background: var(--white); border: 1px solid #c9bdae; border-radius: 7px; }
.layout-button { border-left: 1px solid var(--line); }
.layout-button:first-child { border-left: 0; }
.layout-button.active { color: var(--panel); background: var(--ink); }
.view-status { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tool-button:disabled, .square-button:disabled { cursor: not-allowed; opacity: .38; }
.columns-mode #autoscroll-cluster { opacity: .45; }

.badges { padding: 2px 0 17px; display: flex; flex-wrap: wrap; gap: 7px; }
.badge { padding: 6px 9px; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.badge.accent { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.chord-index { padding: 17px 0; display: flex; align-items: flex-start; gap: 18px; border-block: 1px solid var(--line); }
.chord-index > span { padding-top: 5px; flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.chords { display: flex; flex-wrap: wrap; gap: 6px; }
.chord { min-width: 34px; padding: 4px 7px; color: var(--accent-dark); background: #f8e9b4; border: 0; border-radius: 5px; font: 800 12px ui-monospace, monospace; text-align: center; }
.chord-trigger { cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.chord-trigger:hover, .chord-trigger:focus-visible, .chord-trigger[aria-expanded="true"] { color: var(--panel); background: var(--accent-dark); outline: 0; transform: translateY(-1px); }
.chord-trigger:focus-visible { box-shadow: 0 0 0 3px rgba(229,83,38,.22); }
.chord-popover { position: fixed; z-index: 300; width: 196px; padding: 14px 12px 12px; color: var(--ink); background: rgba(255,253,249,.98); border: 1px solid #d7cdbf; border-radius: 12px; box-shadow: 0 18px 50px rgba(30,24,17,.2); pointer-events: auto; }
.chord-popover[hidden] { display: none; }
.chord-diagram { display: grid; justify-items: center; }
.chord-diagram-title { margin-bottom: 2px; font: 800 18px/1.1 ui-monospace, monospace; letter-spacing: -.03em; }
.chord-diagram-svg { width: 164px; height: 174px; overflow: visible; }
.chord-fret, .chord-string { stroke: #776f66; stroke-width: 1.25; }
.chord-nut { stroke: var(--ink); stroke-width: 5; }
.chord-barre { stroke: var(--ink); stroke-width: 15; stroke-linecap: round; }
.chord-finger { fill: var(--ink); }
.chord-string-marker { fill: var(--muted); font: 700 15px ui-monospace, monospace; text-anchor: middle; }
.chord-fret-number { fill: var(--muted); font: 700 10px ui-monospace, monospace; text-anchor: middle; }
.chord-diagram-unavailable { max-width: 145px; padding: 16px 6px 7px; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: center; }
.chord-audio-button { min-height: 36px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--panel); background: var(--accent-dark); border: 0; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 900; letter-spacing: .03em; }
.chord-audio-button:hover, .chord-audio-button:focus-visible { background: var(--ink); outline: 0; box-shadow: 0 0 0 3px rgba(7,82,59,.16); }
.chord-audio-button.playing { background: var(--accent); }
.chord-audio-icon { font-size: 10px; transform: translateX(1px); }

.sheet-grid { width: 100%; min-width: 0; max-width: 100%; margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.sheet-page { width: 100%; min-width: 0; max-width: 100%; margin: 0; padding: clamp(20px, 3vw, 38px); overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; color: #25211c; background: rgba(255,253,249,.9); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 34px rgba(38,31,23,.07); font: 500 var(--sheet-font-size)/1.58 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre; tab-size: 4; }
.columns-mode .sheet-grid { gap: 8px; }
.columns-mode .sheet-page { padding: clamp(7px, .8vw, 12px); overflow: hidden; line-height: 1.25; }
.public-footer { min-height: 48px; padding: 12px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--paper); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.print-stage { display: none; }

html[data-theme="dark"] body { background: var(--panel); }
html[data-theme="dark"] .search-stage {
  background-image: radial-gradient(circle at 50% 22%, rgba(243,182,30,.12), transparent 28%), linear-gradient(rgba(131,210,175,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(131,210,175,.055) 1px, transparent 1px);
}
html[data-theme="dark"] .search-box { border-color: #42564d; }
html[data-theme="dark"] .search-box:focus-within { box-shadow: 0 18px 60px rgba(0,0,0,.32), 0 0 0 4px rgba(131,210,175,.12); }
html[data-theme="dark"] .suggestions { box-shadow: 0 24px 70px rgba(0,0,0,.46); }
html[data-theme="dark"] .suggestion:hover,
html[data-theme="dark"] .suggestion.active { background: #263029; }
html[data-theme="dark"] .suggestion-group-title span { background: #3b351d; }
html[data-theme="dark"] .artist-suggestion { background: #182a23; }
html[data-theme="dark"] .reading .search-stage,
html[data-theme="dark"] .artist-view .search-stage { background: rgba(17,25,22,.94); }
html[data-theme="dark"] .artist-shell,
html[data-theme="dark"] .reader-shell {
  background-image: linear-gradient(rgba(131,210,175,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(131,210,175,.045) 1px, transparent 1px);
}
html[data-theme="dark"] .artist-song-card { background: rgba(25,35,31,.9); }
html[data-theme="dark"] .artist-song-card:hover { background: #243029; border-color: #52675e; }
html[data-theme="dark"] .print-cifra-button { color: var(--accent-dark); background: #19231f; border-color: #496057; }
html[data-theme="dark"] .print-cifra-button:hover { color: #101915; background: var(--accent-dark); border-color: var(--accent-dark); }
html[data-theme="dark"] .correct-cifra-button { color: #a7aea8; background: #19231f; border-color: #496057; }
html[data-theme="dark"] .correct-cifra-button:hover { color: #101915; background: var(--accent-dark); border-color: var(--accent-dark); }
html[data-theme="dark"] .reader-toolbar { background: rgba(24,34,29,.94); box-shadow: 0 8px 30px rgba(0,0,0,.24); }
html[data-theme="dark"] .tool-cluster { border-color: #43544d; }
html[data-theme="dark"] .stepper,
html[data-theme="dark"] .segmented-control { border-color: #4a5d54; }
html[data-theme="dark"] .text-button,
html[data-theme="dark"] .tool-button { border-color: #4a6258; }
html[data-theme="dark"] .chord { color: #f5d77b; background: #3c341c; }
html[data-theme="dark"] .chord-trigger:hover,
html[data-theme="dark"] .chord-trigger:focus-visible,
html[data-theme="dark"] .chord-trigger[aria-expanded="true"] { color: #101915; background: var(--accent-dark); }
html[data-theme="dark"] .chord-popover { background: rgba(25,35,31,.98); border-color: #475b52; box-shadow: 0 18px 50px rgba(0,0,0,.48); }
html[data-theme="dark"] .chord-fret,
html[data-theme="dark"] .chord-string { stroke: #9ba59f; }
html[data-theme="dark"] .sheet-page { color: #eee7dc; background: rgba(24,33,29,.94); box-shadow: 0 12px 34px rgba(0,0,0,.22); }
html[data-theme="dark"] .focus-mode,
html[data-theme="dark"] .focus-mode .reader-shell { background: var(--panel); }
html[data-theme="dark"] .mini-brand img,
html[data-theme="dark"] .compact-brand img,
html[data-theme="dark"] .search-brand img,
html[data-theme="dark"] .public-footer img { filter: drop-shadow(0 0 9px rgba(243,182,30,.14)); }

.focus-mode { background: var(--white); }
.focus-mode .search-stage, .focus-mode .public-footer,
.focus-mode .breadcrumbs, .focus-mode .song-header,
.focus-mode .version-switcher, .focus-mode .badges,
.focus-mode .chord-index, .focus-mode .account-button, .focus-mode .account-menu { display: none; }
.focus-mode .reader-shell { min-height: 100vh; min-height: 100dvh; padding: 0; background: var(--white); }
.focus-mode .song-reader { width: 100%; max-width: none; }
.focus-mode .reader-toolbar { position: fixed; top: auto; right: auto; bottom: 10px; left: 50%; z-index: 100; width: max-content; max-width: calc(100vw - 20px); margin: 0; transform: translateX(-50%); transition: opacity .22s ease, transform .22s ease; }
.focus-mode .reader-toolbar, .columns-mode .reader-toolbar { overflow-x: auto; }
.focus-mode.controls-hidden .reader-toolbar { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
.focus-mode .sheet-grid { width: 100%; max-width: 100vw; min-height: 100vh; min-height: 100dvh; margin: 0; padding: 4px; overflow-x: hidden; gap: 6px; background: var(--ink); }
.focus-mode .sheet-page { width: 100%; max-width: 100%; min-height: calc(100vh - 8px); min-height: calc(100dvh - 8px); padding: 10px 12px; background: var(--white); border: 0; border-radius: 0; box-shadow: none; }
.focus-mode.columns-mode .sheet-page { padding: 8px 10px; }
.focus-mode .primary-tool { color: var(--ink); background: var(--accent); border-color: var(--accent); }

body.columns-mode { overflow: hidden; background: var(--white); }
.columns-mode .search-stage, .columns-mode .public-footer,
.columns-mode .breadcrumbs, .columns-mode .song-header,
.columns-mode .version-switcher, .columns-mode .badges,
.columns-mode .chord-index, .columns-mode .account-button, .columns-mode .account-menu { display: none; }
.columns-mode .reader-shell { height: 100vh; min-height: 100vh; padding: 0; overflow: hidden; background: var(--white); }
.columns-mode .song-reader { width: 100%; max-width: none; }
.columns-mode .reader-toolbar { position: fixed; top: auto; right: auto; bottom: 10px; left: 50%; z-index: 100; width: max-content; max-width: calc(100vw - 20px); margin: 0; transform: translateX(-50%); transition: opacity .22s ease, transform .22s ease; }
.columns-mode.controls-hidden .reader-toolbar { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }
.columns-mode .sheet-grid { height: 100vh; min-height: 100vh; margin: 0; padding: 4px; gap: 6px; overflow: hidden; background: var(--ink); }
.columns-mode .sheet-page { height: calc(100vh - 8px); min-height: 0; padding: 7px 9px; background: var(--white); border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 900px) {
  .public-header { padding-inline: 18px; }
  .mini-brand small { display: none; }
  .search-stage { padding-top: 20vh; }
  .reading .search-stage, .artist-view .search-stage { padding-inline: 10px; }
  .reading .compact-brand img, .artist-view .compact-brand img { width: 38px; height: 38px; }
  .reader-shell { padding-inline: 14px; }
  .song-header { display: block; }
  .song-actions { margin-top: 18px; }
  .reader-toolbar { width: 100%; max-width: 100%; position: static; overflow: visible; }
  .reader-toolbar::-webkit-scrollbar { display: none; }
  .focus-mode .reader-toolbar, .columns-mode .reader-toolbar { position: fixed; top: auto; right: auto; bottom: calc(72px + env(safe-area-inset-bottom)); left: 8px; width: calc(100vw - 16px); max-width: none; overflow-x: auto; flex-wrap: nowrap; transform: none; }
  .focus-mode.controls-hidden .reader-toolbar, .columns-mode.controls-hidden .reader-toolbar { transform: translateY(16px); }
  .tool-cluster { border-right: 0; }
  .song-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 1280px) and (min-width: 901px) {
  .reader-toolbar { flex-wrap: wrap; row-gap: 8px; }
  .layout-control { border-right: 0; }
}

@media (max-width: 540px) {
  .public-header { height: 64px; padding: 12px 14px; }
  .mini-brand img { width: 34px; height: 34px; }
  .mini-brand strong { font-size: 16px; }
  .search-stage { min-height: 100dvh; padding: max(112px, 18dvh) 12px 48px; }
  .search-brand img { width: 58px; height: 58px; margin-bottom: 14px; }
  .search-brand h1 { font-size: 40px; }
  .search-brand p { margin: 12px 0 26px; font-size: 13px; }
  .search-shell { width: 100%; gap: 0; }
  .search-box { height: 54px; padding: 0 13px; gap: 10px; border-radius: 14px; }
  .search-box input { font-size: 16px; }
  .search-box svg { width: 20px; }
  .search-clear { width: 38px; height: 38px; }
  .suggestion { min-height: 60px; padding: 11px 10px; gap: 3px 8px; }
  .suggestion-group-title { position: sticky; top: 0; z-index: 1; margin-inline: 2px; background: var(--white); }
  .suggestion strong { font-size: 16px; }
  .suggestion-meta { font-size: 9px; }
  .suggestions-open:not(.reading):not(.artist-view) .search-stage { padding-top: 78px; }
  .suggestions-open:not(.reading):not(.artist-view) .search-brand { display: none; }
  .suggestions-open:not(.reading):not(.artist-view) .suggestions { max-height: calc(100dvh - 154px); }
  .reading .search-stage, .artist-view .search-stage { padding: 8px; }
  .reading .search-box, .artist-view .search-box { height: 50px; border-radius: 12px; }
  .reading .suggestions, .artist-view .suggestions { position: fixed; top: 66px; right: 8px; left: 8px; width: auto; max-height: calc(100dvh - 78px); margin: 0; }
  .compact-brand { display: none !important; }
  .artist-shell { padding: 28px 10px 72px; }
  .artist-page-header { padding-bottom: 22px; }
  .artist-page-header h2 { font-size: 46px; overflow-wrap: anywhere; }
  .artist-song-list { grid-template-columns: minmax(0, 1fr); }
  .artist-song-card { min-height: 72px; padding: 12px; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 8px; }
  .artist-song-copy strong { font-size: 17px; }
  .artist-song-keys { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .song-header h2 { font-size: 42px; }
  .song-actions { width: 100%; }
  .song-actions > button { flex: 1; justify-content: center; }
  .print-cifra-button { min-height: 38px; }
  .correct-cifra-button { min-height: 38px; }
  .reader-shell { padding: 28px 10px 72px; }
  .reader-toolbar { margin: 14px 0; padding: 7px; gap: 6px 2px; border-radius: 10px; touch-action: pan-y; }
  .performance-cluster, .focus-mode .performance-cluster { width: auto; }
  .tool-cluster { width: auto; padding: 0 5px; }
  .tool-cluster:first-child { padding-left: 0; }
  .tool-cluster:last-child { padding-right: 0; }
  .text-button, .tool-button { padding-inline: 9px; white-space: nowrap; }
  .speed-control { display: none; }
  .layout-control { display: none; }
  .chord-index { display: block; }
  .chord-index > span { display: block; margin-bottom: 10px; }
  .sheet-grid { margin-top: 14px; }
  .sheet-page { padding: 15px 10px; line-height: 1.5; }
  .focus-mode .sheet-page { padding: 10px 8px; }
  .focus-mode .reader-toolbar, .columns-mode .reader-toolbar { padding: 7px; touch-action: pan-x; }
  .public-footer { padding-inline: 12px; font-size: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@page { size: A4 portrait; margin: 13mm 12mm 14mm; }

@media print {
  html, body { width: auto !important; max-width: none !important; margin: 0 !important; overflow: visible !important; color: #15130f !important; background: #fff !important; color-scheme: light !important; }
  body > :not(#print-stage) { display: none !important; }
  #print-stage { display: block !important; color: #15130f; background: #fff; font-family: Arial, Helvetica, sans-serif; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-cover { min-height: 245mm; display: flex; flex-direction: column; justify-content: center; break-after: page; page-break-after: always; }
  .print-brand { margin-bottom: 34mm; color: #07523b; font-size: 13pt; letter-spacing: .08em; text-transform: uppercase; }
  .print-cover > span { color: #07523b; font-size: 10pt; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
  .print-cover h1 { max-width: 165mm; margin: 5mm 0 4mm; font: 700 34pt/1.05 Georgia, serif; }
  .print-cover p { max-width: 145mm; margin: 0 0 8mm; color: #59544d; font-size: 12pt; line-height: 1.45; }
  .print-cover small { color: #07523b; font-size: 10pt; font-weight: 800; text-transform: uppercase; }
  .print-song + .print-song { break-before: page; page-break-before: always; }
  .print-song header { margin-bottom: 7mm; padding-bottom: 5mm; border-bottom: 1.5pt solid #07523b; }
  .print-song-brand { float: right; color: #07523b; font-size: 8pt; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .print-song header > p:first-of-type { margin: 0 0 2mm; color: #07523b; font-size: 9pt; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .print-song h2 { margin: 0 0 2.5mm; font: 700 25pt/1.05 Georgia, serif; }
  .print-song-details { margin: 0; color: #403b35; font-size: 8.5pt; font-weight: 700; text-transform: uppercase; }
  .print-song-composers { margin: 2mm 0 0; color: #6c665e; font-size: 8pt; }
  .print-song pre { margin: 0; overflow: visible; color: #15130f; background: transparent; border: 0; font: 500 8.5pt/1.42 "Courier New", Courier, monospace; white-space: pre-wrap; tab-size: 4; }
}
