#fc-page-content[data-fc-math]{min-width:0}
[data-fc-math] *{box-sizing:border-box}[data-fc-math] [hidden]{display:none!important}[data-fc-math] h2,[data-fc-math] h3,[data-fc-math] p{margin:0 0 12px}[data-fc-math] button,[data-fc-math] input,[data-fc-math] select,[data-fc-math] textarea{font:inherit;max-width:100%}
[data-fc-math] button,[data-fc-math] .mg-link{min-height:36px;border:1px solid var(--fc-dark,#718078);border-radius:3px;padding:7px 11px;background:var(--fc-alt,#eef1ee);color:inherit;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}[data-fc-math] button:hover{background:var(--fc-bg,#e7ebe8)}[data-fc-math] button:disabled{opacity:.5;cursor:wait}[data-fc-math] :focus-visible{outline:2px solid var(--fc-primary,#365c76);outline-offset:2px}
[data-fc-math] .mg-primary,[data-fc-math] button[aria-pressed=true]{background:var(--fc-primary,#365c76);border-color:var(--fc-primary,#365c76);color:white}[data-fc-math] .mg-primary:hover{filter:brightness(1.1);background:var(--fc-primary,#365c76)}
[data-fc-math] input,[data-fc-math] select,[data-fc-math] textarea{width:100%;min-height:36px;border:1px solid var(--fc-dark,#718078);border-radius:3px;background:var(--fc-paper,#f8f9f7);color:inherit;padding:7px 9px}[data-fc-math] textarea{resize:vertical;min-height:100px;font:12px/1.5 Consolas,monospace}[data-fc-math] [aria-invalid=true]{border:2px solid #913b32}
[data-fc-math] .mg-muted{font-size:12px;color:var(--fc-muted,#53625b)}[data-fc-math] .mg-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--fc-line,#aab5ae);align-items:end}[data-fc-math] .mg-toolbar label{display:grid;gap:3px;min-width:95px;font-size:12px}[data-fc-math] .mg-toolbar #mg-saved{width:180px}[data-fc-math] .mg-layout{display:grid;grid-template-columns:230px minmax(0,1fr)}[data-fc-math] .mg-navigation{padding:14px;border-right:1px solid var(--fc-line,#aab5ae);background:var(--fc-alt,#eef1ee)}[data-fc-math] .mg-navigation details{border-bottom:1px solid var(--fc-line,#aab5ae);padding:8px 0}[data-fc-math] summary{cursor:pointer;font-weight:600;padding:6px 0}[data-fc-math] .mg-navigation button{display:block;width:100%;text-align:left;border:0;background:transparent;min-height:32px;padding:7px 9px;font-size:12px}[data-fc-math] .mg-navigation button[aria-pressed=true]{background:var(--fc-primary,#365c76);color:white}
[data-fc-math] .mg-main{padding:16px;min-width:0}[data-fc-math] .mg-selector{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-bottom:16px}[data-fc-math] label.mg-field{display:grid;gap:5px;min-width:0}[data-fc-math] label.mg-field>span{font-size:12px;font-weight:600}[data-fc-math] .mg-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}[data-fc-math] .mg-error{color:#913b32;font-size:12px;white-space:normal}[data-fc-math] #mg-status:empty{display:none}[data-fc-math] #mg-status{margin-bottom:12px;padding:10px;background:var(--fc-alt,#eef1ee);border-left:3px solid #913b32;color:#913b32}
[data-fc-math] .mg-work{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}[data-fc-math] .mg-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}[data-fc-math] .mg-formula{font:13px/1.6 Consolas,monospace;white-space:normal;overflow-wrap:anywhere;border-left:3px solid var(--fc-primary,#365c76);padding:9px 12px;background:var(--fc-alt,#eef1ee);margin:12px 0}
[data-fc-math] #mg-output{border-top:1px solid var(--fc-line,#aab5ae);padding-top:16px;min-width:0}[data-fc-math] #mg-output[data-stale=true]{opacity:.65}[data-fc-math] #mg-output[data-stale=true]::before{content:"Данные изменены — выполните расчёт заново";display:block;font-weight:600;padding:8px;background:var(--fc-alt,#eef1ee);margin-bottom:10px}[data-fc-math] .mg-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}[data-fc-math] .mg-result{border:1px solid var(--fc-line,#aab5ae);background:var(--fc-paper,#f8f9f7);padding:10px;min-width:0}[data-fc-math] .mg-result span{display:block;color:var(--fc-muted,#53625b);font-size:12px}[data-fc-math] .mg-result strong{display:block;font-size:19px;font-weight:650;overflow-wrap:anywhere}[data-fc-math] .mg-result small{font-size:12px;font-weight:400;margin-left:4px}
[data-fc-math] .mg-diagram-shell{margin-top:12px;border:1px solid var(--fc-line,#aab5ae);background:var(--fc-paper,#f8f9f7);min-width:0}[data-fc-math] #mg-diagram svg,[data-fc-math] .mg-profile-preview svg{display:block;width:100%;height:auto;max-height:500px;touch-action:none;user-select:none}[data-fc-math] .mg-view-toolbar{display:flex;gap:6px;flex-wrap:wrap;padding:8px;border-top:1px solid var(--fc-line,#aab5ae)}[data-fc-math] .mg-profile{grid-column:1/-1;border:1px solid var(--fc-line,#aab5ae);padding:10px;min-width:0}[data-fc-math] .mg-profile>summary{padding:2px 0 8px}[data-fc-math] .mg-profile-tools{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}[data-fc-math] .mg-profile-tools select{width:180px}[data-fc-math] .mg-profile-columns{display:grid;grid-template-columns:minmax(220px,1fr) minmax(180px,.8fr);gap:12px}[data-fc-math] .mg-coordinate-table{max-height:265px;overflow:auto;border:1px solid var(--fc-line,#aab5ae);padding:5px}[data-fc-math] .mg-coordinate-row{display:grid;grid-template-columns:25px minmax(0,1fr) minmax(0,1fr) 30px;gap:5px;align-items:center;margin-bottom:4px;font-size:12px}[data-fc-math] .mg-coordinate-row button{padding:0;min-height:30px}[data-fc-math] .mg-coordinate-row input{font:12px Consolas,monospace;min-height:30px;padding:5px}[data-fc-math] .mg-profile-preview{border:1px solid var(--fc-line,#aab5ae);min-width:0;align-self:start}[data-fc-math] .mg-hole{display:grid;grid-template-columns:30px 1fr 1fr 1fr 34px;gap:5px;align-items:center;margin-top:6px}[data-fc-math] .mg-hole input{min-width:0;font-size:12px}[data-fc-math] .mg-hole textarea{grid-column:2/5}[data-fc-math] .mg-json-field{grid-column:1/-1}[data-fc-math] .mg-json-field details{margin-top:8px}[data-fc-math] .mg-notes{padding:10px 14px;background:var(--fc-alt,#eef1ee);font-size:12px;overflow-wrap:anywhere}[data-fc-math] .mg-quota{padding:24px;max-width:700px;margin:20px auto}[data-fc-math] .mg-quota a{display:inline-block;margin-right:16px;color:var(--fc-primary,#365c76)}[data-fc-math] .mg-sources{margin-top:16px;padding-top:12px;border-top:1px solid var(--fc-line,#aab5ae);font-size:12px}[data-fc-math] .mg-sources a{color:var(--fc-primary,#365c76);margin-right:14px}
@media(min-width:1600px){[data-fc-math] .mg-work{grid-template-columns:minmax(350px,.9fr) minmax(0,1.1fr)}[data-fc-math] #mg-output{border-top:0;border-left:1px solid var(--fc-line,#aab5ae);padding:0 0 0 16px;align-self:start;position:sticky;top:70px}}
@media(max-width:1000px){[data-fc-math] .mg-layout{grid-template-columns:minmax(0,1fr)}[data-fc-math] .mg-navigation{display:none}[data-fc-math] .mg-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){[data-fc-math] .mg-main{padding:12px}[data-fc-math] .mg-selector,[data-fc-math] .mg-profile-columns{grid-template-columns:minmax(0,1fr)}[data-fc-math] .mg-results{grid-template-columns:repeat(2,minmax(0,1fr))}[data-fc-math] .mg-result strong{font-size:16px}[data-fc-math] .mg-toolbar{padding:10px}[data-fc-math] .mg-toolbar #mg-saved{width:150px}[data-fc-math] .mg-fields{gap:8px}[data-fc-math] .mg-coordinate-table{max-height:210px}}
@media(pointer:coarse){[data-fc-math] button,[data-fc-math] input,[data-fc-math] select{min-height:44px}}
html[data-fc-module="math-geometry"] .fc-tool-parent-hero{grid-template-columns:minmax(0,1fr)}html[data-fc-module="math-geometry"] .fc-tool-parent-hero>div{min-width:0}html[data-fc-module="math-geometry"] .fc-tool-parent-hero h1{overflow-wrap:anywhere}
[data-fc-math] .mg-diagram-key{border-top:1px solid var(--fc-line,#aab5ae);padding:12px;font-size:12px;line-height:1.5}[data-fc-math] .mg-diagram-key h4{margin:0 0 7px;font-size:13px}[data-fc-math] .mg-diagram-key p{margin:5px 0 9px}[data-fc-math] .mg-key-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:5px 14px;margin-bottom:10px}[data-fc-math] .mg-key-items span{overflow-wrap:anywhere}
@media(min-width:1280px){[data-fc-math] .mg-layout{grid-template-columns:190px minmax(0,1fr)}[data-fc-math] .mg-work{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)}[data-fc-math] .mg-fields{grid-template-columns:repeat(2,minmax(0,1fr))}[data-fc-math] #mg-output{border-top:0;border-left:1px solid var(--fc-line,#aab5ae);padding:0 0 0 12px;align-self:start}[data-fc-math] .mg-profile-columns{grid-template-columns:minmax(0,1fr)}}
/* MG1 R1.2: unified controls, compact result and direct diagram manipulation. */
[data-fc-math] .mg-filter-bar{display:grid;grid-template-columns:minmax(120px,.75fr) minmax(130px,.85fr) minmax(190px,1.35fr) minmax(160px,1fr) 78px 78px;gap:9px;padding:14px 16px;border-bottom:1px solid var(--fc-line,#aab5ae);align-items:end}[data-fc-math] .mg-filter-bar label{min-width:0}[data-fc-math] .mg-tools-panel{padding:5px 16px;border-bottom:1px solid var(--fc-line,#aab5ae);font-size:12px}[data-fc-math] .mg-tools-panel>summary{font-weight:400;color:var(--fc-muted,#53625b)}[data-fc-math] .mg-tools-panel select{max-width:260px}[data-fc-math] #mg-result-details{margin-top:15px;border-top:1px solid var(--fc-line,#aab5ae);padding-top:8px}[data-fc-math] #mg-result-details>.mg-diagram-key{border:0;padding:12px 0}[data-fc-math] #mg-export-panel{margin-top:12px}[data-fc-math] .mg-canvas-hint{font-size:11px;color:var(--fc-muted,#53625b);padding:7px 10px;margin:0!important;border-top:1px solid var(--fc-line,#aab5ae)}[data-fc-math] #mg-diagram svg{overflow:hidden;cursor:grab;touch-action:none}[data-fc-math] #mg-diagram svg:active{cursor:grabbing}[data-fc-math] #mg-diagram [data-mg-draggable-label]{cursor:move;user-select:none}[data-fc-math] .mg-view-toolbar button[aria-pressed=true]{background:var(--fc-primary,#365c76);color:#fff}[data-fc-math] .mg-important-note{font-size:12px;border-left:3px solid #913b32;background:var(--fc-alt,#eef1ee);padding:9px;margin-top:10px}[data-fc-math] .mg-important-note p{margin:0 0 5px}[data-fc-math] .mg-json-field>label{display:block}
@media(min-width:900px){[data-fc-math] .mg-work{grid-template-columns:minmax(280px,.85fr) minmax(0,1.15fr)}[data-fc-math] .mg-fields{grid-template-columns:repeat(2,minmax(0,1fr))}[data-fc-math] #mg-output{border-top:0;border-left:1px solid var(--fc-line,#aab5ae);padding:0 0 0 14px;min-width:0;align-self:start}[data-fc-math] .mg-profile-columns{grid-template-columns:minmax(0,1fr)}}
@media(max-width:1100px){[data-fc-math] .mg-filter-bar{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){[data-fc-math] .mg-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}[data-fc-math] .mg-filter-bar label:nth-child(3),[data-fc-math] .mg-filter-bar label:nth-child(4){grid-column:1/-1}[data-fc-math] .mg-view-toolbar{gap:4px}[data-fc-math] .mg-view-toolbar button{padding:5px 8px;font-size:12px}[data-fc-math] .mg-results{grid-template-columns:repeat(2,minmax(0,1fr))}}

[data-fc-math] .mg-table-scroll{max-height:350px;overflow:auto;margin:12px 0}[data-fc-math] .mg-coordinate-results{width:100%;border-collapse:collapse;font-size:13px}[data-fc-math] .mg-coordinate-results th,[data-fc-math] .mg-coordinate-results td{padding:7px 10px;border:1px solid var(--fc-r3-border,#aab5ae);text-align:right}[data-fc-math] .mg-coordinate-results th{position:sticky;top:0;background:var(--fc-alt,#eef1ee)}

[data-fc-math] .mg-pipe-developments{margin-top:16px;border-top:1px solid var(--fc-r3-border,#aab5ae);padding-top:8px}[data-fc-math] #mg-template-preview svg{width:100%;height:auto;display:block;background:var(--fc-paper,#f8f9f7)}[data-fc-math] #mg-template-preview{margin:10px 0;border:1px solid var(--fc-r3-border,#aab5ae)}

[data-fc-math] .mg-search-box{position:relative;min-width:0}[data-fc-math] #mg-search-results{position:absolute;left:0;top:100%;width:min(480px,80vw);max-height:390px;overflow:auto;background:var(--fc-paper,#f8f9f7);border:1px solid var(--fc-line,#aab5ae);z-index:50;box-shadow:0 8px 18px #0002}[data-fc-math] #mg-search-results[hidden]{display:none}[data-fc-math] #mg-search-results button{display:block;text-align:left;width:100%;border:0;border-bottom:1px solid var(--fc-line,#aab5ae);border-radius:0;padding:9px 12px;background:transparent}[data-fc-math] #mg-search-results button span{display:block;font-size:11px;margin-top:3px;color:var(--fc-muted,#53625b)}[data-fc-math] #mg-search-results button:hover,[data-fc-math] #mg-search-results button[aria-selected=true]{background:var(--fc-alt,#e2e8e4)}[data-fc-math] #mg-search-results p{padding:10px}[data-fc-math] .mg-print-controls{display:grid;grid-template-columns:minmax(0,1fr) 85px;gap:10px;margin-top:10px}[data-fc-math] .mg-template-steps{padding-left:22px;font-size:12px;line-height:1.7}

[data-fc-math] #mg-template-preview path{vector-effect:non-scaling-stroke}[data-fc-math] #mg-template-preview path[stroke="#913b32"]{stroke-width:1.25}[data-fc-math] #mg-template-preview path[stroke="#365c76"]{stroke-width:1}[data-fc-math] #mg-template-preview path[stroke="#718078"]{stroke-width:.55}

.mg-fold-toggle{display:flex;align-items:center;gap:8px;font-size:13px;margin:10px 0}.mg-fold-toggle input{width:auto}#mg-assembly table{font-size:12px}#mg-assembly p{line-height:1.5}

.mg-layout-source,.mg-layout-counts{grid-column:1/-1}.mg-layout-counts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.mg-layout-counts h4{grid-column:1/-1}
