:root {
  --ink: #17202a;
  --muted: #637083;
  --line: #dce2e8;
  --surface: #ffffff;
  --background: #f4f6f8;
  --primary: #1458d4;
  --primary-dark: #0d43a5;
  --danger: #b42318;
  --success: #16794b;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--background); }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -0.03em; }
h2 { margin-bottom: 18px; font-size: 1.25rem; }
h3 { margin-bottom: 8px; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.page { padding: 36px 0 72px; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.header-inner { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 24px; }
.header-branding { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand, .header-current, .header-link { font-weight: 750; text-decoration: none; }
.brand { color: var(--ink); }
.header-current { color: var(--muted); }
.header-arrow { color: #9aa6b6; }
.pwa-offline-shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; border: 1px solid #a7c8f2; border-radius: 12px; padding: 12px 14px; background: #edf4ff; color: #174ea6; font-size: .86rem; }
.pwa-offline-shell > div { display: grid; gap: 2px; }
.pwa-offline-shell strong { color: inherit; }
.pwa-offline-shell .button { flex: 0 0 auto; }
.pwa-offline-shell[data-offline-level="ready"] { border-color: #88c7a7; background: #e9f8f0; color: #145c3b; }
.pwa-offline-shell[data-offline-level="warning"] { border-color: #ebcf87; background: #fff8e6; color: #765000; }
.pwa-offline-shell[data-offline-level="critical"] { border-color: #e5aaa5; background: #fff0ee; color: var(--danger); }
.pwa-storage-shell { display: flex; align-items: center; gap: 12px; margin-top: 16px; border: 1px solid #b9d9c8; border-radius: 12px; padding: 12px 14px; background: #eef9f3; color: #145c3b; font-size: .86rem; }
.pwa-storage-shell[hidden] { display: none; }
.pwa-storage-shell > div { display: grid; gap: 2px; }
.pwa-storage-shell strong { color: inherit; }
.pwa-storage-shell[data-storage-level="warning"] { border-color: #ebcf87; background: #fff8e6; color: #765000; }
.pwa-storage-shell[data-storage-level="critical"] { border-color: #e5aaa5; background: #fff0ee; color: var(--danger); }
.form-field ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.form-field ul label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.owner-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; height: 48px; overflow: hidden; border: 1px solid #b8c8de; border-radius: 999px; background: #eef3f8; }
.form-field .owner-toggle-option { display: flex; align-items: center; justify-content: center; min-width: 170px; margin: 0; padding: 0 18px; color: var(--muted); text-align: center; font-weight: 700; cursor: pointer; transition: color .18s, background .18s; }
.owner-toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.owner-toggle-option:has(input:checked) { border-radius: 999px; background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(20,88,212,.35); }
.room-shape-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; height: 48px; min-width: 340px; overflow: hidden; border: 1px solid #b8c8de; border-radius: 999px; background: #eef3f8; }
.form-field .room-shape-toggle-option { display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 18px; color: var(--muted); text-align: center; font-weight: 700; cursor: pointer; transition: color .18s, background .18s; }
.room-shape-toggle-option input { position: absolute; opacity: 0; pointer-events: none; }
.room-shape-toggle-option:has(input:checked) { border-radius: 999px; background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(20,88,212,.35); }
.user-menu { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }
.user-menu form { margin: 0; }
.header-link { color: var(--primary); }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.heading-actions form { margin: 0; }
.export-actions { justify-content: flex-start; }
.export-actions form { min-width: 370px; }
.export-submit { width: 100%; white-space: nowrap; }
.export-format-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.export-finished-at { margin: 14px 0 0; }
.client-signature-panel { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.client-signature-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.client-signature-heading h3, .client-signature-heading p { margin-bottom: 5px; }
.client-signature-summary { margin-top: 16px; }
.client-signature-summary:empty { display: none; }
.client-signature-summary > .muted { margin-bottom: 0; }
.participant-signature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.participant-signature-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; }
.participant-signature-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.participant-signature-card-heading > div { display: grid; min-width: 0; gap: 3px; }
.participant-signature-card-heading strong, .participant-signature-card-heading span { overflow-wrap: anywhere; }
.participant-signature-card .client-signature-preview { width: 100%; height: 110px; margin-top: 12px; }
.participant-signature-card .button { margin-top: 12px; }
.participant-signature-meta { margin: 10px 0 0; white-space: pre-wrap; }
.participant-signature-role { margin: 6px 0 0; font-size: .85rem; }
.client-signature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.client-signature-preview { display: block; width: min(100%, 360px); height: 150px; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; object-position: left center; background: white; }
.client-signature-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; }
.client-signature-details dt { color: var(--muted); }
.client-signature-details dd { margin: 0; white-space: pre-wrap; }
.client-signature-summary:has(> .client-signature-preview) { display: grid; grid-template-columns: minmax(220px, 360px) minmax(0, 1fr); align-items: start; gap: 16px; }
.status-awaiting { background: #edf1f5; color: #465366; }
.status-signed { background: #e7f7ee; color: var(--success); }
.status-unavailable { background: #fff4d9; color: #825500; }
.client-signature-modal-open { overflow: hidden; }
.client-signature-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(23,32,42,.68); }
.client-signature-modal[hidden] { display: none; }
.client-signature-dialog { position: relative; width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 16px; padding: 26px; background: white; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.client-signature-dialog h2 { padding-right: 42px; }
.client-signature-close { position: absolute; top: 12px; right: 12px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: #edf1f5; color: var(--ink); font: 30px/1 inherit; cursor: pointer; }
.client-signature-consent { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 18px; font-size: .92rem; font-weight: 600; line-height: 1.4; }
.client-signature-consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; }
.client-signature-pad { position: relative; overflow: hidden; border: 1px solid #9aacbf; border-radius: 12px; background: #fff; }
.client-signature-pad canvas { display: block; width: 100%; height: 240px; touch-action: none; }
.client-signature-pad span { position: absolute; right: 12px; bottom: 8px; color: #9aa6b6; font-size: .78rem; pointer-events: none; }
.client-signature-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.heading-line, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.heading-line { justify-content: flex-start; }
.eyebrow, .step-label { margin-bottom: 6px; color: var(--primary); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.lead { margin-bottom: 6px; color: var(--muted); font-size: 1.05rem; }
.muted { color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--primary); font-size: .9rem; text-decoration: none; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-list { display: grid; gap: 14px; }
.object-card, .report-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; text-decoration: none; transition: border-color .15s, transform .15s; }
.object-card:hover, .report-card:hover { border-color: #9cb8ea; transform: translateY(-1px); }
.object-card h2, .report-card h3 { margin-bottom: 6px; }
.object-card p, .report-card p { margin-bottom: 0; color: var(--muted); }
.object-details-card { padding: 24px; }
.report-card-link { min-width: 0; flex: 1; text-decoration: none; }
.report-card-link p + p { margin-top: 5px; }
.assignment-panel { margin: -8px 0 24px; padding: 20px 24px; }
.report-assignment-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 14px; text-align: left; }
.report-assignment-form label { color: var(--ink); font-size: .8rem; font-weight: 700; }
.report-assignment-form .form-field { margin: 0; }
.expert-assignment-form + .expert-assignment-form { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 4px; }
.filter-tab { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: white; color: var(--muted); text-decoration: none; }
.filter-tab span { display: inline-grid; min-width: 23px; min-height: 23px; place-items: center; border-radius: 999px; background: #edf1f5; color: var(--ink); font-size: .76rem; }
.filter-tab-active { border-color: #8db0ef; background: #edf4ff; color: var(--primary-dark); }
.report-worklist { display: grid; gap: 14px; }
.work-report-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, auto); gap: 24px; padding: 22px; text-decoration: none; }
.work-report-card h2 { margin: 0; }
.work-report-card p { margin-bottom: 5px; color: var(--muted); }
.work-report-card small { color: var(--muted); }
.work-report-object { margin-top: 16px; color: var(--ink) !important; font-weight: 700; }
.work-report-meta { display: grid; grid-template-columns: auto auto; align-content: start; gap: 7px 14px; margin: 0; font-size: .86rem; }
.work-report-meta dt { color: var(--muted); }
.work-report-meta dd { margin: 0; text-align: right; }
.overdue { color: var(--danger); font-weight: 750; }
.assignment-history { margin-top: 14px; }
.assignment-history summary { color: var(--primary); cursor: pointer; font-weight: 700; }
.history-list { display: grid; gap: 8px; margin-top: 10px; }
.assignment-history-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; border-left: 2px solid var(--line); padding-left: 10px; font-size: .82rem; }
.assignment-history-row time, .assignment-history-row small { color: var(--muted); }
.assignment-history-row small { grid-column: 2; }
.object-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 8px; color: var(--muted); font-size: .85rem; }
.empty-state { padding: 44px; text-align: center; color: var(--muted); }
.inspection-home-actions { display: grid; justify-items: center; gap: 18px; margin-top: 24px; }
.inspection-home-actions form { margin: 0; }
.inspection-home-import { display: grid; justify-items: center; }
.inspection-home-import [data-pwa-import-html-feedback] { max-width: 720px; margin: 12px 0 0; }
.inspection-home-actions .button { gap: 8px; }
.inspection-home-actions form .button { min-width: 260px; }
.inspection-home-secondary-actions { display: flex; width: 100%; justify-content: center; gap: 10px; }
.inspection-home-secondary-actions .button { min-width: 210px; }
.inspection-home-actions .counter { min-width: 23px; height: 23px; background: #edf1f5; color: var(--ink); }
.inspection-home-retention { margin: 16px 0 0; font-size: .86rem; }
.inspection-home-registry-status { margin: 8px 0 0; font-size: .86rem; }
.inspection-home-registry-error { color: var(--danger); font-weight: 700; }
.inspection-home-list { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 24px; text-align: left; }
.inspection-home-list .section-heading { margin-bottom: 14px; }
.inspection-home-list .section-heading h2 { margin: 0; }
.inspection-home-report { padding: 18px 20px; }
.inspection-home-report .report-card-link { display: grid; gap: 5px; }
.inspection-home-report h3 { margin: 0; color: var(--ink); }
.inspection-home-report p { margin: 0; }
.inspection-home-report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inspection-home-report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inspection-storage-manager { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 24px; text-align: left; }
.inspection-storage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.inspection-storage-heading h2, .inspection-storage-heading p { margin: 0; }
.inspection-storage-list { display: grid; gap: 10px; margin-top: 16px; }
.inspection-storage-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #f9fbfd; }
.inspection-storage-row h3, .inspection-storage-row p { margin: 0; }
.inspection-storage-row h3 { color: var(--ink); font-size: 1rem; }
.inspection-storage-row .status { margin: 6px 0; }
.inspection-storage-breakdown { margin-top: 5px !important; font-size: .82rem; }
.inspection-storage-size { color: var(--ink); font-weight: 750; white-space: nowrap; }
.inspection-storage-cleanup { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 18px; }
.inspection-storage-cleanup p, .inspection-storage-feedback { margin: 0; font-size: .82rem; }
.status-stale { background: #fff4d9; color: #825500; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-danger { background: #fff0ee; color: var(--danger); }
.button-small { min-height: 34px; padding: 5px 11px; font-size: .82rem; }
.button-block { width: 100%; }

.messages { display: grid; gap: 8px; margin-bottom: 24px; }
.message { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: white; }
.message-success { border-color: #a9dfc4; color: var(--success); }
.message-error { border-color: #f0b4ae; color: var(--danger); }

.status { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: #edf1f5; color: #465366; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.status-draft, .status-active { background: #e9f1ff; color: #174ea6; }
.status-in_review { background: #fff4d9; color: #825500; }
.status-needs_revision { background: #fff0ee; color: var(--danger); }
.status-approved, .status-completed { background: #e7f7ee; color: var(--success); }

.form-card, .report-section { padding: 24px; }
.form-card { max-width: 760px; }
.form-field { min-width: 0; max-width: 100%; margin-bottom: 18px; }
.form-field label, .review-actions label, .workflow-card label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 700; }
.required-marker { margin-left: 4px; color: #c62828; font-weight: 800; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; border: 1px solid #bdc7d3; border-radius: 8px; padding: 10px 11px; background: white; color: var(--ink); font: inherit; }
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364778c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px 8px;
}
input[type="radio"], input[type="checkbox"] { width: auto; max-width: none; padding: 0; }
input[type="date"], input[type="time"], input[type="datetime-local"] { display: block; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid rgba(20,88,212,.12); }
fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
fieldset:disabled { opacity: .72; }
.field-error, .form-errors { margin-top: 6px; color: var(--danger); font-size: .85rem; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.inline-form { display: flex; align-items: center; gap: 10px; margin-top: 18px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-grid > .card { padding: 24px; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.stack-list { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.list-row small { display: block; margin-top: 3px; color: var(--muted); }
.section-block { margin-top: 32px; }
.section-heading h2 { margin-bottom: 0; }
.counter { display: inline-grid; min-width: 28px; height: 28px; place-items: center; border-radius: 999px; background: #e9edf2; font-size: .8rem; }

.report-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.report-nav { position: sticky; top: 84px; display: grid; padding: 12px; }
.report-nav a { border-radius: 8px; padding: 10px 12px; color: var(--muted); text-decoration: none; }
.report-nav a:hover { background: #f2f5f8; color: var(--ink); }
.report-content { display: grid; min-width: 0; gap: 18px; }
.report-content > [data-report-screen] { min-width: 0; max-width: 100%; }
.report-page-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.report-page-controls .button { width: 100%; }
.report-page-controls .button:last-child { justify-self: end; }
.report-section, [data-room-element], [data-surface-element] { min-width: 0; max-width: 100%; scroll-margin-top: 84px; }
.report-section form, .report-section fieldset, .report-section .form-field { min-width: 0; }
.report-section .section-heading { margin-bottom: 20px; }
.save-state { min-height: 20px; color: var(--success); font-size: .82rem; }
.review-actions { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.history { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.history-row { display: grid; grid-template-columns: 130px 1fr 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.history-row p { grid-column: 2 / -1; margin: 0; color: var(--muted); }

.multi-choice { position: relative; min-width: 0; max-width: 100%; }
.multi-choice summary { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #bdc7d3; border-radius: 8px; padding: 9px 11px; background: white; cursor: pointer; list-style: none; }
.multi-choice summary::-webkit-details-marker { display: none; }
.multi-choice-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-choice-chevron { color: var(--muted); font-size: 1.1rem; }
.multi-choice-options { position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; left: 0; display: grid; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: white; box-shadow: 0 12px 30px rgba(16,24,40,.14); }
.multi-choice-option label { display: flex; align-items: flex-start; gap: 9px; margin: 0; border-radius: 7px; padding: 8px; font-weight: 500; cursor: pointer; }
.multi-choice-option label:hover { background: #f2f5f8; }
.multi-choice-option input { width: auto; margin-top: 3px; }

.subsection + .subsection { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.room-bundles-section { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.spaces-save-button { margin-top: 20px; }
.subsection > h3 { margin-bottom: 14px; }
.repeatable-list { display: grid; gap: 14px; margin-bottom: 18px; }
.repeatable-row { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fbfcfd; }
.repeatable-row .form-field:last-of-type { margin-bottom: 0; }
.repeatable-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-bottom: 14px; }
.repeatable-grid .delete-field { grid-column: 1 / -1; }
.movable-property-list { display: grid; gap: 12px; margin-bottom: 18px; }
.movable-property-row { padding: 16px; }
.movable-property-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.movable-property-row > .repeatable-actions { margin-top: 4px; }
.property-technical-notice { display: block; margin: .55rem 0 0; padding: .65rem .75rem; border: 1px solid #f1c36d; border-radius: 10px; background: #fff8e6; color: #704700; font-size: .88rem; line-height: 1.4; }
.property-technical-notice[hidden] { display: none; }
.repeatable-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.opening-formset-group + .opening-formset-group { margin-top: 20px; }
.opening-formset-group h5, .balcony-parts-editor h6 { margin: 0 0 8px; }
.balcony-parts-editor { grid-column: 1 / -1; padding: 14px; border: 1px solid #c9d6ea; border-radius: 12px; background: #f7faff; }
.balcony-part-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: end; padding: 18px 0; border-bottom: 1px solid #dce5f2; }
.balcony-part-card > strong { grid-column: 1 / -1; font-size: 1.05rem; }
.balcony-part-card label { display: grid; gap: 5px; }
.balcony-part-card > label input { width: 100%; }
.balcony-layout-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.balcony-layout-option { display: grid; gap: 10px; min-height: 132px; margin: 0; border: 1px solid #b8c8de; border-radius: 12px; padding: 12px; background: #fff; color: var(--text); cursor: pointer; }
.balcony-layout-option:has(input:checked) { border: 2px solid var(--primary); padding: 11px; background: #edf4ff; }
.balcony-layout-option input { position: absolute; opacity: 0; pointer-events: none; }
.balcony-layout-graphic { display: grid; height: 104px; place-items: center; overflow: hidden; border-radius: 9px; background: #fff; }
.balcony-layout-graphic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.balcony-part-components { display: grid; grid-column: 1 / -1; gap: 10px; margin-top: 8px; }
.balcony-component-card > summary { min-height: 62px; }
@media (max-width: 760px) { .balcony-layout-picker { grid-template-columns: 1fr; } .balcony-part-card { grid-template-columns: 1fr; } }
.window-components-editor { grid-column: 1 / -1; display: grid; gap: 10px; }
.window-components-editor:not([hidden]) + .repeatable-actions { margin-top: 18px; }
.window-component-card { border: 1px solid #d7deea; border-radius: 12px; background: #fff; overflow: hidden; }
.window-component-card > summary { display: flex; align-items: center; min-height: 70px; gap: 14px; padding: 10px 16px; cursor: pointer; list-style: none; }
.window-component-card > summary::-webkit-details-marker { display: none; }
.window-component-card > summary > strong { flex: 1 1 auto; min-width: 0; }
.window-component-collapse-indicator { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; visibility: hidden; }
.window-component-card.has-damage .window-component-collapse-indicator { visibility: visible; }
.window-component-chevron { width: 8px; height: 8px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.window-component-card[open] .window-component-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.window-component-damage-toggle { display: grid; flex: 0 1 360px; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; min-width: 0; height: 48px; overflow: hidden; border: 1px solid #b8c8de; border-radius: 999px; background: #eef3f8; }
.window-component-damage-toggle label { display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; margin: 0; padding: 5px 10px; color: var(--muted); font-size: .85rem; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; }
.window-component-damage-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.window-component-damage-toggle label:has(input:checked) { border-radius: 999px; background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(20,88,212,.35); }
.window-component-damage-toggle label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: -2px; }
.window-component-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 14px 14px; }
.window-component-fields.field-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.window-component-fields.field-count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.window-component-fields label { display: grid; gap: 5px; }
.window-component-fields .window-component-other-comment { grid-column: 1 / -1; }
.window-component-other-comment[hidden] { display: none; }
.window-component-other-comment textarea { min-height: 88px; resize: vertical; }
.window-glazing-list { display: grid; grid-column: 1 / -1; gap: 12px; }
.window-glazing-card { border: 1px solid #c9d6ea; border-radius: 12px; padding: 14px; background: #f7faff; }
.window-glazing-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.window-glazing-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.window-glazing-fields label { display: grid; gap: 5px; }
.window-glazing-comment { grid-column: 1 / -1; }
.window-glazing-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; }
.window-glazing-add { justify-self: start; }
.window-glazing-add.is-active { border-color: var(--primary); background: #edf4ff; color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
@media (max-width: 640px) {
  .window-component-card > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
  .window-component-card > summary > strong { grid-column: 1 / -1; }
  .window-component-collapse-indicator { grid-column: 1; }
  .window-component-damage-toggle { grid-column: 1 / -1; width: 100%; }
  .window-component-damage-toggle label { padding: 3px 4px; font-size: .7rem; line-height: 1.05; white-space: normal; }
  .window-component-fields, .window-component-fields.field-count-3, .window-glazing-fields { grid-template-columns: 1fr; }
  .window-glazing-actions .button { flex: 1 1 100%; }
}
.opening-quantity-hint { margin: 8px 0 0; }
.floor-plan-previews { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.floor-plan-previews img, .floor-plan-preview { max-width: min(100%, 360px); max-height: 260px; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; background: #fff; }
.floor-plan-preview { display: block; margin-top: 10px; }
.file-upload-control { position: relative; }
.file-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-upload-dropzone { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; min-height: 64px; border: 1px dashed #9aacbf; border-radius: 12px; padding: 10px 16px; background: #f8fbff; outline: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.floor-plan-row .form-field > input:not(.file-upload-input) { height: 64px; min-height: 64px; }
.asset-upload-row .form-field > input:not(.file-upload-input) { height: 64px; min-height: 64px; }
.file-upload-dropzone:hover, .file-upload-dropzone:focus-within, .file-upload-dropzone:focus { border-color: var(--primary); background: #f2f7ff; }
.file-upload-dropzone.is-dragging { border-color: var(--primary); border-style: solid; background: #eaf2ff; box-shadow: inset 0 0 0 2px rgba(20, 88, 212, .12); }
.file-upload-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--primary); background: #e5efff; }
.file-upload-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.file-upload-copy { display: grid; min-width: 0; gap: 3px; }
.file-upload-copy strong { color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.file-upload-copy span { color: var(--muted); line-height: 1.25; overflow-wrap: anywhere; }
.file-upload-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 24px rgba(16,24,40,.12); }
.file-upload-menu[hidden] { display: none; }
.file-upload-menu button { min-height: 42px; border: 1px solid #b9c7d8; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.file-upload-menu button:hover, .file-upload-menu button:focus-visible { border-color: var(--primary); background: #edf4ff; outline: none; }
.file-upload-preview:empty { display: none; }
.file-upload-preview { margin-top: 12px; }
.file-upload-preview .floor-plan-preview { margin-top: 0; }
.asset-batch-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfd; }
.asset-batch-dropzone { cursor: pointer; }
.asset-batch-card.is-uploading .asset-batch-dropzone { opacity: .65; cursor: wait; }
.asset-batch-feedback { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.asset-batch-feedback.is-error { color: var(--danger); }
.asset-batch-feedback.is-warning { color: #9a5b00; }
.asset-batch-menu { margin-bottom: 12px; }
.asset-thumbnail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0 0; }
.asset-thumbnail-grid:empty { display: none; }
.asset-thumbnail { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: start; gap: 10px 12px; min-width: 0; padding: 12px; background: #fff; }
.asset-thumbnail-image { display: grid; width: 110px; height: 96px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f3f7fc; }
.asset-thumbnail-image img { width: 100%; height: 100%; object-fit: contain; }
.asset-thumbnail-placeholder { padding: 8px; color: var(--muted); font-size: .76rem; line-height: 1.25; text-align: center; }
.asset-thumbnail-caption { min-width: 0; margin: 0; }
.asset-thumbnail-caption input { width: 100%; min-width: 0; }
.asset-thumbnail-storage { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .85rem; }
.asset-thumbnail-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 7px; }
.asset-thumbnail-actions .button { min-height: 34px; padding: 5px 10px; }
@media (max-width: 700px) { .asset-thumbnail-grid { grid-template-columns: 1fr; } }
.room-defect { margin-top: 28px; }
.room-bundle + .room-bundle { margin-top: 18px; }
.room-bundle { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.room-bundle > summary { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 16px; cursor: pointer; font-size: 1.06rem; font-weight: 700; list-style: none; }
.room-bundle > summary::-webkit-details-marker { display: none; }
.room-bundle[open] > summary { border-bottom: 1px solid var(--line); }
.room-bundle-content { padding: 16px; }
.room-bundle-content > .repeatable-row { border: 0; border-radius: 0; padding: 0 0 18px; background: transparent; }
.room-meta-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .95fr); gap: 0 18px; }
.room-meta-fields + .repeatable-actions { margin-top: 18px; }
.room-element { min-height: 54px; margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; background: #fbfcfd; }
.room-element > summary { display: flex; align-items: center; justify-content: space-between; height: 54px; min-height: 54px; cursor: pointer; font-size: 1.06rem; font-weight: 700; list-style: none; }
.building-address-title { min-width: 0; white-space: nowrap; }
@media (max-width: 640px) {
  [data-building-address-photo] > summary { font-size: clamp(.78rem, 3.7vw, 1.06rem); }
}
.room-element > summary::-webkit-details-marker { display: none; }
.room-element[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.room-bundle > summary::after, .room-element > summary::after { content: ""; flex: 0 0 8px; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.room-bundle[open] > summary::after, .room-element[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.surface-element { padding: 0; overflow: visible; }
.surface-element:has(.multi-choice[open]) { position: relative; z-index: 20; }
.surface-element-header { display: flex; align-items: center; min-height: 70px; gap: 14px; padding: 10px 16px; }
.surface-element-title { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ink); font-size: 1.06rem; font-weight: 700; }
.surface-damage-toggle { flex: 0 1 360px; min-width: 0; cursor: pointer; }
.surface-collapse-button { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--primary); cursor: pointer; }
.surface-collapse-button:hover, .surface-collapse-button:focus-visible { border-color: #b8c8de; background: #edf4ff; outline: none; }
.surface-element:not(.has-damage) .surface-collapse-button { visibility: hidden; pointer-events: none; }
.surface-element-chevron { width: 8px; height: 8px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.surface-collapse-button[aria-expanded="true"] .surface-element-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.surface-damage-toggle > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; height: 48px; overflow: hidden; border: 1px solid #b8c8de; border-radius: 999px; background: #eef3f8; }
.surface-damage-toggle > div > div { display: flex; min-width: 0; }
.surface-damage-toggle label { display: flex; flex: 1; align-items: center; justify-content: center; min-width: 0; height: 100%; margin: 0; padding: 5px 10px; color: var(--muted); font-size: .85rem; font-weight: 700; line-height: 1.2; text-align: center; pointer-events: none; }
.surface-damage-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.surface-damage-toggle label:has(input:checked) { border-radius: 999px; background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(20,88,212,.35); }
.surface-damage-toggle label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.surface-apron-toggle { margin: 0 16px 14px; padding: 12px 14px; border: 1px solid #c9d7e8; border-radius: 12px; background: #f4f8fc; }
.surface-apron-toggle > label { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-weight: 700; cursor: pointer; }
.surface-apron-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.surface-apron-toggle .muted { margin: 6px 0 0 30px; }
.questionnaire-derived-field { display: none !important; }
.building-evidence { margin: 28px 0 24px; }
.building-evidence-item { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fbfcfe; }
.building-evidence-item > h4, .building-evidence-heading h4 { margin: 0 0 6px; }
.building-evidence-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.required-label { flex: 0 0 auto; border-radius: 999px; padding: 4px 9px; background: #fee2e2; color: #991b1b; font-size: .78rem; font-weight: 700; }
.building-photo-required-control { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.building-evidence [data-building-legacy-overview] .asset-batch-card { border: 0; padding: 0; background: transparent; }
.building-evidence [data-building-legacy-overview] .asset-batch-card:has(.asset-thumbnail-grid:empty) { display: none; }
.building-evidence [data-building-additional-count] { margin-left: 6px; }
.building-location { margin-top: 18px; padding: 18px; background: #fff; }
.building-location [hidden], .building-map-card[hidden] { display: none; }
.building-location-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.building-location-heading h2 { margin: 0; color: var(--ink); font-size: 1.4rem; }
.building-location-heading .button { min-width: 230px; }
.building-location-heading .button.is-captured { background: #eef3f8; color: var(--muted); }
.button-outline { border-color: #c9d7e8; background: #fff; color: var(--primary); }
.button-outline:hover { background: #f7f9fc; }
.building-location-status { display: grid; gap: 5px; margin: 20px 0 14px; color: var(--muted); }
.building-location-preview { margin: 18px 0; }
.building-location-preview-image { display: block; width: 100%; max-height: 520px; aspect-ratio: 650 / 420; object-fit: cover; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.building-location-preview-error { margin: 8px 0; color: var(--muted); }
.building-location-status-title { color: var(--ink); font-size: 1.2rem; font-weight: 750; }
.building-location-coordinates { color: #294c9e; font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.2; }
.building-location-meta { color: #8493aa; font-size: 1rem; }
.building-location-error { color: var(--danger); font-size: .92rem; }
.building-location-actions { margin-top: 14px; }
.building-location-map-link { width: 100%; min-height: 58px; border-color: #c9d7e8; color: var(--primary); font-size: 1.05rem; }
.building-location-confirm { margin-top: 22px; text-align: center; }
.building-location-confirm > p { margin: 0 0 14px; color: var(--ink); font-size: 1.2rem; font-weight: 750; }
.building-location-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.building-location-confirm-actions .button { min-height: 54px; font-size: 1.05rem; }
.building-location-confirmed { margin: 0; color: #227747; font-size: 1.15rem; font-weight: 750; text-align: center; }
.building-location-confirmed span { margin-right: 7px; }
.building-location-change, .building-location-back { display: block; margin: 14px auto 0; border: 0; padding: 8px; background: transparent; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; }
.building-location-previous { margin: 16px 0; border-radius: 12px; padding: 12px 14px; background: #fff5e9; color: #8d5b22; }
.building-location-manual { margin-top: 20px; }
.building-location-manual h4 { margin: 0 0 8px; font-size: 1.25rem; }
.building-location-manual > p { color: var(--muted); line-height: 1.5; }
.building-location-open-maps, .building-location-verify { width: 100%; min-height: 58px; margin: 10px 0 18px; font-size: 1.05rem; }
.building-location-manual-row { display: flex; gap: 10px; }
.building-location-input-wrap { position: relative; flex: 1; min-width: 0; }
.building-location-manual-row input { width: 100%; min-width: 0; padding-right: 44px; }
.building-location-clear { position: absolute; top: 50%; right: 7px; width: 36px; height: 36px; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.building-location-clear:hover { background: #eef3f8; color: var(--ink); }
.building-location-input-status:empty { display: none; }
.building-location-input-status:not(:empty) { margin: 8px 0 0; color: var(--danger); }
.building-location-manual-row [data-paste-location]:disabled { opacity: .5; cursor: default; }
.building-location-manual-row .button { min-width: 100px; }
.building-location-verify { margin-top: 14px; margin-bottom: 4px; }
.building-location-back { color: var(--muted); }
.building-map-status { margin: 10px 0 0; color: var(--muted); }
.building-map-status.is-error { color: var(--danger); }
.building-map-card .asset-thumbnail { grid-template-columns: minmax(0, 1fr); }
.building-map-card .asset-thumbnail-image { width: min(100%, 650px); height: auto; min-height: 220px; aspect-ratio: 13 / 9; }
.building-map-card .asset-thumbnail-caption { display: none; }
.building-map-card [data-asset-action="up"], .building-map-card [data-asset-action="down"] { display: none; }
@media (max-width: 700px) {
  .building-evidence-heading { display: grid; }
  .building-evidence-heading .button { width: 100%; }
  .building-location-heading { align-items: stretch; flex-direction: column; }
  .building-location-heading .button { width: 100%; }
  .building-location-manual-row { align-items: stretch; flex-direction: column; }
  .building-location-manual-row .button { width: 100%; }
  .required-label { justify-self: start; }
}
.surface-fields { border-top: 1px solid var(--line); padding: 16px; }
@media (max-width: 620px) { .surface-element-header { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 14px 16px; } .surface-element-title { grid-column: 1 / -1; } .surface-collapse-button { grid-column: 1; } .surface-damage-toggle { grid-column: 2; width: 100%; } }
.room-model { margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #f8fafc; }
.room-model-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.room-model-heading h4 { margin: 0; }
.room-model-switch { display: flex; gap: 6px; }
.room-model-switch .is-active { border-color: var(--primary); background: #e9f1ff; color: var(--primary-dark); }
.room-model-stage { display: grid; min-height: 310px; place-items: center; margin: 14px 0; overflow: hidden; }
.room-model-canvas { --room-marker-gutter: 16px; position: relative; display: inline-block; padding: 0 78px 51px var(--room-marker-gutter); }
.room-model-shape { position: relative; width: var(--room-width, 227px); height: var(--room-plan-height, 168px); border: 3px solid var(--primary); border-radius: 5px; background: rgba(20,88,212,.14); transition: width .2s, height .2s, transform .2s; }
.room-model-stage[data-view="3d"] .room-model-canvas, .room-model-stage[data-view="3d"] .room-plan-2d-view { display: none; }
.room-plan-2d-view { position: relative; width: 100%; }
.room-scene-svg { display: block; width: min(100%, 720px); height: auto; max-height: 430px; margin: 0 auto; }
.room-3d-viewport { display: none; width: 100%; min-height: 310px; place-items: center; perspective: 760px; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }
.room-model-stage[data-view="3d"] .room-3d-viewport { display: grid; }
.room-3d-viewport:focus-visible { border-radius: 10px; box-shadow: inset 0 0 0 2px var(--primary); }
.room-3d-viewport.is-dragging { cursor: grabbing; }
.room-3d-scene { position: relative; width: var(--room-3d-width, 200px); height: var(--room-3d-height, 130px); transform: rotateX(var(--room-rotation-x, -24deg)) rotateY(var(--room-rotation-y, -38deg)) scale(var(--room-3d-scale, 1)); transform-style: preserve-3d; transition: width .2s, height .2s, transform .16s ease-out; }
.room-3d-viewport.is-dragging .room-3d-scene { transition: width .2s, height .2s; }
.room-3d-floor, .room-3d-wall { position: absolute; top: 50%; left: 50%; border: 2px solid rgba(20,88,212,.82); transform-style: preserve-3d; backface-visibility: visible; }
.room-3d-floor { width: var(--room-3d-width, 200px); height: var(--room-3d-depth, 150px); background: linear-gradient(135deg, #dbe8fb 0 48%, #cfdef5 48% 52%, #dbe8fb 52% 100%); transform: translate(-50%, -50%) rotateX(-90deg) translateZ(var(--room-3d-half-height, 65px)); box-shadow: 0 18px 28px rgba(23,32,42,.2); }
.room-3d-wall { overflow: hidden; background: rgba(232,240,252,.78); box-shadow: inset 0 0 20px rgba(20,88,212,.08); }
.room-3d-wall-top, .room-3d-wall-bottom { width: var(--room-3d-width, 200px); height: var(--room-3d-height, 130px); }
.room-3d-wall-left, .room-3d-wall-right { width: var(--room-3d-depth, 150px); height: var(--room-3d-height, 130px); }
.room-3d-wall-bottom { background: rgba(232,240,252,.46); transform: translate(-50%, -50%) translateZ(var(--room-3d-half-depth, 75px)); }
.room-3d-wall-top { transform: translate(-50%, -50%) rotateY(180deg) translateZ(var(--room-3d-half-depth, 75px)); }
.room-3d-wall-right { background: rgba(219,232,250,.58); transform: translate(-50%, -50%) rotateY(90deg) translateZ(var(--room-3d-half-width, 100px)); }
.room-3d-wall-left { transform: translate(-50%, -50%) rotateY(-90deg) translateZ(var(--room-3d-half-width, 100px)); }
.room-3d-wall-openings { position: absolute; inset: 0; }
.room-3d-opening { position: absolute; bottom: var(--opening-bottom, 0%); left: var(--opening-position, 50%); width: var(--opening-width, 24%); min-width: 8px; height: var(--opening-height, 55%); min-height: 10px; border: 2px solid rgba(255,255,255,.92); border-radius: 3px 3px 0 0; transform: translateX(-50%) translateZ(1px); box-shadow: 0 1px 5px rgba(23,32,42,.28); }
.room-3d-opening.is-window { border-color: #d9f2ff; background: linear-gradient(145deg, rgba(102,198,241,.92), rgba(25,136,216,.78)); }
.room-3d-opening.is-door { border-color: #fff2df; background: linear-gradient(90deg, #ad651d, #dc984e); }
.room-3d-opening.is-entrance { border: 4px double #3b2414; background: linear-gradient(90deg, #7a4217, #bd742d); }
.room-3d-opening.is-double-entrance { box-shadow: inset 5px 0 0 rgba(255,255,255,.75), inset -5px 0 0 rgba(59,36,20,.5); }
.room-3d-opening.has-damage { outline: 3px dashed #b42318; outline-offset: 2px; }
.room-3d-opening.is-doorway { border: 3px solid #8b5726; border-bottom: 0; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.room-3d-opening::after { position: absolute; z-index: 4; top: 2px; left: 50%; content: attr(data-marker-label); color: #fff; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px rgba(23,32,42,.85); transform: translateX(-50%); pointer-events: none; }
.room-3d-opening.is-composite-opening { display: flex; align-items: stretch; overflow: visible; border-color: #d9f2ff; background: transparent; }
.room-3d-opening.is-composite-opening > .opening-visual-part { position: relative; bottom: var(--part-bottom, 0%); width: var(--part-width); height: var(--part-height, 100%); flex: 0 0 var(--part-width); align-self: flex-end; box-sizing: border-box; border: 1px solid #d9f2ff; background: linear-gradient(145deg, rgba(102,198,241,.92), rgba(25,136,216,.78)); }
.room-3d-opening.is-composite-opening > .opening-visual-part.is-balcony-door { background: linear-gradient(90deg, #ad651d, #dc984e); border-color: #fff2df; }
.room-dimension { position: absolute; display: grid; place-items: center; color: var(--primary-dark); font-size: .9rem; font-weight: 700; line-height: 1; white-space: nowrap; pointer-events: none; transition: opacity .15s; }
.room-dimension-value { display: block; white-space: nowrap; }
.room-dimension::before, .room-dimension::after { position: absolute; content: ""; width: 0; height: 0; background: none; }
.room-dimension-length { bottom: 3px; left: var(--room-marker-gutter); width: calc(100% - 78px - var(--room-marker-gutter)); height: 30px; border-top: 1px solid var(--primary); }
.room-dimension-length::before, .room-dimension-length::after { top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }.room-dimension-length::before { left: 0; border-right: 8px solid var(--primary); }.room-dimension-length::after { right: 0; border-left: 8px solid var(--primary); }
.room-dimension-length span { padding: 0 5px; background: #f8fafc; }
.room-dimension-width { top: 0; right: 6px; width: 30px; height: calc(100% - 51px); border-left: 1px solid var(--primary); }
.room-dimension-width .room-dimension-value { transform: none; }
.room-dimension-width::before, .room-dimension-width::after { left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; }.room-dimension-width::before { top: 0; border-bottom: 8px solid var(--primary); }.room-dimension-width::after { bottom: 0; border-top: 8px solid var(--primary); }
.room-dimension-width span { padding: 0 5px; background: #f8fafc; }
.room-opening-markers { position: absolute; inset: 0; }
.room-opening-marker { position: absolute; z-index: 2; width: var(--opening-size, 32px); height: 16px; border: 2px solid #fff; border-radius: 4px; padding: 0; color: #fff; font-size: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(23,32,42,.35); }
.room-opening-marker::after { content: attr(data-marker-label); font-size: 11px; font-weight: 700; line-height: 12px; }
.room-opening-marker.is-window { background: #1988d8; }.room-opening-marker.is-door { background: #c77722; }.room-opening-marker.is-doorway { background: repeating-linear-gradient(135deg, #7a4a1c 0 4px, #e7a855 4px 8px); }.room-opening-marker.is-entrance { border: 3px double #2b190e; background: #8f511f; }.room-opening-marker.is-double-entrance { box-shadow: 3px 3px 0 #fff, 5px 5px 0 #6b3b18; }.room-opening-marker.has-damage { outline: 3px dashed #b42318; outline-offset: 2px; }
.room-opening-marker.is-composite-opening { display: flex; overflow: visible; background: transparent; }
.room-opening-marker.is-composite-opening::after { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: #fff; text-shadow: 0 1px 2px rgba(23,32,42,.8); pointer-events: none; }
.room-opening-marker > .opening-visual-part { position: relative; width: var(--part-width); height: 100%; flex: 0 0 var(--part-width); box-sizing: border-box; border-right: 1px solid rgba(255,255,255,.9); background: #1988d8; pointer-events: none; }
.room-opening-marker > .opening-visual-part:last-child { border-right: 0; }
.room-opening-marker > .opening-visual-part.is-balcony-door { background: #c77722; }
.opening-visual-part.has-frame-damage { outline: 2px solid #b42318; outline-offset: -2px; }
.opening-visual-part.has-filling-damage { background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(180,35,24,.85) 4px 6px); }
.opening-visual-part.has-sill-damage::after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; content: ""; background: #b42318; }
.opening-visual-part.has-hardware-damage::before { position: absolute; z-index: 2; top: 50%; right: 2px; width: 5px; height: 5px; border-radius: 50%; content: ""; background: #b42318; transform: translateY(-50%); }
.room-opening-marker[data-wall="TOP"] { top: -9px; left: var(--opening-position); transform: translateX(-50%); }.room-opening-marker[data-wall="BOTTOM"] { bottom: -9px; left: var(--opening-position); transform: translateX(-50%); }.room-opening-marker[data-wall="LEFT"] { top: var(--opening-position); left: calc(var(--opening-size, 32px) / -2); transform: translateY(-50%) rotate(90deg); }.room-opening-marker[data-wall="RIGHT"] { top: var(--opening-position); right: calc(var(--opening-size, 32px) / -2); transform: translateY(-50%) rotate(90deg); }
.opening-trim-field { border-left: 3px solid #d5a15f; padding-left: .85rem; background: #fffaf3; }
.room-model-hint { margin: -5px 0 12px; font-size: .83rem; }
.room-model-hint-3d { display: none; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
.room-model[data-active-view="3d"] [data-room-hint-2d] { display: none; }
.room-model[data-active-view="3d"] .room-model-hint-3d { display: flex; }
.room-opening-warning { margin: -4px 0 12px; }
.room-sketch-model { display: grid; justify-items: center; }
.room-sketch-model .room-model-heading, .room-sketch-model > .muted, .room-sketch-model > .repeatable-formset { width: 100%; }
.custom-room-model { justify-items: stretch; }
.custom-room-model-stage { width: 100%; place-items: stretch; }
.custom-room-2d-view { width: 100%; }
.custom-room-model-stage[data-view="3d"] .custom-room-2d-view { display: none; }
.custom-room-3d-viewport { min-height: 400px; }
.custom-room-3d-svg { display: block; width: min(100%, 720px); height: auto; max-height: 430px; overflow: visible; }
.custom-room-3d-floor { fill: #dbe8fb; stroke: rgba(20,88,212,.82); stroke-width: 2; }
.custom-room-3d-wall { fill: rgba(232,240,252,.88); stroke: rgba(20,88,212,.82); stroke-width: 2; stroke-linejoin: round; }
.custom-room-3d-wall.is-front { fill: rgba(219,232,250,.92); }
.custom-room-3d-opening { stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.custom-room-3d-opening.is-window { fill: #1988d8; }
.custom-room-3d-opening.is-door { fill: #c77722; }
.custom-room-3d-opening.is-composite-part.is-balcony-door { fill: #c77722; }
.custom-room-3d-opening.is-composite-part.has-frame-damage { stroke: #b42318; stroke-width: 3; }
.custom-room-3d-opening.is-composite-part.has-filling-damage { fill: #b42318; fill-opacity: .78; }
.custom-room-3d-opening.is-composite-part.has-sill-damage { stroke: #b42318; stroke-width: 4; }
.custom-room-3d-opening.is-composite-part.has-hardware-damage { stroke: #b42318; stroke-dasharray: 2 2; }
.custom-room-3d-opening.is-doorway { fill: rgba(255,255,255,.2); stroke: #8b5726; stroke-width: 3; }
.custom-room-3d-opening.is-entrance { fill: #8f511f; stroke: #2b190e; stroke-width: 3; }
.custom-room-3d-opening.is-double-entrance { stroke-width: 5; }
.custom-room-3d-opening.has-damage { stroke: #b42318; stroke-dasharray: 5 3; }
.custom-room-3d-empty { fill: #596579; font: 600 16px/1 sans-serif; text-anchor: middle; }
.custom-room-3d-opening-label { fill: #174a88; stroke: #fff; stroke-width: 4px; paint-order: stroke; font: 800 12px/1 sans-serif; text-anchor: middle; pointer-events: none; }
.custom-room-editor { display: grid; gap: .75rem; width: 100%; }
.custom-room-canvas { display: block; width: 100%; min-height: 240px; max-height: 420px; border-radius: 16px; touch-action: none; user-select: none; }
.custom-room-canvas-background { fill: #f7f9fc; stroke: #cbd5e1; stroke-width: 2; }
.custom-room-canvas polyline { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.custom-room-canvas polygon { fill: rgba(20,88,212,.14); stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; }
.custom-room-preview { stroke: #3b82f6; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 12 8; }
.custom-room-preview.is-invalid { stroke: #b42318; }
.custom-room-preview-label, .custom-room-side-number, .custom-room-dimension-label, .custom-room-angle-label { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.custom-room-preview-label { fill: #174a88; font: 700 16px/1 sans-serif; }
.custom-room-closing-guide { fill: none; stroke: #cbd5e1; stroke-width: 2; stroke-dasharray: 8 7; opacity: .9; pointer-events: none; vector-effect: non-scaling-stroke; }
.custom-room-closing-guide.is-closeable { stroke: #94a3b8; opacity: .95; }
.custom-room-preview-label, .custom-room-side-number, .custom-room-angle-label { pointer-events: none; }
.custom-room-side-number { fill: #174a88; font: 800 15px/1 sans-serif; }
.custom-room-dimension-group { color: var(--primary-dark); cursor: pointer; }
.room-scene-dimension-group { cursor: default; }
.room-scene-dimension-group .custom-room-dimension-label { pointer-events: none; }
.custom-room-dimension-line, .custom-room-dimension-extension { fill: none; stroke: currentColor; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.custom-room-dimension-extension { opacity: .7; pointer-events: none; }
.custom-room-dimension-hit { fill: none; stroke: transparent; stroke-width: 28; pointer-events: stroke; vector-effect: non-scaling-stroke; }
.custom-room-dimension-arrow { fill: currentColor; stroke: none; }
.custom-room-dimension-line { pointer-events: stroke; }
.custom-room-dimension-label { fill: currentColor; font: 600 .9rem/1 sans-serif; pointer-events: all; }
.custom-room-dimension-group:hover, .custom-room-dimension-group:focus { color: #0f6bdc; outline: none; }
.custom-room-dimension-group:focus .custom-room-dimension-label { stroke: #dbeafe; stroke-width: 8px; }
.custom-room-angle-label { fill: #596579; font: 400 12px/1 sans-serif; }
.custom-room-angle-label[role="button"] { pointer-events: all; cursor: pointer; }
.custom-room-angle-label[role="button"]:focus { outline: none; stroke: #dbeafe; stroke-width: 8px; }
.custom-room-angle-square { fill: none; stroke: #1458d4; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.custom-room-angle-arc { fill: none; stroke: #7d8898; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.custom-room-angle-arc.is-non-right { stroke: #b9650c; stroke-width: 2; }
.custom-room-angle-label.is-non-right { fill: #a85708; }
.custom-room-wall-handle { fill: none; stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: move; }
.custom-room-arc-handle { cursor: grab; }
.custom-room-arc-handle:active { cursor: grabbing; }
.custom-room-arc-handle-hit { fill: transparent; stroke: transparent; }
.custom-room-arc-handle-dot { fill: #dbeafe; stroke: #174a88; stroke-width: 3; transition: r .12s ease, fill .12s ease; }
.custom-room-arc-handle:hover .custom-room-arc-handle-dot { r: 8px; fill: #fff; }
.custom-room-arc-handle.is-arc .custom-room-arc-handle-dot { fill: #174a88; stroke: #fff; }
.custom-room-vertex { cursor: grab; }
.custom-room-vertex:active { cursor: grabbing; }
.custom-room-vertex circle { fill: #fff; stroke: #174a88; stroke-width: 3; transition: r .12s ease, fill .12s ease, stroke .12s ease; }
.custom-room-vertex.is-free circle { r: 12px; fill: #e8f1ff; stroke-width: 4; }
.custom-room-vertex.is-snap-target circle { r: 17px; fill: #dcfce7; stroke: #16803c; stroke-width: 5; }
.custom-room-opening { cursor: pointer; }
.custom-room-opening rect { fill: #c77722; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(23,32,42,.35)); }
.custom-room-opening.is-window rect { fill: #1988d8; }
.custom-room-opening .custom-room-opening-part { fill: #1988d8; rx: 0; }
.custom-room-opening .custom-room-opening-part.is-balcony-door { fill: #c77722; }
.custom-room-opening .custom-room-opening-part.has-frame-damage { stroke: #b42318; stroke-width: 3; }
.custom-room-opening .custom-room-opening-part.has-filling-damage { fill: #b42318; fill-opacity: .8; }
.custom-room-opening .custom-room-opening-part.has-sill-damage { stroke: #b42318; stroke-width: 4; }
.custom-room-opening .custom-room-opening-part.has-hardware-damage { stroke: #b42318; stroke-dasharray: 2 2; }
.custom-room-opening.is-doorway rect { fill: #b77832; stroke: #7a4a1c; stroke-dasharray: 4 2; }
.custom-room-opening.is-entrance rect { fill: #8f511f; stroke: #2b190e; stroke-width: 3; }
.custom-room-opening.is-double-entrance rect { stroke-width: 4; }
.custom-room-opening.has-damage rect { stroke: #b42318; stroke-width: 3; stroke-dasharray: 5 3; }
.custom-room-opening text { fill: #fff; font: 700 11px/1 sans-serif; pointer-events: none; }
.custom-room-opening rect.custom-room-opening-hit { fill: transparent; stroke: none; filter: none; pointer-events: all; }
.custom-room-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.custom-room-modes { display: flex; flex-wrap: wrap; gap: .5rem; }
.custom-room-template { width: auto; min-width: 170px; }
[data-custom-room-pan][aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: #edf4ff; }
.custom-room-pan-icon { display: block; width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.custom-room-editor.is-fullscreen { position: fixed; z-index: 1000; inset: 0; overflow: auto; overscroll-behavior: contain; padding: 12px; background: #fff; }
.custom-room-editor.is-fullscreen .custom-room-canvas { min-height: min(70vh, 700px); }
.custom-room-editor.is-fullscreen .custom-room-actions { position: sticky; z-index: 4; bottom: 0; padding: 8px; border: 1px solid #d9e1ec; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 -4px 18px rgba(23,32,42,.08); }
body.has-custom-room-fullscreen { overflow: hidden; }
.custom-room-rotate-icon { display: inline-grid; width: 36px; min-width: 36px; height: 36px; padding: 0; place-items: center; font-size: 1.25rem; line-height: 1; }
.custom-room-angle-mode { display: inline-flex; width: fit-content; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid #d9e1ec; border-radius: 10px; background: #fff; color: #334155; font-size: .9rem; cursor: pointer; }
.custom-room-angle-mode input { width: auto; margin: 0; }
.custom-room-actions [hidden], .custom-room-dimensions[hidden], .custom-room-canvas [hidden] { display: none; }
.custom-room-dimensions { width: calc(100% - 32px); margin-inline: 16px; }
.custom-room-wall-picker { display: none; gap: .35rem; margin-bottom: .65rem; color: #334155; font-size: .82rem; }
.custom-room-wall-picker select { width: 100%; }
.custom-room-dimensions [data-custom-room-wall-list] { display: grid; gap: .55rem; }
.custom-room-wall-input { display: grid; grid-template-columns: minmax(92px, .65fr) repeat(2, minmax(120px, 1fr)); align-items: start; gap: .65rem; padding: .65rem; border: 1px solid #e2e8f0; border-radius: 10px; color: #334155; font-size: .88rem; background: #fff; }
.custom-room-wall-input > strong { align-self: center; color: #174a88; }
.custom-room-wall-input > label { display: grid; grid-template-rows: 42px 48px 44px auto; align-self: start; gap: .3rem; }
.custom-room-wall-input > label > input[type="number"] { width: 100%; height: 48px; }
.custom-room-wall-input > label > .custom-room-lock { align-self: start; }
.custom-room-wall-input small { color: var(--muted); font-size: .76rem; }
.custom-room-lock { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .76rem; }
.custom-room-lock input { width: auto; }
.custom-room-topology-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.custom-room-notch-dialog { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.42); }
.custom-room-notch-dialog[hidden] { display: none; }
.custom-room-notch-card { width: min(480px, 100%); padding: 18px; border-radius: 18px; background: #fff; box-shadow: 0 20px 55px rgba(15,23,42,.28); }
.custom-room-notch-card h5 { margin: 0 0 .35rem; }
.custom-room-wall-dialog { position: fixed; z-index: 1150; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.42); }
.custom-room-wall-dialog[hidden] { display: none; }
.custom-room-wall-dialog-card { width: min(500px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; border-radius: 20px; background: #fff; box-shadow: 0 20px 55px rgba(15,23,42,.28); }
.custom-room-wall-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.custom-room-wall-dialog-heading h5 { margin: 0; font-size: 1.25rem; }
.custom-room-wall-dialog-close { width: 44px; height: 44px; border: 1px solid #c9d5e5; border-radius: 12px; background: #fff; color: #172033; font-size: 1.35rem; cursor: pointer; }
.custom-room-wall-dialog-card label { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); }
.custom-room-wall-dialog-card input, .custom-room-wall-dialog-card select { min-height: 48px; }
.custom-room-wall-dialog-lock { display: flex !important; grid-template-columns: auto 1fr; align-items: center; color: #174a88 !important; font-weight: 600; }
.custom-room-wall-dialog-lock input { width: 22px; min-height: 22px; }
.custom-room-wall-dialog-actions { display: grid; gap: 10px; margin-top: 14px; }
.custom-room-wall-dialog-topology { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.custom-room-wall-dialog-actions .button { min-height: 46px; }
.custom-room-notch-fields { display: grid; gap: .7rem; margin: 1rem 0; }
.custom-room-notch-fields label { display: grid; gap: .3rem; color: var(--muted); }
.custom-room-notch-fields input, .custom-room-notch-fields select { min-height: 48px; }
.custom-room-notch-actions { display: flex; gap: .5rem; }
.custom-room-notch-actions .button { width: 100%; min-height: 48px; }
.custom-room-wall-angle[hidden] { display: none; }
.custom-room-sketch-upload { margin-top: .65rem; }
.custom-room-model { width: calc(100% + 32px); margin-inline: -16px; padding: 0; border: 0; border-radius: 0; overflow: visible; background: #fff; }
.custom-room-model-stage { min-height: 0; margin: 0; overflow: visible; }
.custom-room-topbar { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 4px 9px; border-bottom: 1px solid #e2e8f0; }
.custom-room-title { min-width: 0; }
.custom-room-title h4 { margin: 0; font-size: 1.05rem; line-height: 1.15; }
.custom-room-title span { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.custom-room-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.custom-room-icon-button, .custom-room-toolrail button, .custom-room-bottom-tools button, .custom-room-overlay-button { display: inline-grid; min-width: 44px; min-height: 44px; place-items: center; border: 1px solid #cfdaea; border-radius: 11px; background: rgba(255,255,255,.96); color: #172033; font: 800 1.18rem/1 sans-serif; cursor: pointer; }
.custom-room-icon-button:disabled, .custom-room-toolrail button:disabled, .custom-room-bottom-tools button:disabled { opacity: .38; cursor: default; }
.custom-room-menu { position: relative; }
.custom-room-menu > summary { list-style: none; }
.custom-room-menu > summary::-webkit-details-marker { display: none; }
.custom-room-menu-panel { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; display: grid; width: min(310px, calc(100vw - 32px)); gap: 5px; padding: 8px; border: 1px solid #cfdaea; border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.18); }
.custom-room-menu-panel > button, .custom-room-menu-panel > label, .custom-room-menu-panel > details { min-height: 44px; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: #172033; font: 600 .9rem/1.25 sans-serif; text-align: left; cursor: pointer; }
.custom-room-menu-panel > button:hover, .custom-room-menu-panel > label:hover { background: #edf4ff; }
.custom-room-menu-panel label { display: flex; align-items: center; gap: 9px; }
.custom-room-menu-panel input { width: auto; margin: 0; }
.custom-room-menu-panel details p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.custom-room-editor { position: relative; display: grid; width: 100%; gap: 7px; }
.custom-room-canvas-shell { position: relative; width: 100%; min-height: clamp(440px, 62vh, 680px); overflow: hidden; border: 1px solid #cfdaea; border-radius: 12px; background: #f8fbff; }
.custom-room-canvas { --grid-minor: 14px; --grid-major: 70px; --grid-x: 0px; --grid-y: 0px; width: 100%; height: clamp(440px, 62vh, 680px); max-height: none; min-height: 0; border-radius: 0; background-color: #f8fbff; background-image: linear-gradient(rgba(75,112,166,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(75,112,166,.14) 1px, transparent 1px), linear-gradient(rgba(51,91,151,.23) 1px, transparent 1px), linear-gradient(90deg, rgba(51,91,151,.23) 1px, transparent 1px); background-position: var(--grid-x) var(--grid-y); background-size: var(--grid-minor) var(--grid-minor), var(--grid-minor) var(--grid-minor), var(--grid-major) var(--grid-major), var(--grid-major) var(--grid-major); }
.custom-room-canvas-background { fill: transparent; stroke: none; }
.room-plan-empty-label { fill: #64748b; font: 700 16px/1 sans-serif; pointer-events: none; }
.custom-room-canvas polyline, .custom-room-canvas polygon { stroke: #1f5fd4; stroke-width: 3.5; }
.custom-room-canvas polygon { fill: rgba(31,95,212,.13); }
.custom-room-modes { position: absolute; z-index: 7; top: 8px; left: 8px; right: 60px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.custom-room-modes > * { pointer-events: auto; }
.custom-room-modes > button { flex: 0 0 44px; padding: 0; font-size: 1.25rem; }
.custom-room-modes > button:disabled { opacity: .38; cursor: default; }
.custom-room-modes .custom-room-angle-mode { white-space: nowrap; }
.custom-room-angle-mode, .custom-room-overlay-button { min-height: 44px; padding: 0 12px; border-color: #c9d5e5; border-radius: 11px; background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(15,23,42,.06); font-size: .82rem; }
.custom-room-overlay-button { width: auto; font-weight: 700; }
.custom-room-toolrail { position: absolute; z-index: 8; top: 62px; right: 8px; display: grid; max-height: calc(100% - 70px); gap: 6px; overflow-y: auto; }
.custom-room-toolrail button { padding: 0; font-size: 1.25rem; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.custom-room-toolrail button[aria-pressed="true"] { border-color: var(--primary); background: #e8f1ff; color: var(--primary); }
.custom-room-summary { display: flex; min-height: 32px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; color: #596579; font-size: .84rem; }
.custom-room-summary span + span::before { margin-right: 12px; content: "|"; color: #a5b2c4; }
.custom-room-summary strong { color: #172033; }
.custom-room-editor > [data-custom-room-hint] { min-height: 18px; margin: 0; padding: 0 6px; text-align: center; font-size: .8rem; }
.custom-room-bottom-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.custom-room-bottom-tools button { display: flex; min-width: 0; gap: 7px; padding: 0 10px; font-size: .82rem; }
.custom-room-bottom-tools button span[aria-hidden="true"] { font-size: 1.2rem; }
.custom-room-bottom-tools [data-custom-room-close-label] { font-size: .82rem; }
.custom-room-bottom-tools [data-custom-room-close].is-closed,
.custom-room-bottom-tools [data-custom-room-close].is-closed:disabled { border-color: #1458d4; background: #1458d4; color: #fff; opacity: 1; }
.custom-room-editor.is-clean .custom-room-modes, .custom-room-editor.is-clean [data-custom-room-wall-handles], .custom-room-editor.is-clean [data-custom-room-vertices], .custom-room-editor.is-clean [data-custom-room-angle-labels], .custom-room-editor.is-clean .custom-room-preview, .custom-room-editor.is-clean .custom-room-preview-label { display: none; }
.custom-room-editor.is-clean [data-custom-room-clean] { border-color: var(--primary); background: #e8f1ff; color: var(--primary); }
.custom-room-editor.is-clean .custom-room-canvas-background { display: none; }
.custom-room-editor.is-clean .custom-room-canvas-shell { border: 0; background: #fff; }
.custom-room-editor.is-clean .custom-room-canvas { background: #fff; }
.custom-room-editor.is-clean .custom-room-canvas polyline,
.custom-room-editor.is-clean .custom-room-canvas polygon { stroke: #111827; }
.custom-room-editor.is-clean .custom-room-canvas polygon { fill: #fff; }
.custom-room-editor.is-clean .custom-room-dimension-group { color: #111827; }
.custom-room-editor.is-clean .custom-room-dimension-label { fill: #111827; stroke: #fff; }
.custom-room-editor.is-clean .custom-room-side-number { fill: #111827; stroke: #fff; }
.custom-room-editor.is-clean [data-custom-room-opening-markers] * { fill: #fff; stroke: #111827; }
.custom-room-editor.is-clean [data-custom-room-opening-markers] text { fill: #111827; stroke: #fff; }
.custom-room-editor.is-clean .custom-room-closing-guide { stroke: #cbd5e1; }
.custom-room-smart-guide { stroke: #cbd5e1; stroke-width: 1.5; stroke-dasharray: 6 5; opacity: .9; vector-effect: non-scaling-stroke; pointer-events: none; }
.custom-room-template-dialog { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.46); }
.custom-room-template-dialog[hidden] { display: none; }
.custom-room-template-card { width: min(660px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.3); }
.custom-room-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.custom-room-dialog-heading h5 { margin: 0; font-size: 1.18rem; }
.custom-room-dialog-heading p { margin: 6px 0 14px; color: var(--muted); }
.custom-room-dialog-heading button { display: grid; min-width: 44px; min-height: 44px; place-items: center; border: 1px solid #cfdaea; border-radius: 11px; background: #fff; font-size: 1.5rem; cursor: pointer; }
.custom-room-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.custom-room-template-grid button { display: grid; min-height: 150px; place-items: center; gap: 5px; padding: 12px; border: 1px solid #cfdaea; border-radius: 14px; background: #fff; color: #172033; font: 800 .95rem/1.15 sans-serif; cursor: pointer; }
.custom-room-template-grid button:hover, .custom-room-template-grid button:focus-visible { border-color: var(--primary); background: #f8fbff; }
.custom-room-template-grid svg { width: min(150px, 90%); height: 75px; }
.custom-room-template-grid path { fill: none; stroke: #1f5fd4; stroke-width: 4; stroke-linejoin: round; }
.custom-room-editor.is-fullscreen { grid-template-rows: minmax(0, 1fr) auto auto auto; overflow: hidden; padding: 8px; }
.custom-room-editor.is-fullscreen .custom-room-canvas-shell, .custom-room-editor.is-fullscreen .custom-room-canvas { height: calc(100dvh - 150px); min-height: 320px; max-height: none; }
.custom-room-editor.is-fullscreen .custom-room-toolrail { top: 62px; }
@media (orientation: portrait) {
  .custom-room-modes { right: 8px; }
  .custom-room-toolrail,
  .custom-room-editor.is-fullscreen .custom-room-toolrail {
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    max-height: none;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }
}
.custom-room-model > .room-model-stats { margin-top: 18px; }
.custom-room-dimension-label { font-size: .9rem; }
.room-sketch-gallery { display: grid; width: 100%; justify-items: center; gap: 18px; margin: 16px 0; }
.room-sketch-image { display: block; width: min(100%, 1120px); max-height: none; border: 1px solid var(--line); border-radius: 10px; object-fit: contain; background: white; }
.room-model { container-type: inline-size; }
.room-model-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; color: var(--muted); font-size: .9rem; }
.room-model-stats strong { color: var(--ink); }
.formset-delete-input { display: none; }
.add-row-button { margin: 0 0 18px; }
.room-defect-save { margin-top: 18px; }
.surface-combined-split { margin: 16px 0; }
.surface-element:not(.is-combined) [data-surface-combined-fields] { display: none !important; }
.surface-covering { margin: 16px 0; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; background: #f8fafc; }
.surface-covering h4 { margin: 0 0 14px; }
@media (max-width: 700px) { .surface-combined-split { max-width: none; } }
@media (max-width: 520px) { .file-upload-menu { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .custom-room-wall-dialog, .custom-room-notch-dialog { place-items: end center; padding: 0; } .custom-room-wall-dialog-card, .custom-room-notch-card { width: 100%; max-height: 88dvh; overflow: auto; border-radius: 20px 20px 0 0; } }
@media (max-width: 520px) { .room-model { padding: 14px; } .room-model-stage, .room-3d-viewport { min-height: 280px; } .room-model-hint-3d { align-items: flex-start; flex-direction: column; } }
@media (max-width: 520px) {
  .room-model.custom-room-model { padding: 0; }
  .custom-room-topbar { align-items: flex-start; flex-direction: column; }
  .custom-room-top-actions { width: 100%; justify-content: space-between; }
  .custom-room-top-actions .room-model-switch { margin-right: auto; }
  .custom-room-icon-button { min-width: 44px; }
  .custom-room-canvas-shell, .custom-room-canvas { height: min(63dvh, 600px); min-height: 430px; }
  .custom-room-modes { right: 54px; }
  .custom-room-angle-mode, .custom-room-overlay-button { min-height: 42px; padding-inline: 9px; font-size: .75rem; }
  .custom-room-bottom-tools button { min-height: 48px; padding-inline: 5px; }
  .custom-room-template-card { padding: 14px; }
  .custom-room-template-grid { gap: 7px; }
  .custom-room-template-grid button { min-height: 126px; padding: 8px; font-size: .78rem; }
  .custom-room-template-grid svg { height: 62px; }
  .custom-room-summary { gap: 3px 7px; font-size: .76rem; }
  .custom-room-summary span + span::before { margin-right: 7px; }
  .custom-room-wall-picker { display: grid; }
  .custom-room-wall-input { display: none; grid-template-columns: 1fr 1fr; }
  .custom-room-wall-input.is-selected { display: grid; }
  .custom-room-wall-input > strong { grid-column: 1 / -1; }
}
.room-plan-toolrail { top: auto; right: auto; bottom: 8px; left: 50%; display: flex; max-height: none; overflow: visible; transform: translateX(-50%); }
@media (orientation: portrait) {
  .room-plan-toolrail { top: auto; right: auto; bottom: 8px; left: 50%; display: flex; width: max-content; grid-auto-columns: auto; overflow: visible; }
}
.compact-row { margin-bottom: 12px; }
.delete-field { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--danger); font-size: .85rem; }
.delete-field input { width: auto; }
.datetime-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.datetime-now-button { width: 44px; padding: 9px; }
.datetime-now-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.time-field-control { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; }
.time-field-control input[type="time"] { height: 44px; appearance: textfield; -webkit-appearance: none; }
.time-field-control input[type="time"]::-webkit-calendar-picker-indicator,
.time-field-control input[type="time"]::-webkit-inner-spin-button { display: none; }
.time-field-picker-button { display: grid; width: 46px; height: 44px; min-height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); cursor: pointer; }
.time-field-picker-button:hover, .time-field-picker-button:focus-visible { border-color: var(--primary); color: var(--primary); background: #edf4ff; }
.time-field-picker-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.auth-layout { display: grid; min-height: calc(100vh - 150px); place-items: center; }
.auth-card { width: min(420px, 100%); padding: 32px; }

.window-calculator-page { display: grid; gap: 22px; }
.window-calculator-breadcrumb a { color: var(--primary); font-weight: 700; text-decoration: none; }
.window-calculator-upload { padding: 28px; }
.window-calculator-upload h1 { margin: 4px 0 10px; }
.window-calculator-form { display: grid; max-width: 760px; gap: 10px; margin-top: 22px; }
.window-calculator-form > label { font-weight: 700; }
.window-calculator-form input[type="file"] { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.window-calculator-form .errorlist { margin: 0; padding-left: 20px; color: var(--danger); }
.window-calculator-form .button { width: fit-content; margin-top: 6px; }
.window-calculator-privacy { margin: 18px 0 0; }
.window-calculator-result { display: grid; gap: 18px; }
.window-calculator-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.window-calculator-result-heading h2, .window-calculator-result-heading p { margin: 0; }
.window-calculator-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.window-calculator-metrics .card { display: grid; min-height: 116px; align-content: space-between; gap: 12px; padding: 18px; }
.window-calculator-metrics span { color: var(--muted); font-size: .9rem; }
.window-calculator-metrics strong { color: var(--ink); font-size: 1.45rem; }
.window-calculator-warnings { padding: 18px 20px; border: 1px solid #f2d18b; border-radius: 12px; background: #fff8e8; color: #6f4b00; }
.window-calculator-warnings h3 { margin: 0 0 8px; }
.window-calculator-warnings ul { margin: 0; padding-left: 20px; }
.window-calculator-room { padding: 0; overflow: hidden; }
.window-calculator-room-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.window-calculator-room-heading h3 { margin: 0; }
.window-calculator-room-heading span { color: var(--muted); }
.window-calculator-table-wrap { overflow-x: auto; }
.window-calculator-table { width: 100%; min-width: 1120px; border-collapse: collapse; font-size: .82rem; }
.window-calculator-table th, .window-calculator-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.window-calculator-table th { background: #edf4ff; color: #174a88; font-weight: 800; }
.window-calculator-table td small { display: block; max-width: 320px; margin-top: 5px; color: #825500; line-height: 1.35; }
.window-calculator-empty { padding: 20px; }

@media (max-width: 800px) {
  .page-heading, .object-card, .report-card { align-items: stretch; flex-direction: column; }
  .report-assignment-form { grid-template-columns: 1fr 1fr; }
  .heading-actions { justify-content: flex-start; }
  .export-format-actions { margin-left: 0; }
  .object-meta { align-items: flex-start; }
  .detail-grid, .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-nav { position: static; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-nav a, .form-field label { overflow-wrap: anywhere; }
  .review-actions { grid-template-columns: 1fr; }
  .repeatable-grid { grid-template-columns: 1fr; }
  .room-meta-fields { grid-template-columns: 1fr; }
  .room-shape-toggle { min-width: 0; width: 100%; }
  .repeatable-grid .delete-field { grid-column: auto; }
  .history-row { grid-template-columns: 1fr; }
  .history-row p { grid-column: auto; }
  .work-report-card { grid-template-columns: minmax(0, 1fr); }
  .work-report-meta { grid-template-columns: auto minmax(0, 1fr); }
  .window-calculator-result-heading { align-items: stretch; flex-direction: column; }
  .window-calculator-result-heading .button { width: 100%; }
  .window-calculator-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1120px); }
  .user-menu > span { display: none; }
  .header-inner { gap: 12px; }
  .header-branding { gap: 7px; font-size: .88rem; }
  .user-menu { gap: 8px; }
  .form-card, .report-section, .detail-grid > .card { padding: 18px; }
  .owner-toggle { width: 100%; min-width: 0; }
  .form-field .owner-toggle-option { min-width: 0; padding: 0 10px; }
  .time-field-control { grid-template-columns: minmax(0, 1fr) 44px; }
  .file-upload-dropzone { align-items: center; min-height: 96px; padding: 14px; }
  .asset-batch-card, .file-upload-control, .file-upload-dropzone { min-width: 0; max-width: 100%; }
  .export-actions, .export-actions form, .export-format-actions { width: 100%; min-width: 0; }
  .export-submit { white-space: normal; line-height: 1.25; }
  .inline-form, .form-actions { align-items: stretch; flex-direction: column; }
  .assignment-panel { padding: 18px; }
  .report-assignment-form { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; gap: 4px; }
  .details dd { margin-bottom: 10px; }
  .inspection-home { padding: 30px 18px; }
  .inspection-home-actions form, .inspection-home-actions .button { width: 100%; }
  .inspection-home-secondary-actions { display: grid; grid-template-columns: 1fr; }
  .inspection-storage-heading, .inspection-storage-row, .inspection-storage-cleanup { grid-template-columns: 1fr; }
  .inspection-storage-heading { display: grid; }
  .inspection-storage-heading .button, .inspection-storage-row .button, .inspection-storage-cleanup .button { width: 100%; }
  .pwa-offline-shell { align-items: stretch; flex-direction: column; }
  .pwa-offline-shell .button { width: 100%; }
  .pwa-storage-shell { align-items: flex-start; }
  .client-signature-heading { align-items: stretch; flex-direction: column; }
  .client-signature-heading .status { align-self: flex-start; }
  .client-signature-summary:has(> .client-signature-preview) { grid-template-columns: 1fr; }
  .participant-signature-list { grid-template-columns: 1fr; }
  .client-signature-actions, .client-signature-form-actions { display: grid; grid-template-columns: 1fr; }
  .client-signature-actions .button, .client-signature-form-actions .button { width: 100%; }
  .client-signature-dialog { max-height: calc(100dvh - 16px); border-radius: 14px; padding: 22px 16px; }
  .client-signature-pad canvas { height: 210px; }
  .movable-property-fields { grid-template-columns: 1fr; }
  .window-calculator-upload { padding: 20px 16px; }
  .window-calculator-form .button { width: 100%; }
  .window-calculator-metrics { grid-template-columns: 1fr; }
}

/* iOS WebKit 26 counts an input's padding outside width: 100% for native
   date controls. Keep the padding on the internal value instead. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 520px) {
    input[type="date"], input[type="datetime-local"] { padding: 0; }
    input[type="date"]::-webkit-date-and-time-value,
    input[type="datetime-local"]::-webkit-date-and-time-value {
      box-sizing: border-box;
      min-width: 0;
      padding: 10px 0 10px 11px;
    }
  }
}
