html,body{max-width:100%;overflow-x:clip}main,#results,.workspace-section{min-width:0;max-width:100%}
body{padding-bottom:calc(var(--active-dock-height,80px) + 20px)!important}
.composition-fields{display:flex;flex-wrap:wrap;gap:12px;padding:16px}.composition-fields label{display:flex;flex:1 1 220px;flex-direction:column;gap:6px;min-width:0}.composition-fields input{width:100%;min-width:0;box-sizing:border-box}
#analysis-section{margin-top:18px}.analysis-cards{display:flex;gap:10px;overflow-x:auto;padding:12px;max-width:100%;box-sizing:border-box;overscroll-behavior-x:contain}.analysis-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;flex:0 0 190px;white-space:normal;text-align:left;padding:14px}.analysis-card strong{font-size:24px}.analysis-card[aria-expanded=true]{border-color:#456337;background:#eff3e8}
#analysis-detail{width:100%;min-width:0;overflow-wrap:anywhere}#analysis-detail .detail{min-width:0;box-sizing:border-box}#analysis-detail .detail-grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))}#analysis-detail select,#analysis-detail fieldset,#explanation-panel select{min-width:0;max-width:100%;box-sizing:border-box}#analysis-detail .detail-grid>div{min-width:0}
#meter-editor{box-sizing:border-box;z-index:10001;background:#f7f8f3;border-top:1px solid #bac7b4;padding:8px 12px calc(8px + env(safe-area-inset-bottom));margin:0;max-height:65dvh;overflow:auto;box-shadow:0 -3px 16px #0001}#meter-editor[hidden]{display:none!important}.editing-composition #jazz-player{display:none!important}.editing-composition .editing-bar{outline:3px solid #436538;outline-offset:-3px}.editing-composition .chart-chord{cursor:text}
#meter-editor .notation-toolbar{display:flex;flex-wrap:wrap;overflow-x:visible;gap:5px;padding-bottom:6px}#meter-editor .notation-toolbar button{flex:0 0 auto;min-width:36px;min-height:36px;padding:5px 9px}#meter-editor .notation-entry{display:flex;gap:8px;align-items:center}#meter-editor .notation-entry input{flex:1;min-width:0;font-size:16px}#meter-editor [data-meter-status]{font-size:12px;margin:5px 0}#meter-editor [data-editor-save]{background:#314f29;color:white;float:right}#meter-editor .notation-popover{max-height:20dvh;overflow:auto}
@media(max-width:600px){#analysis-detail .detail{padding:14px}.analysis-card{flex-basis:160px}#meter-editor{padding-left:8px;padding-right:8px}#meter-editor .notation-entry{gap:5px}#meter-editor [data-selected-bar]{font-size:12px}#meter-editor .notation-entry button{padding:6px}}

.document-menu #edit-composition{min-width:0;width:100%;max-width:100%}

/* The entry and keypad form one fixed panel, with no horizontal scrolling. */
#meter-editor .notation-entry{margin:0 0 6px;position:static}
#meter-editor .notation-toolbar{display:grid;grid-template-columns:repeat(auto-fit,minmax(40px,1fr));padding:5px;gap:4px}
#meter-editor .notation-toolbar button{min-width:0;padding:5px 2px;font-size:16px;min-height:36px}
#meter-editor [data-meter-status]:empty{display:none}
#meter-editor [data-editor-save]{margin-top:5px;padding:7px 14px}
.editing-composition #analysis-section,.editing-composition .about,.editing-composition main>footer,.editing-composition #input-section .controls,.editing-composition #explanation-panel{display:none!important}
@media(max-width:600px){#meter-editor .notation-entry input{padding:7px;font-size:16px}#meter-editor .notation-toolbar{grid-template-columns:repeat(8,minmax(0,1fr))}#meter-editor .notation-toolbar button{font-size:15px}#meter-editor .notation-toolbar button[aria-label="Разделить аккорды"]{font-size:10px}}

#meter-editor .chord-input{flex:1;min-width:0;overflow-x:auto;white-space:pre;box-sizing:border-box;min-height:38px;padding:8px 10px;border:1px solid #aab99b;border-radius:7px;background:white;font-size:18px;line-height:22px;cursor:text;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.chord-input:focus{outline:2px solid #739b50;outline-offset:1px}.chord-input-caret{display:inline-block;width:0;height:1.1em;border-left:2px solid #314f29;vertical-align:-.15em;pointer-events:none}.chord-input-selection{background:#dce8d5}

.chord-chart .chart-bar.with-double-start{border-left:4px double #647357}.chord-chart .chart-bar.with-double-end{border-right:4px double #647357}
#meter-editor .notation-toolbar{display:flex;flex-wrap:wrap}
#meter-editor .notation-toolbar button{flex:1 0 auto;min-width:2.4rem;width:auto;max-width:100%;white-space:normal;padding-inline:.35rem}
#meter-editor .notation-toolbar button[aria-label="Разделить аккорды"]{font-size:.85rem}

#groups.layout-editing .chart-bar { touch-action: none; cursor: ns-resize; }

#groups.range-editing {touch-action:none;user-select:none;}
#groups .editor-selected {outline:2px solid #547637;outline-offset:-2px;background:#dae7cd;}
