.bs-shell {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.bs-toolbar,
.bs-section-head,
.bs-subhead,
.bs-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bs-toolbar h2,
.bs-section h3,
.bs-subhead h4,
.bs-subhead h5,
.bs-subsection h5 {
    margin: 0;
}

.bs-toolbar p,
.bs-section-head p {
    margin: 4px 0 0;
    color: var(--muted, #65727b);
}

.bs-save-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    text-align: right;
}

.bs-export-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.bs-save-status {
    color: var(--muted, #65727b);
    font-size: .86rem;
}

.bs-save-status.is-dirty {
    color: #8a6200;
}

.bs-save-status.is-error {
    color: #b3261e;
}

.bs-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border: 1px solid #d9e1e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.bs-summary > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid #e4eaed;
}

.bs-summary > div:last-child {
    border-right: 0;
}

.bs-summary strong {
    color: #20213f;
    font-size: 1.25rem;
}

.bs-summary span {
    color: var(--muted, #65727b);
    font-size: .8rem;
}

.bs-quality {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #d9e1e6;
    border-radius: 8px;
    background: #fff;
}

.bs-quality > div {
    display: grid;
    gap: 3px;
}

.bs-quality strong {
    color: #20333b;
}

.bs-quality span,
.bs-quality summary,
.bs-quality li {
    color: #53636b;
    font-size: .9rem;
}

.bs-quality details {
    flex: 0 0 auto;
}

.bs-quality summary {
    cursor: pointer;
    color: #006f5b;
    font-weight: 700;
}

.bs-quality ul {
    max-width: 560px;
    margin: 10px 0 0;
    padding-left: 20px;
}

.bs-quality.is-open {
    border-color: #e7c575;
    background: #fffaf0;
}

.bs-quality.is-ready {
    border-color: #9ed7bd;
    background: #f1faf5;
}

.bs-readonly,
.bs-empty {
    padding: 14px 16px;
    border: 1px dashed #b9c5cb;
    border-radius: 6px;
    color: var(--muted, #65727b);
    background: #f8fafb;
}

.bs-offline-conflict {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #e7c575;
    border-left: 4px solid #d99513;
    border-radius: 8px;
    background: #fffaf0;
}

.bs-offline-conflict strong { color: #624200; }
.bs-offline-conflict p { margin: 0; color: #6c5b31; }
.bs-offline-conflict > div { display: flex; flex-wrap: wrap; gap: 8px; }

.bs-section {
    min-width: 0;
    padding: 20px;
    border: 1px solid #d9e1e6;
    border-radius: 8px;
    background: #fff;
}

.bs-section-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e4eaed;
}

.bs-item,
.bs-room,
.bs-nested-item {
    min-width: 0;
    margin-top: 10px;
    border: 1px solid #d9e1e6;
    border-radius: 6px;
    background: #fff;
}

.bs-room,
.bs-nested-item {
    background: #fbfcfd;
}

.bs-item > summary,
.bs-room > summary,
.bs-nested-item > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px 8px 14px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.bs-item > summary::-webkit-details-marker,
.bs-room > summary::-webkit-details-marker,
.bs-nested-item > summary::-webkit-details-marker {
    display: none;
}

.bs-item > summary::before,
.bs-room > summary::before,
.bs-nested-item > summary::before {
    content: "›";
    color: #188b79;
    font-size: 1.25rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.bs-item[open] > summary::before,
.bs-room[open] > summary::before,
.bs-nested-item[open] > summary::before {
    transform: rotate(90deg);
}

.bs-item > summary > span,
.bs-room > summary > span,
.bs-nested-item > summary > span {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
}

.bs-detail-body {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 14px;
    border-top: 1px solid #e4eaed;
}

.bs-entry-tools {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -4px;
}

.bs-copy-button {
    min-height: 34px;
    padding: 7px 11px;
}

dialog.bs-copy-modal {
    width: min(560px, calc(100vw - 24px));
}

dialog.bs-copy-modal #modalBody {
    display: block;
}

.bs-copy-dialog-body > p:first-child {
    margin: 0 0 14px;
    color: #50616b;
}

.bs-copy-room-list {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 430px);
    overflow-y: auto;
}

.bs-copy-room {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #d6e0e5;
    border-radius: 6px;
    background: #f8fafb;
    cursor: pointer;
}

.bs-copy-room:has(input:checked) {
    border-color: #188b79;
    background: #eaf7f3;
}

.bs-copy-room input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #188b79;
}

.bs-copy-room span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.bs-copy-room strong,
.bs-copy-room small {
    overflow-wrap: anywhere;
}

.bs-copy-room small {
    color: #65757e;
}

.bs-copy-error {
    margin: 10px 0 0;
}

.bs-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}

.bs-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bs-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bs-fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bs-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    margin: 0;
}

.bs-field > span {
    color: #3e4a51;
    font-size: .78rem;
    font-weight: 700;
}

.bs-field input,
.bs-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
}

.bs-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
}

.bs-input-wrap small {
    align-self: stretch;
    display: grid;
    place-items: center;
    min-width: 42px;
    padding: 0 8px;
    border: 1px solid #c9d3d8;
    border-left: 0;
    border-radius: 0 5px 5px 0;
    background: #eef2f4;
    color: #546169;
}

.bs-input-wrap:has(small) input {
    border-radius: 5px 0 0 5px;
}

.bs-subsection,
.bs-system-group {
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid #e4eaed;
}

.bs-subhead {
    margin-bottom: 10px;
}

.bs-subhead small {
    display: block;
    margin-top: 2px;
    color: var(--muted, #65727b);
}

.bs-layer-list,
.bs-room-list {
    display: grid;
    gap: 8px;
}

.bs-layer-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 2fr) minmax(120px, 1fr) 38px;
    align-items: end;
    gap: 10px;
    min-width: 0;
}

.bs-layer-row > strong {
    align-self: center;
    color: #188b79;
    text-align: center;
}

.bs-inline-item {
    min-width: 0;
    margin-top: 8px;
    padding: 12px;
    border-left: 3px solid #64b5a6;
    background: #f7faf9;
}

.bs-inline-head {
    margin-bottom: 10px;
}

.bs-icon-danger {
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: #a92722;
    font-size: 1.35rem;
}

.bs-icon-danger:hover,
.bs-icon-danger:focus-visible {
    border-color: #e4b8b5;
    background: #fff1f0;
}

.bs-add {
    white-space: nowrap;
}

.bs-window-fields {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.bs-window-config-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(170px, 1fr);
    align-items: stretch;
    gap: 14px;
    min-width: 0;
}

.bs-choice-group,
.bs-window-counters {
    min-width: 0;
    margin: 0;
    padding: 10px;
    border: 1px solid #d9e1e6;
    border-radius: 6px;
    background: #f8fafb;
}

.bs-choice-group legend,
.bs-window-counters legend {
    padding: 0 5px;
    color: #26333a;
    font-size: .78rem;
    font-weight: 800;
}

.bs-choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 6px;
}

.bs-choice {
    display: grid;
    grid-template-rows: 48px auto;
    place-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 76px;
    padding: 7px 6px;
    border: 1px solid #bcc8ce;
    border-radius: 4px;
    background: #fff;
    color: #26333a;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.bs-choice:hover,
.bs-choice:focus-visible {
    border-color: #188b79;
    background: #f1fbf8;
}

.bs-choice.selected {
    border-color: #138777;
    box-shadow: inset 0 0 0 1px #138777;
    background: #dff5ef;
    color: #174a42;
}

.bs-choice-compact .bs-choice-list {
    grid-template-columns: minmax(0, 1fr);
}

.bs-choice-compact .bs-choice {
    display: block;
    min-height: 34px;
    padding: 8px;
}

.bs-glazing-icon {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    width: 52px;
    height: 46px;
    padding-bottom: 4px;
    transform: skewY(-14deg);
}

.bs-glazing-icon i {
    display: block;
    width: 4px;
    height: 38px;
    border: 1px solid #31525a;
    background: #c9f2f3;
}

.bs-glazing-icon.is-wsv i:last-child {
    border-color: #1575b7;
    background: #7fc9f1;
}

.bs-frame-icon {
    position: relative;
    display: block;
    width: 66px;
    height: 46px;
    border-top: 8px solid #cbd2d5;
    border-left: 8px solid #cbd2d5;
    background: #dff8f7;
}

.bs-frame-icon i {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 50px;
    height: 20px;
    border-bottom: 7px solid #e6ebed;
    border-left: 7px solid #e6ebed;
}

.bs-frame-icon.is-wood {
    border-color: #7d471b;
}

.bs-frame-icon.is-wood i {
    border-color: #a45d20;
}

.bs-frame-icon.is-plastic {
    border-color: #f7fafb;
    box-shadow: inset 2px 0 #7d8b91, inset 0 2px #7d8b91;
}

.bs-frame-icon.is-plastic i {
    border-color: #fff;
    box-shadow: -2px 2px #7d8b91;
}

.bs-frame-icon.is-aluminum {
    border-color: #969ea2;
}

.bs-frame-icon.is-aluminum i {
    border-color: #bcc2c5;
}

.bs-division-icon {
    display: block;
    width: 52px;
    height: 44px;
    border: 3px solid #24363c;
    background-color: #dff8f7;
}

.bs-division-icon.is-wing-2 {
    background-image: linear-gradient(90deg, transparent 48%, #24363c 48%, #24363c 53%, transparent 53%);
}

.bs-division-icon.is-wing-3 {
    background-image: linear-gradient(90deg, transparent 32%, #24363c 32%, #24363c 36%, transparent 36%, transparent 65%, #24363c 65%, #24363c 69%, transparent 69%);
}

.bs-division-icon.is-muntin-2 {
    background-image: linear-gradient(90deg, transparent 48%, #24363c 48%, #24363c 53%, transparent 53%), linear-gradient(0deg, transparent 47%, #24363c 47%, #24363c 53%, transparent 53%);
}

.bs-division-icon.is-muntin-4 {
    background-image: linear-gradient(90deg, transparent 48%, #24363c 48%, #24363c 53%, transparent 53%), repeating-linear-gradient(0deg, transparent 0, transparent 20%, #24363c 20%, #24363c 25%);
}

.bs-window-counters {
    display: grid;
    align-content: center;
    gap: 8px;
}

.bs-window-counters .bs-field {
    grid-template-columns: minmax(70px, 1fr) 76px;
    align-items: center;
}

.bs-window-counters .bs-field > span {
    font-weight: 700;
}

.bs-window-dimensions {
    padding-top: 14px;
    border-top: 1px solid #e4eaed;
}

@media (max-width: 1050px) {
    .bs-fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bs-fields-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bs-window-config-row { grid-template-columns: minmax(0, 1fr); }
    .bs-choice-compact .bs-choice-list { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (max-width: 720px) {
    .bs-toolbar,
    .bs-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .bs-save-area {
        align-items: stretch;
        flex-direction: column;
        text-align: left;
    }

    .bs-export-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bs-export-actions button:last-child:nth-child(3) {
        grid-column: 1 / -1;
    }

    .bs-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bs-summary > div,
    .bs-summary > div:last-child {
        border-right: 1px solid #e4eaed;
        border-bottom: 1px solid #e4eaed;
    }

    .bs-quality {
        flex-direction: column;
    }

    .bs-offline-conflict > div { display: grid; grid-template-columns: minmax(0, 1fr); }

    .bs-section {
        padding: 14px;
    }

    .bs-fields-2,
    .bs-fields-3,
    .bs-fields-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .bs-layer-row {
        grid-template-columns: 28px minmax(0, 1fr) 38px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e4eaed;
    }

    .bs-layer-row .bs-field:first-of-type {
        grid-column: 2;
    }

    .bs-layer-row .bs-field:nth-of-type(2) {
        grid-column: 2;
    }

    .bs-layer-row .bs-icon-danger {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .bs-subhead {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bs-add {
        white-space: normal;
    }

    .bs-choice-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bs-choice-division .bs-choice-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bs-choice-compact .bs-choice-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* building-survey-room-profiles-v2 */
.bs-field-wide { grid-column: 1 / -1; }
.bs-field textarea {
    width: 100%; min-height: 92px; resize: vertical; font: inherit; color: inherit;
    border: 1px solid var(--line, #d8e0e5); border-radius: 6px; padding: 10px 12px; background: #fff;
}
.bs-room-profile-meta {
    min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
    padding: 9px 12px; border: 1px solid #dce6e9; border-radius: 6px; background: #f7fafb; color: #53646d;
}
.bs-room-profile-meta strong { color: #142f5b; }
.bs-unassigned-roof-windows {
    margin: 18px 0; padding: 16px; border: 1px solid #e4b34a; border-left: 4px solid #e4a11b;
    border-radius: 7px; background: #fffaf0;
}
.bs-roof-window-assignment {
    display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; margin-top: 14px;
}
@media (max-width: 720px) { .bs-roof-window-assignment { grid-template-columns: 1fr; } }
