.w3d-app{--bg:#f2f3f5;--panel:#fff;--ink:#111827;--muted:#6b7280;--navy:#0f172a;--accent:#f5a300;--green:#65d56f;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;border:1px solid #e5e7eb;border-radius:18px;overflow:hidden;box-shadow:0 18px 60px rgba(15,23,42,.12);background:var(--bg);color:var(--ink);min-height:760px}.w3d-app *{box-sizing:border-box}.w3d-topbar{height:66px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 22px;gap:16px}.w3d-brand{display:flex;align-items:center;gap:10px}.w3d-brand-mark{color:var(--accent);font-size:32px;line-height:1}.w3d-brand strong{display:block;font-size:18px;letter-spacing:.04em}.w3d-brand small{display:block;color:#9ca3af;font-size:9px;letter-spacing:.22em}.w3d-top-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.w3d-chip{border:0;border-radius:999px;padding:10px 13px;background:#374151;color:#d1d5db;font-size:12px;font-weight:700;cursor:pointer;transition:.2s}.w3d-chip:hover,.w3d-chip.is-active{background:#4b5563;color:#fff}.w3d-chip.is-active{color:#ffc14d}.w3d-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;min-height:694px}.w3d-stage-wrap{position:relative;min-width:0;background:radial-gradient(circle at 50% 18%,#fff 0,#f7f8fa 52%,#eceff1 100%)}.w3d-stage{position:absolute;inset:0}.w3d-stage canvas{display:block;width:100%!important;height:100%!important}.w3d-loading{position:absolute;inset:0;display:grid;place-items:center;background:rgba(242,243,245,.85);font-weight:700;z-index:3;transition:.25s}.w3d-loading.is-hidden{opacity:0;pointer-events:none}.w3d-hint{position:absolute;left:18px;bottom:14px;background:rgba(15,23,42,.74);color:#fff;padding:8px 11px;border-radius:8px;font-size:11px;pointer-events:none}.w3d-panel{background:var(--panel);border-left:1px solid #e5e7eb;padding:18px;overflow:auto;max-height:calc(100vh - 30px)}.w3d-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid #edf0f3}.w3d-kicker{font-size:10px;letter-spacing:.16em;color:#9ca3af;font-weight:800}.w3d-panel h3{margin:3px 0 0;font-size:22px}.w3d-badge{font-size:10px;background:#111827;color:#fff;border-radius:999px;padding:5px 8px}.w3d-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:14px 0 4px}.w3d-tabs button{border:1px solid #e5e7eb;background:#f8fafc;color:#64748b;border-radius:9px;padding:9px 8px;font-size:11px;font-weight:800;cursor:pointer}.w3d-tabs button.is-active{background:#111827;border-color:#111827;color:#fff}.w3d-tabpanel{display:none}.w3d-tabpanel.is-active{display:block}.w3d-grid{display:grid;gap:16px;padding:18px 0}.w3d-grid-compact{padding-top:10px}.w3d-field>span{display:block;font-size:12px;font-weight:800;margin-bottom:8px}.w3d-field>div{display:grid;grid-template-columns:1fr 72px;gap:10px;align-items:center}.w3d-field input[type=range]{width:100%;accent-color:var(--accent)}.w3d-field output{font-variant-numeric:tabular-nums;font-size:12px;text-align:right;color:#374151;font-weight:700}.w3d-section{border-top:1px solid #edf0f3;padding:16px 0}.w3d-section-first{border-top:0;padding-top:16px}.w3d-section h4{font-size:13px;margin:0 0 12px}.w3d-color-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.w3d-color-row label{font-size:11px;color:#6b7280;display:flex;flex-direction:column;gap:6px}.w3d-color-row input[type=color]{width:100%;height:38px;border:1px solid #d1d5db;background:#fff;border-radius:8px;padding:3px;cursor:pointer}.w3d-check{display:flex;align-items:center;gap:9px;font-size:12px;padding:6px 0;color:#374151}.w3d-check input{accent-color:var(--accent)}.w3d-segmented{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.w3d-segmented button{border:1px solid #d1d5db;background:#fff;color:#374151;border-radius:9px;padding:10px 8px;font-size:12px;font-weight:800;cursor:pointer}.w3d-segmented button.is-active{border-color:#f5a300;background:#fff7e6;color:#9a6100;box-shadow:0 0 0 1px #f5a300 inset}.w3d-capacity{border-radius:10px;background:#ecfdf3;border:1px solid #bbf7d0;padding:10px 11px;margin:0 0 12px}.w3d-capacity strong{display:block;font-size:12px;color:#166534}.w3d-capacity span{display:block;font-size:10px;color:#4b5563;margin-top:2px}.w3d-capacity.is-warning{background:#fff7ed;border-color:#fed7aa}.w3d-capacity.is-warning strong{color:#9a3412}.w3d-summary-section{margin-top:4px}.w3d-summary{margin:0}.w3d-summary div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;font-size:12px}.w3d-summary dt{color:#6b7280}.w3d-summary dd{margin:0;font-weight:800;text-align:right}.w3d-price-box{background:#0f172a;color:#fff;border-radius:12px;padding:14px 15px;margin:2px 0 12px}.w3d-price-box>span{display:block;font-size:10px;color:#94a3b8;text-transform:uppercase;letter-spacing:.08em;font-weight:800}.w3d-price-box strong{display:block;font-size:26px;line-height:1.1;margin:4px 0 5px;color:#f8fafc}.w3d-price-box small{display:block;color:#94a3b8;font-size:9px;line-height:1.4}.w3d-actions-row{display:grid;grid-template-columns:1fr 1.35fr;gap:8px}.w3d-primary,.w3d-secondary{width:100%;border:0;border-radius:10px;padding:12px 12px;font-weight:900;cursor:pointer}.w3d-primary{background:var(--accent);color:#111827}.w3d-secondary{background:#e5e7eb;color:#111827}.w3d-primary:hover,.w3d-secondary:hover{filter:brightness(.97)}.w3d-note{font-size:10px;line-height:1.45;color:#9ca3af;margin:10px 0 0}@media(max-width:960px){.w3d-app{min-height:940px}.w3d-layout{grid-template-columns:1fr;grid-template-rows:560px auto}.w3d-panel{border-left:0;border-top:1px solid #e5e7eb;max-height:none}.w3d-topbar{height:auto;padding:12px 14px;align-items:flex-start}.w3d-top-actions{max-width:68%}}@media(max-width:640px){.w3d-layout{grid-template-rows:470px auto}.w3d-topbar{display:block}.w3d-top-actions{max-width:none;margin-top:10px;justify-content:flex-start}.w3d-chip{font-size:11px;padding:8px 10px}.w3d-panel{padding:14px}.w3d-color-row{grid-template-columns:1fr 1fr 1fr}.w3d-hint{font-size:10px;left:10px;bottom:10px}.w3d-actions-row{grid-template-columns:1fr}.w3d-price-box strong{font-size:23px}}

.w3d-helper{margin:-4px 0 12px;font-size:10px;line-height:1.45;color:#94a3b8}.w3d-bin-counts{display:grid;gap:8px}.w3d-bin-card{display:grid;grid-template-columns:1fr 82px;align-items:center;gap:12px;border:1px solid #e2e8f0;border-radius:10px;padding:10px 11px;background:#fff}.w3d-bin-card>span{display:flex;flex-direction:column;gap:2px}.w3d-bin-card strong{font-size:13px;color:#111827}.w3d-bin-card small{font-size:9px;color:#94a3b8}.w3d-bin-card input[type=number]{width:100%;height:38px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc;color:#111827;font-size:14px;font-weight:800;text-align:center;padding:4px 6px}.w3d-bin-card input[type=number]:focus{outline:2px solid rgba(245,163,0,.28);border-color:#f5a300;background:#fff}
.w3d-bin-tools{padding-bottom:6px}.w3d-bin-actions{grid-template-columns:1fr 1fr}.w3d-bin-actions .w3d-secondary{padding:10px 8px;font-size:11px}.w3d-manual-hint{margin:9px 0 0;font-size:9px;line-height:1.45;color:#64748b;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:8px;padding:8px 9px}

.w3d-layout-status{margin:8px 0 0;font-size:12px;line-height:1.45;color:#607086}

/* v0.7: przełącznik 3D / rzut 2D */
.w3d-view-switch{display:flex;align-items:center;background:#1f2937;border:1px solid #4b5563;border-radius:999px;padding:3px;gap:2px}.w3d-view-switch button{border:0;background:transparent;color:#cbd5e1;border-radius:999px;padding:7px 11px;font-size:11px;font-weight:900;cursor:pointer;white-space:nowrap}.w3d-view-switch button.is-active{background:#f5a300;color:#111827}.w3d-stage{transition:opacity .16s ease}.w3d-plan2d{position:absolute;inset:0;width:100%;height:100%;display:none;background:#f8fafc;touch-action:none;cursor:default}.w3d-stage-wrap.is-2d .w3d-stage{opacity:0;pointer-events:none}.w3d-stage-wrap.is-2d .w3d-plan2d{display:block}.w3d-stage-wrap.is-2d .w3d-loading{display:none}.w3d-stage-wrap.is-2d .w3d-hint{background:rgba(15,23,42,.80)}
@media(max-width:760px){.w3d-view-switch{order:-1;width:100%;justify-content:center}.w3d-view-switch button{flex:1}.w3d-top-actions{width:100%}}

/* v1.2: profil słupów i komunikat inżynierski */
.w3d-select-wrap{display:grid!important;grid-template-columns:1fr 96px!important;gap:10px!important;align-items:center}.w3d-select-wrap select{width:100%;height:38px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:0 9px;font-size:11px;font-weight:800;color:#1f2937}.w3d-engineering-note{display:block;margin-top:7px;font-size:9px;line-height:1.35;color:#9a6700;background:#fffbeb;border:1px solid #fde68a;border-radius:7px;padding:7px 8px}

.w3d-auto-profile{display:block!important;border:1px solid #dbe3ea;border-radius:10px;background:#f8fafc;padding:10px 11px}.w3d-auto-profile strong{display:block;font-size:14px;color:#111827}.w3d-auto-profile span{display:block;margin-top:3px;font-size:10px;color:#15803d;font-weight:700}.w3d-auto-profile span.is-warning{color:#b91c1c}.w3d-summary dd[data-w3d-summary="postCheck"]{max-width:180px}

/* v1.4: lokalizacja i obciążenia klimatyczne */
.w3d-location-card{border:1px solid #dbe3ea;border-radius:12px;background:#f8fafc;padding:11px 12px;display:grid;gap:9px}.w3d-location-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.w3d-location-head>span{font-size:12px;font-weight:900;color:#111827}.w3d-location-head small{font-size:8px;color:#64748b}.w3d-location-row{display:grid;grid-template-columns:1fr 150px;gap:10px;align-items:center;font-size:10px;color:#64748b}.w3d-location-row select,.w3d-zone-grid select,.w3d-number-unit input{width:100%;height:36px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:0 8px;color:#111827;font-weight:800;font-size:11px}.w3d-number-unit{display:grid!important;grid-template-columns:1fr 30px!important;gap:0!important;align-items:center}.w3d-number-unit input{border-radius:8px 0 0 8px}.w3d-number-unit b{height:36px;display:grid;place-items:center;border:1px solid #cbd5e1;border-left:0;border-radius:0 8px 8px 0;background:#eef2f7;font-size:10px;color:#64748b}.w3d-zone-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.w3d-zone-grid label{display:grid;gap:5px;font-size:9px;color:#64748b}.w3d-summary dd[data-w3d-summary="snowLoad"],.w3d-summary dd[data-w3d-summary="windLoad"]{max-width:180px}.w3d-summary sub{font-size:.72em}@media(max-width:420px){.w3d-location-row{grid-template-columns:1fr}.w3d-zone-grid{grid-template-columns:1fr}}

/* v1.6 – system panelowy */
.w3d-panel-system-note{margin-top:10px;padding:12px 13px;border:1px solid #dbe2ea;border-radius:10px;background:#f8fafc;display:flex;flex-direction:column;gap:5px;font-size:12px;line-height:1.45;color:#475569}
.w3d-panel-system-note strong{font-size:13px;color:#0f172a}
.w3d-panel-system-note small{color:#64748b}
.w3d-panel-system-note b{color:#0f172a}
.w3d-finish-type select{min-width:190px}

/* v1.7 – kalkulacja materiałowa */
.w3d-cost-breakdown{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:14px;margin-top:14px}
.w3d-cost-table{display:grid;gap:8px;margin-top:8px}
.w3d-cost-table>div,.w3d-cost-total{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:8px 0;border-bottom:1px solid #e5e7eb}
.w3d-cost-table span{font-size:12px;color:#334155;line-height:1.35}
.w3d-cost-table span small{display:block;margin-top:2px;color:#64748b;font-size:10px;font-weight:500}
.w3d-cost-table b,.w3d-cost-total b{white-space:nowrap;font-size:12px;color:#0f172a}
.w3d-cost-total{font-weight:700;margin-top:4px}
.w3d-cost-total.is-sale{border-bottom:0;padding-top:10px;font-size:13px}
.w3d-cost-total.is-sale b{font-size:15px}

/* v2.4 – paleta RAL */
.w3d-ral-head h4{font-size:16px;margin:0 0 4px}.w3d-ral-head p{margin:0 0 13px;font-size:10px;line-height:1.4;color:#64748b}.w3d-ral-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.w3d-ral-card{position:relative;border:1px solid #dbe3ea;border-radius:10px;background:#fff;padding:7px;text-align:left;cursor:pointer;min-width:0;transition:.16s}.w3d-ral-card:hover{border-color:#94a3b8;transform:translateY(-1px)}.w3d-ral-card.is-active{border-color:#0f172a;box-shadow:0 0 0 2px #0f172a}.w3d-ral-card i{display:block;height:42px;border-radius:7px;background:var(--ral);border:1px solid rgba(15,23,42,.14);margin-bottom:7px}.w3d-ral-card strong{display:block;font-size:12px;color:#0f172a}.w3d-ral-card small{display:block;margin-top:1px;font-size:9px;color:#64748b}.w3d-ral-card em{position:absolute;top:12px;left:12px;background:#fff;color:#0f172a;border-radius:999px;padding:3px 6px;font-size:7px;font-style:normal;font-weight:900;box-shadow:0 1px 4px rgba(0,0,0,.15)}.w3d-ral-card.is-popular:before{content:'★';position:absolute;right:12px;top:10px;color:#f5a300;font-size:16px;text-shadow:0 1px 2px rgba(0,0,0,.15)}.w3d-ral-selected{margin-top:11px;border:1px solid #dbe3ea;background:#f8fafc;border-radius:9px;padding:9px 10px;font-size:10px;color:#64748b}.w3d-ral-selected strong{color:#0f172a}.w3d-color-row{display:none!important}@media(min-width:430px){.w3d-ral-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* v2.5 – osobny RAL konstrukcji i wypełnienia */
.w3d-ral-subtitle{margin:14px 0 8px;font-size:13px;font-weight:800;color:#0f172a}
.w3d-ral-subtitle:first-of-type{margin-top:6px}

.w3d-field:has(.w3d-manual)>div{grid-template-columns:minmax(0,1fr) 105px}.w3d-manual{display:flex;align-items:center;gap:5px}.w3d-manual input{width:78px;min-width:0;height:36px;border:1px solid #cbd5e1;border-radius:7px;padding:5px;font-weight:700}.w3d-manual b{font-size:11px}.w3d-location-row>input{width:100%;min-width:0;height:36px;border:1px solid #cbd5e1;border-radius:8px;padding:8px}
