.mebel { border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: var(--s-4); background: var(--c-surface); }
.mebel-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.mebel-toolbar label { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; }
.mebel [aria-pressed="true"] { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.mebel-layout { display: grid; gap: var(--s-4); min-width: 0; }
.mebel-properties, .mebel-workspace, .mebel-parts { min-width: 0; }
.mebel-properties { max-height: 560px; overflow: auto; padding: var(--s-2); border: 1px solid var(--c-border); border-radius: var(--radius); }
.mebel-properties > select + button { margin-top: var(--s-3); margin-bottom: var(--s-4); }
.mebel-form { display: grid; gap: var(--s-3); margin-bottom: var(--s-5); }
.mebel-form label { display: grid; gap: var(--s-1); }
.mebel input:not([type="checkbox"]), .mebel select { min-width: 0; width: 100%; min-height: 46px; font-size: 1rem; }
.mebel-toolbar select { width: auto; max-width: 100%; }
.mebel-form fieldset { min-width: 0; }
.mebel-form h3 { margin: var(--s-2) 0; }
.mebel-error:empty { display: none; }
.mebel-error { color: var(--c-error); border: 1px solid currentColor; padding: var(--s-3); margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.mebel-drawing, .mebel-three { height: 440px; min-width: 0; background: var(--c-surface-alt); border-radius: var(--radius); overflow: hidden; }
.mebel-drawing svg { width: 100%; height: 100%; }
.mebel-panel { fill: var(--c-accent-soft); stroke: var(--c-text); stroke-width: 1.5; cursor: pointer; }
.mebel-panel--selected { fill: var(--c-accent); stroke-width: 3; }
.mebel-selected { background: var(--c-accent-soft); }
.mebel-parts { margin-top: var(--s-5); font-variant-numeric: tabular-nums; }
.mebel-parts td { white-space: nowrap; }
.mebel-parts td:first-child { white-space: normal; min-width: 160px; }
.mebel--fullscreen { position: fixed; inset: 0; z-index: 10000; border-radius: 0; overflow: auto; }
html.mebel-fs-lock { overflow: hidden; }
@media (min-width: 800px) { .mebel-layout { grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); } }
@media (max-width: 479px) { .mebel { padding: var(--s-2); } .mebel-drawing, .mebel-three { height: 320px; } }
@media print { .mebel { border: 0; padding: 0; } .mebel-layout { display: block; } .mebel-properties, .mebel-three { display: none !important; } .mebel-drawing { display: block !important; height: 100mm; break-inside: avoid; } .mebel-parts .table-wrap { overflow: visible; } .mebel-parts button { display: inline !important; color: inherit; background: none; border: 0; padding: 0; box-shadow: none; } .mebel-parts td { white-space: normal; } }

.mebel [hidden] { display: none !important; }
.mebel-manufacturing { min-width: 0; }
.mebel-manufacturing details { margin-bottom: var(--s-4); }
.mebel-manufacturing summary { cursor: pointer; padding: var(--s-3) 0; font-weight: 600; }
.mebel-manufacturing .mebel-form { padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--radius); grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); }
.mebel-manufacturing .mebel-form h3 { grid-column: 1 / -1; }
.mebel-cut-map { margin: var(--s-4) 0; break-inside: avoid; }
.mebel-cut-map svg { display: block; width: 100%; max-height: 620px; background: var(--c-surface-alt); }
.mebel-cut-map text { fill: var(--c-text); }
.mebel-sheet { fill: var(--c-surface); stroke: var(--c-text); }
.mebel-remnant { fill: var(--c-surface-alt); stroke: var(--c-border); stroke-dasharray: 4 3; }
.mebel-manufacturing td { font-variant-numeric: tabular-nums; }
@media print { .mebel-stale-output { display: none !important; } .mebel-manufacturing .table-wrap { overflow: visible; } .mebel-manufacturing table { font-size: 9pt; } .mebel-manufacturing details:not(.no-print) { display: block; } .mebel-cut-map svg { max-height: 160mm; } }

.mebel-projects { margin: var(--s-4) 0; padding: var(--s-4); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface-alt); }
.mebel-project-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-border); }
.mebel-project-row strong { flex: 1 1 180px; }
.mebel-project-row span { font-size: .875rem; }

.mebel-commandbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); position: relative; z-index: 5; }
.mebel-primary-actions { display: flex; gap: var(--s-2); margin-right: auto; }
.mebel-quick-tools { display: flex; gap: var(--s-1); padding-left: var(--s-3); border-left: 1px solid var(--c-border); }
.mebel .mebel-icon-button { width: 44px; min-width: 44px; height: 44px; padding: 0; font-size: 24px; line-height: 1; border-color: transparent; background: transparent; box-shadow: none; color: var(--c-text); }
.mebel .mebel-icon-button:disabled { opacity: .35; }
.mebel-more { position: relative; }
.mebel-more > summary { list-style: none; display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3); border: 1px solid var(--c-border); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.mebel-more > summary::-webkit-details-marker { display: none; }
.mebel-more > summary::after { content: '⌄'; }
.mebel-more[open] > summary { background: var(--c-surface-alt); }
.mebel-more-content { position: absolute; right: 0; top: calc(100% + var(--s-2)); width: 272px; max-width: calc(100vw - 32px); padding: var(--s-2); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); box-shadow: var(--shadow-pop); max-height: 70vh; overflow: auto; }
.mebel-menu-group + .mebel-menu-group { border-top: 1px solid var(--c-border); margin-top: var(--s-2); padding-top: var(--s-2); }
.mebel-menu-group > p { margin: var(--s-1) var(--s-2); }
.mebel .mebel-menu-group > button { display: block; width: 100%; min-height: 44px; text-align: left; margin: 0; padding: var(--s-2); border-color: transparent; box-shadow: none; background: transparent; color: var(--c-text); font-weight: 400; }
.mebel .mebel-menu-group > button:hover { background: var(--c-surface-alt); }
.mebel .mebel-menu-group > button:disabled { opacity: .45; }
@media (max-width: 599px) { .mebel-commandbar { flex-wrap: wrap; gap: var(--s-2); } .mebel-primary-actions { width: 100%; margin: 0; } .mebel-primary-actions > button { flex: 1; padding-inline: var(--s-2); } .mebel-quick-tools { border: 0; padding: 0; margin-right: auto; } }

.mebel-catalog-list { display: grid; gap: var(--s-2); margin-block: var(--s-3); }
.mebel-example-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: var(--s-4); }
.mebel-example-grid article { padding: var(--s-4); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); }
.mebel-example-grid h3 { margin-top: 0; }
@media(max-width:599px) { .mebel-primary-actions { flex-wrap: wrap; } }

/* Standalone action groups wrap with the same spacing as toolbar actions. */
.mebel-properties > button, .mebel-manufacturing > button, .mebel-manufacturing details > button { margin-inline-end: var(--s-2); margin-bottom: var(--s-3); }

.mebel-projects > button { margin-bottom:var(--s-4); }

.mebel-example-preview { display:block; width:100%; height:160px; margin-bottom:var(--s-3); background:var(--c-bg); border-radius:var(--radius); }

.mebel-manufacturing .kv { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:var(--s-2) var(--s-4); max-width:36rem; margin-block:var(--s-4); }
.mebel-manufacturing .kv dt, .mebel-manufacturing .kv dd { margin:0; }
.mebel-manufacturing .kv dd { text-align:right; font-weight:600; }
.mebel-manufacturing .result-main { font-size:1.25rem; font-weight:700; margin-block:var(--s-4); }