/* Chord workspace only. A4 geometry is identical for preview and exports. */
#tabChords[hidden],#hymnChordPanel[hidden],#hc-sidebar[hidden],.hc-suppressed{display:none!important}
.hc-panel{flex:1;min-width:0;width:100%;display:flex;flex-direction:column;gap:12px;order:5}
.hc-sidebar{display:flex;flex-direction:column;gap:12px;order:1;min-width:0}
.hc-controls{border:1px solid #8190a344;border-radius:16px;padding:16px;background:rgba(128,128,128,.06)}
.hc-controls h2{font-size:16px;font-weight:800}.hc-controls p{font-size:12px;margin:6px 0}
.hc-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}
.hc-buttons button{border:1px solid #8190a366;border-radius:8px;padding:6px 10px;font-size:13px}
.hc-buttons button:hover{border-color:#007e8a}
.hc-controls textarea{display:block;width:100%;padding:10px;margin-top:8px;border:1px solid #8190a366;border-radius:8px;background:transparent;font:13px/1.5 monospace;resize:vertical}
.hc-controls summary{cursor:pointer;font-size:14px;font-weight:700}
.hc-adjust{display:grid;gap:8px;margin:14px 0}
.hc-adjust label{display:flex;justify-content:space-between;font-size:11px;font-weight:700}
.hc-preview-head{font-size:12px;padding-right:40px}
.hc-viewport{width:100%;min-width:0;overflow:hidden}
.hc-paper{width:210mm;margin:0 auto;display:flex;flex-direction:column;gap:16px}
.hc-page{box-sizing:border-box;width:210mm;height:297mm;padding:12.7mm;background:white;color:#161616;box-shadow:0 2px 10px #0002;font-family:Arial,"Microsoft JhengHei",sans-serif;font-size:var(--hc-font,16pt);line-height:var(--hc-spacing,1.25);overflow:hidden;flex:none;text-align:left}
.hc-page-inner{box-sizing:border-box;height:100%;width:100%;display:flow-root}
.hc-title{text-align:center;font-size:1.35em;font-weight:700;margin:0 0 .65em;line-height:1.2}
.hc-key{font-size:.75em;font-weight:700;margin:.65em 0 .15em}
.hc-section{font-size:.75em;font-weight:700;margin:.65em 0 .15em}
.hc-row{display:grid;align-items:stretch;margin:.1em 0;break-inside:avoid}
.hc-cell{box-sizing:border-box;border-left:1px solid #444;padding:.16em .35em;font-size:1em;font-weight:600;overflow-wrap:anywhere}
.hc-repeat{align-self:center;text-align:center;font-size:1.1em}.hc-comment{font-size:.75em;overflow-wrap:anywhere}
body.hc-active #workTabs{flex-wrap:wrap}
@media screen and (min-width:1024px){.hc-panel{padding-top:35px}}
@media print{
 body.hc-active #rightPreview,body.hc-active #leftSidebar,body.hc-active #clc-header,body.hc-active #hymnGearWrap,body.hc-active footer,body.hc-active .hc-controls{display:none!important}
 body.hc-active main.hymn-main{display:block!important;padding:0!important;margin:0!important}
 body.hc-active .hc-panel{display:block!important;padding:0!important}
 body.hc-active .hc-paper{zoom:1!important;display:block;gap:0;margin:0}
 body.hc-active .hc-page{margin:0;box-shadow:none;break-after:page}
 body.hc-active .hc-page:last-child{break-after:auto}
}

/* Fixed-width measures; repeat symbols drawn as CSS shapes for export parity. */
.hc-row{grid-template-columns:repeat(4,minmax(0,1fr)) 1.2em}
.hc-cell{position:relative;min-width:0}
.hc-repeat{position:relative;align-self:stretch;min-height:1em}
.hc-bar-end{border-left:1px solid #444}
.hc-repeat-mark{position:absolute;display:block;width:.72em;height:100%;top:0;left:0}
.hc-repeat-mark span{position:absolute;display:block;background:#161616}
.hc-repeat-thick{width:3px;height:100%;top:0}
.hc-repeat-thin{width:1px;height:100%;top:0}
.hc-repeat-dot{width:.13em;height:.13em;border-radius:50%;transform:translateY(-50%)}
.hc-repeat-dot-upper{top:36%}.hc-repeat-dot-lower{top:64%}
.hc-repeat-start .hc-repeat-thick{left:0}.hc-repeat-start .hc-repeat-thin{left:.20em}.hc-repeat-start .hc-repeat-dot{left:.43em}
.hc-repeat-end .hc-repeat-thick{left:.52em}.hc-repeat-end .hc-repeat-thin{left:.32em}.hc-repeat-end .hc-repeat-dot{left:.08em}
.hc-cell-repeat-start{border-left:0;padding-left:1em}
.hc-row-ending{padding-top:.8em}
.hc-ending{position:absolute;left:0;right:0;top:-1em;border-top:1px solid #444;border-left:1px solid #444;font-size:.7em;font-weight:500;line-height:1;padding-left:.25em}

/* WYSIWYG P1/P2: global font sets bar height, spacing sets only inter-row gap. */
.hc-page{line-height:1.25}
.hc-row{margin:0 0 calc(var(--hc-font,16pt) * var(--hc-spacing,1.25) * .48);padding:0;align-items:stretch}
.hc-cell{height:calc(var(--hc-font,16pt) * 2.4);padding:0 .35em;overflow:visible;display:flex;align-items:center}
.hc-cell-repeat-start{padding-left:1em}
.hc-measure-content{width:100%;min-width:0;display:flex;align-items:center;min-height:1.4em;overflow:hidden}
.hc-measure-label{display:block;white-space:nowrap;line-height:1.2;font-size:inherit;flex:none}
.hc-repeat{height:calc(var(--hc-font,16pt) * 2.4);min-height:0}
.hc-row-ending{padding-top:.85em}
.hc-ending{top:-.85em}
.hc-key,.hc-section{margin:.5em 0 .2em}
.hc-preview-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.hc-edit-action,#hc-edit-tools button,#hc-edit-tools select{font-size:12px;line-height:1.4;border:1px solid #8190a366;border-radius:7px;padding:5px 9px;background:transparent;color:inherit}
#hc-edit-tools{display:flex;gap:6px;flex-wrap:wrap;width:100%}
#hc-edit-tools[hidden]{display:none!important}
.hc-editing .hc-measure-content,.hc-editing .hc-section{cursor:text;min-height:1.5em}
.hc-editing .hc-measure-content:hover,.hc-editing .hc-section:hover{background:#007e8a0d}
.hc-editing .hc-measure-content:focus-visible,.hc-editing .hc-section:focus-visible{outline:1px solid #007e8a;outline-offset:2px}
.hc-editing .hc-selected{outline:1px solid #007e8a;outline-offset:-1px;background:#007e8a0d}
.hc-inline-input{box-sizing:border-box;display:block;width:100%;min-width:0;border:1px solid #007e8a;border-radius:2px;background:white;color:#161616;font:inherit;line-height:1.2;padding:2px 3px}
.hc-edit-meta{display:flex;gap:6px;margin:0 0 .4em;color:#007e8a}
.hc-edit-meta .hc-edit-action{font-size:10px}
@media print{.hc-edit-meta,#hc-edit-tools,#hc-edit-toggle{display:none!important}.hc-editing .hc-measure-content,.hc-editing .hc-section{background:transparent!important;outline:none!important}}

/* P3/P4: optional meter, distinct barline targets, equal beat positions. */
.hc-song-header{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);align-items:center;gap:.25em;margin:0 0 .65em}
.hc-song-header .hc-title{grid-column:2;margin:0;overflow-wrap:anywhere}
.hc-song-meta{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:.1em;font-size:.64em;font-weight:600}
.hc-meta-value{white-space:nowrap;color:inherit;background:transparent;border:0;padding:0;text-align:left;font:inherit}
.hc-editing button.hc-meta-value{cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}
.hc-boundary-cell{border-left:0;padding:0 .35em 0 .8em}
.hc-boundary{position:absolute;left:0;top:0;height:100%;width:.72em;display:block;background:transparent;border:0;padding:0;color:#161616;overflow:visible}
button.hc-boundary{cursor:pointer;z-index:2}
.hc-editing button.hc-boundary:hover,.hc-editing button.hc-boundary:focus-visible{background:#007e8a22;outline:1px solid #007e8a}
.hc-boundary-stroke{position:absolute;left:0;top:0;height:100%;width:1px;background:#444}
.hc-boundary-second{left:.22em}
.hc-boundary-final .hc-boundary-second{width:3px}
.hc-boundary-repeatBoth .hc-repeat-start{left:.65em}
.hc-boundary-repeatBoth{width:1.35em}
.hc-boundary-cell:has(.hc-boundary-repeatBoth){padding-left:1.45em}
.hc-meter-label{position:absolute;top:-.85em;left:0;font-size:.68em;line-height:1;font-weight:700}
.hc-row:has(.hc-has-meter){padding-top:.85em}
.hc-row-ending .hc-meter-label{left:.8em}
.hc-end-boundary{width:1.2em}
.hc-beat-grid{display:grid;align-items:center;gap:0}
.hc-beat{min-width:0;overflow:hidden;min-height:1.3em;display:flex;align-items:center}
.hc-editing .hc-beat{cursor:text;outline:1px dotted #8190a355;outline-offset:-1px}
.hc-editing .hc-beat:hover,.hc-editing .hc-beat:focus-visible{background:#007e8a18;outline:1px solid #007e8a}
.hc-editing .hc-warning{background:#eab30828;color:#805400}
.hc-dialog{position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,560px);max-height:75dvh;overflow:auto;padding:18px;border:1px solid #8190a366;border-radius:16px 16px 0 0;background:Canvas;color:CanvasText;z-index:10000}
.hc-dialog::backdrop{background:#0006}
.hc-dialog h3{font-size:16px;font-weight:700;margin:0 0 12px}
.hc-dialog-body{display:flex;flex-direction:column;gap:10px}
.hc-dialog-body p{font-size:13px}
.hc-dialog-field{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.hc-dialog-field select,.hc-chord-field{min-width:0;border:1px solid #8190a366;border-radius:6px;padding:8px;background:Canvas;color:CanvasText;font:inherit}
.hc-chord-field{width:100%}
.hc-dialog-field .hc-chord-field{width:65%}
.hc-chord-options,.hc-dialog-foot{display:flex;flex-wrap:wrap;gap:6px}
.hc-dialog-foot{justify-content:flex-end;margin-top:14px}
.hc-dialog-error{color:#a16207;font-size:12px}
@media print{.hc-dialog{display:none!important}}

/* Chord Beta: centered dialog, engraved meter and chord notation. */
.hc-dialog{inset:0;margin:auto;width:min(calc(100% - 24px),760px);max-height:85dvh;border-radius:16px}
.hc-meter-label{position:absolute;left:-.85em;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;width:.72em;font-size:.82em;line-height:.85;font-weight:700;white-space:nowrap}
.hc-row:has(.hc-has-meter){padding-top:0}
.hc-row-ending:has(.hc-has-meter){padding-top:.85em}
.hc-row-ending .hc-meter-label{left:-.85em}
.hc-measure-label{white-space:nowrap;flex:none;max-width:none}
.hc-beat{overflow:visible;position:relative}
.hc-beat .hc-measure-label{position:relative;z-index:1;pointer-events:none}
.hc-chord-acc{font-size:.78em}
.hc-chord-ext{font-size:.68em;vertical-align:super;line-height:0;position:static}
.hc-chord-live{font-size:24px;font-weight:600;min-height:1.5em;text-align:center}
.hc-chord-keyboard{display:flex;flex-direction:column;gap:6px}
.hc-chord-keyrow{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:4px}
.hc-chord-keyrow button{min-width:0;padding:9px 2px;font-size:13px;white-space:nowrap}
@media(max-width:480px){.hc-dialog{padding:12px}.hc-chord-keyrow{gap:2px}.hc-chord-keyrow button{font-size:11px;padding:8px 0}}

.hc-chord-field.hc-active-chord-field{border-color:#007e8a;outline:1px solid #007e8a;outline-offset:0}

/* Simplified always-editable chord workspace; controls stay out of exported sheets. */
#hc-sidebar [hidden],#hc-edit-tools [hidden]{display:none!important}
#hc-sidebar .hc-adjust{margin:0 0 12px}
#hc-video-home:empty{display:none}
#hc-video-home:not(:empty){min-width:0}
#hc-edit-tools{align-items:center;gap:10px}
#hc-edit-tools .hc-history,#hc-edit-tools .hc-structure-tools{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
#hc-edit-tools .hc-history{padding-right:10px;border-right:1px solid #8190a344}
#hc-edit-tools button,#hc-edit-tools select{height:32px;box-sizing:border-box;background:rgba(128,128,128,.06);border-radius:8px}
#hc-edit-tools button[data-edit="undo"],#hc-edit-tools button[data-edit="redo"]{width:36px;font-size:16px;font-weight:700;padding:0}
#hc-edit-tools button:disabled{opacity:.3;cursor:default}
.hc-key-inline{display:flex;align-items:center;gap:.3em;flex-wrap:wrap}
.hc-key-actions{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.hc-key-actions .hc-edit-action{padding:2px 4px;font-size:clamp(8px,.78em,12px);line-height:1.25;border:1px solid #bfc7cc;border-radius:4px;color:#52616b;background:#fff}
.hc-key-actions .hc-edit-action:hover{color:#007e8a;border-color:#007e8a}
.hc-song-meta{min-width:0}
.hc-editing .hc-beat,.hc-editing .hc-measure-content,.hc-editing .hc-selected{outline:none;background:transparent}
.hc-editing .hc-beat::after{content:"";position:absolute;left:2px;right:3px;bottom:0;height:1px;background:#d9dde0;pointer-events:none}
.hc-editing .hc-beat:hover,.hc-editing .hc-beat:focus-visible{outline:none;background:transparent}
.hc-editing .hc-beat:hover::after,.hc-editing .hc-beat:focus-visible::after{background:#007e8a}
.hc-editing .hc-measure-content:not(.hc-beat-grid){border-bottom:1px solid #d9dde0}
.hc-editing .hc-measure-content:hover,.hc-editing .hc-section:hover{background:transparent}
.hc-editing .hc-measure-content:focus-visible,.hc-editing .hc-section:focus-visible{outline:none;text-decoration:underline dotted;text-underline-offset:4px}
.hc-editing .hc-warning{background:transparent;color:inherit;text-decoration:underline dotted #a16207;text-underline-offset:3px}
.hc-editing .hc-warning::after{background:#c5a36a}
.hc-editing .hc-selected .hc-beat::after{background:#91b5b8}
@media screen and (max-width:1023px){
 #hymnChordPanel{padding-top:0}
 #hymnChordPanel .hc-preview-head{padding-right:0}
 #hymnChordPanel #hc-downloads{width:100%;box-sizing:border-box}
 #hc-edit-tools .hc-history{border-right:0;padding-right:0}
}
@media print{
 #hc-downloads,.hc-key-actions,#hc-edit-tools{display:none!important}
 .hc-editing .hc-beat::after{display:none!important}
 .hc-editing .hc-measure-content:not(.hc-beat-grid){border:0!important}
 .hc-editing .hc-warning,.hc-editing .hc-measure-content,.hc-editing .hc-section{text-decoration:none!important;outline:none!important;color:inherit!important}
}

/* Word-like chart selection, four-measure notes and modulation blocks. */
.hc-song-meta .hc-meta-value{font-size:1em}
.hc-song-meta{font-size:inherit}
.hc-modulation{font-weight:600;cursor:text}
.hc-editing [data-hc-target]{user-select:none;touch-action:manipulation}
.hc-editing .hc-range-selected{background:rgba(0,126,138,.12)!important}
.hc-editing .hc-caret{position:relative}
.hc-editing .hc-boundary.hc-caret{position:absolute}
.hc-editing .hc-caret::before{content:"";position:absolute;left:0;top:20%;height:60%;width:2px;background:#007e8a;animation:hc-caret-blink 1s step-end infinite;z-index:5;pointer-events:none}
@keyframes hc-caret-blink{50%{opacity:0}}
.hc-notes-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 1.2em;gap:0;margin-bottom:calc(var(--hc-font,16pt)*var(--hc-spacing,1.25)*.48);align-items:stretch}
.hc-note{font-size:calc(var(--hc-font,16pt)*.67);min-height:calc(var(--hc-font,16pt)*1.6);padding:.2em .4em;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.3;position:relative}
.hc-editing .hc-note{border-bottom:1px solid #d9dde0;cursor:text}
.hc-note-input{display:block;width:100%;min-height:1.3em;resize:none;overflow:hidden;border:0;outline:0;background:transparent;color:inherit;font:inherit;line-height:inherit;padding:0;user-select:text}
@media(prefers-reduced-motion:reduce){.hc-editing .hc-caret::before{animation:none}}
@media print{.hc-caret::before{display:none!important}.hc-range-selected{background:transparent!important}.hc-note{border:0!important}}

/* Uniform score metadata and section typography. */
.hc-song-meta,.hc-section,.hc-key{font-size:.75em;font-weight:700;line-height:1.3}
.hc-song-meta .hc-meta-value,.hc-key.hc-meta-value{font:inherit}
.hc-meta-value{display:flex;align-items:baseline;gap:.15em;white-space:nowrap}
.hc-meta-label{flex:none}
.hc-meta-field{min-width:1em}
.hc-editing .hc-meta-field{cursor:text;border-bottom:1px solid #d9dde0}
.hc-meta-field .hc-inline-input{width:4.5em;max-width:100%;font:inherit;padding:0 2px}
.hc-key-inline{flex-wrap:nowrap}
@media print{.hc-meta-field{border:0!important}}

/* Keep inline editing on the same baseline; Word-like row selection gutter. */
.hc-meta-field{position:relative;display:inline-block;min-height:1.3em;line-height:1.3}
.hc-meta-field.hc-inline-open{min-width:2.6em}
.hc-meta-field .hc-inline-input{position:absolute;left:0;top:0;z-index:8;width:4em;min-width:0;max-width:none;height:1.3em;line-height:1.3;padding:0 2px;margin:0;box-sizing:border-box}
.hc-section.hc-inline-open,.hc-comment.hc-inline-open{position:relative;min-height:1.3em}
.hc-section.hc-inline-open .hc-inline-input,.hc-comment.hc-inline-open .hc-inline-input{position:absolute;left:0;top:0;height:1.3em;line-height:1.3;padding:0 2px;margin:0}
#hc-add-menu{color-scheme:light dark}
#hc-add-menu option{background:#fff;color:#161616}
.dark #hc-add-menu option{background:#252832;color:#f5f5f5}
.hc-row,.hc-notes-row{position:relative}
.hc-row-handle{position:absolute;left:-2.1em;top:0;width:1.2em;height:100%;border:0;background:transparent;cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h11V4l9 8-9 8v-5H3z' fill='white' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 19 12,pointer;padding:0}
.hc-row-handle:hover{background:#007e8a22}
.hc-comment:empty{min-height:1.3em}
@media print{.hc-row-handle{display:none!important}}

/* Explicit shared typography: avoid inherited font shorthand on modulation rows. */
.hc-page .hc-song-meta,.hc-page .hc-section,.hc-page .hc-key,.hc-page .hc-key.hc-meta-value{
 font-size:calc(var(--hc-font,16pt)*.75);font-weight:700;line-height:1.3;
}
.hc-page .hc-song-meta .hc-meta-value,.hc-page .hc-meta-label,.hc-page .hc-meta-field{
 font-size:inherit;font-weight:inherit;line-height:inherit;
}

/* Keep chord warnings in editor dialogs/tooltips, not the score surface. Align toolbar with paper lyrics. */
.hc-editing .hc-warning,.hc-editing .hc-warning .hc-measure-label{background:transparent;color:inherit;text-decoration:none!important}
.hc-editing .hc-warning::after,.hc-editing .hc-warning .hc-beat::after{background:#d9dde0}
@media screen and (min-width:1024px){.hc-panel{padding-top:0}.hc-preview-head{padding-left:8px;padding-right:8px}}

/* Optional proofreading; never print review marks. */
.hc-check-toggle{display:inline-flex;align-items:center;gap:6px;margin-left:auto;white-space:nowrap;cursor:pointer;font-size:12px}
.hc-check-toggle input{appearance:none;width:30px;height:17px;border-radius:12px;background:#777;position:relative;cursor:pointer}
.hc-check-toggle input::after{content:"";position:absolute;width:13px;height:13px;border-radius:50%;background:white;top:2px;left:2px}
.hc-check-toggle input:checked{background:#007e8a}.hc-check-toggle input:checked::after{left:15px}
/* Diagnostic colors are defined by the specific issue classes below. */
@media print{.hc-check-toggle{display:none!important}.hc-editing.hc-check-mode .hc-warning .hc-measure-label{text-decoration:none!important}}

/* Volta range brackets and touch selection. */
.hc-volta{position:absolute;top:0;box-sizing:border-box;border-top:1px solid currentColor;border-left:1px solid currentColor;height:.85em;font-size:.7em;line-height:1;padding-left:.25em;z-index:3;cursor:pointer}
.hc-row-ending{padding-top:1em!important}
@media(pointer:coarse){#hc-edit-tools button,#hc-edit-tools select{min-height:44px}.hc-row-handle{width:1.6em}.hc-volta{min-height:1em} .hc-dialog{max-height:80dvh;overflow:auto}}

/* Reserve gear clearance at all viewport sizes. */
body.hc-active #hymnChordPanel .hc-preview-head{box-sizing:border-box;padding-right:52px!important}
.hc-original-link{display:inline-flex;align-items:center;white-space:nowrap;font-size:12px;color:#007e8a;border:1px solid #8190a366;border-radius:7px;padding:5px 9px;text-decoration:none}.hc-original-link[hidden]{display:none!important}.dark .hc-original-link{color:#5eead4}
@media print{.hc-original-link{display:none!important}}

/* v18: accidentals raised and compact; no diagnostic markings in exported pages. */
.hc-chord-acc{font-size:.62em;vertical-align:.38em;line-height:0;display:inline}
.hc-measure-label{white-space:nowrap;overflow:visible;flex:none;width:max-content;max-width:none}
.hc-beat{overflow:visible}
.hc-measure-content{overflow:hidden}
.hc-editing.hc-check-mode .hc-warning .hc-measure-label{ text-decoration:none!important }
.hc-editing.hc-check-mode .hc-issue-harmony .hc-measure-label{text-decoration:underline dashed #2477b3!important;text-underline-offset:3px}
.hc-editing.hc-check-mode .hc-issue-timing .hc-measure-label{text-decoration:underline dashed #b7791f!important;text-underline-offset:3px}
.hc-editing.hc-check-mode .hc-issue-syntax .hc-measure-label{text-decoration:underline wavy #d33!important;text-underline-offset:3px}
.hc-debug-item{text-align:left;white-space:normal;overflow-wrap:anywhere;width:100%}
@media print{.hc-editing.hc-check-mode .hc-warning .hc-measure-label{text-decoration:none!important}}

/* v19 keyboard entry stays anchored within the selected measure. */
.hc-measure-content{position:relative}
.hc-direct-open .hc-measure-label{visibility:hidden}
.hc-direct-input{position:absolute;left:0;top:50%;transform:translateY(-50%);z-index:5;max-width:none;box-sizing:border-box;height:1.5em;min-height:22px;padding:1px 2px;background:#fff;color:#161616;border:1px solid #007e8a;border-radius:2px;outline:none;line-height:1.1;font-family:Arial,sans-serif;font-weight:600;user-select:text}
.hc-direct-open.hc-measure-content .hc-direct-input{height:100%;min-height:0}
#hc-sync-folders{display:block;margin:6px 0;width:100%}
@media print{.hc-direct-input{display:none!important}.hc-direct-open .hc-measure-label{visibility:visible!important}}

/* Read-only chord access: viewing and downloads are available without editor controls. */
#hymnChordPanel.hc-readonly #hc-edit-tools > :not(#hc-original-link):not(#hc-pages){display:none!important}
#hc-sidebar.hc-readonly > .hc-controls:not(#hc-downloads) > :not(#hc-status){display:none!important}
#hc-downloads[hidden]{display:none!important}
.hc-row-handle:focus-visible{outline:1px solid #007e8a;outline-offset:-1px;background:#007e8a22}

/* Phone toolbar: precisely two compact rows. Keep the desktop toolbar unchanged. */
.hc-mobile-label{display:none}
@media screen and (max-width:600px){
 body.hc-active #hymnChordPanel .hc-preview-head{padding:0 0 8px!important}
 #hc-edit-tools{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px;align-items:stretch}
 #hc-edit-tools .hc-history,#hc-edit-tools .hc-structure-tools{display:contents}
 #hc-edit-tools button[data-edit="undo"],#hc-edit-tools button[data-edit="redo"]{display:none!important}
 #hc-edit-tools button[data-edit="restore"],#hc-add-menu,#hc-edit-tools button[data-edit="duplicate"],#hc-edit-tools button[data-edit="delete"]{grid-column:span 3;grid-row:1;min-width:0}
 #hc-volta-tool{grid-column:1/5;grid-row:2}
 #hc-original-link{grid-column:5/9;grid-row:2;justify-content:center;min-width:0}
 #hc-edit-tools .hc-check-toggle{grid-column:9/13;grid-row:2;margin:0;justify-content:center;min-width:0;gap:4px;padding:0 3px}
 #hc-edit-tools button,#hc-edit-tools select,#hc-original-link{height:36px;min-height:36px;box-sizing:border-box;padding:4px 3px;white-space:nowrap;font-size:12px}
 #hc-edit-tools #hc-debug-summary{grid-column:12/13;grid-row:2;align-self:center;justify-self:end;min-height:24px;height:24px;width:24px;padding:0;font-size:0;border-radius:50%}
 #hc-edit-tools #hc-debug-summary::after{content:'i';font-size:12px}
 #hc-edit-tools:has(#hc-debug-summary:not([hidden])) #hc-volta-tool{grid-column:1/4}
 #hc-edit-tools:has(#hc-debug-summary:not([hidden])) #hc-original-link{grid-column:4/8}
 #hc-edit-tools:has(#hc-debug-summary:not([hidden])) .hc-check-toggle{grid-column:8/12;justify-content:center}
 #hc-edit-tools .hc-check-toggle{font-size:12px}
 #hc-edit-tools .hc-check-toggle input{flex:none}
 @media(max-width:360px){#hc-edit-tools .hc-check-toggle{gap:3px;font-size:11px}#hc-edit-tools .hc-check-toggle input{transform:scale(.86);transform-origin:center}#hc-edit-tools #hc-debug-summary{width:20px;height:20px;min-height:20px}}
 #hc-edit-tools .hc-desktop-label{display:none}
 #hc-edit-tools .hc-mobile-label{display:inline}
 #hymnChordPanel.hc-readonly #hc-edit-tools{display:flex}
 #hymnChordPanel.hc-readonly #hc-original-link{min-width:88px}
 .hc-editing [data-hc-target]{touch-action:pan-y;-webkit-touch-callout:none}
 .hc-direct-input{font-size:16px;touch-action:auto;-webkit-touch-callout:default}
}
