/* Projekt Meblarz — interfejs w stylu CAD: neutralne szarości + jeden kolor akcentu, gęstość informacji, tryb jasny i ciemny. */
:root {
  --bg: #e9ebee; --panel: #f6f7f8; --panel2: #ffffff; --ink: #1c2025; --ink2: #3a4047; --muted: #69707a; --line: #d3d7dc; --line2: #e3e6e9;
  --hover: rgba(20, 30, 45, .06); --press: rgba(20, 30, 45, .10);
  --accent: #2f6fdb; --accent-ink: #ffffff; --accent-soft: rgba(47, 111, 219, .12); --accent-line: rgba(47, 111, 219, .45);
  --ok: #23804a; --warn: #a86b00; --warn-soft: #fff5df; --err: #c0352b;
  --vp: #dfe2e6; --paper: #fbfbfa;
  --tv-ink: #2b2f35; --tv-thin: #b3b8bf; --tv-cut: #c9ced5; --tv-front: #eef0f2; --tv-dim: #5b6470;
  --th-b: #e6e8eb; --th-f: #f8f9fa; --th-s: #8b929b; --th-ink: #5d646d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 20px rgba(0, 0, 0, .10);
  --radius: 6px; --h-bar: 36px; --fs: 13px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191c; --panel: #212428; --panel2: #282b30; --ink: #e4e6e9; --ink2: #c3c7cc; --muted: #9198a1; --line: #363a40; --line2: #2d3035;
    --hover: rgba(255, 255, 255, .06); --press: rgba(255, 255, 255, .10);
    --accent: #5b93f0; --accent-ink: #0d1726; --accent-soft: rgba(91, 147, 240, .16); --accent-line: rgba(91, 147, 240, .5);
    --ok: #4fbf7d; --warn: #e0a23a; --warn-soft: #34291a; --err: #f07167;
    --vp: #1d2024; --th-b: #3a3e44; --th-f: #4a4f56; --th-s: #9aa1aa; --th-ink: #a8aeb6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  --bg: #17191c; --panel: #212428; --panel2: #282b30; --ink: #e4e6e9; --ink2: #c3c7cc; --muted: #9198a1; --line: #363a40; --line2: #2d3035;
  --hover: rgba(255, 255, 255, .06); --press: rgba(255, 255, 255, .10);
  --accent: #5b93f0; --accent-ink: #0d1726; --accent-soft: rgba(91, 147, 240, .16); --accent-line: rgba(91, 147, 240, .5);
  --ok: #4fbf7d; --warn: #e0a23a; --warn-soft: #34291a; --err: #f07167;
  --vp: #1d2024; --th-b: #3a3e44; --th-f: #4a4f56; --th-s: #9aa1aa; --th-ink: #a8aeb6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: var(--fs)/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 4px; padding: 4px 10px; min-height: 26px; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
button:hover:not(:disabled) { border-color: var(--accent-line); background: var(--hover); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, .tr:focus-visible, .li:focus-visible, .mi:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
button.wide { width: 100%; margin: 6px 0; justify-content: center; }
button.small { padding: 2px 7px; min-height: 22px; font-size: 12px; }
button.danger, .danger { color: var(--err); }
input[type=number], input[type=text], input[type=search], input[type=email], input[type=password], select, .search, input:not([type]), textarea {
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; background: var(--panel2); width: 100%; min-height: 26px;
}
input[type=number] { font-variant-numeric: tabular-nums; text-align: right; }
input[type=color] { width: 44px; height: 24px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
input:focus, select:focus { border-color: var(--accent); outline: none; }
label { display: block; font-size: 12px; color: var(--muted); }
label > input, label > select { margin-top: 2px; color: var(--ink); }
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; }
.note { font-size: 12px; color: var(--muted); }
.hidden { display: none !important; }
.spacer { flex: 1; }
.pad { padding: 10px 12px; } .pad2 { padding: 4px 8px 4px 34px; } .pad3 { padding: 2px 8px 2px 52px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 30px; height: 30px; stroke-width: 1.3; }
.gl { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; flex: none; }
kbd { font: 11px/1 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 2px 5px; background: var(--panel2); }

/* ---------- pasek menu ---------- */
.appbar { display: flex; align-items: center; gap: 6px; height: var(--h-bar); padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); height: 22px; white-space: nowrap; }
.brand .logo { color: var(--accent); display: inline-flex; }
.menubar { display: flex; align-items: center; gap: 0; }
.mb-btn { border: none; background: none; padding: 4px 9px; min-height: 26px; border-radius: 4px; color: var(--ink2); }
.mb-btn:hover:not(:disabled), .mb-btn.open { background: var(--press); border: none; color: var(--ink); }
.proj-name { max-width: 220px; min-width: 80px; border-color: transparent !important; background: transparent !important; font-weight: 600; text-align: right; }
.proj-name:hover, .proj-name:focus { border-color: var(--line) !important; background: var(--panel2) !important; text-align: left; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--panel2); flex: none; }
.seg button { border: none; border-radius: 0; min-height: 24px; padding: 3px 10px; background: transparent; color: var(--ink2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover:not(:disabled) { background: var(--hover); border-left-color: var(--line); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tb { border: 1px solid transparent; background: transparent; padding: 0; width: 28px; height: 28px; min-height: 28px; justify-content: center; color: var(--ink2); border-radius: 4px; position: relative; }
.tb:hover:not(:disabled) { background: var(--hover); border-color: transparent; color: var(--ink); }
.tb[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.ib { border: none; background: none; width: 24px; height: 24px; min-height: 24px; padding: 0; justify-content: center; color: var(--muted); border-radius: 4px; position: relative; }
.ib:hover:not(:disabled) { background: var(--hover); color: var(--ink); border: none; }
.ib .ic { width: 16px; height: 16px; }
/* podpowiedzi */
[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); font-size: 11px; font-weight: 500; white-space: nowrap; padding: 4px 7px; border-radius: 4px; pointer-events: none; z-index: 80; box-shadow: var(--shadow); }
.tb-g:first-child .tb[data-tip]:hover::after, .ph-a .ib:last-child[data-tip]:hover::after { left: 0; transform: none; }
.ph-a [data-tip]:hover::after { left: auto; right: 0; transform: none; }

/* ---------- menu rozwijane i kontekstowe ---------- */
.menu { position: fixed; z-index: 70; min-width: 230px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 4px; }
.menu.sub { display: none; position: absolute; left: 100%; top: -5px; }
.mi { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; position: relative; color: var(--ink); }
.mi:hover, .mi.open { background: var(--accent); color: var(--accent-ink); }
.mi:hover .mi-k, .mi.open .mi-k { color: inherit; opacity: .85; }
.mi .ic { width: 16px; height: 16px; }
.mi-k { color: var(--muted); font-size: 11px; display: inline-flex; }
.mi.dis { opacity: .4; cursor: default; }
.mi.dis:hover { background: none; color: var(--ink); }
.mi.has-sub:hover > .menu.sub, .mi.has-sub.open > .menu.sub { display: block; }
/* podmenu ustawiane w JS (placeSub): w lewo/w górę przy krawędzi ekranu, przewijane, gdy wyższe niż okno */
.menu.sub.placed { position: fixed; max-height: calc(100vh - 8px); overflow-y: auto; }
.menu.ctx { max-height: calc(100vh - 8px); overflow-y: auto; }
.menu.ctx:not(.inline) { overflow: visible; }
/* telefon / wąskie okno: podmenu rozwijane w miejscu (sekcje), całe menu przewijane */
.menu.inline { max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); overflow-y: auto; overscroll-behavior: contain; }
.menu.inline .mi { white-space: normal; }
.menu.inline .mi.has-sub { grid-template-columns: 22px 1fr auto; }
.menu.inline .mi.has-sub > .mi-k .ic { transition: transform .15s; }
.menu.inline .mi.has-sub.open > .mi-k .ic { transform: rotate(90deg); }
.menu.inline .mi.has-sub:hover, .menu.inline .mi.has-sub.open { background: none; color: var(--ink); }
.menu.inline .mi.has-sub:hover > .mi-k, .menu.inline .mi.has-sub.open > .mi-k { color: var(--muted); }
.menu.inline .mi.has-sub:hover > .menu.sub { display: none; }
.menu.inline .mi.has-sub.open > .menu.sub { display: block; }
.menu.inline .menu.sub { position: static; grid-column: 1 / -1; min-width: 0; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 2px 0 2px 10px; padding: 0 0 0 4px; background: transparent; max-height: none; overflow: visible; }
.menu.inline .mi.has-sub.open > .mi-l { font-weight: 600; }
.mi.danger { color: var(--err); }
.mi.danger:hover { background: var(--err); color: #fff; }
.msep { height: 1px; background: var(--line); margin: 4px 2px; }
.mgrp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 8px 3px; font-weight: 600; }
.menu.sheet { left: 8px; right: 8px; top: 8px; bottom: 8px; overflow-y: auto; min-width: 0; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 8px; position: sticky; top: -4px; background: var(--panel2); }

/* ---------- pasek narzędzi ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.tb-groups { display: flex; align-items: center; min-width: 0; }
.tb-g { display: flex; align-items: center; gap: 1px; padding: 0 5px; }
.tb-g + .tb-g { border-left: 1px solid var(--line); }
.tb-g:first-child { padding-left: 0; }
.ws button { padding: 3px 12px; }
.only-phone { display: none !important; }

/* ---------- układ roboczy ---------- */
.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; }
#viewDesign { display: none; }
#viewDesign.active { display: grid; grid-template-columns: 272px minmax(0, 1fr) 336px; }
body.hide-left #viewDesign.active { grid-template-columns: 0 minmax(0, 1fr) 336px; }
body.hide-right #viewDesign.active { grid-template-columns: 272px minmax(0, 1fr) 0; }
body.hide-left.hide-right #viewDesign.active { grid-template-columns: 0 minmax(0, 1fr) 0; }
body.hide-left .left, body.hide-right .right { visibility: hidden; overflow: hidden; border: none; }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.panel.right { border-right: none; border-left: 1px solid var(--line); }
.ptabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); flex: none; position: sticky; top: 0; background: var(--panel); z-index: 2; }
.ptabs button[data-tab] { flex: 1; border: none; border-radius: 0; background: none; padding: 8px 6px; min-height: 34px; justify-content: center; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.ptabs button[data-tab]:hover { background: var(--hover); }
.ptabs button[data-tab].active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.pane { display: none; }
.pane.active { display: block; }

/* drzewa (projekt i biblioteka) */
.tree { padding: 4px 0 12px; user-select: none; }
.tr { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 4px; cursor: default; white-space: nowrap; color: var(--ink); border-left: 2px solid transparent; }
.tr:hover { background: var(--hover); }
.tr.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.tr .tw { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); cursor: pointer; }
.tr .tw .ic { width: 12px; height: 12px; transition: transform .12s; }
.tn-g.open > .tr .tw .ic, .tr[aria-expanded="true"] .tw .ic { transform: rotate(90deg); }
.tr > .ic, .tr > .gl { width: 16px; height: 16px; color: var(--muted); }
.tr.sel > .ic, .tr.sel > .gl { color: var(--accent); }
.tr .tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tr .td { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.tr.lvl1 { padding-left: 18px; } .tr.lvl2 { padding-left: 32px; } .tr.lvl3 { padding-left: 50px; }
.tr.lvl0 .tn { font-weight: 600; }
.tr.mutedrow .tn { color: var(--muted); font-style: italic; }
.tn-c { display: none; }
.tn-g.open > .tn-c { display: block; }
.code { display: inline-block; min-width: 22px; font-size: 10px; font-weight: 700; color: var(--muted); margin-right: 5px; font-variant-numeric: tabular-nums; }
.wdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); vertical-align: middle; margin-left: 3px; }
.lib-search { position: relative; padding: 8px; border-bottom: 1px solid var(--line2); }
.lib-search .ic-in { position: absolute; left: 15px; top: 13px; color: var(--muted); display: inline-flex; }
.lib-search .ic-in .ic { width: 15px; height: 15px; }
.lib-search input { padding-left: 27px; }
.lib-res { padding: 6px 10px; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 6px 22px; }
.lib-tools .ic { width: 14px; height: 14px; }
.li { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 34px; cursor: pointer; border-left: 2px solid transparent; }
.lib-res ~ .li { padding-left: 10px; }
.li:hover { background: var(--hover); border-left-color: var(--accent-line); }
.li.na { opacity: .55; cursor: default; }
.li .thumb { width: 38px; height: 38px; flex: none; background: var(--panel2); border: 1px solid var(--line2); border-radius: 3px; padding: 2px; }
.li-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.li-n { font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li-p { font-size: 10px; color: var(--muted); }
.li-d { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.li-a { display: none; gap: 0; }
.li:hover .li-a { display: flex; }
.thumb .tb-b { fill: var(--th-b); stroke: var(--th-ink); }
.thumb .tb-f { fill: var(--th-f); stroke: var(--th-ink); }
.thumb .tb-g { fill: var(--accent-soft); stroke: var(--th-ink); }
.thumb .tb-s { fill: var(--th-s); }
.thumb .tb-x { fill: none; stroke: var(--th-ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* środek: widoki */
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.viewbar { display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.vp-seg button { gap: 5px; }
.vp-seg .ic { width: 15px; height: 15px; }
.vsep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.vp-title { font-size: 12px; color: var(--ink2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; margin-right: 8px; }
body.mode-furniture #optRoom, body.mode-furniture #vpMode [data-mode="plan"] { display: none; }
body.no-viz #vpMode [data-mode="3d"], body.no-viz #optCam, body.no-viz #optXray { display: none; }
.viewport { flex: 1; min-height: 0; background: var(--vp); position: relative; overflow: hidden; }
.viewport.tech { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--line); }
.viewport.tech.hidden { display: none !important; }
.tv { background: var(--paper); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; color: var(--tv-ink); }
.tv-front { grid-row: 1 / 3; }
.tv-h { position: absolute; left: 0; top: 0; padding: 5px 9px; font-size: 11px; font-weight: 600; color: var(--tv-dim); text-transform: uppercase; letter-spacing: .05em; pointer-events: none; z-index: 1; }
.tv-h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--tv-dim); }
.tv-b { flex: 1; min-height: 0; }
.tv-b svg { width: 100%; height: 100%; display: block; touch-action: none; }
.tv .empty-state { color: #5d646d; }
.tv .empty-state b { color: #2b2f35; }
#viewportPlan { background: var(--paper); }
#viewportPlan svg { width: 100%; height: 100%; }
.warnbox { position: absolute; left: 10px; bottom: 10px; max-width: min(560px, 62%); display: flex; flex-direction: column; gap: 4px; pointer-events: none; z-index: 3; }
.warnbox .w { display: flex; gap: 7px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--warn); padding: 5px 9px; border-radius: 4px; font-size: 12px; pointer-events: auto; box-shadow: var(--shadow); color: var(--ink); }
.warnbox .w > .ic { color: var(--warn); width: 15px; height: 15px; margin-top: 1px; }
.warnbox .w button { margin: 3px 4px 0 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); height: 100%; padding: 24px; }
.empty-state b { color: var(--ink); font-size: 14px; }
.empty-state span { max-width: 360px; }
.empty-state.small { height: auto; padding: 30px 18px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.btnrow.center { justify-content: center; margin-top: 10px; }
.btnrow .ic { width: 15px; height: 15px; }

/* prawy panel: nagłówek + sekcje zwijane */
.ph { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; flex: none; }
.ph > .ic { color: var(--accent); }
.ph-t { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-s { font-weight: 400; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ph-a { display: flex; gap: 1px; }
.acc { border-bottom: 1px solid var(--line2); }
.acc-h { width: 100%; border: none; border-radius: 0; background: none; padding: 7px 10px 7px 6px; min-height: 32px; gap: 4px; font-weight: 600; font-size: 12px; color: var(--ink); text-align: left; }
.acc-h:hover:not(:disabled) { background: var(--hover); border: none; }
.acc-h .tw { width: 16px; display: inline-flex; color: var(--muted); }
.acc-h .tw .ic { width: 12px; height: 12px; transition: transform .12s; }
.acc.open > .acc-h .tw .ic { transform: rotate(90deg); }
.acc-t { flex: 1; }
.acc-s { font-weight: 400; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.acc-b { display: none; padding: 2px 12px 10px; }
.acc.open > .acc-b { display: block; }
.fr { display: grid; grid-template-columns: 104px minmax(0, 1fr) 24px; align-items: center; gap: 6px; min-height: 28px; margin: 2px 0; }
.fr > label { font-size: 12px; color: var(--ink2); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr .fc { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fr .fc > select, .fr .fc > input:not([type=checkbox]):not([type=color]):not([type=range]) { width: 100%; }
.fr .fu { font-size: 11px; color: var(--muted); }
.fr.dim .fc > input[type=number] { width: 80px !important; flex: none; text-align: right; }
.stp { width: 26px; height: 26px; padding: 0; flex: none; justify-content: center; font-size: 15px; line-height: 1; }
.fr .ro { color: var(--ink2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr .chk { margin: 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); cursor: pointer; }
.chk input { accent-color: var(--accent); margin: 0; }
.mat-btn { display: grid; grid-template-columns: 96px 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; text-align: left; margin: 2px 0; border-color: transparent; background: none; padding: 3px 4px; min-height: 30px; }
.mat-btn:hover:not(:disabled) { border-color: var(--line); background: var(--panel2); }
.mat-btn .mb-l { font-size: 12px; color: var(--ink2); }
.mat-btn .sw { width: 22px; height: 22px; border-radius: 3px; border: 1px solid var(--line); }
.mat-btn .t { font-size: 12px; line-height: 1.25; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.mat-btn .t, .mat-btn .t .muted { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.mat-btn .t .muted { font-size: 11px; }
.zone-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.zone-head .gl { color: var(--accent); }
.zone-head .muted { flex: 1; }
.fills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-bottom: 6px; }
.fills button { font-size: 11px; padding: 5px 2px; flex-direction: column; gap: 2px; justify-content: center; color: var(--ink2); min-height: 44px; }
.fills button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fills button .gl { width: 20px; height: 20px; }
.zl { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.zl-i { border: none; background: none; justify-content: flex-start; gap: 7px; padding: 3px 4px; min-height: 26px; font-size: 12px; }
.zl-i .muted { margin-left: auto; font-variant-numeric: tabular-nums; }
.swatches { display: flex; gap: 4px; margin: 2px 0 6px 110px; }
.swatches button { width: 20px; height: 20px; min-height: 20px; padding: 0; border-radius: 3px; border: 1px solid var(--line); }
.room-panel .rw-add button { font-size: 11px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.zone-box { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius); padding: 8px; margin-top: 6px; }
.dim-row { display: grid; grid-template-columns: 90px 1fr 76px; gap: 6px; align-items: center; margin: 4px 0; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.chips button { font-size: 12px; padding: 2px 9px; border-radius: 99px; min-height: 24px; }
.chips button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.callout { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: 4px; margin: 4px 0; font-size: 12px; }
.callout.warn { background: var(--warn-soft); border-left: 3px solid var(--warn); }
.callout .ic { color: var(--warn); width: 15px; height: 15px; }

/* ekran startowy */
.start { position: fixed; inset: 0; z-index: 60; background: rgba(15, 18, 22, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.start-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: min(780px, 100%); max-height: 100%; overflow-y: auto; padding: 22px 24px; box-shadow: var(--shadow); }
.start-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.start-h .logo { color: var(--accent); }
.start-h .logo .ic { width: 36px; height: 36px; stroke-width: 1.4; }
.start-h > div { flex: 1; }
.start-h h1 { margin: 0; font-size: 20px; }
.start-h p { margin: 2px 0 0; color: var(--muted); }
.start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sc { flex-direction: column; align-items: flex-start; text-align: left; gap: 6px; padding: 16px; min-height: 128px; background: var(--panel2); border-radius: 8px; }
.sc .ic { color: var(--accent); }
.sc-t { font-weight: 600; font-size: 14px; }
.sc-d { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sc:hover:not(:disabled) { border-color: var(--accent); background: var(--panel2); box-shadow: 0 0 0 3px var(--accent-soft); }
.start-last { width: 100%; margin-top: 10px; padding: 10px 14px; justify-content: flex-start; background: var(--panel2); }
.start-last > span { flex: 1; text-align: left; }
.start-f { margin-top: 12px; }

/* okna modalne */
.modal { position: fixed; inset: 0; background: rgba(15, 18, 22, .5); display: flex; align-items: center; justify-content: center; z-index: 65; padding: 16px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-width: 980px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; position: relative; box-shadow: var(--shadow); }
.modal-x { position: absolute; right: 8px; top: 8px; font-size: 20px; border: none; background: none; width: 30px; height: 30px; justify-content: center; }
.mh { margin: 0 0 10px; font-size: 17px; }
.step-n { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-top: 10px; }
.board { flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 5px; padding: 5px; cursor: pointer; font-size: 11px; background: var(--panel2); text-align: left; gap: 2px; }
.board:hover, .board.sel { border-color: var(--accent); }
.board.sel { box-shadow: 0 0 0 2px var(--accent-soft); }
.board .sw { height: 50px; border-radius: 3px; margin-bottom: 3px; }
.board b { font-size: 12px; display: block; }
.badge { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--line2); color: var(--ink2); margin: 1px; }
.badge.p3 { background: rgba(35, 128, 74, .15); color: var(--ok); }
.badge.wd { background: rgba(47, 111, 219, .15); color: var(--accent); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 6px; }
.wizard-step { min-height: 260px; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.wz-pict { width: 44px; height: 44px; fill: none; stroke: var(--ink2); stroke-width: 1.2; }
.wz-pict rect { fill: var(--panel); }
.measure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.ok { color: var(--ok); } .bad { color: var(--err); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 7px 14px; border-radius: 5px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 90; font-size: 12px; max-width: calc(100vw - 32px); }
.toast.show { opacity: .95; }
.scrim { position: fixed; inset: 0; background: rgba(15, 18, 22, .4); z-index: 40; }

/* widoki dokumentów */
.doc { overflow-y: auto; background: var(--bg); color: var(--ink); }
.doc-inner { max-width: 1200px; margin: 0 auto; padding: 18px 20px 40px; width: 100%; }
.doc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.doc-head h1 { margin: 0; flex: 1; }
.doc-head .btnrow { margin: 0; }
.docframe { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-height: 400px; }
.doc-inner h2 { margin-top: 26px; }
.tscroll { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 12px; background: var(--panel2); }
table.t th, table.t td { border: 1px solid var(--line); padding: 4px 7px; text-align: left; vertical-align: top; }
table.t th { background: var(--panel); font-weight: 600; color: var(--ink2); }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wizard-step .cards .card { flex-direction: column; align-items: flex-start; gap: 4px; }
.sheet-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 10px 0; color: #222; }
.sheet-wrap svg { width: 100%; height: auto; }
.part-draw { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.part-draw .sheet-wrap svg { max-height: 420px; }
.step { display: grid; grid-template-columns: 1fr 320px; gap: 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.keys td:first-child { width: 190px; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  #viewDesign.active { grid-template-columns: 236px minmax(0, 1fr) 300px; }
  .ws button { padding: 3px 8px; }
  .brand-t { display: none; }
}
/* ---------- telefon: panele jako szuflady ---------- */
@media (max-width: 860px) {
  .only-phone { display: inline-flex !important; }
  .menubar, .proj-name, .brand { display: none; }
  .appbar { gap: 4px; padding: 0 4px; }
  .appbar .spacer { display: block; }
  .mode-seg button { padding: 3px 8px; }
  .toolbar { height: auto; flex-wrap: wrap; padding: 3px 4px; gap: 2px; }
  .tb-groups { flex-wrap: wrap; width: 100%; }
  .tb-g { padding: 0 2px; }
  .ws { width: 100%; display: flex; }
  .ws button { flex: 1; padding: 3px 2px; font-size: 11px; justify-content: center; min-width: 0; }
  #viewDesign.active, body.hide-left #viewDesign.active, body.hide-right #viewDesign.active { display: flex; flex-direction: column; }
  body.hide-left .left, body.hide-right .right { visibility: visible; }
  .center { flex: 1; min-height: 0; }
  .panel { position: fixed; top: 0; bottom: 0; width: min(88vw, 360px); z-index: 50; box-shadow: var(--shadow); transition: transform .2s; border: none !important; }
  .panel.left { left: 0; transform: translateX(-102%); }
  .panel.right { right: 0; transform: translateX(102%); }
  body.open-left .panel.left, body.open-right .panel.right { transform: none; }
  .ptabs .drawer-x { flex: none; width: 40px; height: 34px; border-radius: 0; }
  .viewbar { flex-wrap: wrap; height: auto; padding: 3px 4px; gap: 2px; }
  .vp-title { display: none; }
  .vp-seg button { padding: 3px 7px; }
  .viewport.tech { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1.6fr) minmax(0, 1fr); }
  .tv-front { grid-row: 1; grid-column: 1 / 3; }
  .tv-h .muted { display: none; }
  .warnbox { max-width: calc(100% - 20px); left: 6px; bottom: 6px; }
  .fr { grid-template-columns: 96px minmax(0, 1fr) 22px; }
  .fr.dim input[type=range] { display: none; }
  .fr.dim .fc > input[type=number] { width: 100% !important; flex: 1; }
  .swatches { margin-left: 0; }
  .doc-inner { padding: 12px 14px 30px; overflow-x: hidden; }
  .cards { grid-template-columns: 1fr 1fr; }
  .start-grid { grid-template-columns: 1fr; }
  .sc { min-height: 0; padding: 12px; }
  .start-box { padding: 16px; }
  .step { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .part-draw { grid-template-columns: 1fr; }
  .gd-item { grid-template-columns: 1fr !important; }
  .menu.drop { display: none; }
  [data-tip]:hover::after { display: none; }
}
@media print {
  .appbar, .toolbar, .left, .right, .viewbar { display: none !important; }
  .view { display: none !important; }
  .view.active { display: block !important; }
  body { background: #fff; color: #000; overflow: visible; display: block; }
}

/* room+ai */
.rw-add { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.rw-add button { font-size: 11px; padding: 3px 6px; }
.rw-list { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.rw-item { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.rw-item.sel { border-color: var(--accent); background: var(--accent-soft); }
#viewportPlan { background: #f7f5f1; }
#viewportPlan svg { width: 100%; height: 100%; }

/* cutlist */
.cl h1 { margin-top: 0; }
.cl-steps { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 12px; list-style: none; counter-reset: s; }
.cl-steps li { counter-increment: s; font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.cl-steps li::before { content: counter(s) ". "; color: var(--accent); font-weight: 700; }
.cl-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-bottom: 10px; }
.cl-def { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; }
.cl-def select { flex: 1; min-width: 0; }
.cl-sw { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); flex: none; display: inline-block; }
.cl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.cl-side { position: sticky; top: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cl-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.cl-sum div { background: var(--bg); border-radius: 8px; padding: 6px 8px; }
.cl-sum b { display: block; font-size: 17px; }
.cl-sum span { font-size: 11px; color: var(--muted); }
.cl-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; }
.cl-row.open { border-color: var(--accent); }
.cl-main { display: grid; grid-template-columns: 18px minmax(120px, 1.5fr) 66px 66px 46px 58px 120px minmax(70px, 1fr) auto; gap: 6px; align-items: center; padding: 6px 8px; }
.cl-main > * { min-width: 0; }
.cl-num input, .cl-name input, .cl-ops input, .cl-ops select { width: 100%; min-width: 0; }
.cl-edges { width: 120px; height: 70px; }
.cl-act .small { padding: 2px 6px; }
.cl-n { color: var(--muted); font-size: 12px; text-align: right; }
.cl-mat { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cl-mat select { min-width: 0; font-size: 12px; padding: 4px; }
.cl-num, .cl-name { display: flex; flex-direction: column; font-size: 10px; }
.cl-num input, .cl-name input { padding: 4px 6px; font-size: 13px; }
.cl-grain { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink); }
.cl-edges { width: 130px; height: 76px; display: block; }
.cl-edge { cursor: pointer; }
.cl-edge:hover line + line { stroke-opacity: .7; }
.cl-act { display: flex; gap: 3px; align-items: center; }
.cl-st { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.cl-st.ok { background: var(--ok); } .cl-st.warn { background: var(--warn); } .cl-st.err { background: var(--err); }
.cl-more { border-top: 1px dashed var(--line); padding: 8px 10px 10px; }
.cl-bulk { font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.cl-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; align-items: end; }
.cl-ops .cl-wide { grid-column: 1 / -1; }
.cl-val { margin: 8px 0 0; padding-left: 18px; font-size: 12px; }
.cl-val .error { color: var(--err); } .cl-val .warn { color: var(--warn); } .cl-val .info { color: var(--muted); }
.cl-draw svg { width: 100%; height: auto; max-height: 360px; }
.cl-empty { padding: 20px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.cl-exp button { flex: 1 1 auto; }
@media (max-width: 1100px) { .cl-grid { grid-template-columns: minmax(0, 1fr); } .cl-side { position: static; } }
.cl-side svg, .cl-draw svg { max-width: 100%; }
.cl-ops .chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
@media (max-width: 760px) {
  .cl, .cl-grid, .cl-list, .cl-side { min-width: 0; max-width: 100%; }
  .cl-def { flex: 1 1 100%; min-width: 0; }
  .cl-def select { width: 100%; }
  .cl-tools button { flex: 1 1 auto; }
  .cl-side { padding: 10px; }
  .cl-side table.t { font-size: 12px; }
  .cl-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cl-n { display: none; }
  .cl-mat, .cl-name { grid-column: 1 / -1; }
  .cl-edgebox { grid-column: 1 / 3; }
  .cl-act { grid-column: 3; justify-content: flex-end; }
  .cl-sum { grid-template-columns: repeat(2, 1fr); }
}

/* poradnik pomiaru */
.gd-item { display: grid; grid-template-columns: 1fr 380px; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; align-items: start; }
.gd-item.nofig { grid-template-columns: 1fr; }
.gd-item p { margin: 6px 0; }
.gd-h { margin: 0 0 6px; font-size: 15px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.gd-fig svg { width: 100%; height: auto; background: #fbf9f5; border-radius: 8px; border: 1px solid var(--line); }

/* zamówienie: ostrzeżenie przed pierwszym zamówieniem (zawsze widoczne, bez emoji) */
.order-alert { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); border: 1px solid var(--warn); border-left-width: 4px; border-radius: var(--radius, 6px); padding: 10px 14px; margin: 0 0 14px; color: var(--ink); }
.order-alert > .ic { color: var(--warn); width: 20px; height: 20px; flex: none; margin-top: 1px; }
.order-alert b { font-size: 13px; }
.order-alert p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; }
.callout.warn > span { flex: 1; }

/* telefon: pasek przestrzeni roboczych przewijany poziomo (nic nie jest ucinane) */
@media (max-width: 860px) {
  .ws { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .ws::-webkit-scrollbar { display: none; }
  .ws button { flex: 1 0 auto; padding: 3px 9px; scroll-snap-align: start; white-space: nowrap; }
  .appbar { min-width: 0; overflow: hidden; }
  .mode-seg { flex: 0 1 auto; min-width: 0; }
  .mode-seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) {
  .viewport.tech { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(380px, 1fr) 300px 300px; overflow-y: auto; }
  .tv-front { grid-column: 1; }
}

/* uwagi w widoku: zwinięty pasek z licznikiem (nie zasłania rysunku), rozwijany kliknięciem */
.warnbox .w-pill { pointer-events: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px 3px 8px; border-radius: 13px; border: 1px solid var(--warn); background: var(--panel2); color: var(--ink); font-size: 12px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.warnbox .w-pill .ic { width: 14px; height: 14px; }
.warnbox .w-pill > .ic:first-child { color: var(--warn); }
.warnbox .w-list { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow-y: auto; pointer-events: auto; }
.warnbox .w.more { font-style: italic; color: var(--muted); border-left-color: var(--line); }
@media (max-width: 860px) { .warnbox .w-list .w:nth-child(n+3) { display: none; } }
.warnbox { left: auto; right: 10px; align-items: flex-end; }
.warnbox .w-pill { align-self: flex-end; }
@media (max-width: 860px) { .warnbox { right: 6px; left: auto; } }

/* pusty rysunek: przyciski w jasnych kolorach (rysunek ma zawsze jasne tło) + szybkie kategorie */
.tv .empty-state button { background: #ffffff; color: #2b2f35; border-color: #cfd3d8; }
.tv .empty-state button:hover { border-color: var(--accent); color: #1f2328; }
.tv .empty-state button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.tv .empty-state .quickcats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 4px; max-width: 520px; }
.tv .empty-state .quickcats button { font-size: 13px; padding: 6px 12px; }
/* podświetlenie panelu biblioteki po kliknięciu „Biblioteka” */
@keyframes libflash { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.left.flash { animation: libflash 1.2s ease-out; }

/* historia wersji */
.vlist { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.vday { position: sticky; top: 0; background: var(--panel); font-size: 12px; font-weight: 600; padding: 8px 12px 4px; border-bottom: 1px solid var(--line); color: var(--muted); }
.vrow { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.vrow .vt { font-variant-numeric: tabular-nums; color: var(--muted); }
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* kreator mebla: pola liczbowe z −/+ i szybkimi wartościami (bez suwaków) */
.wz-num { display: grid; grid-template-columns: 150px auto 1fr; gap: 6px 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.wz-num > span.l { color: var(--ink2); }
.wz-num .wz-in { display: inline-flex; align-items: center; gap: 4px; }
.wz-num .wz-in input { width: 90px; text-align: right; font-size: 14px; height: 32px; }
.wz-num .wz-in button { width: 32px; height: 32px; padding: 0; justify-content: center; font-size: 17px; }
.wz-num .wz-in .u { color: var(--muted); font-size: 12px; min-width: 22px; }
.wz-num .wz-q { display: flex; flex-wrap: wrap; gap: 4px; }
.wz-num .wz-q button { font-size: 12px; padding: 3px 8px; min-height: 26px; }
.wz-num .wz-q button.active { border-color: var(--accent); color: var(--accent); }
@media (max-width: 700px) { .wz-num { grid-template-columns: 1fr; gap: 4px; } }
.wz-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 760px) { .wz-cols { grid-template-columns: 1fr; } }

/* konto i chmura (js/cloud.js) */
.acct { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-height: 28px; padding: 0 8px; border: 1px solid var(--line); background: transparent; color: var(--ink2); border-radius: 4px; font-size: 12px; font-weight: 500; max-width: 160px; position: relative; }
.acct:hover { background: var(--hover); color: var(--ink); }
.acct .ic { width: 15px; height: 15px; flex: none; }
.acct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.cloud-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cloud-stat i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.cloud-stat.ok i { background: var(--ok); }
.cloud-stat.busy i { background: var(--accent); animation: clpulse 1s ease-in-out infinite; }
.cloud-stat.warn { color: var(--warn); }
.cloud-stat.warn i { background: var(--warn); }
@keyframes clpulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cloud-stat.busy i { animation: none; } }
@media (max-width: 900px) { .cloud-stat span { display: none; } .acct span { max-width: 70px; } }
.cl { max-width: 460px; }
.cl-f { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; font-size: 12px; color: var(--ink2); }
.cl-f input { width: 100%; height: 34px; font-size: 14px; }
.cl-msg { min-height: 18px; font-size: 12px; margin: 6px 0; color: var(--muted); }
.cl-msg.err { color: var(--err); }
.cl-msg.ok { color: var(--ok); }
.cl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.cl-alt { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.cl .note a { word-break: break-all; }
.cl:has(.cl-list) { max-width: 640px; }
.cl-list .vrow { grid-template-columns: 1fr auto auto auto; }
.cl-row.cur { background: var(--accent-soft); }
.cl-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); border: 1px solid var(--accent); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
button.danger-bg { background: var(--err); border-color: var(--err); color: #fff; }
.vtabs { margin: 0 0 8px; }
@media (max-width: 600px) { .cl-list .vrow { grid-template-columns: 1fr 1fr 1fr; } .cl-list .vrow .vn { grid-column: 1 / -1; } }
