/* Same restrained green workshop palette as the price editor. */
html.fs-3d-active body{height:auto!important;overflow-y:auto!important;overflow-x:clip!important}
html.fs-3d-active #root>.h-screen{height:auto!important;min-height:100dvh}
html.fs-3d-active main,html.fs-3d-active .fs-scheme-host{height:auto!important;min-height:0!important;max-height:none!important;flex:none!important}
.fs-view-bar,.fs-preview{flex-shrink:0!important}
.fs-view-link{margin-top:12px;width:100%;background:#f3f8ef!important}.fs-view-link>svg{width:20px;height:20px}
@media(max-width:1099px){html.fs-3d-active body{padding-bottom:110px!important}}
.fs-side-controls{margin:12px 0 20px}.fs-side-controls>div{display:flex;gap:8px;flex-wrap:wrap}.fs-side-controls small{display:block;margin-top:9px;font-size:12px;color:#63756a}
.fs-dialog{max-width:650px}.fs-view-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:19px 24px;background:#f8fcf8;border:1px solid #cfdfd5;border-radius:20px;margin:0 0 16px}
.fs-view-title{display:flex;align-items:center;gap:15px}.fs-view-title>svg{width:43px;height:43px;color:#087657;flex-shrink:0}.fs-view-title h2{font-size:21px;line-height:1.3;letter-spacing:-.025em;font-weight:800;margin:4px 0 0}
#scheme-print-area.fs-plan-hidden{display:none!important}.fs-preview[hidden]{display:none!important}
.fs-preview{border:1px solid #ccdcd0;border-radius:22px;overflow:hidden;background:#f8fcf8;box-shadow:0 12px 38px #183c3010;width:100%;min-width:0}
.fs-preview-top{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:20px 24px;border-bottom:1px solid #d8e4d9;background:#fbfdfa}
.fs-preview-top>div>strong{font-size:18px;display:block;letter-spacing:-.02em}.fs-preview-top>div>span{display:block;color:#59705e;font-size:13px;margin-top:3px}
.fs-focus{display:flex;align-items:center;gap:10px;color:#5a715e;font-size:12px}.fs-focus select{width:210px;max-width:100%;border:1px solid #cbddd0;border-radius:11px;background:white;min-height:44px;padding:9px 30px 9px 12px;color:#264d36;font-size:14px}
.fs-stage{height:clamp(380px,52vw,580px);width:100%;position:relative;overflow:hidden;background:#edf3ed}.fs-canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none;outline-offset:-4px}.fs-canvas:active{cursor:grabbing}
.fs-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}.fs-dimension{position:absolute;transform:translate(-50%,-50%);border:1px solid #b4cab9;background:#fffffff0;box-shadow:0 3px 9px #0c342b0d;border-radius:7px;padding:4px 9px;white-space:nowrap;font-size:12px;font-weight:750;color:#234f3c;line-height:1.25;max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}
.fs-dimension-gate{background:#163f31f2;color:white;border-color:#163f31;font-size:11px}.fs-dimension-height{font-size:11px;padding:3px 6px;background:#f7f4e9}
.fs-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:35px;text-align:center;color:#365d49;font-size:16px;background:#edf3ed;z-index:3;line-height:1.7}.fs-status[hidden]{display:none}
.fs-controls{padding:14px 24px;border-top:1px solid #d3e1d4;background:#fff}.fs-control-buttons{display:flex;gap:8px;flex-wrap:wrap}.fs-controls p{font-size:12px;color:#718273;margin:10px 0 0}.fs-control-buttons [data-fs-action=save]{margin-left:auto}.fs-control-buttons [aria-pressed=false]{background:#fff;color:#738273}
.fs-preview-info{padding:18px 24px;background:#f4f8f2;border-top:1px solid #dce7d8}.fs-preview-info>small{font-size:11px;line-height:1.65;color:#6a7c6b;display:block;margin-top:15px}.fs-preview-info summary{cursor:pointer;min-height:36px;font-size:14px;font-weight:750;color:#34563d}.fs-notes{margin:0 0 15px;padding:11px 15px;border:1px solid #ddcf94;background:#fff9e6;border-radius:11px;color:#776126;font-size:12px;line-height:1.7}
.fs-legend{list-style:none;padding:0;margin:12px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.fs-legend li{display:flex;gap:10px;align-items:flex-start;padding:12px;background:#ffffffbd;border:1px solid #d8e4d4;border-radius:12px;min-width:0}.fs-legend li>span{width:25px;height:25px;border-radius:7px;flex-shrink:0;border:1px solid #283e2b25}.fs-legend strong{display:block;font-size:12px;line-height:1.5;overflow-wrap:anywhere}.fs-legend small{display:block;font-size:11px;color:#647861;line-height:1.8;margin-top:4px}
@media(max-width:767px){.fs-view-bar{padding:15px;flex-wrap:wrap;border-radius:15px;gap:14px;margin:10px 10px 12px;width:calc(100% - 20px)}.fs-view-title h2{font-size:19px}.fs-view-title>svg{width:33px;height:33px}.fs-view-bar .fw-mode{width:100%}.fs-view-bar .fw-mode button{flex:1}.fs-preview{border-radius:16px;width:calc(100% - 20px);margin:0 10px 20px}.fs-preview-top{padding:14px;gap:10px;align-items:stretch;flex-direction:column}.fs-focus{justify-content:space-between}.fs-focus select{flex:1;width:100%;font-size:16px;max-width:250px}.fs-stage{height:380px}.fs-controls{padding:12px}.fs-control-buttons{gap:6px;display:grid;grid-template-columns:1fr 44px 44px 1fr}.fs-control-buttons .fw-button{font-size:12px;padding:8px;min-height:44px}.fs-control-buttons [data-fs-action=save]{grid-column:1/-1;margin-left:0}.fs-preview-info{padding:15px}.fs-legend{grid-template-columns:minmax(0,1fr)}.fs-dimension{font-size:11px}.fs-dimension-gate{max-width:170px;font-size:10px}.fs-side-controls .fw-button{font-size:12px;padding:10px 12px}}
@media print{.fs-view-bar,.fs-preview,.fs-side-controls{display:none!important}#scheme-print-area.fs-plan-hidden{display:flex!important}}
.fs-navigation{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:13px;margin-bottom:13px;border-bottom:1px solid #e0e9df}
.fs-drag-modes{display:flex;padding:3px;border-radius:12px;border:1px solid #c9dccd;background:#eff5ed;gap:3px}.fs-drag-modes button{border:0;border-radius:8px;padding:9px 14px;min-height:44px;background:transparent;color:#506d57;font-size:17px;display:flex;align-items:center;gap:7px}.fs-drag-modes button span{font-size:13px;font-weight:750}.fs-drag-modes button[aria-pressed=true]{background:#087657;color:white;box-shadow:0 2px 6px #174b2b1a}
.fs-preset{display:flex;align-items:center;gap:9px;font-size:12px;color:#637762}.fs-preset select{min-height:44px;border:1px solid #c6dacb;border-radius:10px;background:#fbfdfa;padding:8px 30px 8px 12px;color:#2c5338;font-size:14px;min-width:160px}
.fs-help{margin-top:12px;border-top:1px solid #e0e9df;padding-top:9px}.fs-help summary{cursor:pointer;font-size:12px;min-height:34px;display:list-item;color:#276c4e;font-weight:750;padding-top:7px}.fs-help>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 22px;padding:6px 0 10px}.fs-help p{font-size:12px;line-height:1.7;margin:0}.fs-help strong{color:#36553c}
.fs-plan-tools{display:none}.fs-plan-tools[hidden]{display:none!important}
.fs-stage[data-drag-mode=pan] .fs-canvas{cursor:move}.fs-preview:fullscreen{width:100vw!important;height:100dvh!important;margin:0;border-radius:0;overflow:auto;background:#f5f9f3}.fs-preview:fullscreen .fs-preview-top{position:sticky;top:0;z-index:5}.fs-preview:fullscreen .fs-stage{height:max(300px,calc(100dvh - 285px))}
@media(max-width:767px){.fs-navigation{align-items:stretch;flex-direction:column;gap:10px}.fs-drag-modes button{flex:1;justify-content:center}.fs-preset{justify-content:space-between}.fs-preset select{flex:1;max-width:250px;font-size:16px}.fs-control-buttons{grid-template-columns:repeat(4,minmax(0,1fr))}.fs-control-buttons [data-fs-action=fullscreen],.fs-control-buttons [data-fs-action=save]{grid-column:span 2}.fs-help>div{grid-template-columns:minmax(0,1fr)}.fs-help summary{min-height:44px}.fs-preview:fullscreen .fs-stage{height:max(270px,calc(100dvh - 360px))}}
@media(max-width:480px){#scheme-print-area .cp-scheme-actions{gap:2px}#scheme-print-area .cp-scheme-actions button{min-width:44px;min-height:44px;padding:0 9px}#scheme-print-area .cp-scheme-bottom-tools{gap:4px!important;padding:6px!important}#scheme-print-area .cp-scheme-bottom-tools button{min-width:44px!important;width:44px!important;min-height:44px!important;padding:0!important}}
/* On small screens, plan toolbars have their own rows, outside the drawing. */
@media screen and (max-width:1023px){
 .fs-view-bar{flex-wrap:wrap}.fs-plan-tools{display:block;width:100%;border-top:1px solid #d4e2d6;padding-top:8px}.fs-plan-tools summary{cursor:pointer;min-height:44px;padding:12px 0;color:#176b4b;font-size:14px;font-weight:750}.fs-plan-tools>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.fs-plan-tools .fw-button{min-height:44px;font-size:12px;padding:8px;white-space:normal;justify-content:flex-start}.fs-plan-tools .fw-button i{width:20px;flex-shrink:0}
 html.fs-scheme-active body{height:auto!important;overflow-y:auto!important;padding-bottom:110px!important}
 html.fs-scheme-active #root>.h-screen{height:auto!important;min-height:100dvh}
 html.fs-scheme-active main,html.fs-scheme-active .fs-scheme-host{height:auto!important;min-height:0!important;max-height:none!important;flex:none!important}
 #scheme-print-area:not(.fs-plan-hidden){height:clamp(540px,72dvh,760px)!important;flex:none!important;border-radius:16px;padding-bottom:72px!important}
 #scheme-print-area .cp-scheme-topbar{position:relative;inset:auto;margin:8px;order:-1;flex-shrink:0;box-shadow:0 4px 14px #24483c0b}
 #scheme-print-area>.flex-grow{height:0!important;min-height:0;flex:1 1 0;overflow:visible}
 #scheme-print-area #fence-visualizer-canvas{min-height:0;min-width:0}
 .fs-scheme-host #scheme-print-area.cp-scheme-enhanced .cp-scheme-bottom-tools{position:absolute!important;top:auto!important;bottom:-64px!important;left:8px!important;right:8px!important;transform:none!important;width:auto!important;max-width:none!important;margin:0!important;box-shadow:none;gap:1px!important;padding:4px!important;overflow:visible}
 #scheme-print-area .cp-scheme-summary-card{bottom:76px!important;max-height:calc(100% - 90px)!important}
 #scheme-print-area .cp-scheme-help{bottom:76px;max-height:calc(100% - 90px);overflow:auto}
}

/* Give the desktop drawing its own height: surrounding flex items must not shrink it. */
@media screen and (min-width:1024px){
 html.fs-scheme-active:not(.fs-3d-active) body{height:auto!important;overflow-y:auto!important}
 html.fs-scheme-active:not(.fs-3d-active) #root>.h-screen{height:auto!important;min-height:100dvh}
 html.fs-scheme-active:not(.fs-3d-active) main,
 html.fs-scheme-active:not(.fs-3d-active) .fs-scheme-host{height:auto!important;min-height:0!important;max-height:none!important;flex:none!important}
 html.fs-scheme-active:not(.fs-3d-active) .fs-scheme-host{margin-top:14px!important}
 html.fs-scheme-active:not(.fs-3d-active) .fs-view-bar{padding:10px 18px;gap:14px;margin-bottom:10px;min-height:66px;border-radius:16px}
 html.fs-scheme-active:not(.fs-3d-active) .fs-view-title{gap:12px}
 html.fs-scheme-active:not(.fs-3d-active) .fs-view-title>svg{width:32px;height:32px}
 html.fs-scheme-active:not(.fs-3d-active) .fs-view-title h2{font-size:18px;margin-top:2px}
 html.fs-scheme-active:not(.fs-3d-active) .fs-view-title .fw-eyebrow{font-size:10px}
 html.fs-scheme-active:not(.fs-3d-active) #scheme-print-area:not(.fs-plan-hidden){height:max(600px,calc(100dvh - 180px))!important;min-height:600px!important;max-height:none!important;flex:none!important;width:100%!important}
 /* Native full-screen plan must still fill the browser, including on short screens. */
 html.fs-scheme-active #scheme-print-area:fullscreen{height:100dvh!important;min-height:0!important}
}

/* The side editor is document content, not a viewport-sized scrolling card. */
@media screen{
 #calculation-view .fw-sides.cp-sides-card{position:static!important;top:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;align-self:start;scrollbar-gutter:auto}
 #calculation-view .fw-sides>.cp-sides-list{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;flex:0 0 auto!important;scrollbar-gutter:auto;padding-right:0!important;margin-right:0!important}
 #calculation-view .fw-sides>*{flex-shrink:0}
 #calculation-view .fw-sides .fw-side-toggle{margin-bottom:0;padding:14px 16px}
 #calculation-view .fw-sides .fs-side-controls{margin:10px 0 18px;padding-bottom:16px;border-bottom:1px solid #dce8e1}
 #calculation-view .fw-sides .fs-side-controls>div{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:8px}
 #calculation-view .fw-sides .fs-side-controls .fw-button{min-width:0;min-height:44px;white-space:normal;font-size:14px;padding:10px 12px;line-height:1.4}
 #calculation-view .fw-sides .fs-view-link{margin-top:10px;background:#edf7f1!important}
 #calculation-view .fw-sides .fs-view-link svg{flex-shrink:0}
 #calculation-view .fw-sides>.flex.justify-between{gap:12px;padding-bottom:12px;margin-bottom:16px}
 #calculation-view .fw-sides>.flex.justify-between h2{font-size:18px;line-height:1.35}
 #calculation-view .fw-sides .cp-sides-list>div{min-width:0;padding:16px;border-radius:16px}
 #calculation-view .fw-sides .cp-sides-list>div>div:first-child{flex-wrap:wrap;gap:12px}
 #calculation-view .fw-sides .cp-sides-list h3{font-size:16px;white-space:nowrap}
 #calculation-view .fw-sides .cp-sides-list button[title^="Разделить сторону"],
 #calculation-view .fw-sides .cp-sides-list button[title^="Удалить Сторона"]{width:40px;height:40px;min-width:40px;flex-shrink:0;border-radius:10px}
 #calculation-view .fw-sides .cp-sides-list [title="Редактировать длину стороны"]{max-width:100%;min-width:120px}
 #calculation-view .fw-sides .cp-sides-list input{min-width:0;min-height:44px}
 #calculation-view .fw-sides .cp-sides-list .btn{min-width:0;min-height:44px;white-space:normal}
 #calculation-view .fw-sides .fw-summary{margin-top:20px}
}
@media screen and (max-width:640px){
 #calculation-view .fw-sides .cp-sides-list [title="Редактировать длину стороны"]{width:100%}
 #calculation-view .fw-sides .cp-sides-list button[title^="Разделить сторону"],
 #calculation-view .fw-sides .cp-sides-list button[title^="Удалить Сторона"]{width:44px;height:44px;min-width:44px}
}
@media screen and (max-width:420px){#calculation-view .fw-sides .fs-side-controls>div{grid-template-columns:minmax(0,1fr)}}

/* Keep one unambiguous way to append plot sides in the calculator.
   Native split/corner tools remain available in the Plan editor. */
#calculation-view .fw-sides button[title="Разделить сторону (добавить угол)"],
#calculation-view .fw-sides button[title="Добавить новый угол на самой длинной стороне выбранного участка"] { display:none !important; }
.fs-shape-preview { display:flex; align-items:center; gap:20px; padding:16px 20px; margin-bottom:18px; border:1px solid #c8e4db; border-radius:16px; background:#f0faf6; color:#116b57; }
.fs-shape-preview svg { width:112px; height:56px; flex:0 0 auto; overflow:visible; }
.fs-shape-preview path { fill:none; stroke:currentColor; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.fs-align-confirm { display:flex; align-items:flex-start; gap:12px; margin-top:18px; padding:16px; background:#fff7df; border:1px solid #e6cb83; border-radius:12px; color:#604615; line-height:1.5; }
.fs-align-confirm input { width:22px; height:22px; flex:0 0 auto; margin-top:2px; accent-color:#087c64; }
.fs-dialog input[readonly] { background:#edf5f2; color:#385d52; }
@media(max-width:380px) { .fs-shape-preview { gap:12px; padding:12px; } .fs-shape-preview svg { width:80px; } }

/* Keep the workshop palette; compact only on mobile, never in printed documents. */
@media screen and (max-width:1099px){
 html.fw-active #calculation-view .mobile-sticky-total,
 html.fw-active #calculation-view .fw-summary-total,
 html.fw-active #calculation-view .fw-summary [data-fw-action=estimate]{display:none!important}
}
@media screen and (max-width:767px){
 .mf-switcher{padding:10px!important;gap:0!important;margin-bottom:8px!important}
 .mf-switcher-label{display:none!important}.mf-tabs{gap:4px!important;padding:3px!important}
 .mf-tabs [role=tab]{min-height:44px!important;padding:8px 6px!important;font-size:12px!important}
 .eg-panel,.mf-panel{margin-top:12px!important}
 .fs-view-bar{padding:10px 12px!important;margin:4px 0 8px!important;width:100%!important;gap:8px!important}
 .fs-view-title{gap:9px}.fs-view-title h2{font-size:17px!important}
 .fs-view-title .fw-eyebrow{display:none}.fs-view-title>svg{width:27px!important;height:27px!important}
 .fs-view-bar .fw-mode{padding:3px}.fs-view-bar .fw-mode button{min-height:40px;padding:7px 12px}
 .fs-preview{width:100%!important;margin:0 0 14px!important;border-radius:14px!important}
 .fs-preview-top{padding:10px 12px!important;gap:6px!important}
 .fs-preview-top>div{display:flex;gap:10px;align-items:baseline;justify-content:space-between}
 .fs-preview-top>div>strong{font-size:16px}.fs-preview-top>div>span{font-size:12px;margin:0}
 .fs-stage{height:clamp(330px,53dvh,520px)!important}
 .fs-controls{padding:10px!important}.fs-preview-info{padding:12px!important}
 .fs-legend small,.fs-preview-info>small{font-size:12px!important}
 .fw-toolbar{padding:12px 14px!important;gap:9px!important}
 .fw-toolbar>.fw-eyebrow,.fw-toolbar .fw-eyebrow{display:none}
 .fw-toolbar h2{font-size:18px!important;margin:0}.fw-toolbar p{margin:3px 0 0;font-size:12px}
 .eg-hero{padding:14px!important;gap:10px!important;margin-bottom:12px!important}
 .eg-hero-icon{width:40px!important;height:40px!important;font-size:20px!important;flex-shrink:0}
 .eg-hero h2{font-size:22px!important;line-height:1.2!important;margin:0!important}
 .eg-hero p{display:none!important}
 .eg-hero span{font-size:12px!important;line-height:1.45!important;margin:5px 0 0!important}
 .eg-price-date{font-size:12px!important;padding-top:4px!important}
 .eg-hero .eg-eyebrow{display:none!important}
 .eg-presets{gap:7px!important;margin-bottom:14px!important}
 .eg-preset{padding:8px!important;gap:4px!important;min-height:76px!important}
 .eg-preset .mi-preset-art{height:42px!important;flex:0 0 42px;overflow:hidden}
 .eg-preset .mi-preset-art svg{height:42px!important;width:100%!important}
 .eg-preset span{font-size:12px!important;line-height:1.25!important}
 .eg-config-card{padding:14px!important}.eg-section-heading{margin-bottom:14px!important}
 .eg-section-heading h3{font-size:18px!important}.eg-section-heading p{font-size:12px!important}
 .mf-hero{padding:14px!important;gap:10px!important}
 .mf-hero-mark{width:40px!important;height:40px!important;font-size:20px!important}
 .mf-hero-copy>p{display:none!important}.mf-hero-copy h2{font-size:22px!important;line-height:1.2!important;margin:0!important}
 .mf-hero-copy>span{font-size:12px!important;line-height:1.45!important;margin-top:5px!important}
 .mf-price-date{font-size:12px!important}
 .mi-monolith{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
 .mi-mono-item{flex-direction:column!important;padding:8px 5px!important;gap:5px!important;text-align:center!important}
 .mi-mono-art{width:100%!important;height:46px!important;max-width:100%!important;flex:0 0 46px!important}
 .mi-mono-art svg{height:46px!important;width:100%!important}
 .mi-mono-copy strong{font-size:12px!important;line-height:1.25!important}
 .mi-mono-copy small,.mi-mono-copy>span{display:none!important}
 .mi-mono-copy em{font-size:11px!important;margin-top:4px!important}
}
