.mg-front{--mg-front-text-size:18px;max-width:1100px;margin:1.5rem auto;font-family:inherit;font-size:var(--mg-front-text-size);line-height:1.6}
.mg-front-form,.mg-front-result{background:#fff;border:1px solid #d7dbe0;border-radius:12px;padding:1rem;box-shadow:0 2px 12px rgba(0,0,0,.05)}
.mg-front :where(p,li,td,th,summary,label,button,span,strong,code,textarea){font-size:inherit!important}
.mg-front h2{font-size:1.55em;line-height:1.3}
.mg-front h3{font-size:1.25em;line-height:1.35}
.mg-front h4{font-size:1.1em;line-height:1.4}
.mg-front-label{display:block;font-weight:700;margin-bottom:.5rem}
.mg-front textarea{width:100%;box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;line-height:1.5}
.mg-front-form textarea{min-height:260px}
.mg-front-button{margin-top:.75rem;padding:.65rem 1rem;border:0;border-radius:8px;background:#1d2327;color:#fff;font-weight:700;cursor:pointer}
.mg-front-alert{margin:1rem 0;padding:.8rem 1rem;border-left:4px solid #b32d2e;background:#fff1f1}
.mg-front-result{margin-top:1rem}
.mg-front-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.75rem;margin:1rem 0}
.mg-front-summary-item{background:#f6f7f7;border:1px solid #e1e4e8;border-radius:10px;padding:.75rem}
.mg-front-summary-item span{display:block;color:#646970}
.mg-front-summary-item strong{display:block;margin-top:.2rem}
.mg-front-notation-wrap,.mg-front-warning,.mg-front-box{border:1px solid #e1e4e8;border-radius:10px;background:#fbfbfc;padding:1rem;margin:1rem 0}
.mg-front-notation{background:#fff;border:1px solid #e1e4e8;border-radius:8px;padding:.75rem;overflow:auto}
.mg-front-warning{border-left:4px solid #dba617;background:#fff8e5}
.mg-front-sections{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1rem}
.mg-front-box{margin:0}
.mg-front-box h3{margin-top:0}
.mg-front-box table{width:100%;border-collapse:collapse}
.mg-front-box th,.mg-front-box td{border-bottom:1px solid #e5e7eb;text-align:left;padding:.45rem;vertical-align:top;line-height:1.5}
.mg-front-box code{white-space:normal;word-break:break-word}
.mg-front-muted{color:#646970;line-height:1.6}
.mg-front-json{margin-top:1rem}
.mg-front-json>summary{font-weight:700;line-height:1.5;cursor:pointer}
.mg-front-json textarea{height:320px;margin-top:.75rem}
.mg-parser-capabilities{margin:0 0 1rem;border:1px solid #d7dbe0;border-radius:12px;background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.05);overflow:hidden}
.mg-parser-capabilities>summary{display:block;position:relative;padding:1rem 3rem 1rem 1rem;font-weight:700;cursor:pointer;list-style:none}
.mg-parser-capabilities>summary::-webkit-details-marker{display:none}
.mg-parser-capabilities>summary::after{content:"+";position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-size:1.4em;line-height:1}
.mg-parser-capabilities[open]>summary::after{content:"−"}
.mg-parser-capabilities[open]>summary{border-bottom:1px solid #e1e4e8}
.mg-parser-capabilities__content{padding:1rem}
.mg-parser-capabilities__content>p:first-child{margin-top:0}
.mg-parser-capabilities__content section{margin:1.2rem 0}
.mg-parser-capabilities__content section:last-child{margin-bottom:0}
.mg-parser-capabilities__content h3{margin:0 0 .45rem;font-size:1.15em}
.mg-parser-capabilities__content p{margin:.4rem 0;line-height:1.6}
.mg-parser-capabilities__content code{padding:.08rem .3rem;border-radius:4px;background:#f0f0f1;white-space:nowrap}
@media(max-width:700px){.mg-front-sections{grid-template-columns:1fr}.mg-front{margin:1rem 0}}

.mg-front-actions{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}
.mg-front-button-secondary{background:#646970}

.mg-front-key-warning{margin:1rem 0}.mg-front-key-candidates{margin:.75rem 0 1rem}.mg-front-key-candidates summary{cursor:pointer;font-weight:600}.mg-front-key-candidates ol{margin:.6rem 0 .2rem 1.5rem}

/* C.3: clear separation between musical results and technical diagnostics. */
.mg-front-overview,.mg-front-box-wide,.mg-front-musical-details{margin:1rem 0}
.mg-front-tonality{border:1px solid #dfe3e7;border-radius:12px;background:#fbfbfc;padding:1rem}
.mg-front-tonality h3{margin-top:0}
.mg-front-tonality-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem}
.mg-front-tonality-item{border:1px solid #e1e4e8;border-radius:10px;background:#fff;padding:.8rem}
.mg-front-tonality-item span,.mg-front-tonality-item strong,.mg-front-tonality-item small{display:block}
.mg-front-tonality-item span{color:#646970}
.mg-front-tonality-item strong{margin:.2rem 0}
.mg-front-tonality-item small{color:#646970;line-height:1.45}
.mg-front-ok{border-left:4px solid #00a32a;background:#edfaef;padding:.75rem 1rem;border-radius:6px}
.mg-front-analysis-group{border:1px solid #e1e4e8;border-radius:10px;background:#fbfbfc;margin:.85rem 0;overflow:hidden}
.mg-front-analysis-group>summary,.mg-front-technical>summary{cursor:pointer;font-weight:700;padding:.85rem 1rem}
.mg-front-analysis-group>.mg-front-sections{padding:0 1rem 1rem}
.mg-front-technical{margin-top:1.25rem;border-top:1px solid #d7dbe0;padding-top:.5rem}
.mg-front-technical[open]{border:1px solid #d7dbe0;border-radius:10px;padding:.25rem 1rem 1rem}
.mg-front-technical-section{border:1px solid #e1e4e8;border-radius:8px;padding:.75rem;margin:.75rem 0;background:#fbfbfc}
@media(max-width:700px){.mg-front-tonality-grid{grid-template-columns:1fr}}

.mg-front-dropzone{position:relative;border:2px dashed #c3c7cc;border-radius:10px;background:#fafbfc;padding:1.5rem 1rem;text-align:center;cursor:pointer;margin-bottom:1rem;transition:border-color .15s,background .15s}
.mg-front-dropzone:hover,.mg-front-dropzone:focus-visible{border-color:#1d2327;outline:none}
.mg-front-dropzone-active{border-color:#00a32a;background:#edfaef}
.mg-front-dropzone-text{margin:0 0 .25rem;font-size:1.05em}
.mg-front-dropzone-hint{margin:0;color:#646970;font-size:.9em}
.mg-front-dropzone-filename{margin:.6rem 0 0;font-weight:600}
.mg-front-file-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.mg-front-audio-controls{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:0 0 .6rem}
.mg-front-play{cursor:pointer}
.mg-front-playback-progress{width:140px;height:8px;vertical-align:middle}
