/* Meber · planer mebli
   Styl: czysty konfigurator (jak u producentów aut). Biel, szarości, grafit w tekście,
   jeden kolor akcentu (pomarańcz) na głównym przycisku i zaznaczeniach, cienkie linie, ostre narożniki. */

@font-face {
  font-family: "Zalando Sans";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/zalando-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Zalando Sans";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/zalando-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --page: #FFFFFF;
  --stage-1: #F7F7F7;
  --stage-2: #EFEFF0;
  --panel: #FFFFFF;
  --panel-2: #F5F5F5;
  --panel-3: #EBEBEC;
  --line: #E1E1E3;
  --line-2: #D0D1D3;
  --ink: #1A1A1A;
  --ink-2: #3D3D40;
  --muted: #66676E;
  --faint: #9A9BA1;
  --on-ink: #FFFFFF;
  /* Wypełnienia: grafit zamiast czerni, zaznaczenia jasne z obrysem (mniej ciężkich czarnych płaszczyzn). */
  --strong: #2B2B2E;
  --strong-2: #424246;
  --on-strong: #FFFFFF;
  /* Akcent: pomarańcz. Obrys i ikony --pri, tekst --pri-ink, wypełnienie przycisku --pri-fill (kontrast z bielą 4,5:1). */
  --pri: #E8590C;
  --pri-ink: #C2410C;
  --pri-fill: #CC4E0A;
  --pri-fill-2: #B5450A;
  --on-pri: #FFFFFF;
  --pri-soft: #FFF4EC;
  --pri-soft-2: #FFE6D4;
  --hover-line: #8E8F95;
  --sel-bg: var(--pri-soft);
  --accent: var(--pri);
  --warn-dot: #E3A008;
  --ok: #1E7F45;
  --ok-soft: #E9F5EE;
  --warn: #A34F00;
  --warn-soft: #FFF2E5;
  --err: #D0021B;
  --err-soft: #FDECEE;
  --info: #3F5B85;
  --info-soft: #EEF2F8;
  --sel: var(--pri);
  --glass: rgba(255, 255, 255, .94);
  --hover: #F5F5F5;
  --shadow: 0 8px 28px -8px rgba(0, 0, 0, .18);
  --float: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px -6px rgba(0, 0, 0, .16);
  --sw-ring: rgba(0, 0, 0, .12);
  --font: "Zalando Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: "Zalando Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --bar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #121212; --stage-1: #232325; --stage-2: #1B1B1D;
    --panel: #121212; --panel-2: #1F1F21; --panel-3: #2A2A2D;
    --line: #2C2C2F; --line-2: #3A3A3E;
    --ink: #F5F5F5; --ink-2: #D6D6D9; --muted: #A2A3A9; --faint: #6E6F75; --on-ink: #121212;
    --strong: #E4E4E7; --strong-2: #C9C9CE; --on-strong: #141416;
    --pri: #FF8A3D; --pri-ink: #FF9A55; --pri-fill: #F76707; --pri-fill-2: #FF7A1A; --on-pri: #121212; --pri-soft: #2A1A10; --pri-soft-2: #3A2213; --hover-line: #7A7B81; --sel-bg: var(--pri-soft); --warn-dot: #F2B33D;
    --float: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -6px rgba(0, 0, 0, .7);
    --sw-ring: rgba(255, 255, 255, .22);
    --ok: #67C98E; --ok-soft: #16291E; --warn: #F2A65A; --warn-soft: #2E2114; --err: #FF6B7A; --err-soft: #2F1519;
    --info: #9DB4DA; --info-soft: #1A2230; --glass: rgba(18, 18, 18, .92); --hover: #1F1F21;
    --shadow: 0 8px 28px -8px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #121212; --stage-1: #232325; --stage-2: #1B1B1D;
  --panel: #121212; --panel-2: #1F1F21; --panel-3: #2A2A2D;
  --line: #2C2C2F; --line-2: #3A3A3E;
  --ink: #F5F5F5; --ink-2: #D6D6D9; --muted: #A2A3A9; --faint: #6E6F75; --on-ink: #121212;
  --strong: #E4E4E7; --strong-2: #C9C9CE; --on-strong: #141416;
  --pri: #FF8A3D; --pri-ink: #FF9A55; --pri-fill: #F76707; --pri-fill-2: #FF7A1A; --on-pri: #121212; --pri-soft: #2A1A10; --pri-soft-2: #3A2213; --hover-line: #7A7B81; --sel-bg: var(--pri-soft); --warn-dot: #F2B33D;
  --float: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -6px rgba(0, 0, 0, .7);
  --sw-ring: rgba(255, 255, 255, .22);
  --ok: #67C98E; --ok-soft: #16291E; --warn: #F2A65A; --warn-soft: #2E2114; --err: #FF6B7A; --err-soft: #2F1519;
  --info: #9DB4DA; --info-soft: #1A2230; --glass: rgba(18, 18, 18, .92); --hover: #1F1F21;
  --shadow: 0 8px 28px -8px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* Cyfry tabelaryczne tylko tam, gdzie są same liczby (w tym kroju „tnum” poszerza też spację). */
td.num, td.pos, .size, .size-val input, .slider-val input, .input-unit input, .mini input, .bag-count, .stepper output, .cs-row .size-val input { font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; border-radius: 0; }
button:disabled { cursor: default; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { display: flex; flex-direction: column; height: 100dvh; }

/* ---------- Nagłówek ---------- */
.bar {
  height: var(--bar-h); flex: none; position: relative; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--page);
}
.bar-left { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.navlink {
  position: relative; display: inline-flex; align-items: center; padding: 0 12px; height: 100%;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.navlink::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--pri); transform: scaleX(0); transition: transform .25s var(--ease); }
.navlink:hover::after, .navlink[aria-expanded="true"]::after { transform: scaleX(1); }
.navlink.has-menu { gap: 6px; }
.navlink.has-menu::before { content: ""; order: 2; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .55; transition: transform .2s var(--ease); }
.navlink.has-menu[aria-expanded="true"]::before { transform: rotate(225deg); margin-top: 3px; }
.brand { justify-self: center; display: flex; align-items: center; gap: 10px; }
/* Autor: ikona przy logo, dymek po najechaniu, link do hirsch.fi. */
.author {
  position: relative; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--muted); transition: color .15s, border-color .15s, background-color .15s;
}
.author svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.author:hover, .author:focus-visible { color: var(--pri-ink); border-color: var(--pri); background: var(--pri-soft); outline: none; }
.author-tip {
  position: absolute; left: 50%; top: calc(100% + 10px); z-index: 60; transform: translate(-50%, -4px); opacity: 0; pointer-events: none;
  padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; text-align: center;
  transition: opacity .15s, transform .2s var(--ease);
}
.author-tip small { display: block; font-weight: 500; color: var(--pri-ink); }
.author:hover .author-tip, .author:focus-visible .author-tip { opacity: 1; transform: translate(-50%, 0); }
/* Kontakt: okienko z telefonem i e-mailem (wersja dla firmy). */
.menu-contact { position: relative; }
.contact-btn[aria-expanded="true"] { color: var(--pri-ink); border-color: var(--pri); background: var(--pri-soft); }
.contact-pop { left: 50%; margin-left: -160px; width: 320px; margin-top: 10px; }
.cp-head { padding: 8px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.cp-head b { display: block; font-size: 14.5px; }
.cp-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.menu-list a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--hover); outline: none; box-shadow: inset 2px 0 0 var(--pri); }
.menu-list a > svg { width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-list a b { display: block; font-weight: 600; font-size: 14.5px; }
.menu-list a small { display: block; font-size: 12.5px; color: var(--muted); }
.logo { justify-self: center; display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: -.03em; }
.logo svg { width: 26px; height: 26px; }
.logo svg rect { fill: var(--ink); }
.logo svg rect.l { fill: var(--page); }
.bar-right { justify-self: end; display: flex; align-items: center; gap: 2px; }
.ibtn { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--ink); transition: background-color .15s, opacity .15s; }
.ibtn:hover:not(:disabled) { background: var(--hover); }
.ibtn:disabled { opacity: .25; }
.ibtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bag { position: relative; height: 44px; padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; transition: background-color .15s; }
.bag:hover { background: var(--hover); }
.bag svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.bag span { margin-left: 0; order: 2; }
.bag-count {
  position: relative; order: 3; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; background: var(--pri-fill); color: var(--on-pri); font-size: 11px; font-weight: 600;
  transition: transform .3s var(--ease);
}
.bag-count.bump { transform: scale(1.25); }
.bag[aria-expanded="true"] { background: var(--pri-soft); color: var(--pri-ink); }

.menu { position: relative; display: flex; }
.menu-list {
  position: absolute; left: 0; top: 100%; z-index: 50; width: 340px; padding: 8px 0;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  animation: drop .2s var(--ease);
  /* Długie menu (np. szablony na niskim ekranie) przewija się w sobie, nic nie ucieka pod krawędź okna. */
  max-height: calc(100dvh - var(--bar-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.menu-list button { display: flex; gap: 14px; align-items: center; width: 100%; padding: 10px 16px; text-align: left; }
.menu-list button:hover { background: var(--hover); }
.menu-list .mi-ico { width: 48px; height: 48px; background: var(--panel-2); display: grid; place-items: center; color: var(--ink); flex: none; }
.menu-list .mi-ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.menu-list b { display: block; font-weight: 600; }
.menu-list small { color: var(--muted); font-size: 13px; }
.menu-compact { width: 320px; padding: 6px 0; }
.menu-compact button { gap: 12px; padding: 10px 16px; align-items: flex-start; }
.menu-compact button > svg { width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.menu-compact b { font-size: 14.5px; }
.menu-compact small { font-size: 12.5px; line-height: 1.35; display: block; margin-top: 1px; }
.menu-list button:focus-visible { outline: none; background: var(--hover); box-shadow: inset 2px 0 0 var(--pri); }
.menu-list button[disabled] { opacity: .5; cursor: progress; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Układ: galeria + kolumna ---------- */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; transition: grid-template-columns .45s var(--ease); }
/* Podgląd 3D od krawędzi do krawędzi; panel można schować, żeby scena zajęła całą szerokość. */
.main.panel-hidden { grid-template-columns: minmax(0, 1fr) 0px; }
.main.panel-hidden .config { visibility: hidden; }
.config { overflow: hidden; border-left: 1px solid var(--line); }
.canvas-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0; }

/* ---------- Galeria 3D ---------- */
.stage {
  position: relative; flex: 1; min-height: 240px; overflow: hidden; isolation: isolate;
  background: radial-gradient(75% 65% at 52% 40%, var(--stage-1) 0%, var(--stage-2) 100%);
}
.viewer { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; outline: none; }
.viewer.is-dragging, .viewer.is-dragging canvas { cursor: grabbing !important; }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer:focus-visible { box-shadow: inset 0 0 0 2px var(--pri); }

.stage-top { position: absolute; left: 16px; top: 16px; z-index: 6; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.status, .chip-soft {
  height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); font-size: 12.5px; font-weight: 600; white-space: nowrap; letter-spacing: .01em;
}
.status { border: 1px solid transparent; box-shadow: var(--float); transition: background-color .2s, color .2s, border-color .2s; }
.status:hover { border-color: var(--hover-line); }
.status[aria-expanded="true"] { background: var(--pri-soft); border-color: var(--pri); }
.status svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .3s var(--ease); }
.status[aria-expanded="true"] svg { transform: rotate(180deg); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok i { background: var(--ok); }
.status.warn i { background: var(--warn-dot); }
.status.err i { background: var(--err); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.chip-soft { color: var(--muted); font-weight: 500; background: transparent; padding: 0; height: auto; }

/* Miniatury widoków (jak galeria zdjęć produktu) */
/* Narzędzia podglądu: jedna pływająca karta (jak przełączniki widoku w konfiguratorach aut). */
.thumbs {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 2px;
  padding: 4px; background: var(--panel); box-shadow: var(--float);
}
/* Grupy: dodawanie · widoki · podgląd wnętrza · ustawianie (cienka kreska między grupami). */
.thumbs > [data-view="three"], .thumbs > #btnInterior, .thumbs > #btnArrange { margin-top: 5px; position: relative; }
.thumbs > [data-view="three"]::before, .thumbs > #btnInterior::before, .thumbs > #btnArrange::before { content: ""; position: absolute; left: 10px; right: 10px; top: -4px; height: 1px; background: var(--line); }
.thumbs > :first-child { margin-top: 0 !important; margin-left: 0 !important; }
.thumbs > :first-child::before { display: none; }
.thumb {
  width: 60px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: 1px solid transparent; font-size: 11px; font-weight: 500; color: var(--ink-2);
  transition: background-color .15s, border-color .15s, color .15s;
}
.thumb:hover { background: var(--hover); color: var(--ink); }
.thumb span { display: block; text-align: center; line-height: 1.15; padding: 0 3px; }
.thumb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.thumb[aria-pressed="true"] { background: var(--pri-soft); border-color: transparent; color: var(--pri-ink); font-weight: 600; }

.stage-hint { position: absolute; left: 50%; bottom: 116px; transform: translateX(-50%); z-index: 3; font-size: 12.5px; color: var(--muted); pointer-events: none; white-space: nowrap; transition: opacity .8s; }
.stage-hint.gone { opacity: 0; }
.stage-status { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 8; padding: 8px 14px; font-size: 13px; font-weight: 600; background: var(--err-soft); color: var(--err); border: 1px solid currentColor; }

.label-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.mlabel {
  position: absolute; left: 0; top: 0; pointer-events: none; padding: 2px 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--ink-2); border: 1px solid transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  transition: opacity .25s, background-color .25s, color .25s;
}
.mlabel.has-error { color: var(--err); border-color: currentColor; }
.mlabel.is-selected { background: var(--pri-fill); color: var(--on-pri); border-color: var(--pri-fill); }
.mlabel.dim { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }

.tooltip {
  position: absolute; z-index: 9; pointer-events: none; max-width: 280px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.4;
}
.tooltip b { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.tooltip .tt-pos { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; background: var(--pri-soft); color: var(--pri-ink); font-size: 11px; }
.tooltip .tt-dim { color: var(--muted); display: block; }
.tooltip .tt-bad { color: var(--err); display: block; font-weight: 600; margin-top: 3px; }

/* Plusy „dodaj obok”, menu typów i pasek zaznaczonego mebla */
.slot-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.slot-plus {
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--panel); color: var(--pri-ink); border: 1.5px solid var(--pri); border-radius: 50%; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, background-color .15s, color .15s; will-change: transform;
}
.slot-plus.show { opacity: 1; pointer-events: auto; }
.slot-plus:hover, .slot-plus:focus-visible { background: var(--pri-fill); color: var(--on-pri); border-color: var(--pri-fill); }
.slot-plus svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.slot-menu {
  position: absolute; z-index: 12; width: 300px; padding: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior: contain;
}
.slot-menu[hidden] { display: none; }
.sm-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.sm-head small { font-weight: 400; color: var(--muted); font-size: 12px; }
.sm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sm-grid:has(> :nth-child(5)) { grid-template-columns: repeat(4, 1fr); }
.slot-menu:has(.sm-grid > :nth-child(5)) { width: 380px; }
.sm-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--line-2); background: var(--panel); text-align: center; font-size: 12.5px; font-weight: 600; transition: border-color .15s; }
.sm-item:hover, .sm-item:focus-visible { border-color: var(--pri); background: var(--pri-soft); box-shadow: inset 0 0 0 1px var(--pri); outline: none; }
.sm-item svg { width: 30px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.sm-item small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.mod-tools {
  position: absolute; left: 0; top: 0; z-index: 7; display: flex; align-items: center; gap: 0; padding: 3px 4px 3px 10px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--float); will-change: transform;
}
.mod-tools[hidden] { display: none; }
.mod-tools b { font-size: 12.5px; font-weight: 600; margin-right: 4px; }
.mod-tools .ico-btn { width: 34px; height: 34px; }
.mod-tools .ico-btn svg { width: 18px; height: 18px; }
.tb-edit { height: 30px; margin-left: 4px; padding: 0 12px; border: 1px solid var(--pri); color: var(--pri-ink); font-weight: 600; font-size: 12.5px; }
.tb-edit:hover { background: var(--pri-soft); }
.panel-toggle {
  position: absolute; right: 16px; top: 16px; z-index: 7; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid transparent; box-shadow: var(--float); color: var(--ink); transition: border-color .2s;
}
.panel-toggle:hover { border-color: var(--hover-line); }
.panel-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.panel-toggle[aria-pressed="true"] .pt-arrow { transform: rotate(180deg); transform-origin: 10.25px 12px; }
.panel-toggle[aria-pressed="true"] { background: var(--pri-soft); color: var(--pri-ink); border-color: var(--pri); }
.canvas-col.sheet-open .panel-toggle { display: none; }

/* Tryb ustawiania mebli (przeciąganie po podłodze, obrót co 90°) */
.thumb-add { color: var(--ink); font-weight: 600; }
.thumb-add svg { stroke-width: 2.2; color: var(--pri); }
.thumb-arrange[aria-pressed="true"] { background: var(--pri-soft); }
.arrange-bar {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 7; width: min(640px, calc(100% - 300px));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: var(--glass); border: 1px solid var(--pri); box-shadow: var(--float);
  font-size: 12.5px; line-height: 1.4; color: var(--ink-2);
}
.arrange-bar[hidden] { display: none; }
.arrange-bar b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.arrange-bar kbd { display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 4px; border: 1px solid var(--line-2); font: 600 11px/1 inherit; background: var(--panel); }
.ab-text { flex: 1; min-width: 0; }
.ab-btns { display: flex; align-items: center; gap: 2px; flex: none; }
.ab-touch { display: none; }
@media (hover: none), (max-width: 600px) {
  .ab-desk { display: none; }
  .ab-touch { display: inline; }
}
.btn-mini { height: 34px; padding: 0 14px; margin-left: 6px; background: var(--pri-fill); color: var(--on-pri); font-weight: 600; font-size: 13px; }
.btn-mini:hover { background: var(--pri-fill-2); }
.stage.arranging .viewer { cursor: default; }
.label-layer.is-moving { opacity: 0; transition: opacity .15s; }
.rot-ctl { display: inline-flex; align-items: center; gap: 4px; }
.rot-ctl b { min-width: 92px; text-align: center; font-weight: 600; font-size: 13.5px; }
.free-pos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.pv-front { stroke: var(--ink); stroke-width: 22; stroke-linecap: butt; pointer-events: none; opacity: .55; }
.pv-mod.free rect { stroke-dasharray: none; stroke-width: 16; }
.wtab.free { border-style: dashed; }

/* Pasek modułów */
.strip {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6;
  width: min(780px, calc(100% - 120px)); padding: 10px 12px; margin-left: 30px;
  background: var(--glass); border: 0; box-shadow: var(--float);
  display: grid; grid-template-columns: 54px 1fr; row-gap: 6px; column-gap: 8px; align-items: center;
}
.strip:empty, .canvas-col.sheet-open .strip, .canvas-col.sheet-open .stage-hint { display: none; }
.lane-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lane { position: relative; height: 36px; background: var(--panel-2); }
.blk {
  position: absolute; top: 0; bottom: 0; padding: 0 8px; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap;
  transition: background-color .2s, color .2s, box-shadow .2s, left .5s var(--ease), width .5s var(--ease);
}
.blk:hover { box-shadow: inset 0 0 0 1px var(--hover-line); }
.blk small { font-weight: 500; color: var(--muted); }
.blk.is-on { background: var(--pri-soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--pri); }
.blk.is-on small { color: var(--pri-ink); }
.blk .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.blk .dot.warn { background: var(--warn-dot); }
.blk .dot.err { background: var(--err); }
.blk.free {
  background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); font-weight: 600;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink) 6%, transparent) 6px 7px);
}
.blk.free:hover { color: var(--pri-ink); box-shadow: inset 0 0 0 1.5px var(--pri); }
.blk.over { box-shadow: inset 0 0 0 2px var(--err); }

.checks-pop {
  position: absolute; left: 16px; top: 54px; z-index: 8; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 180px); overflow: auto;
  padding: 8px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: drop .2s var(--ease);
}
.checks-pop .alert:last-child { margin-bottom: 0; }

.empty-state {
  position: absolute; inset: 0; margin: auto; height: fit-content; z-index: 6;
  width: min(580px, calc(100% - 40px)); padding: 32px 28px 26px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .5s var(--ease) both;
}
.empty-state h3 { font: 600 22px/1.2 var(--display); margin: 0 0 8px; letter-spacing: -.015em; }
.empty-state p { margin: 0 auto 22px; color: var(--muted); max-width: 42ch; }
.empty-state .add-grid { text-align: left; }

/* ---------- Lista do zamówienia (arkusz) ---------- */
.sheet {
  flex: none; height: 0; margin-top: 0; overflow: hidden; background: var(--panel); border: 0 solid var(--line);
  display: flex; flex-direction: column; transition: height .55s var(--ease), margin-top .55s var(--ease);
}
.sheet.is-open { height: min(56%, 620px); margin-top: 0; border-width: 1px 0 0; }
.sheet-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.sheet-actions { display: flex; gap: 6px; align-items: center; padding: 10px 0; }
.sheet-body { flex: 1; overflow: auto; padding: 14px 18px 24px; overscroll-behavior: contain; }
.tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; height: 52px; padding: 0 14px; font-weight: 500; font-size: 14.5px; color: var(--muted); white-space: nowrap; transition: color .2s; }
.tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--pri); transform: scaleX(0); transition: transform .3s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 600; }
.tab.is-on::after { transform: scaleX(1); }

/* Przyciski */
.pill {
  height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 14.5px; background: var(--panel); color: var(--ink); white-space: nowrap; border: 1px solid var(--hover-line);
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.pill:hover { background: var(--hover); border-color: var(--ink); }
.pill:active { transform: scale(.985); }
.pill.dark { background: var(--pri-fill); color: var(--on-pri); border-color: var(--pri-fill); }
.pill.dark:hover { background: var(--pri-fill-2); border-color: var(--pri-fill-2); }
.pill svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pill.block { width: 100%; height: 56px; font-size: 16px; }

/* ---------- Kolumna wyboru ---------- */
.config { min-height: 0; display: flex; flex-direction: column; background: var(--panel); }
.pdp { flex: none; padding: 18px 24px 0; }
.pdp-brand { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.pdp-brand small { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.pdp-brand small.flash { color: var(--ok); }
.proj-name {
  display: block; width: 100%; border: 0; background: transparent; padding: 2px 0 0; margin: 0;
  font-size: 20px; font-weight: 400; letter-spacing: -.01em; text-overflow: ellipsis;
}
.proj-name:focus { outline: none; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.steps { flex: none; display: flex; margin: 14px 0 0; padding: 0 15px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
@media (min-width: 921px) {
  /* Panel ma 370-400 px: cztery kroki w równych kolumnach, numer nad nazwą (wszystko widać bez przewijania). */
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 12px; }
  .steps .step { height: 58px; flex-direction: column; justify-content: center; gap: 4px; padding: 0 2px; font-size: 13px; }
  .steps .step b { width: 20px; height: 20px; }
  .steps .step::after { left: 8px; right: 8px; }
}
.step { position: relative; height: 50px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .2s; }
.step b { font-weight: 500; font-size: 12px; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; }
.step::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 3px; background: var(--pri); transform: scaleX(0); transition: transform .3s var(--ease), background-color .3s; }
.step:hover { color: var(--ink); }
.step.is-on { color: var(--ink); font-weight: 600; }
.step.is-on b { background: var(--pri-fill); color: var(--on-pri); border-color: var(--pri-fill); font-weight: 600; }
.step.is-done { color: var(--ink-2); }
.step.is-done b { border-color: var(--pri); color: var(--pri-ink); }
.step.is-on::after { transform: scaleX(1); }
.step.is-done::after { transform: scaleX(1); background: var(--pri-soft-2); }

.config-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 30px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.config-body.enter > * { animation: rise .45s var(--ease) both; }
.config-body.enter > *:nth-child(2) { animation-delay: .03s; }
.config-body.enter > *:nth-child(3) { animation-delay: .06s; }
.config-body.enter > *:nth-child(4) { animation-delay: .09s; }
.config-body.enter > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lead h2 { font: 600 22px/1.2 var(--display); letter-spacing: -.015em; margin: 0 0 6px; }
.lead p { margin: 0 0 26px; color: var(--muted); font-size: 14px; max-width: 46ch; }

.group { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.lead + .group, .mod-tabs + .group, .mod-head + div + .group { border-top: 0; padding-top: 0; }
.group-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.group-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.group-h .aside { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }

/* Pola liczbowe */
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.fields.c2 { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); }
.input-unit { position: relative; }
.input-unit input, .text-in, select.text-in {
  width: 100%; height: 48px; padding: 0 40px 0 14px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 0;
  font-size: 15px; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
.text-in { padding-right: 14px; }
.input-unit input:hover, .text-in:hover { border-color: var(--hover-line); }
.input-unit input:focus, .text-in:focus { outline: none; border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }
.input-unit i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Rozmiary (jak tabela rozmiarów) */
.size-field { margin-bottom: 18px; }
.size-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.size-head > span { font-size: 13.5px; font-weight: 600; }
.size-val { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); transition: border-color .15s; cursor: text; }
.size-val:hover { border-color: var(--hover-line); }
.size-val:focus-within { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }
.size-val input { width: 5ch; border: 0; background: transparent; padding: 0; text-align: right; font-size: 15px; font-weight: 600; }
.size-val input:focus { outline: none; }
.size-val i { font-style: normal; font-size: 12px; color: var(--muted); }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.size {
  height: 44px; border: 1px solid var(--line-2); background: var(--panel); font-size: 14px; font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.size:hover { border-color: var(--hover-line); }
.size.is-on { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); background: var(--pri-soft); font-weight: 600; }

/* Suwak */
.slider { --p: 50%; padding: 2px 0 12px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.slider-head > span { font-size: 13.5px; color: var(--ink-2); }
.slider-val { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); cursor: text; transition: border-color .15s; }
.slider-val:hover { border-color: var(--hover-line); }
.slider-val:focus-within { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }
.slider-val input { width: 5ch; border: 0; background: transparent; padding: 0; text-align: right; font-size: 15px; font-weight: 600; }
.slider-val input:focus { outline: none; }
.slider-val i { font-style: normal; font-size: 12px; color: var(--muted); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; cursor: pointer; display: block; }
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--pri) 0 var(--p), var(--line-2) var(--p) 100%); }
.range::-moz-range-track { height: 2px; background: var(--line-2); }
.range::-moz-range-progress { height: 2px; background: var(--pri); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--pri); transition: transform .2s var(--ease); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--panel); border: 2px solid var(--pri); }
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--pri) 25%, transparent); }

/* Kafelki */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px;
  background: var(--panel); border: 1px solid var(--line-2); text-align: center; font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.25;
  transition: border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--hover-line); }
.tile svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); }
.tile small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tile.is-on { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); background: var(--pri-soft); font-weight: 600; }
.tile.is-on svg { color: var(--pri-ink); }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-grid .tile { flex-direction: row; text-align: left; padding: 12px; gap: 12px; align-items: center; }
.add-grid .tile svg { width: 36px; height: 36px; color: var(--ink); }
.add-grid .tile span { display: flex; flex-direction: column; font-weight: 600; }

/* Żetony */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 38px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13.5px; font-weight: 500; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.chip:hover { border-color: var(--hover-line); }
.chip.is-on { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); background: var(--pri-soft); font-weight: 600; }
.chip.ghost { border-style: dashed; }

/* Kolory (jak warianty produktu) */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px 8px; }
.sw { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font-size: 12px; color: var(--muted); text-align: left; line-height: 1.25; }
.sw i { display: block; aspect-ratio: 1 / 1.15; position: relative; border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.sw i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, .22), transparent 45%, rgba(0, 0, 0, .08)); }
.sw:hover i { border-color: var(--hover-line); }
.sw.is-on { color: var(--ink); font-weight: 600; }
.sw span small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); margin-top: 1px; letter-spacing: .01em; }
.sw.is-on i { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri), inset 0 0 0 3px var(--panel); }
.swatches.round { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 16px 6px; }
.swatches.round .sw { align-items: center; text-align: center; gap: 8px; font-size: 11.5px; line-height: 1.2; }
.swatches.round .sw i {
  width: 48px; height: 48px; aspect-ratio: auto; border: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--sw-ring); transition: box-shadow .15s;
}
.swatches.round .sw i::after { border-radius: 50%; }
.swatches.round .sw > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 72px; }
.swatches.round .sw span small { display: none; }
.swatches.round .sw:hover i { box-shadow: inset 0 0 0 1px var(--sw-ring), 0 0 0 2px var(--panel), 0 0 0 3px var(--hover-line); }
.swatches.round .sw.is-on i { box-shadow: inset 0 0 0 1px var(--sw-ring), 0 0 0 2px var(--panel), 0 0 0 4px var(--pri); }
.swatches.round .sw.is-on i::before {
  content: ""; position: absolute; right: -5px; top: -5px; z-index: 1; width: 19px; height: 19px; border-radius: 50%;
  background: var(--pri-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 0 0 2px var(--panel);
}

/* Wykończenia jak w konfiguratorze: kategorie, karta z wybraną opcją, wybór pod spodem */
.opt-nav {
  position: sticky; top: -24px; z-index: 3; display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none;
  margin: -6px -24px 8px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.opt-nav::-webkit-scrollbar { display: none; }
/* Kategorie przewijane w bok: delikatne wygaszenie przy prawej krawędzi podpowiada, że jest ich więcej. */
.opt-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.opt-nav::after { content: ""; flex: none; width: 24px; }
.opt-nav button { position: relative; flex: none; height: 44px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .15s; }
.opt-nav button:hover { color: var(--ink); }
.opt-nav button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--pri); transform: scaleX(0); transition: transform .25s var(--ease); }
.opt-nav button.is-on { color: var(--ink); font-weight: 600; }
.opt-nav button.is-on::after { transform: scaleX(1); }
.opt { padding: 18px 0 8px; scroll-margin-top: 52px; }
.opt-h { margin: 0 0 12px; font: 400 21px/1.2 var(--display); letter-spacing: -.01em; }
.opt-card { border: 1px solid var(--line-2); }
.opt-sel { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel-2); }
.opt-sel > span { flex: 1; min-width: 0; }
.opt-sel b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.opt-sel small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.os-sw { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sw-ring); }
.os-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); }
.os-ico svg { width: 30px; height: 30px; fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.os-ok { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--pri-fill); color: var(--on-pri); }
.os-ok svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.opt-body { padding: 18px 16px 16px; }
.opt-body > .mini-h:first-child { margin-top: 0; }
.opt + details.more { margin-top: 18px; }
@media (max-width: 920px) {
  .opt-nav { position: static; margin: -6px -16px 8px; padding: 0 16px; }
  .opt { scroll-margin-top: calc(var(--bar-h) + 60px); }
}
.grain { background-image: repeating-linear-gradient(98deg, rgba(90, 55, 20, 0) 0 3px, rgba(90, 55, 20, .16) 3px 4px, rgba(90, 55, 20, 0) 4px 7px, rgba(90, 55, 20, .08) 7px 8px) !important; }

/* Przełącznik */
.toggles { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; cursor: pointer; }
.toggle + .toggle { border-top: 1px solid var(--line); }
.toggle > span { display: flex; flex-direction: column; font-size: 14px; font-weight: 500; }
.toggle small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); position: relative; flex: none; margin: 0; cursor: pointer; transition: background-color .3s var(--ease); }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .35s var(--ease); }
.toggle input:checked { background: var(--pri-fill); }
.toggle input:checked::after { transform: translateX(18px); }

/* Licznik */
.stepper { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line-2); }
.stepper button { width: 38px; height: 36px; display: grid; place-items: center; color: var(--ink); transition: background-color .15s; }
.stepper button:hover:not(:disabled) { background: var(--hover); }
.stepper button:disabled { opacity: .25; }
.stepper button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.stepper output { min-width: 30px; text-align: center; font-weight: 600; font-size: 14.5px; }
.param { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; flex-wrap: wrap; padding: 6px 0; }
.param > span { font-size: 13.5px; color: var(--ink-2); }
.param + .param { border-top: 1px solid var(--line); }

/* Karty sekcji */
.card { border: 1px solid var(--line-2); padding: 14px 16px 8px; margin-bottom: 10px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h b { font-size: 14px; font-weight: 600; }
.card-h small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mini { display: flex; flex-direction: column; gap: 4px; }
.mini span { font-size: 12px; color: var(--muted); }
.mini input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 500; border-radius: 0; }
.mini input:focus { outline: none; border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }

.ico-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; color: var(--ink); transition: background-color .15s; }
.ico-btn:hover:not(:disabled) { background: var(--hover); }
.ico-btn:disabled { opacity: .25; }
.ico-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Wybór mebla (jak warianty kolorystyczne) */
.mod-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 6px; margin: 0 -1px 20px; scrollbar-width: thin; }
.mod-tab {
  position: relative; flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px;
  border: 1px solid var(--line); background: var(--panel); font-size: 11.5px; color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.mod-tab svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; }
.mod-tab b { font-size: 12px; font-weight: 600; color: var(--ink); }
.mod-tab:hover { border-color: var(--hover-line); }
.mod-tab.is-on { border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); background: var(--pri-soft); }
.mod-tab.is-on b { color: var(--pri-ink); }
.mod-tab .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; }
.mod-tab .dot.warn { background: var(--warn-dot); }
.mod-tab .dot.err { background: var(--err); }
.mod-tab.add { justify-content: center; border-style: dashed; border-color: var(--line-2); color: var(--ink); font-weight: 600; font-size: 12px; }
.mod-tab.add svg { width: 22px; height: 22px; }
/* Komputer: wszystkie meble widać od razu jako siatkę ikon (telefon zostaje z przewijaniem w bok). */
@media (min-width: 921px) {
  .mod-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; overflow: visible; padding: 1px; margin: 0 -1px 20px; }
  .mod-tab { width: auto; min-width: 0; padding: 7px 2px 6px; }
  .mod-tab svg { width: 30px; height: 30px; }
}
.mod-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.mod-name { flex: 1; min-width: 0; }
.mod-name small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.mod-name input { width: 100%; border: 0; background: transparent; padding: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.015em; text-overflow: ellipsis; }
.mod-name input:focus { outline: none; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.mod-actions { display: flex; gap: 0; margin-top: 14px; }

/* Komunikaty */
.alert { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px; text-align: left; width: 100%; border-left: 3px solid transparent; transition: background-color .15s; }
.alert svg { width: 20px; height: 20px; margin-top: 0; }
.alert b { display: block; font-weight: 600; margin-bottom: 1px; }
.alert p { margin: 0; color: var(--ink-2); line-height: 1.42; }
.alert .cmod { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.alert.error { background: var(--err-soft); border-left-color: var(--err); }
.alert.error svg { color: var(--err); }
.alert.warning { background: var(--warn-soft); border-left-color: var(--warn-dot); }
.alert.warning svg { color: var(--warn); }
.alert.info { background: var(--info-soft); border-left-color: var(--info); }
.alert.info svg { color: var(--info); }
.alert.is-on { box-shadow: inset 0 0 0 1.5px var(--pri); }
.all-good { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ok-soft); color: var(--ok); font-weight: 600; margin-bottom: 8px; border-left: 3px solid var(--ok); }
.all-good svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Układy sekcji w siatce: wszystkie widoczne od razu (bez przewijania w bok). */
.sec-scroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; padding: 1px; margin: 0 -1px 8px; }
.sec-scroll .tile { padding: 10px 4px 8px; font-size: 12px; gap: 6px; }
.sec-scroll .tile svg { width: 34px; height: 42px; }

details.more { margin-top: 0; border-top: 1px solid var(--line); }
details.more > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; font-size: 15px; font-weight: 600; padding: 18px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .35s var(--ease); }
details.more[open] > summary svg { transform: rotate(180deg); }
details.more[open] > :not(summary) { animation: rise .35s var(--ease) both; }
details.more.small > summary { font-size: 13.5px; font-weight: 600; padding: 12px 0; color: var(--muted); }

/* Podsumowanie konfiguracji (krok Zamówienie) */
.sum { border-top: 1px solid var(--line); }
.sum-row { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); text-align: left; transition: background-color .15s; }
.sum-row:hover { background: var(--hover); }
.sum-row > span { min-width: 0; }
.sum-row small { display: block; font-size: 12px; color: var(--muted); }
.sum-row b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-row > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease), stroke .2s; }
.sum-row:hover > svg { stroke: var(--pri); transform: translateX(2px); }
.sum-sw { width: 32px; height: 32px; margin: 0 2px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sw-ring); }
.sum-ico { width: 36px; height: 36px; display: grid; place-items: center; background: var(--panel-2); }
.sum-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* Zamówienie */
.cart { border-top: 1px solid var(--line); margin-bottom: 18px; }
.cart-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-row .ci { width: 52px; height: 60px; background: var(--panel-2); display: grid; place-items: center; flex: none; }
.cart-row .ci svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cart-row .ci i { width: 100%; height: 100%; display: block; }
.cart-row .ct { flex: 1; min-width: 0; }
.cart-row .ct b { display: block; font-weight: 600; font-size: 14px; }
.cart-row .ct small { color: var(--muted); font-size: 13px; }
.cart-row .cv { text-align: right; font-weight: 600; font-size: 15px; white-space: nowrap; }
.cart-row .cv small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.btn-stack { display: grid; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.infobox { border: 1px solid var(--line-2); margin-top: 16px; }
.infobox div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; font-size: 13.5px; }
.infobox div + div { border-top: 1px solid var(--line); }
.infobox svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.infobox b { display: block; font-weight: 600; }
.infobox small { color: var(--muted); font-size: 12.5px; }

.config-foot { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 24px 18px; border-top: 1px solid var(--line); background: var(--panel); }
/* Cena zawsze nad głównym przyciskiem (jak suma w konfiguratorze). */
.foot-price { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.fp-l { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fp-l small { font-size: 13px; font-weight: 600; color: var(--ink); }
.fp-l span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-price > b { flex: none; font-size: 22px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.foot-next {
  flex: none; height: 54px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--pri-fill); color: var(--on-pri); font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: background-color .15s, transform .15s;
}
.foot-next:hover { background: var(--pri-fill-2); }
.foot-next:active { transform: scale(.99); }
.foot-next svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.foot-next:hover svg { transform: translateX(3px); }
.foot-save { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line-2); transition: background-color .15s, border-color .15s; }
.foot-save:hover { border-color: var(--hover-line); }
.foot-save:hover { background: var(--hover); }
.foot-save svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; white-space: nowrap; }
th { position: sticky; top: -14px; z-index: 1; background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-2); }
td { border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; }
tr.group td { border-bottom: 1px solid var(--line-2); padding-top: 22px; font-weight: 600; font-size: 14px; }
tr.group td small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.gsw { display: inline-block; width: 14px; height: 14px; margin-right: 9px; vertical-align: -2px; border: 1px solid var(--line-2); }
tr.row-hover { cursor: pointer; }
tr.row-hover td { transition: background-color .12s; }
tr.row-hover:hover td, tr.row-hover.is-on td { background: color-mix(in srgb, var(--sel) 14%, var(--panel)); }
td.pos { width: 1%; }
td.pos span { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 7px; background: var(--panel-2); font-weight: 600; font-size: 12px; }
td.wrap { white-space: normal; min-width: 150px; }
td .dim { font-weight: 600; font-size: 14px; }
.grain-mark { color: var(--muted); font-size: 12px; }
.edge-svg { width: 46px; height: 28px; display: block; }
.edge-svg .plate { fill: var(--panel-3); }
.edge-svg .e2 { stroke: var(--ink); stroke-width: 3.2; }
.edge-svg .e1 { stroke: var(--ink); stroke-width: 2.2; opacity: .7; }
.edge-svg .e08 { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 2.4; }
.edge-txt { font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend svg { width: 26px; height: 10px; vertical-align: middle; margin-right: 5px; }
.muted { color: var(--muted); }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

.sheets-mat { margin-bottom: 28px; }
.sheets-mat h4 { margin: 4px 0 2px; font-size: 15px; font-weight: 600; display: flex; align-items: center; }
.sheets-mat .meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sheet-fig { margin: 0; border: 1px solid var(--line); padding: 12px; }
.sheet-fig figcaption { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.sheet-fig svg { width: 100%; height: auto; display: block; }
.sheet-fig .board { fill: var(--panel-2); }
.sheet-fig .trim { fill: none; stroke: var(--line-2); stroke-dasharray: 18 14; stroke-width: 4; }
.sheet-fig .pc { fill: var(--panel); stroke: var(--ink); stroke-width: 3; transition: fill .15s; }
.sheet-fig g { cursor: pointer; }
.sheet-fig g:hover .pc { fill: color-mix(in srgb, var(--sel) 45%, var(--panel)); }
.sheet-fig text { font: 600 64px var(--font); fill: var(--ink); pointer-events: none; }
.sheet-fig text.small { font-size: 44px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 14px 20px; background: var(--strong); color: var(--on-strong); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); transition: opacity .25s var(--ease), transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mniejsze ekrany ---------- */
/* Gdy otwarta jest lista albo scena jest niska: miniatury w rzędzie w prawym górnym rogu. */
.canvas-col.sheet-open .thumbs { top: 16px; right: 16px; left: auto; transform: none; flex-direction: row; }
/* Narzędzia w rzędzie: kreski między grupami pionowe. */
.canvas-col.sheet-open .thumbs > [data-view="three"], .canvas-col.sheet-open .thumbs > #btnInterior, .canvas-col.sheet-open .thumbs > #btnArrange { margin-top: 0; margin-left: 5px; }
.canvas-col.sheet-open .thumbs > [data-view="three"]::before, .canvas-col.sheet-open .thumbs > #btnInterior::before, .canvas-col.sheet-open .thumbs > #btnArrange::before { left: -4px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
.canvas-col.sheet-open .thumb { width: 44px; height: 44px; font-size: 0; gap: 0; }
.canvas-col.sheet-open .thumb svg { width: 20px; height: 20px; }
.canvas-col.sheet-open .chip-soft { display: none; }

@media (max-width: 1240px) {
  .main { grid-template-columns: minmax(0, 1fr) 370px; }
  .navlink { padding: 0 9px; font-size: 14px; }
  .bag span { display: none; }
}
@media (max-width: 920px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .bar { position: sticky; top: 0; grid-template-columns: auto 1fr auto; padding: 0 6px 0 10px; }
  .bar-left .navlink:not(.menu .navlink), .menu-client { display: none; }
  .navlink.has-menu::before { display: none; }
  .brand { justify-self: start; gap: 8px; }
  .author-tip { left: 0; transform: translate(-30%, -4px); }
  .author:hover .author-tip, .author:focus-visible .author-tip { transform: translate(-30%, 0); }
  .logo { justify-self: start; font-size: 19px; }
  .main { display: flex; flex-direction: column; }
  .canvas-col { padding: 0; }
  .stage { flex: none; height: 64dvh; min-height: 380px; }
  .config { border-left: 0; border-top: 1px solid var(--line); }
  .main.panel-hidden .config { visibility: visible; }
  .panel-toggle { display: none; }
  .stage-hint { display: none; }
  .thumbs { top: 12px; right: 12px; left: auto; transform: none; flex-direction: row; gap: 6px; }
  .thumbs > [data-view="three"], .thumbs > #btnInterior, .thumbs > #btnArrange { margin-top: 0; margin-left: 5px; }
  .thumbs > [data-view="three"]::before, .thumbs > #btnInterior::before, .thumbs > #btnArrange::before { left: -4px; right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
  .thumb { width: 40px; height: 40px; font-size: 0; gap: 0; }
  .thumb svg { width: 20px; height: 20px; }
  .chip-soft { display: none; }
  .stage-top { left: 12px; top: 12px; }
  .step { padding: 0 7px; font-size: 13.5px; }
  .steps { padding: 0 9px; }
  .strip { bottom: 10px; width: calc(100% - 20px); margin-left: 0; grid-template-columns: 1fr; padding: 8px; }
  .lane-label { display: none; }
  .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow); }
  .sheet.is-open { height: 80dvh; margin-top: 0; }
  .config { overflow: visible; }
  .steps { position: sticky; top: var(--bar-h); z-index: 10; background: var(--panel); }
  .config-body { overflow: visible; padding: 22px 16px 26px; }
  .pdp { padding: 16px 16px 0; }
  .config-foot { position: sticky; bottom: 0; z-index: 11; padding: 10px 12px 12px; }
  .menu-list { position: fixed; left: 8px; right: 8px; top: var(--bar-h); width: auto; max-height: calc(100dvh - var(--bar-h) - 8px); }
  .contact-pop { margin: 0; width: auto; }
  .checks-pop { top: 54px; left: 12px; max-height: calc(100% - 140px); }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .arrange-bar { top: 60px; width: calc(100% - 24px); font-size: 12px; padding: 6px 6px 6px 10px; }
}
@media (max-width: 440px) {
  .step b { display: none; }
  .add-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
}

/* ---------- Druk ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; color: #000; overflow: visible; font-size: 10pt; }
  .app, .toast { display: none !important; }
  .print-sheet { display: block; }
  .print-sheet h1 { font: 600 22pt/1.15 var(--display); margin: 0 0 2mm; }
  .print-sheet h2 { font-size: 12pt; margin: 7mm 0 2mm; break-after: avoid; }
  .print-sheet .pmeta { color: #555; margin-bottom: 4mm; }
  .print-sheet img.snap { width: 100%; max-height: 100mm; object-fit: contain; background: #f5f5f5; }
  .print-sheet table { font-size: 8.8pt; }
  .print-sheet th { position: static; background: #f2f2f2; color: #333; box-shadow: none; }
  .print-sheet td, .print-sheet th { padding: 1.3mm 2mm; border-bottom: 1px solid #ddd; }
  .print-sheet tr { break-inside: avoid; }
  .print-sheet .alert { padding: 2mm 3mm; margin-bottom: 2mm; border: 1px solid #ddd; background: #fff; }
  .print-sheet .page-break { break-before: page; }
  .print-sheet .sheet-grid { grid-template-columns: 1fr 1fr; }
  .print-sheet .sheet-fig .board { fill: #f1f1f1; }
  .print-sheet .sheet-fig .pc { fill: #fff; stroke: #333; }
  .print-sheet .sheet-fig text { fill: #000; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-delay: 0s !important; }
}

/* ---------- Własny układ wnętrza ---------- */
.cs { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 14px; padding: 8px 0 10px; align-items: start; }
.cs-draw { display: flex; justify-content: center; padding: 6px 4px; background: var(--panel-2); min-width: 110px; }
.cs-svg { display: block; max-width: 220px; width: auto; touch-action: none; user-select: none; overflow: visible; }
.cs-bg { fill: var(--panel); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cs-item { cursor: ns-resize; }
.cs-item rect:not(.cs-hit), .cs-item path { fill: var(--ink-2); stroke: none; transition: fill .15s; }
.cs-shelf rect:not(.cs-hit) { fill: var(--faint); }
.cs-drawer rect:not(.cs-hit) { fill: var(--panel-3); stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.cs-drawer line, .cs-rod line { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.cs-rod path { fill: none; stroke: var(--ink-2); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.cs-hit { fill: transparent; stroke: none; }
.cs-item:hover rect:not(.cs-hit), .cs-svg.is-drag .cs-item rect:not(.cs-hit) { fill: var(--sel); }
.cs-drawer:hover rect:not(.cs-hit) { fill: color-mix(in srgb, var(--sel) 45%, var(--panel)); }
.cs-dim { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cs-txt { fill: var(--muted); font-family: var(--font); font-weight: 600; }
.cs-side { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cs-side .chip { height: 34px; padding: 0 10px; font-size: 12.5px; }
.cs-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cs-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 30px; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cs-row.is-bad .cs-name, .cs-bad rect:not(.cs-hit) { color: var(--err); fill: var(--err) !important; }
.cs-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.cs-name { min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row .size-val { height: 32px; padding: 0 6px; gap: 3px; }
.cs-row .size-val input { width: 4.2ch; font-size: 14px; }
.cs-sel { min-width: 0; width: 100%; height: 32px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; font-weight: 500; padding: 0 4px; border-radius: 0; }
.cs-row .ico-btn { width: 30px; height: 30px; }
.cs-row .ico-btn svg { width: 17px; height: 17px; }
@media (max-width: 520px) { .cs { grid-template-columns: 1fr; } .cs-draw { justify-self: stretch; } }

[aria-busy="true"] { opacity: .55; pointer-events: none; }

/* ---------- Meber Pro ---------- */
.logo .pro { font-weight: 600; font-size: 12px; letter-spacing: .02em; padding: 3px 6px 2px; background: var(--pri-fill); color: var(--on-pri); margin-left: -3px; align-self: center; }
.pill.sm { height: 36px; padding: 0 12px; font-size: 13px; gap: 6px; }
.pill.sm svg { width: 16px; height: 16px; }
.btn-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.group-h h3 svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Ściany i rzut z góry */
.plan-view { border: 1px solid var(--line-2); background: var(--panel-2); margin-bottom: 12px; }
.pv-svg { display: block; width: 100%; height: auto; max-height: 280px; }
.pv-wall { stroke: var(--ink); stroke-linecap: square; }
.pv-wall.main { stroke: var(--ink); }
.pv-wl { fill: var(--muted); font-weight: 600; font-family: var(--font); }
.pv-top { fill: color-mix(in srgb, var(--muted) 18%, transparent); stroke: none; }
.pv-mod rect { fill: var(--panel); stroke: var(--ink); stroke-width: 12; cursor: pointer; transition: fill .15s; }
.pv-mod.wall rect { fill: none; stroke-dasharray: 40 30; stroke-width: 9; opacity: .7; }
.pv-mod:hover rect { fill: var(--pri-soft); }
.pv-mod.is-on rect { fill: var(--pri-soft-2); stroke: var(--pri); }
.pv-mod.wall.is-on rect { fill: color-mix(in srgb, var(--sel) 22%, transparent); }
.pv-mod.error rect { stroke: var(--err); }
.pv-mod.warning rect { stroke: var(--warn); }
.pv-obs { fill: #B07A5C; opacity: .55; }
.pv-txt { fill: var(--ink); font-weight: 600; font-family: var(--font); pointer-events: none; }
.wall-list { display: grid; gap: 8px; }
.wall-row { display: grid; grid-template-columns: 30px 1fr 118px 40px; gap: 8px; align-items: center; }
.wall-row .text-in { height: 40px; }
.wall-row .size-val input { width: 74px; }
.wall-badge { width: 30px; height: 30px; display: grid; place-items: center; background: var(--panel-3); font-weight: 600; font-size: 13px; }
.wall-row.main .wall-badge { background: var(--pri-soft); color: var(--pri-ink); box-shadow: inset 0 0 0 1px var(--pri); }
.wall-tag { font-size: 11.5px; color: var(--muted); text-align: center; }
.wall-corner .param { padding: 2px 0 2px 38px; border: 0; }
.wall-corner .param > span { font-size: 12.5px; color: var(--muted); }
.wall-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.wtab { height: 28px; padding: 0 9px; border: 1px solid var(--line-2); background: var(--glass); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.wtab small { font-weight: 400; color: var(--muted); font-size: 11px; }
.wtab-add { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px dashed var(--hover-line); color: var(--pri-ink); background: var(--glass); transition: background-color .15s, border-color .15s, color .15s; }
.wtab-add:hover, .wtab-add:focus-visible { border-style: solid; border-color: var(--pri); background: var(--pri-fill); color: var(--on-pri); }
.wtab-add svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wtab-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-2); align-self: center; }
.wtab.is-on { background: var(--pri-soft); color: var(--ink); border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }
.wtab.is-on small { color: var(--pri-ink); }
.blk.tall { background: color-mix(in srgb, var(--muted) 16%, transparent); border: 0; pointer-events: none; }
.blk.corner { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 22%, transparent) 0 4px, transparent 4px 8px); border: 0; color: var(--muted); font-size: 10px; display: grid; place-items: center; pointer-events: auto; cursor: help; }

/* Pomiar wnęki */
.measure { display: grid; grid-template-columns: 74px 1fr; gap: 6px 12px; align-items: start; }
.measure .mini-grid { grid-column: 2; margin-bottom: 0; }
.measure-fig { grid-row: span 2; }
.measure-fig svg { width: 74px; height: 74px; fill: none; stroke: var(--muted); stroke-width: 2; }
.mini-grid.c3 { grid-template-columns: repeat(3, 1fr); }

/* Wycena */
.quote-card { padding: 16px; background: var(--panel-2); }
.quote-card small, .quote-total small { display: block; font-size: 12px; color: var(--muted); }
.quote-card b { display: block; font: 600 26px/1.15 var(--display); letter-spacing: -.02em; margin: 2px 0 4px; }
.quote-card span { font-size: 12.5px; color: var(--muted); }
.quote-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: start; }
.quote-total { display: flex; justify-content: space-between; gap: 12px; padding: 16px; background: var(--panel-2); margin-bottom: 8px; }
.quote-total b { display: block; font: 600 28px/1.15 var(--display); letter-spacing: -.02em; }
.quote-total span { font-size: 12.5px; }
.quote-side { text-align: right; }
.quote-side b { font-size: 18px; }
.quote-table tr.sub td { font-weight: 600; border-top: 1px solid var(--line-2); }
.quote-table tr.total td { font-weight: 700; font-size: 16px; border-bottom: 0; }
.price-edit h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.price-edit h4:first-child { margin-top: 0; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.pfield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pfield.wide { grid-column: span 2; }
.pfield > span:first-child { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfield .input-unit input { height: 38px; }
.pfield .text-in { height: 38px; }

/* Wiercenia */
.kind-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.kchip { font-size: 12px; padding: 4px 8px; background: var(--panel-2); color: var(--ink-2); }
.kchip b { font-weight: 600; }

/* Montaż */
.asm { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 28px; }
.asm-g h4 { margin: 4px 0 6px; font-size: 14px; font-weight: 600; }
.asm-g ol { margin: 0; padding-left: 26px; font-size: 13.5px; line-height: 1.45; }
.asm-g li { margin-bottom: 6px; }
.asm-g li::marker { color: var(--muted); font-weight: 600; }
.asm-draw { max-width: 300px; margin: 4px 0 12px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.asm-draw svg { display: block; width: 100%; height: auto; max-height: 260px; }

/* Karta formatki */
.pc-dialog { border: 0; padding: 0; width: min(1080px, 94vw); max-height: 92vh; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.pc-dialog::backdrop { background: rgba(0, 0, 0, .42); }
.pc-dialog > div { padding: 18px 22px 22px; }
.pc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.pc-head small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pc-head h3 { margin: 2px 0; font: 600 20px/1.2 var(--display); }
.pc-head p { margin: 0; font-size: 13px; }
.pc-draw { background: var(--panel-2); padding: 8px; }
.pc-svg { display: block; width: 100%; height: auto; max-height: 52vh; }
.pc-panel { fill: var(--panel); stroke: var(--ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.pc-grain { fill: none; stroke: color-mix(in srgb, #C49D72 60%, transparent); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.pc-cut { fill: var(--panel-2); stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 8 5; vector-effect: non-scaling-stroke; }
.pc-groove { fill: var(--info); opacity: .75; }
.pc-groove.back { fill: none; stroke: var(--info); stroke-width: 1.4; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.pc-hb circle { fill: var(--ink); }
.pc-ha circle { fill: var(--panel); stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
.pc-thru circle { fill: var(--panel); stroke: var(--err); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.pc-thru path { stroke: var(--err); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.pc-edge rect { fill: var(--pri); opacity: .85; }
.pc-hole { cursor: help; }
.pc-band { stroke: var(--ink); }
.pc-band.pcv08 { stroke: var(--muted); }
.pc-lbl { fill: var(--muted); }
.pc-lbl.strong { fill: var(--ink); font-weight: 600; }
.pc-dim, .pc-ord { stroke: var(--faint); stroke-width: .8; vector-effect: non-scaling-stroke; }
.pc-dimt { fill: var(--ink); font-weight: 600; }
.pc-ordt { fill: var(--muted); }
.pc-legend { margin: 10px 0 2px; }
.lg { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; }
.lg-b { background: var(--ink); }
.lg-a { border: 1.3px dashed var(--ink); }
.lg-t { border: 1.5px solid var(--err); }
.lg-e { background: var(--pri); border-radius: 0; height: 7px; }
.lg-g { background: var(--info); border-radius: 0; height: 5px; }
.ops-table td { font-size: 13px; padding: 8px 10px; }

@media (max-width: 920px) {
  .quote-wrap { grid-template-columns: 1fr; }
  .wall-row { grid-template-columns: 30px 1fr 104px 36px; }
}
@media print {
  .pc-dialog { display: none; }
  .print-card .pc-svg { max-height: none; }
  .print-card .btn-row, .print-card [data-dialog-close] { display: none; }
}
@media (max-width: 440px) {
  .thumbs { gap: 4px; }
  .thumb { width: 34px; height: 34px; }
  #btnLabels { display: none; }
  .thumb svg { width: 18px; height: 18px; }
  .arrange-bar { top: 52px; }
  .arrange-bar .ab-text > b { display: none; }
  .bar { padding-right: 6px; gap: 8px; }
  .bar-left .navlink { padding: 0 8px; }
  .logo .pro { font-size: 10px; padding: 2px 4px 1px; }
  /* Telefon: ponów jest pod skrótem i w historii, w nagłówku zostaje cofnij i lista. */
  #btnRedo { display: none; }
  .bag { padding: 0 6px; }
  .wall-row { grid-template-columns: 26px 1fr 96px 32px; gap: 6px; }
  .wall-row .size-val input { width: 56px; }
}

/* ---------- Strona dla klienta (link /k/...) ---------- */
.share-bar { grid-template-columns: 1fr auto; padding: 0 12px 0 20px; }
.share-bar .brand { justify-self: start; align-items: flex-start; }
.share-bar .logo { font-size: 18px; gap: 10px; }
.share-info .config-body { padding-top: 26px; }
.sh-kicker { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.sh-title { margin: 0; font: 600 26px/1.15 var(--display); letter-spacing: -.015em; }
.sh-date { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.sh-price { margin: 18px 0 6px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sh-price b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.sh-price span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.sh-sec { margin-top: 22px; }
.sh-sec h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.sh-mats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sh-mats li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; font-size: 14px; }
.sh-mats i { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sw-ring); }
.sh-mats i.none { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }
.sh-mats small { display: block; font-size: 12px; color: var(--muted); }
.sh-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; table-layout: fixed; }
.sh-table td:last-child { width: 36%; }
.sh-table td { overflow-wrap: anywhere; }
.sh-table td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sh-table td:first-child { width: 38px; }
.sh-table td small { display: block; color: var(--muted); font-size: 12px; }
.sh-table td.num { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.share-page .plan-view { margin-top: 6px; }
@media print {
  .print-sheet .sh-price b { font-size: 18pt; }
  .print-sheet .plan-view svg { max-height: 90mm; }
}

.share-row { display: flex; gap: 8px; margin-top: 16px; }
.share-row input { flex: 1; min-width: 0; height: 44px; font-size: 14px; }


.mini-h { margin: 18px 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.pm-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Szybka zmiana wymiarów: pola w pasku nad meblem i uchwyty w 3D */
.tb-size { display: inline-flex; align-items: center; gap: 3px; margin: 0 6px 0 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.tb-size input { width: 64px; height: 30px; padding: 0 6px; border: 1px solid var(--line-2); background: var(--panel); font: 600 13px/1 inherit; text-align: right; border-radius: 0; -moz-appearance: textfield; }
.tb-size input::-webkit-inner-spin-button, .tb-size input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tb-size input:focus { outline: none; border-color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri); }
.tb-size i { font-style: normal; font-size: 12px; color: var(--muted); }
.rs-handle {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; z-index: 6;
  background: var(--pri-fill); color: var(--on-pri); border: 2px solid var(--panel); border-radius: 50%; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform 0s; touch-action: none; will-change: transform;
}
.rs-handle.show { opacity: 1; pointer-events: auto; }
.rs-handle.width { cursor: ew-resize; }
.rs-handle.height { cursor: ns-resize; }
.rs-handle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rs-handle:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.viewer.is-resizing, .viewer.is-resizing canvas { cursor: grabbing; }
@media (max-width: 600px) { .tb-size input { width: 54px; } }

.sw small .nw { white-space: nowrap; }

/* Strona 404 */
.nf-page { background: var(--page); color: var(--ink); font-family: var(--font); }
.nf { max-width: 520px; margin: 0 auto; padding: 18vh 24px 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.nf h1 { margin: 18px 0 0; font: 600 30px/1.15 var(--display); letter-spacing: -.02em; }
.nf p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.nf-btn { margin-top: 8px; height: 52px; padding: 0 22px; display: inline-flex; align-items: center; background: var(--pri-fill); color: var(--on-pri); font-weight: 600; text-decoration: none; }
.nf-btn:hover { background: var(--pri-fill-2); }
.kbd { display: inline-block; margin-left: 6px; padding: 1px 5px; border: 1px solid var(--line-2); font: 500 11px/1.3 var(--font); color: var(--muted); vertical-align: 1px; }
.menu-foot { margin-top: 6px; padding: 8px 16px 4px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.stage.arranging .chip-soft { display: none; }

/* ---------- Ukryty spis linków (/spis) ---------- */
body.spis-page { overflow: auto; }
.spis { max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; }
.spis h1 { margin: 0 0 6px; font: 600 24px/1.2 var(--display); letter-spacing: -.015em; }
.spis-login { max-width: 420px; margin: 8vh auto 0; display: grid; gap: 14px; }
.spis-login p { margin: 0; color: var(--muted); }
.spis-login code { font-size: 13px; background: var(--panel-2); padding: 1px 5px; }
.spis-err { color: var(--err) !important; font-weight: 600; }
.spis-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.spis-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.spis-search { display: flex; gap: 8px; }
.spis-search .text-in { height: 36px; width: 260px; font-size: 14px; }
.spis-table td { vertical-align: top; }
.spis-table td small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.spis-table td.wrap { min-width: 120px; max-width: 260px; }
.spis-log summary { cursor: pointer; color: var(--pri-ink); font-weight: 600; }
.spis-log ol { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.45; }
.spis-log li { margin-bottom: 6px; }
@media (max-width: 920px) {
  .spis { padding: 20px 12px 40px; }
  .spis-search .text-in { width: 100%; }
  .spis-search { width: 100%; }
}
.spis-table td.num { font-variant-numeric: normal; white-space: nowrap; }
a.pill { text-decoration: none; }

/* Katalog mebli w grupach (1.2.0) */
.add-group + .add-group { margin-top: 14px; }
.add-group > .mini-h { margin: 0 0 8px; }
.add-grid.compact { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.add-grid.compact .tile { flex-direction: column; text-align: center; padding: 8px 4px 7px; gap: 4px; font-size: 12.5px; line-height: 1.25; }
.add-grid.compact .tile svg { width: 30px; height: 30px; }
.add-grid.compact .tile small { display: none; }
.empty-state { max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain; padding-top: 24px; }
.empty-state p { margin-bottom: 14px; }
.empty-state .add-group > .mini-h { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; margin-bottom: 6px; }
.empty-state .add-group + .add-group { margin-top: 10px; }
@media (max-width: 560px) { .add-grid.compact { grid-template-columns: repeat(3, 1fr); } }
.sm-sub { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.sm-head + .sm-sub { margin-top: 0; }
.slot-menu.is-catalog { width: 400px; }
.sm-grid.cat { grid-template-columns: repeat(4, 1fr); }
.sm-grid.cat .sm-item { font-size: 12px; padding: 8px 4px 7px; }
@media (max-width: 560px) {
  .slot-menu.is-catalog { width: calc(100% - 16px); }
  .sm-grid.cat { grid-template-columns: repeat(3, 1fr); }
}

/* Wąski telefon: mniejsze odstępy w nagłówku. */
@media (max-width: 560px) {
  .bar { gap: 6px; padding-left: 8px; }
  .brand { gap: 6px; }
  .bar-right .ibtn { width: 38px; }
}
.cp-copy { margin: 4px 0 0; padding: 10px 16px 6px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.menu-list .cp-copy a { display: inline; padding: 0; box-shadow: none; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.menu-list .cp-copy a:hover, .menu-list .cp-copy a:focus-visible { color: var(--pri-ink); text-decoration-color: currentColor; outline: none; }
