:root {
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #1e2126;
  --muted: #6b7079;
  --line: #e2ded6;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe9;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --err: #b83232;
  --err-soft: #fbe9e9;
  --ok: #2f7d4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0 0 .6em; font-weight: 600; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
button, .btn {
  font: inherit; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; padding: .5em 1em; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: .4em; white-space: nowrap;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; }
/* кнопки рекомендації: виділені; .pulse — блимає, поки рекомендацію не застосовано */
button.rec { font-weight: 700; }
button.rec.pulse { animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 94, .7); filter: brightness(1); }
  50% { box-shadow: 0 0 0 7px rgba(47, 111, 94, 0); filter: brightness(1.2); }
}
@media (prefers-reduced-motion: reduce) { button.rec.pulse { animation: none; outline: 2px solid var(--ink); } }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button.icon { background: transparent; border: none; color: var(--muted); padding: .2em .45em; }
button.small, .btn.small { padding: .25em .6em; font-size: .85rem; }
input, select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 7px; padding: .45em .6em; background: #fff;
  color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.need { border-color: var(--warn); background: var(--warn-soft); }
label { display: block; font-size: .85rem; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: .2em; }
.small { font-size: .85rem; color: var(--muted); }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: #1f2a27; color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 1.2rem; cursor: pointer; letter-spacing: .02em; }
.brand b { color: #9fd3bf; }
.project-meta { flex: 1; color: #cfd8d4; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: .5rem; align-items: center; }
.top-actions select { width: auto; background: #2c3a36; color: #fff; border-color: #3d4d48; }
.topbar button.ghost { color: #d7ede4; border-color: #4b6b61; }

.progress {
  display: flex; gap: 2px; padding: .6rem 1.2rem; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto; position: sticky; top: 52px; z-index: 15;
}
.progress .step {
  flex: 1 0 auto; min-width: 88px; font-size: .78rem; color: var(--muted); padding: .35em .5em .45em;
  border-top: 4px solid var(--line); cursor: default; background: none; border-radius: 0; border-left: 0;
  border-right: 0; border-bottom: 0; text-align: left; display: block;
}
.progress .step.done { border-top-color: #8fc4b1; color: var(--ink); cursor: pointer; }
.progress .step.current { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }
.progress .step .n { display: block; font-size: .7rem; opacity: .7; }

main { max-width: 1280px; margin: 0 auto; padding: 1.2rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: .8rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: .8rem; } }

.note { border-radius: 8px; padding: .6em .8em; margin: .4em 0; font-size: .92rem; }
.note.warn { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.note.err { background: var(--err-soft); border-left: 4px solid var(--err); }
.note.ok { background: var(--accent-soft); border-left: 4px solid var(--ok); }
.note.info { background: #eef2f7; border-left: 4px solid #6c8ab3; }

.drop {
  border: 2px dashed #bfc9c4; border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted);
  background: #fafaf8; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.thumb { width: 170px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 130px; object-fit: cover; display: block; }
.thumb .pdf { height: 130px; display: grid; place-items: center; font-size: 2rem; color: var(--muted); }
.thumb .cap { display: flex; align-items: center; justify-content: space-between; padding: .3em .5em; font-size: .8rem; }

.section-card { border: 1px solid var(--line); border-radius: 9px; padding: .8rem; background: #fcfbf9; }
.section-card h3 { display: flex; align-items: center; gap: .5rem; }
.el-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 30px; gap: .4rem; align-items: end; margin: .5rem 0; padding-top: .45rem; border-top: 1px dashed var(--line); }
.el-row > label:nth-child(n+4) { grid-column: 1 / -1; }
.el-row > label:nth-child(4):not(:last-child) { grid-column: 1 / 2; }
.el-row > label:nth-child(5) { grid-column: 2 / -1; }
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; }

.svgbox { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
.svgbox svg { width: 100%; height: auto; max-height: 72vh; display: block; }
.tabs { display: flex; gap: .3rem; margin-bottom: .7rem; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border-color: var(--line); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
#viewer3d { width: 100%; height: 560px; border-radius: 8px; overflow: hidden; background: #eceae5; position: relative; }
#viewer3d canvas { display: block; }
.renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; margin-top: .8rem; }
.renders img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }

table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--line); padding: .4em .5em; text-align: left; vertical-align: middle; }
th { background: #f1efea; font-weight: 600; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td select { width: 64px; padding: .2em; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }

.tree { font-family: Consolas, "Cascadia Mono", monospace; font-size: .86rem; white-space: pre; line-height: 1.55; overflow-x: auto; }
.tree .k { color: var(--accent); font-weight: 600; }
.tree .d { color: var(--muted); }

.sheet-card { margin-bottom: 1rem; }
.stat { display: inline-block; padding: .2em .6em; background: #f1efea; border-radius: 6px; margin-right: .4em; font-size: .85rem; }

.chat {
  position: fixed; right: 1rem; bottom: 1rem; width: min(420px, calc(100vw - 2rem)); height: min(620px, calc(100vh - 7rem));
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; z-index: 40;
}
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.msg { padding: .5em .7em; border-radius: 9px; max-width: 92%; white-space: pre-wrap; font-size: .92rem; }
.msg.user { align-self: flex-end; background: var(--accent-soft); }
.msg.assistant { align-self: flex-start; background: #f1efea; }
.msg.system { align-self: center; font-size: .8rem; color: var(--muted); }
.msg .changes { margin: .4em 0; font-size: .85rem; }
.msg .changes div { font-family: Consolas, monospace; }
.chat-form { border-top: 1px solid var(--line); padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.chat-form .row { justify-content: space-between; }
.inline-chat { height: 520px; position: static; width: auto; box-shadow: none; }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: #1f2a27; color: #fff;
  padding: .6em 1em; border-radius: 8px; z-index: 60; max-width: 90vw;
}
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.proj { cursor: pointer; }
.proj:hover { border-color: var(--accent); }
.diff { font-family: Consolas, monospace; font-size: .85rem; }
.diff .old { color: var(--err); text-decoration: line-through; }
.diff .new { color: var(--ok); font-weight: 600; }
kbd { background: #eee; border-radius: 4px; padding: 0 .3em; font-size: .85em; }
.columns-box { margin-top: .6rem; padding: .5rem; border: 1px dashed #bfc9c4; border-radius: 8px; background: #fff; }
.columns-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .4rem; margin-top: .3rem; }
.column-card { border: 1px solid var(--line); border-radius: 7px; padding: .4rem; background: #fcfbf9; }
[hidden] { display: none !important; }
.danger-icon { font-size: 1.05rem; opacity: .55; }
.danger-icon:hover { opacity: 1; color: var(--err); background: var(--err-soft); border-radius: 6px; }

/* документи (privacy / terms) */
.doc { max-width: 46rem; margin: 0 auto; padding: 2.2rem 1.2rem 3rem; }
.doc h1 { font-size: 1.8rem; margin-bottom: .3rem; }
.doc .meta { color: var(--muted); font-size: .85rem; margin-bottom: 1.8rem; }
.doc h2 { font-size: 1.12rem; margin: 1.8rem 0 .6rem; }
.doc p, .doc li { line-height: 1.6; color: #3b3f46; }
.doc a, .site-footer a, .auth-box a { color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 1rem; text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.7; }

/* вхід / реєстрація */
.auth-box { max-width: 440px; margin: 2.5rem auto; }
.auth-box label { margin-top: .6rem; }
.auth-box .consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; color: var(--muted); margin-top: .8rem; }
.auth-box .consent input { width: auto; margin-top: .2rem; }
.user-chip { color: #cfd8d4; font-size: .85rem; }

/* адмінка */
.kpi { flex: 1; min-width: 160px; margin-bottom: 0; }
.kpi b { font-size: 1.4rem; display: block; margin-top: .2rem; }
.stat.st-paid { background: var(--accent-soft); color: var(--ok); }
.stat.st-failed { background: var(--err-soft); color: var(--err); }

/* оплата на кроці «Експорт» */
.paywall { border: 2px solid var(--accent); background: linear-gradient(180deg, #f5faf8, #fff); }
.paywall .price { font-size: 2rem; font-weight: 700; color: var(--accent); }
.locked .section-card { opacity: .55; }
/* кнопки з класом .small не мають успадковувати сірий колір тексту підписів */
a.btn.small:not(.ghost), button.small:not(.ghost):not(.icon) { color: var(--accent-ink); }
.table-wrap a, .paywall a { color: var(--accent); }

/* обов'язкове поле цеху, ще не заповнене */
input.req-missing { border-color: var(--err); background: var(--err-soft); box-shadow: 0 0 0 1px var(--err); }
input.req-missing::placeholder { color: var(--err); opacity: .75; }

/* застосунок: підвал притиснутий донизу вікна, навіть коли вмісту мало */
body.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
body.app-layout > main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
body.app-layout > .site-footer { flex-shrink: 0; }

/* звернення користувачів (feedback.js, як у Meblens) */
/* звернення замовників (feedback.js) */
.panel > .fb-badge { display: inline-block; min-width: 1.2em; padding: 0 .35em; margin-left: .35rem; border-radius: 999px; background: var(--err); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5; }
.kb-link[hidden] { display: none; }
#fb-root { position: fixed; z-index: 9000; inset: auto 0 0 auto; font-family: inherit; }
.fb-fab { position: fixed; right: 18px; bottom: 18px; z-index: 9001; border-radius: 999px; padding: .6rem 1rem; font-weight: 700; font-size: .88rem;
  background: #1f2a27; color: #fff; border: 0; box-shadow: 0 8px 24px -8px rgba(0,0,0,.45); cursor: pointer; }
.fb-fab:hover { background: #2b3a36; }
.fb-fab[hidden] { display: none; }
.fb-menu, .fb-modal { background: #fff; border-radius: 14px; box-shadow: 0 18px 50px -12px rgba(0,0,0,.35); padding: .9rem 1rem; color: var(--ink); }
.fb-menu { position: fixed; right: 18px; bottom: 70px; width: 300px; z-index: 9002; }
.fb-menu p { font-size: .82rem; color: #6b665d; margin: .3rem 0 .6rem; }
.fb-menu-h { display: flex; align-items: center; gap: .5rem; }
.fb-menu-h b { flex: 1; font-size: 1rem; }
.fb-x { background: none; border: 0; font-size: 1rem; cursor: pointer; color: #6b665d; padding: .2rem .4rem; box-shadow: none; }
.fb-opt { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: #faf7f1; color: var(--ink); border: 1px solid #e6dfd2; border-radius: 10px; padding: .55rem .7rem; margin-bottom: .4rem; cursor: pointer; box-shadow: none; }
.fb-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.fb-opt span { font-size: .78rem; color: #6b665d; font-weight: 400; }
.fb-menu-link { display: block; text-align: right; font-size: .85rem; margin-top: .2rem; color: var(--accent); }
.fb-layer { position: fixed; inset: 0; z-index: 9003; cursor: crosshair; }
.fb-zone-layer { background: rgba(20,24,22,.18); }
.fb-el-layer { cursor: pointer; }
.fb-tip { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #1f2a27; color: #fff; padding: .45rem .9rem; border-radius: 999px; font-size: .85rem; pointer-events: none; }
.fb-rect { position: fixed; border: 3px solid #e0453a; background: rgba(224,69,58,.10); border-radius: 4px; pointer-events: none; }
.fb-rect[hidden] { display: none; }
.fb-modal-wrap { position: fixed; inset: 0; z-index: 9004; background: rgba(20,24,22,.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.fb-modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.fb-prev { width: 100%; border-radius: 8px; border: 1px solid #e6dfd2; margin: .5rem 0 .3rem; max-height: 340px; object-fit: contain; background: #f4f1ec; }
.fb-lbl { font-size: .8rem; font-weight: 700; margin: .7rem 0 .3rem; color: #4d4a44; }
.fb-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.fb-chip { display: flex; flex-direction: column; align-items: flex-start; background: #fff; color: var(--ink); border: 1px solid #d8cdb8; border-radius: 10px; padding: .4rem .65rem; cursor: pointer; font-weight: 600; font-size: .88rem; box-shadow: none; }
.fb-chip small { font-weight: 400; font-size: .72rem; color: #6b665d; }
.fb-chip.fb-sm { flex-direction: row; font-size: .82rem; }
.fb-chip.on { border-color: #1f2a27; background: #1f2a27; color: #fff; }
.fb-chip.on small { color: #d9d4ca; }
.fb-modal textarea { width: 100%; }
.fb-row { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .9rem; }
.fb-cancel { background: #fff; color: var(--ink); border: 1px solid #d8cdb8; }
.fb-muted { font-size: .82rem; color: #6b665d; }
.fb-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fb-filters { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.fb-filters select { width: auto; }
.fb-list { display: flex; flex-direction: column; gap: .45rem; }
.fb-item { display: block; padding: .65rem .8rem; border: 1px solid #e6dfd2; border-radius: 12px; color: var(--ink); text-decoration: none; background: #fff; }
.fb-item:hover { border-color: var(--accent); }
.fb-item.unread { border-left: 4px solid var(--err); }
.fb-item-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.fb-item-text { margin: .3rem 0 .2rem; }
.fb-when { margin-left: auto; font-size: .78rem; color: #6b665d; }
.fb-dot { color: var(--err); font-size: .8rem; }
.fb-type { font-size: .85rem; font-weight: 600; }
.fb-st { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: #eee; }
.fb-st-new { background: #e8eefc; color: #2b4c9b; }
.fb-st-review, .fb-st-planned { background: var(--accent-soft); color: var(--accent); }
.fb-st-progress { background: #fff1d6; color: #8a5a00; }
.fb-st-need { background: #fde9dc; color: #a0461a; }
.fb-st-done { background: #e3f1e8; color: #2d6a45; }
.fb-st-rej { background: #eee; color: #777; }
.fb-st-high { background: var(--err-soft); color: var(--err); }
.fb-back { display: inline-block; margin-bottom: .5rem; font-size: .88rem; }
.fb-text { white-space: pre-wrap; margin: .7rem 0; font-size: 1rem; }
.fb-meta { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .6rem; font-size: .9rem; }
.fb-shot { max-width: 100%; border: 1px solid #e6dfd2; border-radius: 10px; display: block; }
.fb-admin-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .9rem 0; padding: .6rem; background: var(--accent-soft); border-radius: 10px; }
.fb-admin-row select { width: auto; }
.fb-admin-row input { flex: 1; min-width: 180px; }
.fb-thread { display: flex; flex-direction: column; gap: .45rem; }
.fb-msg { max-width: 80%; padding: .5rem .75rem; border-radius: 12px; white-space: pre-wrap; }
.fb-msg.from-user { background: #f3efe7; align-self: flex-start; }
.fb-msg.from-admin { background: #1f2a27; color: #fff; align-self: flex-end; }
.fb-msg.from-admin .fb-muted { color: #cfc9be; }
.fb-msg-st { align-self: center; font-size: .78rem; color: #6b665d; background: #faf7f1; border-radius: 999px; padding: .15rem .7rem; }
.fb-reply { display: flex; gap: .5rem; align-items: flex-end; margin-top: .7rem; }
.fb-reply textarea { flex: 1; }
.fb-tech { margin-top: 1rem; font-size: .85rem; }
.fb-tech pre { white-space: pre-wrap; font-size: .75rem; background: #faf7f1; padding: .5rem; border-radius: 8px; max-height: 240px; overflow: auto; }
body.fb-picking * { cursor: pointer !important; }
@media (max-width: 640px) { .fb-fab { right: 12px; bottom: 12px; } .fb-menu { right: 12px; left: 12px; width: auto; } .fb-msg { max-width: 92%; } }
.fb-howto { margin: .6rem 0; padding: .55rem .8rem; border: 1px solid #e6dfd2; border-radius: 10px; background: #faf7f1; font-size: .9rem; }
.fb-howto summary { cursor: pointer; font-weight: 700; }
.fb-howto ol { margin: .5rem 0 .4rem 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.fb-howto p { margin: .35rem 0; }


.fb-howto { margin: .6rem 0; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #faf8f4; font-size: .9rem; }
.fb-howto summary { cursor: pointer; font-weight: 700; }
.fb-howto ol { margin: .5rem 0 .4rem 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.fb-howto p { margin: .35rem 0; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .45em; margin-left: .4rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; vertical-align: middle; text-align: center; }
button.act-add:not(.ghost):not(.icon), .btn.act-add { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
button.act-add:not(.ghost):not(.icon):hover { background: var(--accent); color: #fff; }
button.act-del:not(.ghost):not(.icon) { background: var(--err-soft); color: var(--err); border: 1px solid var(--err); }
.kb-link { color: #d7ede4; text-decoration: none; font-size: .9rem; white-space: nowrap; }
.kb-link[hidden] { display: none; }
button.small.danger:not(.ghost):not(.icon) { color: var(--err); }

/* картка деталі (як у Meblens): групи дій — Додати (зелені) / Змінити / Прибрати (червоні) / Допомога */
.part-card { margin-top: .7rem; border: 1px solid #cfe3da; background: #f7fbf9; border-radius: 12px; padding: .6rem .8rem; box-shadow: var(--shadow); }
.part-card[hidden], .extra-form[hidden] { display: none; }
.part-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.part-grp { margin-top: .55rem; padding: .45rem .55rem .5rem; border-radius: 10px; border-left: 4px solid var(--line); background: rgba(255,255,255,.7); }
.part-grp-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-size: .85rem; }
.grp-add { border-left-color: var(--ok); } .grp-add .part-grp-h b { color: var(--ok); }
.grp-del { border-left-color: var(--err); } .grp-del .part-grp-h b { color: var(--err); }
.grp-help { background: transparent; }
button.act-edit:not(.ghost):not(.icon) { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.act-edit:not(.ghost):not(.icon):hover { border-color: var(--accent); background: var(--accent-soft); }
button.act-help:not(.ghost):not(.icon) { background: transparent; color: var(--ink); border: 1px dashed var(--line); }
.part-hint { flex-basis: 100%; color: var(--muted); }
.part-choice { width: auto; font-size: .85rem; padding: .25em .5em; }

/* 3D-інструменти, зона для чату, бібліотека модулів (як у Meblens) */
.v3d-tools { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: .5rem; }
.tb-group { display: flex; flex-wrap: wrap; gap: .25rem; padding-right: .6rem; border-right: 1px solid var(--line); }
.tb-group:last-child { border-right: 0; }
button.tb { padding: .25rem .55rem; font-size: .78rem; }
button.tb.on, button.tb.on:hover { background: #1f2a27 !important; color: #fff !important; border-color: #1f2a27; }
button.tb.warn { border-color: var(--warn); color: var(--warn); }
.tb-view { width: auto; font-size: .78rem; padding: .25rem .5rem; }
.zone-chip { display: flex; align-items: center; gap: .5rem; margin: .4rem 0; padding: .4rem .6rem; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); font-size: .88rem; }
.zone-chip[hidden] { display: none; }
.zone-chip span { flex: 1; }
.lib-modal { position: fixed; inset: 0; z-index: 8000; background: rgba(20,24,22,.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow: auto; }
.lib-box { width: min(980px, 100%); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.lib-card { border: 1px solid var(--line); border-radius: 10px; padding: .5rem; background: #fff; display: flex; flex-direction: column; gap: .35rem; }
.lib-card img { width: 100%; height: 120px; object-fit: contain; background: #faf8f4; border-radius: 6px; }
