@media (max-width: 1050px) {
    .workspace { grid-template-columns: 90px minmax(520px, 1fr) 90px; }
    .production-area { padding-right: 22px; padding-left: 22px; }
}

@media (min-width: 801px) {
    body.details-mode .workspace { grid-template-columns: minmax(220px, 260px) minmax(560px, 1fr) minmax(220px, 260px); }
    body.details-mode .side-panel { padding-right: 18px; padding-left: 18px; overflow-y: auto; }
    body.details-mode .catalog-panel .panel-heading,
    body.details-mode .finished-panel .panel-heading { justify-content: space-between; }
    body.details-mode .catalog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
    body.details-mode .catalog-item { justify-items: center; }
    body.details-mode .finished-list { justify-items: stretch; align-content: start; }
    body.details-mode .finished-object { width: 100%; justify-items: start; grid-template-columns: 67px 1fr; padding: 7px; }
    body.details-mode .finished-object .unit-badge { right: 6px; }
    body.details-mode .side-trash { min-height: 74px; }
}

.side-trash { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 58px; margin-top: 18px; padding: 9px 5px; border: 1px dashed #cbd5ce; border-radius: 12px; color: #8d9991; background: rgba(255,255,255,.34); text-align: center; transition: border-color .2s, background .2s, color .2s, transform .2s; }
.side-trash:hover, .side-trash.is-drop-target { border-color: var(--red); color: var(--red); background: #fff4f2; transform: translateY(-2px); }
.trash-symbol { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #9aa59d; background: #edf1ed; font-size: 21px; line-height: 1; transform: rotate(180deg); }
.side-trash small { font-size: 8px; }

.user-menu-wrap { position: relative; }
.user-menu { position: absolute; z-index: 20; top: calc(100% + 11px); right: 0; width: 204px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: 0 16px 35px rgba(29, 43, 38, .14); }
.user-menu[hidden] { display: none; }
.user-menu-heading { display: flex; align-items: center; gap: 9px; padding: 8px 8px 11px; border-bottom: 1px solid #eef1ef; }
.avatar-small { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: var(--purple); background: #f0edff; font-size: 9px; font-weight: 800; }
.user-menu-heading strong, .user-menu-heading small { display: block; }.user-menu-heading strong { font-size: 11px; }.user-menu-heading small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 8px; border-radius: 8px; color: var(--ink); background: transparent; font-size: 11px; text-align: left; }.user-menu-item:hover { color: var(--purple); background: #f7f5ff; }.user-menu-item span { width: 17px; color: var(--purple); font-size: 15px; text-align: center; }.user-menu-item.is-muted { color: var(--muted); }.user-menu-item small { margin-left: auto; color: #a9b1ad; font-size: 8px; }

@media (max-width: 800px) {
    .workspace { display: block; }
    .side-panel { min-height: 100px; border: 0; border-bottom: 1px solid var(--line); overflow: visible; }
    .catalog-list, .finished-list { grid-template-columns: repeat(4, 1fr); min-height: 0; }
    .catalog-panel .panel-heading, .finished-panel .panel-heading { justify-content: space-between; }
    .panel-toggle { display: none; }
    .production-area { padding: 18px 12px; }
    .bench-surface { min-height: 600px; }
    .side-trash { width: 100%; margin-top: 14px; }
}

@media (max-width: 560px) {
    .topbar { padding: 0 14px; }
    .topbar-actions { gap: 7px; }
    .mode-toggle span:last-child { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .item-art.object-art { width: 116px; height: 116px; }
    .component-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-list, .finished-list { grid-template-columns: repeat(2, 1fr); }
    .user-menu { right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
