/* Responsive polish for touch devices; print keeps its own layout. */
@media screen{
 .section-heading,.song-heading,.results-heading{flex-wrap:wrap}
 .section-heading>div,.song-heading>div,.entry-heading>div{min-width:0}
 .page-heading h1,.song-heading h1,.event-card h2,.user-card strong{overflow-wrap:anywhere}
 .form-grid>*{min-width:0}
 .editor-section input[type=checkbox],.sharing-panel input[type=checkbox]{width:18px;height:18px;flex-shrink:0;accent-color:var(--green)}
 .table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
 .aligned-chart,.mono{overscroll-behavior-inline:contain}
 .lineup-song>a[href$="/remove"]{color:#B91C1C}
 html[data-theme=dark] .lineup-song>a[href$="/remove"]{color:#FCA5A5}
 .lineup-export{overflow-x:auto}.export-song{min-width:calc(var(--export-columns,1) * 240px)}
 .sharing-panel .picker-result{gap:20px}.sharing-panel .picker-result>div{min-width:0;overflow-wrap:anywhere}
 .sharing-panel .picker-result form{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:0;max-width:100%}
 .sharing-panel .picker-result form label{min-width:160px;flex:1}.sharing-panel .picker-result form input[type=hidden]{display:none}
}
@media screen and (max-width:1100px){
 .container{width:calc(100% - 48px)}
 .header-inner{height:76px;gap:20px}.desktop-nav{display:none}.mobile-toggle{display:inline-flex}
 .header-actions{gap:10px}.header-actions .submit-link{display:none}
 .mobile-nav:not([hidden]){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:12px 0 18px}
 .mobile-nav a{padding:12px 15px;border-radius:8px;background:var(--soft);font-size:15px;min-height:46px}
 .library-split{grid-template-columns:minmax(0,1fr) 250px;gap:24px}
 .article-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
 .home-paths small{font-size:12px}.home-paths>a{align-items:flex-start}.home-paths>a>svg{display:none}
 .reader-layout{grid-template-columns:minmax(0,1fr);gap:16px}
 .section-nav{display:flex;gap:18px;overflow-x:auto;padding:5px 0 12px}.section-nav>a{white-space:nowrap;min-height:44px;align-items:center}.section-nav>.eyebrow,.section-nav .reader-tip{display:none}
 .chord-toolbar{gap:10px 18px;position:static}.chord-toolbar button{min-height:44px}
 .sharing-panel .picker-result{flex-wrap:wrap}.sharing-panel .picker-result form{width:100%}
 .tutorial-nav{display:grid;grid-template-columns:1fr 1fr}.tutorial-nav>.eyebrow{grid-column:1/-1}
 .lineup-song{gap:14px}.lineup-song>.song-name{flex-basis:40%}
}
@media screen and (max-width:760px){
 .container{width:calc(100% - 32px)}
 main{padding-bottom:40px}.header-inner{height:70px;gap:10px}.header-actions{gap:3px}
 .header-actions .search-trigger,.header-actions .favorite-link{display:none}
 .account-link{max-width:92px;font-size:14px}.brand{font-size:29px}.brand-symbol{width:29px;height:33px;font-size:30px;margin-right:7px}
 .mobile-nav:not([hidden]){grid-template-columns:1fr 1fr}.mobile-nav a{font-size:14px}
 .page-heading h1,.song-heading h1{font-size:clamp(29px,8vw,39px)}
 .page-heading{margin-top:28px;margin-bottom:24px}.page-heading p{font-size:15px;line-height:1.75}
 .photo-hero{padding:34px 22px}.photo-hero h1{font-size:clamp(34px,9vw,46px)}.photo-hero .eyebrow{font-size:10px;letter-spacing:.7px}
 .photo-hero .search-bar{padding-left:12px}.photo-hero .search-bar input{font-size:16px}
 .home-paths>a>svg{display:block}.home-paths>a{align-items:center}
 .library-split,.article-grid,.artist-grid,.event-grid{grid-template-columns:minmax(0,1fr)}
 .section-heading{gap:14px}.section-heading .text-link{font-size:14px;min-height:40px;display:inline-flex;align-items:center}
 .song-row{gap:8px;padding:10px 0}.song-row .song-art{display:none}.song-row .song-meter{display:none}.song-row .song-number{font-size:12px;width:22px;flex-shrink:0}.song-row .favorite-button{width:44px;min-width:44px}.song-name>a:first-child{font-size:16px}.artist-name{font-size:13px}
 .filter-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;padding:14px}.filter-search{grid-column:1/-1;min-width:0}.filter-panel select{width:100%;font-size:16px}.filter-panel .button{width:100%}
 input:not([type=checkbox]):not([type=hidden]),select,textarea{font-size:16px}
 .button,.icon-button,.section-editor-actions button,.admin-nav a{min-height:44px}
 .form-card,.editor-section,.sharing-panel,.user-card{padding:18px;border-radius:12px}.form-grid{gap:18px}
 .inline-dynamics-editor{padding:14px;gap:12px}.inline-dynamics-editor>label{min-width:0;width:100%}.inline-dynamics-editor .button{width:100%}
 .section-editor-actions{flex-wrap:wrap;gap:8px;justify-content:flex-start}.section-editor-actions button{padding:8px 10px;background:var(--soft);border-radius:7px}
 .editor-save{position:static;padding:16px;gap:12px;margin-top:24px}.editor-save>.button{flex:1 1 180px}.editor-save>.text-link{min-height:44px;display:inline-flex;align-items:center;justify-content:center;flex:1}
 .assignment-form{display:grid!important;grid-template-columns:minmax(0,1fr);width:100%;margin:20px 0!important}.assignment-form label{min-width:0}.assignment-form .button{width:100%}
 .sharing-panel .picker-result form label{min-width:0;flex-basis:100%}.sharing-panel .picker-result form button{flex:1 1 130px}
 .lineup-song{display:flex;gap:10px;align-items:center;padding:20px 0}.lineup-song>.song-number{width:25px;flex:0 0 25px}.lineup-song>.song-name{flex:1 1 calc(100% - 40px);min-width:0}.lineup-song>.text-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:14px;padding:8px 12px;border:1px solid var(--line);border-radius:8px}.lineup-song>.key-badge{margin-left:auto}
 .results-heading{gap:14px}.results-heading .button{width:100%}
 .song-heading-actions{gap:9px}.song-heading-actions>.button{flex:1 1 145px}
 .song-metadata{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 12px}.song-metadata dd{font-size:15px;overflow-wrap:anywhere}.song-metadata dt{font-size:10px}
 .reader-view-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px}.reader-view-tabs a{display:flex;align-items:center;justify-content:center;text-align:center;font-size:13px;padding:10px 8px}
 .transpose-form{gap:8px}.transpose-form select{min-width:85px}.chord-toolbar{padding:12px;gap:10px;top:auto}.control-group button{min-width:44px}.theme-control,.cue-toggle{min-height:44px}.control-label{font-size:13px}
 .chord-paper{padding:20px 14px}.lineup-reader-nav>div{gap:8px}.lineup-reader-nav .button{padding:10px 12px;font-size:13px}
 .lineup-export-controls .transpose-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}.lineup-export-controls .transpose-form>button,.lineup-export-controls .transpose-form>a{grid-column:1/-1}.lineup-export-controls select{width:100%;min-width:0}
 .tutorial-nav{display:flex}.tutorial-card{padding:22px 18px}.tutorial-card .admin-table{min-width:420px}
 .footer-top nav{gap:18px;flex-wrap:wrap}.footer-top nav a{min-height:44px;display:inline-flex;align-items:center;font-size:14px}.footer-bottom{line-height:1.7}
 dialog{width:calc(100% - 24px);max-width:calc(100% - 24px);padding:20px}.dialog-head{gap:12px}.dialog-head h2{font-size:26px}
}
@media screen and (max-width:380px){.container{width:calc(100% - 24px)}.photo-hero{padding:30px 18px}.brand{font-size:26px}.account-link{max-width:70px}.event-card{flex-wrap:wrap}.event-card h2{font-size:25px}.song-metadata{grid-template-columns:1fr 1fr}}

/* A musician's chosen columns remain available at every screen size. */
@media screen{
 .column-controls{display:flex;flex-wrap:wrap}
 [data-chord-viewer]{overflow-x:auto;overscroll-behavior-inline:contain}
 [data-chord-viewer] .chord-sections{column-count:var(--columns,1)}
}
@media screen and (max-width:1100px){
 [data-chord-viewer] .chord-sections{min-width:calc(var(--columns,1) * 250px);column-gap:24px}
 .column-controls{gap:4px}
}
@media print{[data-chord-viewer] .chord-sections{column-count:var(--columns,1);min-width:0}}

/* Phone readers use up to two columns and vertical scrolling only. */
@media screen and (max-width:760px){
 [data-chord-viewer]{overflow-x:visible;min-width:0}
 [data-chord-viewer] .chord-sections{min-width:0;column-gap:14px}
 [data-chord-viewer] .song-section{min-width:0;overflow:visible;overflow-wrap:anywhere}
 [data-chord-viewer] .aligned-chart{white-space:pre-wrap;overflow-wrap:anywhere;overflow-x:visible;min-width:0}
 [data-chord-viewer] .inline-dynamic,[data-chord-viewer] .inline-rhythm{max-width:100%}
 [data-chord-viewer] .section-title{flex-wrap:wrap}
 .column-controls button[hidden]{display:none}
}

/* Shared song typography and column dividers, including PDF/print. */
.chord-sections,.export-sections{column-rule:0.5px solid #cbd5ce}
.aligned-chart,.chord-sections,.export-sections,.section-title h2,.editor-section .mono{font-family:"Courier New",monospace}

/* Keep song sheets readable without sideways scrolling at any size. */
.section-title h2{font-weight:700}
[data-chord-viewer],.lineup-export{overflow:visible;min-width:0;max-width:100%}
[data-chord-viewer] .chord-sections,.lineup-export .export-song{min-width:0}
.song-section{min-width:0;overflow:visible;overflow-wrap:anywhere}
.aligned-chart,[data-chord-viewer] .aligned-chart,.lineup-export .aligned-chart{white-space:pre-wrap;overflow-wrap:anywhere;overflow:visible;min-width:0;max-width:100%}
.section-title,.performance-cues{flex-wrap:wrap}
.inline-dynamic,.inline-rhythm{max-width:100%}
@media screen{
 .section-nav{flex-wrap:wrap;overflow:visible}
 .section-nav>a{white-space:normal;overflow-wrap:anywhere}
 .mono,.tutorial-example{white-space:pre-wrap;overflow-wrap:anywhere;overflow-x:visible}
 .table-scroll{overflow:visible}
 .admin-table,.tutorial-card .admin-table{min-width:0;width:100%;table-layout:fixed}
 .admin-table th,.admin-table td{overflow-wrap:anywhere}
}
@media print{
 .export-song+.export-song{break-before:page;page-break-before:always}
}

/* Fill printable pages instead of moving whole verses to the next page. */
@media print{
 @page{margin:10mm}
 .chord-sections,.lineup-export .export-sections{column-fill:auto;column-gap:18px}
 .song-section,.lineup-export .song-section,[data-chord-viewer] .song-section{break-inside:auto;page-break-inside:auto;margin-bottom:12px}
 .aligned-chart,.lineup-export .aligned-chart{break-inside:auto;page-break-inside:auto;line-height:1.35;orphans:2;widows:2;padding-bottom:0}
 .section-title{margin-bottom:6px;break-after:avoid;page-break-after:avoid}
 .performance-cues{margin-bottom:6px;break-after:avoid;page-break-after:avoid}
 .performance-cues:empty{display:none!important}
 .export-song-heading{margin-bottom:12px}
 .export-song{padding-top:0;border-top:0}
 .export-cover{padding:0;margin-bottom:14px}
}

/* Compact on-screen reading without changing saved chart alignment. */
@media screen{
 .aligned-chart{line-height:1.3;padding-bottom:2px}
 .song-section{margin-bottom:20px}
 .section-title{margin-bottom:6px}
 .performance-cues{margin-bottom:6px}
 .performance-cues:empty{display:none}
}

/* Group lineup actions by purpose with consistent touch spacing. */
.lineup-actions{margin:0 0 24px;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.lineup-actions-main{display:flex;flex-wrap:wrap;gap:10px}
.lineup-actions-main .button{min-height:44px;text-align:center;justify-content:center}
.lineup-actions>.field-help{margin:8px 0 0}
.lineup-actions-manage{display:flex;flex-wrap:wrap;gap:8px 24px;border-top:1px solid var(--line);margin-top:14px;padding-top:8px}
.lineup-actions-manage a{display:inline-flex;align-items:center;min-height:44px;font-size:14px}
.lineup-actions-manage .lineup-delete-link{color:#b91c1c}
@media screen and (max-width:760px){.lineup-actions-main{display:grid;grid-template-columns:minmax(0,1fr)}.lineup-actions-main .button{width:100%}.lineup-actions{padding:14px}}

/* A compact, consistent spacing rhythm on phones. */
@media screen and (max-width:760px){
 .breadcrumbs{padding-top:18px;gap:6px 10px;line-height:1.5}
 .page-heading{padding:24px 0 20px}
 .breadcrumbs+.page-heading{padding-top:16px}
 .page-heading h1{margin:8px 0 10px;font-size:34px;line-height:1.15}
 .page-heading p{line-height:1.55}
 .section-heading.page-heading{margin-bottom:0;gap:12px}
 .section-heading{margin-bottom:18px;gap:12px}
 .lineup-actions{margin-bottom:20px;padding:14px}
 .lineup-actions-main{gap:8px}
 .lineup-actions-main .button{padding:11px 14px}
 .lineup-actions>.field-help{margin-top:8px;line-height:1.5}
 .lineup-actions-manage{margin-top:12px;padding-top:4px;gap:8px 24px}
 .results-heading{margin:18px 0 4px;align-items:center}
 .event-notes{padding:14px 16px;margin-bottom:18px}
 .lineup-song{display:grid;grid-template-columns:28px repeat(5,minmax(0,1fr));gap:8px 10px;padding:16px 0}
 .lineup-song>.song-number{grid-column:1;grid-row:1;align-self:start;padding-top:2px;width:auto}
 .lineup-song>.song-name{grid-column:2/6;grid-row:1}
 .lineup-song>.key-badge{grid-column:6;grid-row:1;align-self:start;margin:0}
 .lineup-song>.text-link{grid-column:span 2;justify-content:center;text-align:center;padding:8px 4px;min-height:44px;font-size:12px;line-height:1.35}
 .lineup-song>.song-name .entry-note{margin-top:5px;line-height:1.5}
 .sharing-panel{margin-top:24px;padding:16px}
 .sharing-panel h2{margin-bottom:8px;font-size:26px}
 .sharing-panel p{margin-bottom:14px}
 .song-heading{margin-top:20px;gap:14px}
 .song-heading h1{margin:8px 0 10px;font-size:34px}
 .song-heading-actions{margin-top:14px;gap:8px}
 .song-metadata{gap:14px 10px}
 .reader-view-tabs{gap:6px}
 .chord-toolbar{padding:10px;gap:8px}
 .chord-paper{padding:16px 12px}
 .form-grid{gap:14px}
 .editor-section{margin:18px 0;padding:16px}
 .editor-section-heading{margin:24px 0 12px}
 .full-field{margin-top:16px}
 .tutorial-card{padding:20px 16px}
}

.tutorial-video{margin:0 0 36px;padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.tutorial-video h2{font-size:28px;margin-bottom:12px}.tutorial-video>p{margin-bottom:16px;max-width:760px}
.tutorial-video video{display:block;width:100%;max-height:75vh;background:#103d2a;border-radius:8px}
.tutorial-video-links{display:flex;gap:12px 24px;flex-wrap:wrap;margin:14px 0 6px}.tutorial-video-links a{min-height:44px;display:inline-flex;align-items:center}
.tutorial-video>.field-help{margin-bottom:0}
@media(max-width:760px){.tutorial-video{padding:16px;margin-bottom:24px}.tutorial-video h2{font-size:24px}}
@media print{.tutorial-video{display:none}}

/* Full-width collection headers keep primary actions aligned with the content. */
@media screen{
 .collection-heading.page-heading{max-width:none;width:100%;display:flex;align-items:center;justify-content:space-between;gap:20px 32px;padding:32px 0 24px;margin:0 0 20px;border-bottom:1px solid var(--line)}
 .collection-heading>div{flex:1;min-width:0}
 .collection-heading>h1{margin:0;flex:1}
 .collection-heading>div h1{margin:8px 0 10px}
 .collection-heading>.button{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:11px 22px;margin:0;white-space:nowrap}
}
@media screen and (max-width:760px){
 .collection-heading.page-heading{align-items:stretch;flex-direction:column;gap:16px;padding:24px 0 20px;margin-bottom:18px}
 .collection-heading>.button{width:100%;min-height:46px}
 .collection-heading>div h1{margin:8px 0}
 .collection-heading>div p{margin:0;line-height:1.5}
}

/* Footer uses the same content width and a compact, responsive hierarchy. */
@media screen{
 body{min-height:100vh;min-height:100svh;display:flex;flex-direction:column}
 main#main{flex:1;min-height:0}
 .site-footer{flex-shrink:0;margin-top:0;padding:28px 0 18px;background:var(--soft);border-top:1px solid var(--line)}
 .site-footer .footer-top{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:0;flex-wrap:nowrap}
 .footer-branding{min-width:0;max-width:440px}
 .footer-branding .brand{display:inline-flex;align-items:center;min-height:44px;font-size:29px;line-height:1.2;margin:0}
 .footer-branding p{font-size:13px;line-height:1.6;margin:4px 0 0;overflow-wrap:anywhere}
 .site-footer .footer-top nav{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px 24px;width:auto;margin:0}
 .site-footer .footer-top nav a{display:inline-flex;align-items:center;min-height:44px;padding:6px 0;font-size:14px;line-height:1.5}
 .site-footer a:focus-visible{outline:2px solid var(--green);outline-offset:4px;border-radius:3px}
 .site-footer nav a:hover{text-decoration:underline;text-underline-offset:4px}
 .site-footer .footer-bottom{display:flex;flex-direction:row;justify-content:flex-start;margin-top:20px;padding-top:14px;border-top:1px solid var(--line);font-size:12px;line-height:1.6;gap:0}
}
@media screen and (max-width:760px){
 .site-footer{padding:20px 0 16px}
 .site-footer .footer-top{flex-direction:column;align-items:stretch;gap:14px}
 .footer-branding{max-width:none}
 .site-footer .footer-top nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;justify-content:start}
 .site-footer .footer-top nav a{overflow-wrap:anywhere}
 .site-footer .footer-bottom{margin-top:14px;padding-top:12px}
}

.song-admin-actions{display:flex;flex-wrap:wrap;gap:6px 18px}.song-admin-actions a{display:inline-flex;align-items:center;min-height:44px}.song-admin-actions a[href$="/delete"]{color:#b91c1c}

/* Compact export toolbar and preview spacing. */
@media screen{
 .lineup-export-controls.page-heading{max-width:none;margin:20px 0 0;padding:16px 0 12px}
 .lineup-export-controls.page-heading>p{margin:10px 0 0;line-height:1.5}
 .lineup-export-controls .transpose-form{margin:16px 0 0;gap:10px;align-items:flex-end}
 .export-font-control{display:inline-flex;align-items:center;gap:2px;min-height:46px;border:1px solid var(--line);border-radius:8px;padding:0 6px;background:var(--surface)}
 .export-font-control>span{font-size:12px;padding:0 6px}
 .export-font-control button{min-width:36px;min-height:44px;padding:6px;font-size:13px;border-radius:5px}
 .export-font-control output{min-width:24px;text-align:center;font-size:13px;font-variant-numeric:tabular-nums}
 .export-font-control button:focus-visible{outline:2px solid var(--green)}
 .lineup-export .export-cover{padding:12px 0 16px;margin:0 0 18px}
 .lineup-export .export-cover h1{margin:8px 0 10px}
 .lineup-export .export-event-notes{margin:10px 0 0}
}
@media screen and (max-width:760px){
 .lineup-export-controls.page-heading{margin-top:12px;padding-top:12px}
 .lineup-export-controls .transpose-form{gap:8px}
 .export-font-control{width:100%;justify-content:space-between;align-self:end}
}
