.dna-page { max-width: 1160px; }
.dna-columns { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.dna-columns > *, .dna-form-row > * { min-width: 0; }
.dna-map-panel { grid-template-columns: minmax(0, 1fr); }
.dna-map-panel > * { min-width: 0; }
.dna-drawing { position: relative; width: 100%; height: clamp(270px, 30vw, 360px); }
.dna-drawing svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.dna-ground { fill: var(--bg-panel); }
.dna-house-wall { fill: var(--bg-card); stroke: var(--text-secondary); stroke-width: 3; }
.dna-roof { fill: var(--accent-primary); }
.dna-line { fill: none; stroke: var(--text-secondary); stroke-width: 3; }
.dna-window { fill: var(--bg-panel); stroke: var(--accent-primary); stroke-width: 3; }
.dna-door, .dna-equipment, .dna-basement { fill: var(--border-subtle); stroke: var(--text-secondary); stroke-width: 2; }
.dna-page .dna-hotspot { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: block; width: auto; background: var(--bg-card); border: 1px solid var(--accent-primary); color: var(--text-primary); min-height: 44px; min-width: 44px; padding: 5px 9px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.dna-page .dna-hotspot.is-selected, .dna-page .dna-part-button.is-selected { background: var(--bg-card); color: var(--text-primary); outline: 3px solid var(--accent-primary); outline-offset: 2px; }
.dna-part-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dna-page .dna-part-button { display: block; width: 100%; text-align: left; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); border-radius: 7px; min-height: 56px; padding: 9px 12px; cursor: pointer; overflow-wrap: anywhere; }
.dna-part-button span, .dna-part-button small { display: block; }
.dna-part-button small { font-size: 12px; margin-top: 4px; }
.dna-layout-options { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 18px; }
.dna-layout-options label { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.dna-layout-options input { width: 20px; height: 20px; }
.dna-layout-details > summary, [data-previous-buildings] > summary { min-height: 44px; line-height: 44px; font-weight: 600; }
.dna-layout-details [data-layout-summary] { display: block; line-height: 1.5; font-weight: 400; margin-block: 8px; }
.dna-previous-building-list { display: grid; gap: 8px; }
.dna-view-switch { display: flex; gap: 8px; }
.dna-view-switch button { flex: 1; min-height: 44px; }
.dna-view-switch [aria-pressed="true"] { background: var(--accent-primary); color: var(--bg-card); }
.dna-catalog > details > summary { min-height: 44px; padding-block: 10px; }
.dna-page [data-catalog-view][hidden], .dna-page [data-drawing-view][hidden] { display: none; }
.dna-page .dna-columns { grid-template-columns: minmax(0, 1fr); }
.dna-detail-page { max-width: 900px; }
.dna-editor > details > summary { min-height: 44px; padding-block: 10px; font-weight: 600; }
.dna-editor [data-previous-parts] > button { margin-block: 6px; }
.dna-selection-label { color: var(--text-secondary); font-weight: 600; }
.dna-follow-up { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 14px; margin-block: 12px; }
.dna-follow-up h4 { margin-top: 0; }
.dna-follow-up[data-follow-up-code="RECORDED_PROBLEM"] { border: 2px solid #a56813; }
.dna-fields { display: grid; gap: 14px; padding: 0; margin: 0; border: 0; min-width: 0; }
.dna-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dna-page form, .dna-page .label { min-width: 0; }
.dna-page input, .dna-page select, .dna-page textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.dna-page input[type="date"] { display: block; width: 100%; min-inline-size: 0; }
.dna-page input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.dna-page select[multiple] { width: 100%; }
.dna-page input:disabled { opacity: .6; }
.dna-recommendation { border-top: 1px solid var(--border-subtle); padding-top: 18px; }
.dna-recommendation li { margin: 10px 0; }
.dna-page summary { cursor: pointer; min-height: 32px; }
.dna-page a, .dna-page p { overflow-wrap: anywhere; }
.dna-page :focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 3px; }
@media (max-width: 800px) { .dna-columns { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .dna-form-row, .dna-part-list { grid-template-columns: 1fr; } .dna-page .dna-hotspot { font-size: 11px; padding: 4px 5px; } .dna-page input, .dna-page select, .dna-page textarea { font-size: 16px; } }

.dna-layout-options .dna-house-type { flex: 1 0 100%; display: grid; gap: 8px; }
.dna-house-type select { width: 100%; min-height: 44px; }

.dna-upload-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dna-upload-actions > button { flex: 1 1 160px; }
.dna-upload-actions input[hidden] { display: none; }

.dna-attention, .dna-needs-review { border: 2px solid #a56813; border-radius: 8px; padding: 16px; }
.dna-attention { display: grid; gap: 10px; background: #fff7e6; color: #51320c; }
.dna-attention-badge { background: #fff0cc; color: #51320c; padding: 10px; border-radius: 6px; font-weight: 700; }
.dna-page .dna-part-review { border: 2px solid #a56813; }
.dna-part-review small { background: #fff0cc; color: #51320c; padding: 4px; border-radius: 4px; }

[data-event-replacement] label:has(> input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
[data-event-replacement] input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; margin: 2px 0; }

/* Fixed drawing positions work with the production Content Security Policy. */
.dna-position-41-18 { --x: 41%; --y: 18%; }
.dna-position-41-37 { --x: 41%; --y: 37%; }
.dna-position-18-56 { --x: 18%; --y: 56%; }
.dna-position-58-68 { --x: 58%; --y: 68%; }
.dna-position-28-86 { --x: 28%; --y: 86%; }
.dna-position-84-45 { --x: 84%; --y: 45%; }
.dna-position-85-23 { --x: 85%; --y: 23%; }
.dna-position-84-72 { --x: 84%; --y: 72%; }
.dna-position-84-87 { --x: 84%; --y: 87%; }

.dna-document-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.dna-document-card, .dna-event-documentation { display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 8px; overflow-wrap: anywhere; }
.dna-document-card small { display: block; }
.dna-document-choice { display: flex; align-items: center; gap: 8px; }
.dna-document-choice input { width: 20px; height: 20px; flex: 0 0 20px; }
.dna-document-picker > summary { margin-bottom: 12px; }
.dna-event-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.dna-event-previews .document-thumbnail { max-width: 120px; }
.dna-document-card .document-thumbnail { margin: 0; }
[data-component-documentation] .dna-document-grid { grid-template-columns: minmax(0, 1fr); }
.dna-document-row { display: flex; align-items: flex-start; gap: 12px; }
.dna-document-row > div { flex: 1; min-width: 0; }
.dna-document-row > button { flex: 0 0 auto; min-height: 44px; width: auto; }
.dna-document-row p { margin: 4px 0 0; font-size: 13px; }
.dna-document-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 15px; }
.dna-document-card > details > summary { color: var(--text-secondary); font-size: 14px; min-height: 44px; display: list-item; align-content: center; }
.dna-document-card > details[open] > summary { margin-bottom: 12px; }
.dna-document-card[data-document-record] .document-thumbnail { max-width: 260px; }
.dna-status-card { display: grid; gap: 10px; }
.dna-status-card h2, .dna-status-card p { margin: 0; }
.dna-status-description { color: var(--text-secondary); }
.dna-status-label { font-size: 17px; }
.dna-status-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 4px 0; }
.dna-status-facts dt { color: var(--text-secondary); font-size: 13px; }
.dna-status-facts dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.dna-editor > details, .dna-editor > [data-component-guidance] > details { border-top: 1px solid var(--border-subtle); padding-block: 8px; }
.dna-editor > details > summary, .dna-editor > [data-component-guidance] > details > summary { min-height: 44px; align-content: center; }
.dna-editor details[open] > summary { margin-bottom: 12px; }
.dna-next-actions .dna-upload-actions { margin: 0; }
.dna-next-actions .dna-upload-actions > .primary-btn { flex-basis: 100%; }
.dna-next-actions .dna-follow-up { border: 0; border-left: 2px solid var(--border-subtle); border-radius: 0; margin-block: 16px 0; padding: 0 0 0 12px; }
.dna-next-actions .dna-follow-up[data-follow-up-code="RECORDED_PROBLEM"] { border-left-color: #a56813; }
.dna-event-list p { display: grid; gap: 3px; margin-block: 12px; }
.dna-event-list .hint { font-size: 13px; }
.dna-work-section:empty, [data-results-section]:empty, [data-dna-feedback]:empty { display: none; }
.app-frame > .feedback-launcher-in-flow { position: static; align-self: flex-end; justify-self: end; width: fit-content; padding: 0; margin: 0 16px; box-shadow: none; border: 0; background: transparent; }
.feedback-launcher-in-flow > summary { min-height: 44px; padding-inline: 8px; align-content: center; font-size: 14px; color: var(--text-secondary); }
@media (max-width: 360px) { .dna-status-facts { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.dna-page select[hidden] { display: none; }

.dna-editor [data-component-heading] { scroll-margin-top: 100px; }
.dna-step-notice { padding: 14px; border: 2px solid var(--accent-primary); border-radius: 8px; background: var(--bg-card); font-weight: 600; }
.dna-review-gate { display: flex; align-items: flex-start; gap: 10px; }
.dna-review-gate input { flex: 0 0 22px; width: 22px; height: 22px; }
.dna-editor button:disabled { opacity: .55; cursor: not-allowed; }

.dna-review-gate[hidden] { display: none; }

.dna-inspected { padding: 16px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-card); }
.dna-inspected article + article { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.dna-inspection-status { margin-block: 12px; overflow-wrap: anywhere; }
.dna-page .dna-work-existing-choice { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; cursor: pointer; }
.dna-page input[data-use-existing-event] { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 3px 0 0; flex: 0 0 18px; }

[data-event-components] label:has(> input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; }
[data-event-components] input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; margin: 2px 0; padding: 0; }

.dna-instance-switcher { padding: 12px 16px; border: 1px solid var(--accent-primary); border-radius: 8px; background: var(--bg-card); min-width: 0; }
.dna-instance-switcher > .label { font-weight: 600; }
.dna-instance-switcher select { min-height: 44px; width: 100%; margin-top: 6px; font-weight: 400; }
.dna-instance-switcher p { margin: 8px 0 0; }

/* Keep facade association choices compact at all viewport sizes. */
.dna-facade-choice { min-height: 44px; display: flex; align-items: flex-start; gap: .65rem; margin: .55rem 0; }
.dna-facade-choice input[type="checkbox"] { padding: 0; min-width: 0; min-height: 0; width: 1.15rem; height: 1.15rem; flex: 0 0 1.15rem; margin: .15rem 0; }
.dna-facade-choice span { min-width: 0; overflow-wrap: anywhere; }

.document-view-switch { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: 1 / -1; }
.document-view-switch [aria-pressed="true"] { border-color: var(--accent-primary); font-weight: 600; }
#general-document-context { grid-column: 1 / -1; }
.general-document-round { min-width: 0; }
.general-document-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 160px)); gap: 1rem; }
.general-document-previews figure { margin: 0; }
.general-document-round .dna-document-grid { margin-top: 1rem; }
