.layout-workspace { display: grid; grid-template-columns: minmax(245px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.layout-tools, .layout-preview, .layout-summary { background: white; border: 1px solid #d8e0e5; border-radius: 10px; padding: clamp(13px, 2vw, 24px); }
.layout-tools h2, .layout-preview h2, .layout-summary h2 { margin: 0 0 10px; }
.layout-summary { margin-block: 18px; }
.layout-caption { color: #51616a; font-size: .875rem; margin: 8px 0; }
.layout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.layout-fields label { display: grid; align-content: end; gap: 3px; font-size: .82rem; }
.layout-fields label[hidden] { display: none; }
.layout-fields input { width: 100%; min-width: 0; box-sizing: border-box; padding: 7px; border: 1px solid #aebbc4; border-radius: 5px; }
.layout-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 9px; align-items: center; }
.layout-buttons button { font: inherit; font-size: .875rem; font-weight: 600; color: #253745; background: #fff; border: 1px solid #c4d0d8; border-radius: 5px; padding: 7px 9px; cursor: pointer; }
.layout-buttons button:hover, .layout-buttons button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: #fff4f4; }
.layout-preview svg { display: block; width: 100%; height: clamp(270px, 42vw, 530px); border: 1px solid #d8e0e5; border-radius: 8px; background: #edf2f5; }
.layout-preview svg [data-item] { cursor: grab; touch-action: none; }
.layout-preview #layout-size { font-size: .8rem; color: #51616a; font-weight: 500; }
.layout-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.layout-counts span { background: #f3f6f8; border-radius: 6px; padding: 8px; }
.layout-counts strong { color: var(--accent); padding-inline-end: 5px; }
.layout-message { color: #8a2828; font-size: .875rem; margin: 0; min-height: 1.5em; }
@media (max-width: 760px) {
    .layout-workspace { grid-template-columns: minmax(0, 1fr); }
}
.layout-preview { padding: clamp(12px, 1.8vw, 20px); }
.layout-preview h2 { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.layout-preview svg { background: #eaf0f4; border-color: #cbd8e0; }
.layout-tools h2, .layout-preview h2 { font-size: clamp(19px, 2vw, 23px); }
#layout-edit { margin-top: 16px; padding-top: 14px; border-top: 1px solid #d8e0e5; }
#layout-selection { margin: 0 0 10px; font-size: 16px; }
.layout-legend { display: flex; flex-wrap: wrap; gap: 5px 15px; list-style: none; margin: 8px 0; padding: 0; font-size: 13px; color: #425866; }
.layout-legend li::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; background: #ac3e33; }
.layout-legend li:nth-child(2)::before { background: #485b6b; }
.layout-legend li:nth-child(3)::before { background: #286a83; }
.layout-legend li:nth-child(4)::before { background: #8f621b; }
#layout-elevation { margin: 9px 0 0; padding-top: 10px; border-top: 1px solid #d8e0e5; }
#layout-elevation figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; color: #425866; font-size: 13px; }
#layout-elevation svg { height: 105px; background: #f4f7f9; }
.layout-view-tools { margin: 9px 0; }
.layout-view-tools output { min-width: 3.2em; text-align: center; color: #425866; font-variant-numeric: tabular-nums; }
.layout-view-tools button:disabled { opacity: .48; cursor: default; }
#layout-drawing[data-pan], #layout-drawing[data-pan] [data-item] { cursor: grab; touch-action: none; }
#layout-drawing[data-pan]:active, #layout-drawing[data-pan]:active [data-item] { cursor: grabbing; }
