.chord-diagram-controls{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.chord-diagram-controls button{min-height:40px;font-size:14px;padding:7px 10px;white-space:nowrap}
.chord-diagram-panel{flex:0 0 auto;min-width:0;margin:8px 0;border:1px solid var(--border,#dce2eb);border-radius:10px;background:var(--surface,#fff);overflow:hidden}
.chord-diagram-panel[hidden]{display:none!important}
.chord-diagram-panel>p{margin:12px;font-size:14px}
.chord-diagram-strip{display:flex;align-items:stretch;justify-content:safe center;gap:10px;padding:8px;overflow-x:auto;scrollbar-width:thin}
.chord-diagram-strip figure{margin:0;flex:0 0 112px;min-height:160px;border-radius:6px;background:#fff;color:#111;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;overflow:hidden}
.chord-diagram-strip img{display:block;width:112px;height:170px;object-fit:contain;background:white}
.chord-diagram-strip small,.chord-diagram-strip span{font-size:12px;padding:6px}
.chord-diagram-strip figcaption{font-size:22px;font-weight:700}
.chord-diagram-dialog{width:min(880px,calc(100vw - 24px));max-height:90dvh;border:1px solid var(--border,#dce2eb);border-radius:14px;padding:0;color:var(--text,#15263c);background:var(--surface,#fff)}
.chord-diagram-dialog::backdrop{background:#10213388}
.chord-diagram-dialog header{position:sticky;top:0;z-index:1;background:var(--surface,#fff);padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border,#dce2eb)}
.chord-diagram-dialog h2{margin:0;font-size:23px}.chord-diagram-dialog button{min-height:40px}
.chord-diagram-dialog .chord-dialog-body{padding:16px 20px}
.chord-diagram-dialog p{font-size:14px;line-height:1.5}
.chord-diagram-dialog select{min-height:42px;width:100%;max-width:100%;font-size:16px;color:var(--text,#15263c);background:var(--surface,#fff);border:1px solid var(--border,#dce2eb);border-radius:6px;padding:6px}
.chord-diagram-dialog label{display:flex;flex-direction:column;gap:5px;font-size:14px}
.chord-diagram-dialog .chord-visibility{flex-direction:row;align-items:center;gap:8px}.chord-visibility input{width:20px;height:20px}
.chord-diagram-dialog ol{padding:0;list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:12px}
.chord-choice{display:flex;align-items:center;gap:10px;border:1px solid var(--border,#dce2eb);padding:10px;border-radius:8px;min-width:0}
.chord-choice-preview{flex:0 0 85px;min-height:130px;background:#fff;border-radius:5px}.chord-choice-preview img{width:85px;height:130px;object-fit:contain;display:block}
.chord-choice-fields{flex:1;min-width:0;display:grid;gap:8px}.chord-choice-actions{display:flex;gap:4px;flex-wrap:wrap}.chord-choice-actions button{padding:5px 9px;font-size:13px}
.chord-diagram-add{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.chord-diagram-add label{flex:1;min-width:180px}
.chord-dialog-footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}.chord-dialog-footer a{font-size:14px;color:var(--blue,#005ac8)}
body.focus-screen .chord-diagram-panel{margin:0 0 6px;max-height:24dvh}
body.focus-screen .chord-diagram-strip img{height:min(170px,21dvh);width:auto;max-width:120px}
body.focus-screen .chord-diagram-strip figure{min-height:0;flex-basis:auto;min-width:90px}
body .reader-controls .chord-diagram-controls{margin-left:auto}
@media(max-width:650px){.chord-diagram-dialog ol{grid-template-columns:1fr}.chord-diagram-dialog .chord-dialog-body{padding:12px}.chord-diagram-strip figure{flex-basis:90px;min-height:130px}.chord-diagram-strip img{width:90px;height:138px}.chord-diagram-controls button{font-size:12px;padding:6px}.chord-diagram-controls{gap:4px}.chord-diagram-panel{margin:4px 0}}

.chord-diagram-controls a{display:inline-flex;align-items:center;min-height:40px;padding:6px 10px;font-size:14px;color:var(--blue,#005ac8);text-decoration:none}.chord-diagram-controls a:hover{text-decoration:underline}
