/* SOGpt UI v2 · Unit Layout (Production Agent), 12 Nov 2026: settings on the left, options and the open plan on the right.
   Tokens from styles.css; compact title bar, results first. Plan colours come from the engine's style.json (office standard). */
:root[data-ui=v2] #view-unit-layout.active { display:block; height:100%; padding:0; overflow:hidden; position:relative; }
.ul-view [hidden] { display:none !important; }
.ul-view button:focus-visible, .ul-view a:focus-visible, .ul-view input:focus-visible, .ul-view select:focus-visible, .ul-view summary:focus-visible, .ul-view .ul-e-hit:focus-visible { outline:none; box-shadow:var(--focus-ring); }
.ul-shell { height:100%; display:grid; grid-template-columns:330px minmax(0, 1fr); min-height:0; }

.ul-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:30px; padding:0 12px; border:1px solid var(--hairline-strong); border-radius:var(--r-2); background:transparent; color:var(--text-1); font:500 12.5px/1 var(--font-ui); cursor:pointer; white-space:nowrap; text-decoration:none; }
.ul-btn:hover:not(:disabled) { background:var(--surface-3); }
.ul-btn.primary { border-color:transparent; background:var(--gold); color:var(--on-gold); font-weight:600; }
.ul-btn.primary:hover:not(:disabled) { background:var(--gold-hover); }
.ul-btn:disabled { opacity:.45; cursor:default; }
.ul-btn.small { height:26px; padding:0 9px; font-size:12px; }
.ul-chip { display:inline-flex; align-items:center; gap:5px; flex:none; padding:2px 7px; border-radius:var(--r-1); font:500 11px/16px var(--font-ui); font-style:normal; white-space:nowrap; }
.ul-chip.ok { color:var(--ok); background:color-mix(in srgb, var(--ok) 13%, transparent); }
.ul-chip.bad { color:var(--danger); background:color-mix(in srgb, var(--danger) 13%, transparent); }
.ul-chip.busy { color:var(--gold-hover); background:var(--gold-soft); }
.ul-chip.wait { color:var(--text-2); background:var(--surface-3); }
.ul-spin { width:11px; height:11px; border:2px solid var(--hairline-strong); border-top-color:var(--gold); border-radius:50%; animation:ul-spin .9s linear infinite; display:inline-block; box-sizing:border-box; }
@keyframes ul-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ul-spin { animation:none; } }
.ul-muted { color:var(--text-3); font:400 12px/17px var(--font-ui); }
.ul-none { margin:4px 0; color:var(--text-3); font:400 12px/17px var(--font-ui); }
.ul-grow { flex:1; }

/* settings */
.ul-side { display:flex; flex-direction:column; min-height:0; overflow:auto; border-right:1px solid var(--hairline); background:var(--surface-1); }
.ul-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:14px 16px 4px; }
.ul-title { margin:0; color:var(--text-1); font:650 17px/22px var(--font-ui); }
.ul-ver { color:var(--text-4); font:400 11px/16px var(--font-ui); }
.ul-form { display:flex; flex-direction:column; gap:10px; padding:8px 16px 12px; }
.ul-seg { display:grid; grid-template-columns:repeat(3, 1fr); border:1px solid var(--hairline-strong); border-radius:var(--r-2); overflow:hidden; }
.ul-seg button { height:30px; border:0; border-right:1px solid var(--hairline); background:transparent; color:var(--text-2); font:600 12.5px/1 var(--font-ui); cursor:pointer; }
.ul-seg button:last-child { border-right:0; }
.ul-seg button[aria-checked=true] { background:var(--gold-soft); color:var(--text-1); box-shadow:inset 0 -2px 0 var(--gold); }
.ul-pair { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ul-pair label, .ul-form > label { display:flex; flex-direction:column; gap:3px; color:var(--text-3); font:500 11.5px/15px var(--font-ui); }
.ul-pair label > span { display:flex; align-items:center; gap:5px; color:var(--text-3); font:400 12px/1 var(--font-ui); }
.ul-form input[type=number], .ul-form select { width:100%; min-width:0; height:28px; padding:0 8px; border:1px solid var(--hairline-strong); border-radius:var(--r-2); background:var(--surface-2); color:var(--text-1); font:500 12.5px/1 var(--font-ui); box-sizing:border-box; }
.ul-check { display:flex !important; flex-direction:row !important; align-items:center; gap:7px; color:var(--text-2) !important; font:400 12.5px/17px var(--font-ui) !important; }
.ul-edges { display:grid; grid-template-columns:1fr; gap:4px; }
.ul-edge-svg { width:100%; height:auto; aspect-ratio:26 / 17; border:1px solid var(--hairline); border-radius:var(--r-2); background:var(--surface-2); }
.ul-e-body { fill:color-mix(in srgb, var(--text-1) 4%, transparent); }
.ul-e { stroke-width:5; stroke-linecap:square; }
.ul-e-front { stroke:#3d8bd4; stroke-width:8; }
.ul-e-facade { stroke:#3d8bd4; stroke-opacity:.5; stroke-width:4; }
.ul-e-corridor { stroke:var(--gold); stroke-dasharray:6 4; }
.ul-e-party { stroke:var(--text-4); }
.ul-e-hit { stroke:transparent; stroke-width:18; cursor:pointer; }
.ul-e-hit:hover { stroke:color-mix(in srgb, var(--gold) 25%, transparent); }
.ul-e-entry { stroke:#c0392b; stroke-width:7; }
.ul-e-lab { fill:var(--text-3); font:600 10px var(--font-ui); pointer-events:none; }
.ul-e-front-lab { fill:#3d8bd4; font-size:7.5px; font-weight:700; letter-spacing:.06em; }
.ul-e-size { fill:var(--text-2); font:500 11px var(--font-ui); pointer-events:none; }
.ul-e-north path { fill:var(--text-2); }
.ul-e-north text { fill:var(--text-2); font:700 8px var(--font-ui); }
.ul-edge-list { display:grid; grid-template-columns:minmax(0, 1fr); gap:0; }   /* one row per edge: "Front facade" + balcony overflow a half-width column */
.ul-edge-row { display:grid; grid-template-columns:14px 1fr auto; align-items:center; gap:6px; font:400 12px/20px var(--font-ui); color:var(--text-2); }
.ul-edge-row b { color:var(--text-3); font-weight:600; }
.ul-edge-type { white-space:nowrap; }
.ul-edge-type.ul-t-front { color:#3d8bd4; font-weight:600; }
.ul-edge-type.ul-t-facade { color:color-mix(in srgb, #3d8bd4 70%, var(--text-3)); }
.ul-edge-type.ul-t-corridor { color:var(--gold-hover); }
.ul-mini { display:flex; align-items:center; gap:3px; color:var(--text-3); font:400 11px/1 var(--font-ui); }
.ul-ranges { border:1px solid var(--hairline); border-radius:var(--r-2); padding:0 8px; }
.ul-ranges summary { padding:7px 0; color:var(--text-2); font:600 12px/16px var(--font-ui); cursor:pointer; }
.ul-ranges summary small { margin-left:6px; color:var(--text-3); font-weight:400; }
.ul-ranges-body { overflow-x:auto; }
.ul-rt { width:100%; border-collapse:collapse; font:400 11.5px/1.3 var(--font-ui); color:var(--text-2); }
.ul-rt th { padding:3px 2px; color:var(--text-3); font-weight:500; text-align:left; white-space:nowrap; }
.ul-rt td { padding:2px; white-space:nowrap; }
.ul-rt input { width:40px !important; height:24px !important; padding:0 3px !important; font-size:11.5px !important; }
.ul-rt i { margin:0 1px; color:var(--text-4); font-style:normal; }
.ul-ranges .ul-btn { margin:6px 0 8px; }
.ul-findings { display:flex; flex-direction:column; gap:4px; }
.ul-f { margin:0; padding:5px 8px; border-radius:var(--r-2); font:400 12px/17px var(--font-ui); }
.ul-f-ok { color:var(--ok); background:color-mix(in srgb, var(--ok) 9%, transparent); }
.ul-f-warn { color:var(--warn); background:color-mix(in srgb, var(--warn) 10%, transparent); }
.ul-f-block { color:var(--danger); background:color-mix(in srgb, var(--danger) 9%, transparent); }
.ul-recent { padding:4px 16px 16px; border-top:1px solid var(--hairline); }
.ul-recent h3 { margin:10px 0 6px; color:var(--text-3); font:600 11.5px/16px var(--font-ui); text-transform:uppercase; letter-spacing:.04em; }
.ul-runs { display:flex; flex-direction:column; gap:2px; }
.ul-run-row { display:grid; grid-template-columns:1fr auto; gap:0 8px; padding:6px 8px; border:0; border-radius:var(--r-2); background:transparent; color:var(--text-1); text-align:left; cursor:pointer; font:500 12.5px/17px var(--font-ui); }
.ul-run-row small { grid-column:1; color:var(--text-3); font:400 11.5px/15px var(--font-ui); }
.ul-run-row .ul-chip { grid-row:1 / span 2; grid-column:2; align-self:center; }
.ul-run-row:hover { background:var(--surface-3); }
.ul-run-row.on { background:var(--gold-soft); }

/* results */
.ul-stale { padding: 10px 12px; margin: 0 0 10px; color: var(--gold-hover); border: 1px solid currentColor; border-radius: 6px; }
.ul-stale[hidden] { display: none; }
.ul-dimmed { opacity: .48; }
.ul-main { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:auto; background:var(--surface-0, var(--surface-1)); }
.ul-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px 16px 8px; color:var(--text-1); font:400 13px/20px var(--font-ui); }
.ul-bar b { font-weight:650; }
.ul-wide { flex-basis:100%; }
.ul-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:8px; padding:0 16px 10px; }
.ul-card { display:flex; flex-direction:column; gap:4px; padding:6px; border:1px solid var(--hairline); border-radius:var(--r-2); background:var(--surface-1); color:var(--text-1); text-align:left; cursor:pointer; }
.ul-card:hover { border-color:var(--hairline-strong); }
.ul-card.on { border-color:var(--gold); box-shadow:0 0 0 1px var(--gold); }
.ul-card-wait { align-items:center; justify-content:center; min-height:150px; cursor:default; color:var(--text-3); border-style:dashed; text-align:center; }
.ul-card-meta { display:grid; grid-template-columns:1fr auto; gap:0 6px; font:400 12px/16px var(--font-ui); }
.ul-card-meta small { grid-column:1 / span 2; color:var(--text-3); font-size:11.5px; }
.ul-score { color:var(--gold-hover); font:700 13px/16px var(--font-ui); }
.ul-score.big { margin-left:6px; font-size:20px; }
.ul-diag { margin:0 16px 10px; padding:10px 12px; border:1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius:var(--r-2); background:color-mix(in srgb, var(--warn) 7%, transparent); }
.ul-diag h3 { margin:0 0 4px; color:var(--text-1); font:600 13px/18px var(--font-ui); }
.ul-diag p { margin:2px 0; color:var(--text-2); font:400 12.5px/18px var(--font-ui); }
.ul-relax { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:6px; }
.ul-relax-item { padding:2px 8px; border:1px solid var(--hairline-strong); border-radius:var(--r-1); color:var(--text-2); font:400 12px/18px var(--font-ui); }
.ul-detail { display:grid; grid-template-columns:minmax(0, 1fr) 300px; gap:12px; padding:0 16px 16px; min-height:0; }
.ul-detail:empty { display:none; }
.ul-plan { display:flex; flex-direction:column; min-width:0; border:1px solid var(--hairline); border-radius:var(--r-2); background:#fff; }
.ul-plan-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid var(--hairline); background:var(--surface-1); font:400 12.5px/18px var(--font-ui); color:var(--text-1); }
.ul-plan-svg { padding:6px; }
.ul-facts { display:flex; flex-direction:column; gap:12px; min-width:0; }
.ul-facts section { border:1px solid var(--hairline); border-radius:var(--r-2); padding:8px 10px; background:var(--surface-1); }
.ul-facts h3 { display:flex; align-items:baseline; margin:0 0 6px; color:var(--text-1); font:600 12.5px/18px var(--font-ui); }
.ul-cat summary { display:grid; grid-template-columns:96px 1fr 26px; align-items:center; gap:8px; padding:2px 0; color:var(--text-2); font:400 12px/18px var(--font-ui); cursor:pointer; list-style:none; }
.ul-cat summary::-webkit-details-marker { display:none; }
.ul-cat summary i { height:5px; border-radius:3px; background:linear-gradient(90deg, var(--gold) var(--v), var(--surface-3) var(--v)); }
.ul-cat summary b { text-align:right; color:var(--text-1); font-weight:600; }
.ul-cat ul, .ul-notes { margin:2px 0 6px; padding-left:16px; color:var(--text-3); font:400 11.5px/16px var(--font-ui); }
.ul-tab { width:100%; border-collapse:collapse; font:400 12px/18px var(--font-ui); color:var(--text-2); }
.ul-tab th { text-align:left; font-weight:500; color:var(--text-2); white-space:nowrap; }
.ul-tab td { text-align:right; white-space:nowrap; padding-left:8px; color:var(--text-1); }
.ul-sw { display:inline-block; width:9px; height:9px; margin-right:6px; border-radius:2px; vertical-align:0; box-shadow:inset 0 0 0 1px rgba(0,0,0,.15); }
.ul-vent { margin-left:5px; padding:0 4px; border-radius:var(--r-1); background:var(--surface-3); color:var(--text-3); font:500 10.5px/15px var(--font-ui); cursor:help; }

/* plans: white paper like the office drawings */
.ul-svg { display:block; width:100%; height:auto; background:#fff; }
.ul-svg.thumb { border-radius:calc(var(--r-2) - 2px); max-height:190px; }
.ul-p-edge { stroke-width:60; }
.ul-p-facade { stroke:#3d8bd4; }
.ul-p-front { stroke:#22609e; stroke-width:120; }                 /* darker than the windows (#3d8bd4) so they still read on it */
.ul-p-front-lab { fill:#22609e; font-family:var(--font-ui); font-weight:700; letter-spacing:.08em; }
.ul-p-corridor { stroke:#c9a227; stroke-dasharray:240 160; }
.ul-p-party { stroke:#9a9a9a; }
.ul-p-fill { stroke:none; }
.ul-p-passage { fill:#fff; stroke:#c8c8c8; stroke-width:18; stroke-dasharray:90 70; }
/* A room with the pockets it took: the pieces without strokes, one outline round them (dashed for a passage). */
.ul-p-passage.ul-p-whole { stroke:none; }
.ul-p-passage-line { stroke:#c8c8c8; stroke-width:18; stroke-dasharray:90 70; }
.ul-p-outline { stroke:none; }
.ul-p-shaft, .ul-p-bal { stroke:none; }
.ul-p-room { cursor:pointer; }
.ul-svg.thumb .ul-p-room { cursor:inherit; }
.ul-p-room:hover .ul-p-fill { filter:brightness(1.05); }
.ul-p-room.kept .ul-p-fill { stroke:#c0392b; stroke-width:55; stroke-dasharray:160 90; }
.ul-p-lab { fill:#1d1d1d; text-anchor:middle; dominant-baseline:middle; font-family:var(--font-ui); font-weight:600; pointer-events:none; paint-order:stroke; stroke-linejoin:round; }
.ul-p-lab.inv { fill:#fff; }
/* The master suite as one block of the plan: one outline round its rooms. */
.ul-p-suite { fill:none; stroke:#1d1d1d; stroke-width:60; stroke-linecap:square; pointer-events:none; }
.ul-svg.thumb .ul-p-suite { stroke-width:110; }
.ul-p-lock { fill:#c0392b; font-family:var(--font-ui); font-weight:700; pointer-events:none; }
.ul-p-win { stroke:#3d8bd4; stroke-width:70; }
/* corridor-side notch (open-to-sky well for a kitchen or utility): the corridor line broken over the opening, a dashed
   bracket outside it and a small NOTCH tag, in the window blue so it reads as a ventilation opening, not a window */
.ul-p-notch-gap { stroke:#fff; stroke-width:76; }
.ul-p-notch-open { stroke:#3d8bd4; stroke-width:22; }
.ul-p-notch { fill:none; stroke:#3d8bd4; stroke-width:30; stroke-dasharray:110 70; stroke-linejoin:miter; }
.ul-p-notch-lab { fill:#22609e; font-family:var(--font-ui); font-weight:700; letter-spacing:.08em; pointer-events:none; }
.ul-p-notch-size { fill:#22609e; font-family:var(--font-ui); font-weight:500; pointer-events:none; }
.ul-p-door-gap { stroke:#fff; stroke-width:110; }
.ul-p-door { stroke:#333; stroke-width:28; }
.ul-p-swing { fill:none; stroke:#555; stroke-width:16; stroke-dasharray:60 45; }
.ul-p-open { stroke:#9a9a9a; stroke-width:14; stroke-dasharray:120 80; }
.ul-p-entry { stroke:#c0392b; stroke-width:70; fill:none; }
.ul-p-arrowhead { fill:#c0392b; }
.ul-p-north path { fill:#333; }
.ul-p-north text, .ul-p-dim { fill:#444; font-family:var(--font-ui); font-weight:600; }

@media (max-width: 1100px) { .ul-detail { grid-template-columns:1fr; } }
@media (max-width: 760px) { .ul-shell { grid-template-columns:1fr; overflow:auto; } .ul-side { border-right:0; border-bottom:1px solid var(--hairline); overflow:visible; } }


/* Area-first brief and results, using the portal's theme tokens. */
:root[data-ui=v2] #view-unit-layout.active { overflow:auto; background:var(--bg); color:var(--text-1); }
.ua-header, .ua-area { max-width:1440px; margin:0 auto; box-sizing:border-box; }
.ua-header { min-height:48px; display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:6px 20px; border-bottom:1px solid var(--hairline); }
.ua-header h1 { margin:0; font:600 15px/1.4 var(--font-ui); }
.ua-header > span { margin-left:auto; color:var(--text-2); font:400 12px/1.4 var(--font-ui); }
.ua-area { padding:12px 20px calc(28px + var(--ua-keep, 0px)); display:flex; flex-direction:column; gap:12px; font:400 13px/1.4 var(--font-ui); }
.ua-area *, .ua-header * { box-sizing:border-box; }
.ua-area button, .ua-header button, .ua-area a { display:inline-flex; align-items:center; justify-content:center; min-height:30px; padding:0 12px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--v2-raised); color:var(--text-1); font:500 12px/1.3 var(--font-ui); cursor:pointer; text-decoration:none; }
.ua-area button:disabled { opacity:.45; cursor:default; }
.ua-area .ua-primary { background:var(--v2-action); color:var(--v2-on-action); border-color:transparent; font-weight:600; }
.ua-seg { display:inline-flex; align-items:center; gap:2px; padding:2px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--bg); }
.ua-seg button { min-height:28px; border:0; padding:0 10px; background:transparent; color:var(--text-2); }
.ua-seg button[aria-pressed=true] { background:var(--v2-raised); color:var(--text-1); }
.ua-brief,.ua-programme,.ua-run,.ua-detail { border:1px solid var(--hairline); border-radius:10px; background:var(--panel); }
.ua-brief { padding:12px 16px; }
.ua-brief-row { display:flex; flex-wrap:wrap; align-items:flex-start; gap:14px 32px; }
.ua-group { display:flex; flex-direction:column; gap:6px; min-width:0; }
#ua-area-group { flex:1 1 390px; }
.ua-caption { font:600 11px/1.4 var(--font-ui); color:var(--text-2); letter-spacing:.06em; text-transform:uppercase; }
.ua-controls,.ua-picks { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px; }
.ua-controls label,.ua-more label { display:flex; flex-direction:column; gap:4px; color:var(--text-2); font-size:11px; }
.ua-controls input,.ua-more input,.ua-more select { height:36px; width:68px; padding:0 10px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--bg); color:var(--text-1); font:500 14px var(--font-mono); }
.ua-controls #ua-target { width:92px; }
.ua-controls .ua-seg { min-height:36px; }
.ua-picks { gap:4px; min-height:36px; align-items:center; }
.ua-picks button { min-height:28px; border-radius:999px; background:transparent; padding:0 10px; }
.ua-picks button[aria-pressed=true] { border-color:#4f9db3; background:var(--v2-accent-soft); color:var(--v2-accent-text); }
.ua-disabled { opacity:.45; }
/* Step 3 opens with what the search will use, or why it cannot run yet, then Settings and Generate; under them what
   every option keeps of step 2. */
.ua-run { padding:10px 16px; }
.ua-run-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.ua-run-row #ua-summary { flex:1 1 200px; min-width:0; }
.ua-run-row button { min-height:36px; padding:0 14px; }
.ua-run-row .ua-primary { font-size:13px; }
.ua-run-row kbd { margin-left:8px; border:1px solid currentColor; border-radius:4px; padding:0 5px; font:500 10px/16px var(--font-mono); opacity:.55; }
#ua-summary.ua-reason { color:var(--text-1); }
#ua-more::after { content:""; width:6px; height:6px; margin:-3px 1px 0 9px; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg); }
#ua-more[aria-expanded=true] { border-color:#4f9db3; background:var(--v2-accent-soft); color:var(--v2-accent-text); }
#ua-more[aria-expanded=true]::after { margin-top:3px; transform:rotate(-135deg); }
#ua-summary { text-wrap:balance; }
.ua-message,.ua-muted { margin:0; color:var(--text-2); font-size:12px; }
.ua-more { display:flex; flex-wrap:wrap; gap:12px 28px; align-items:flex-end; margin-top:12px; padding-top:12px; border-top:1px solid var(--hairline); }
.ua-more > div > label { margin-bottom:4px; }
.ua-more input,.ua-more select { height:34px; width:72px; font-size:12px; }
.ua-programme { min-width:0; padding:14px 16px; }
.ua-results { min-width:0; display:flex; flex-direction:column; gap:12px; }
.ua-prog-head,.ua-results-head,.ua-card-head,.ua-detail-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.ua-results h2 { margin:0; font:600 13px/1.4 var(--font-ui); }
.ua-prog-content { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.ua-pending { opacity:.6; }
.ua-status { border-radius:999px; padding:2px 9px; background:var(--v2-accent-soft); color:var(--v2-accent-text); font-size:12px; }
.ua-status.warning,.ua-warning,.ua-table .below { color:var(--warn); }
.ua-status.danger,.ua-danger,.ua-table .legal_min { color:var(--danger); }
.ua-table .above,.ua-accent { color:var(--v2-accent-text); }
.ua-table td.ua-arrow { font:600 14px/1 var(--font-ui); }
.ua-table-wrap { overflow-x:auto; max-width:100%; }
.ua-table { border-collapse:collapse; width:100%; min-width:400px; font-size:12px; }
.ua-table th { color:var(--text-2); font:500 11px var(--font-ui); text-align:left; }
.ua-table th,.ua-table td { height:28px; border-bottom:1px solid var(--hairline); padding:4px 7px 4px 0; white-space:nowrap; }
.ua-table td:not(:first-child) { font-family:var(--font-mono); }
.ua-table th:nth-child(2),.ua-table td:nth-child(2) { text-align:right; }
.ua-detail-table { min-width:520px; }
.ua-detail-table td.ua-wrap, .ua-detail-table td:last-child:not(.ua-arrow) { white-space:normal; }
@container uadetail (width < 560px) { .ua-detail-table { min-width:0; } }
.ua-mono { margin:0; font:400 12px/1.5 var(--font-mono); color:var(--text-2); }
.ua-alert { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; border:1px solid currentColor; border-radius:8px; padding:8px 12px; }
.ua-alert span { flex:1 1 260px; }
.ua-alert.warning { color:var(--warn); background:color-mix(in srgb,var(--warn) 8%,transparent); }
.ua-alert.danger { color:var(--danger); background:color-mix(in srgb,var(--danger) 8%,transparent); }
.ua-empty { border:1px dashed var(--hairline-strong); border-radius:10px; padding:22px 20px; }
/* The options column takes the focus when the bar's line leads to it and nothing in it can be pressed. */
.ua-results:focus { outline:none; }
.ua-empty p { color:var(--text-2); margin:4px 0 0; }
.ua-empty p + button { margin-top:12px; }
/* Open option head. Which option of how many is said beside its number. One row holds everything only in a wide
   column; under that the head is two rows by design, never by wrapping: back and a pager (‹ Option 1 of 6 ›), then
   what this option is and what to do with it. In a phone column the fit score is the first line of the list instead. */
.ua-detail-head b small { color:var(--text-2); font-weight:400; font-size:12px; }
.ua-short { display:none; }
@container uadetail (width < 840px) {
  .ua-detail-head > [data-ua-cycle] .ua-long { display:none; }
  .ua-detail-head > [data-ua-cycle] .ua-short { display:inline; font-size:18px; line-height:1; }
  .ua-detail-head > .ul-grow { order:1; }
  .ua-detail-head > [data-ua-cycle="-1"] { order:2; }
  .ua-detail-head > b { order:3; }
  .ua-detail-head > [data-ua-cycle="1"] { order:4; }
  .ua-detail-head > [data-ua-cycle] { width:32px; padding:0; justify-content:center; }
  /* The break between the rows is a line of its own: half the row gap on each side of it makes one gap. */
  .ua-detail-head { row-gap:4px; }
  .ua-detail-head::after { content:''; order:5; flex:0 0 100%; height:0; }
  .ua-detail-head > :is(.ua-rec, a) { order:6; }
  .ua-detail-head > a { margin-left:auto; }
}
@container uadetail (width < 520px) {
  .ua-detail-head { column-gap:8px; }
  .ua-detail-head .ua-long { display:none; }
  .ua-detail-head > [data-ua-cycle] { width:40px; }
}
/* Equal columns: a card alone on the last row keeps the width of the cards above it. */
.ua-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(250px,100%),1fr)); gap:12px; padding-top:4px; }
.ua-card { min-width:0; display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid var(--hairline); border-radius:10px; background:var(--v2-card); }
.ua-card.ua-new { border-color:#4f9db3; }
.ua-card.ua-recommended { position:relative; border-color:var(--text-2); }
.ua-card-head { justify-content:space-between; }
.ua-rec { border-radius:999px; padding:2px 9px; background:var(--v2-action); color:var(--v2-on-action); font:600 11px/1.5 var(--font-ui); }
/* On the card the label sits on the top border, so the head keeps one line at any card width. */
.ua-card > .ua-rec { position:absolute; top:-11px; left:11px; }
.ua-rec[title],.ua-table .ua-arrow { cursor:help; }
.ua-plan { min-width:0; }
.ua-plan .ul-svg { width:100%; max-height:260px; object-fit:contain; }
.ua-plan-strip { display:flex; justify-content:space-between; position:relative; text-transform:uppercase; font:500 10px/1.4 var(--font-ui); letter-spacing:.05em; color:var(--text-2); }
.ua-plan-strip b { position:absolute; left:50%; transform:translateX(-50%); color:var(--text-1); }
.ua-card-chips { display:flex; flex-wrap:wrap; gap:4px; }
/* A chip is one line where the card has the room; a longer one breaks after its " ·" (the script joins the rest with
   no-break spaces) and is never cut. */
.ua-card-chips span { max-width:100%; padding:3px 6px; border-radius:6px; background:var(--v2-raised); font-size:11px; line-height:1.4; letter-spacing:0; overflow-wrap:anywhere; }
.ua-card-actions { display:flex; gap:8px; }
.ua-card-actions button { flex:1; }
.ua-search { display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--text-2); }
.ua-search button { margin-left:auto; }
.ua-detail { display:flex; flex-direction:column; gap:14px; padding:14px 16px; }
.ua-detail-columns { display:flex; flex-wrap:wrap; gap:16px; }
.ua-detail-plan { flex:3 1 360px; min-width:0; }
.ua-detail-plan .ul-svg { max-height:none; }
/* An open option narrower than 900 px gives the plan the whole width; the facts go under it in two columns. */
.ua-detail { container:uadetail / inline-size; }
@container uadetail (width < 900px) {
  .ua-detail-plan, .ua-facts { flex-basis:100%; }
  .ua-detail-plan .ul-svg { max-height:max(360px, 74vh); }
  .ua-facts { columns:2 280px; column-gap:28px; }
  .ua-facts > :first-child { margin-top:0; }
  .ua-facts h3 { break-after:avoid; }
  .ua-facts ul, .ua-facts .ua-stats, .ua-facts li { break-inside:avoid; }
}
.ua-facts { flex:2 1 260px; min-width:0; }
.ua-facts h3 { margin:12px 0 6px; font:600 12px var(--font-ui); }
.ua-facts h3 small { margin-left:6px; color:var(--text-2); font-weight:400; }
.ua-facts ul { padding-left:16px; margin:5px 0; color:var(--text-2); font-size:12px; }
.ua-stats { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ua-stats small,.ua-stats b { display:block; }.ua-stats small { color:var(--text-2); }.ua-stats b { font:500 12px var(--font-mono); }
.ua-recent { border-top:1px solid var(--hairline); padding-top:10px; }
.ua-recent h3 { font:600 12px var(--font-ui); margin:0 0 6px; }
.ua-recent button { width:100%; justify-content:space-between; background:transparent; border:0; text-align:left; }
.ua-recent small { color:var(--text-2); }
#ua-boundary { height:calc(100% - 48px); }
@media (max-width:760px) { .ua-header { padding-left:12px; padding-right:12px; }.ua-header > span { margin-left:0; }.ua-area { padding:12px 12px calc(12px + var(--ua-keep, 0px)); }.ua-programme { max-width:none; padding:12px; }.ua-run { padding:10px 12px; }.ua-run-row .ua-primary { flex:1 1 auto; } #ua-boundary { height:auto; } }
@media (prefers-reduced-motion:reduce) { .ua-card.ua-new { border-color:var(--hairline); } }

.ua-picks button { padding-left:7px; padding-right:7px; }
.ua-entry-door { stroke:#fff; stroke-width:100; }

/* Darker warning and danger text keeps small labels legible on light chips. */
:root[data-theme=light] .ua-status.warning, :root[data-theme=light] .ua-warning, :root[data-theme=light] .ua-table .below, :root[data-theme=light] .ua-alert.warning { color:#70540e; }
:root[data-theme=light] .ua-status.danger, :root[data-theme=light] .ua-danger, :root[data-theme=light] .ua-table .legal_min, :root[data-theme=light] .ua-alert.danger { color:#963933; }

.ua-plan .ul-p-facade, .ua-plan .ul-p-front { stroke:#4f9db3; }

.ua-entry-near-left { height:28px; }
.ua-entry-near-left b { top:14px; }

/* Equal plan frames and bottom-aligned actions keep a row of cards aligned. */
.ua-card .ua-plan-strip:first-child { height:28px; }
.ua-card .ua-plan-strip:first-child b { top:14px; }
.ua-card .ua-plan .ul-svg { aspect-ratio:3 / 2; max-height:none; }
.ua-card-actions { margin-top:auto; }
.ua-detail-table { table-layout:fixed; }
/* The master suite's row and, set in under it, the rows of its rooms. */
.ua-detail-table .ua-suite-row td { font-weight:600; }
.ua-detail-table .ua-in-suite td:first-child { padding-left:14px; }
/* A long room name wraps rather than running into the size; a pocket a room took is a second line of its size. */
.ua-detail-table td:first-child { white-space:normal; }
.ua-detail-table .ua-plus { display:block; color:var(--text-2); }
.ua-detail-table .ua-room-col { width:32%; }
.ua-detail-table .ua-clear-col { width:25%; }
.ua-detail-table .ua-area-col { width:10%; }
.ua-detail-table .ua-range-col { width:22%; }
.ua-detail-table .ua-flag-col { width:11%; }
.ua-detail-table th, .ua-detail-table td { padding:4px 10px 4px 0; }
.ua-detail-table th:nth-child(2), .ua-detail-table td:nth-child(2) { text-align:left; }
.ua-detail-table th:nth-child(3), .ua-detail-table td:nth-child(3) { text-align:right; }

.ua-detail-table td:nth-child(3), .ua-detail-table th:nth-child(3) { padding-right:14px; }
.ua-detail-table td:nth-child(4), .ua-detail-table th:nth-child(4) { padding-left:14px; }

/* Rooms step. Every room is a box at one scale (--m, px to the metre): rooms that need daylight stand on the front
   line, the others sit behind. --m is worked out from the frame's width, so it is used only outside .ua-box-in,
   which is a container of its own. */
.ua-prog-head .ua-status { font-weight:500; }
/* The Rooms head is the step's name and its state. The tools of the step have the line under it, at every width, so
   nothing moves when the state changes: Lock / Unlock at the left; Undo, Redo and the reset at the right. */
.ua-tools { container:uatools / inline-size; display:flex; align-items:center; gap:8px; margin-top:8px; }
.ua-head-acts { display:flex; gap:6px; margin-left:auto; }
/* Lock / Unlock: a set size stays inside its room's recommended range, or not. */
.ua-lock button { display:inline-flex; align-items:center; gap:5px; min-height:24px; padding:0 8px; font-size:12px; }
.ua-lock svg { flex:none; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.ua-lock button[data-ua-lock=on][aria-pressed=true] { background:var(--v2-accent-soft); color:var(--v2-accent-text); }
/* As tall as Lock / Unlock beside them. Undo and Redo are one pair. */
#ua-sizes-reset, #ua-undo, #ua-redo { min-height:30px; padding:0 10px; gap:6px; }
.ua-pair { display:inline-flex; }
.ua-pair button:first-child { border-radius:8px 0 0 8px; }
.ua-pair button + button { margin-left:-1px; border-radius:0 8px 8px 0; }
.ua-flip { transform:scaleX(-1); }
/* A line too narrow for the words keeps the two arrows. */
@container uatools (width < 400px) { .ua-pair button span { display:none; } }
#ua-undo:disabled, #ua-redo:disabled { opacity:.45; cursor:default; }
.ua-undo, .ua-pin, .ua-front-mark svg { flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.ua-undo { width:13px; height:13px; }
.ua-rooms-wrap { position:relative; }
.ua-rooms { container-type:inline-size; overflow-x:auto; border:1px solid var(--hairline); border-radius:8px; }
/* More rooms than the frame shows: an edge fades while the row goes on past it. */
.ua-rooms-fade { position:absolute; top:1px; right:1px; bottom:26px; width:28px; border-radius:0 7px 0 0; background:linear-gradient(to right, transparent, var(--bg) 85%); opacity:0; pointer-events:none; transition:opacity .15s; }
.ua-rooms-fade-l { right:auto; left:1px; width:16px; border-radius:7px 0 0 0; background:linear-gradient(to left, transparent, var(--bg) 90%); }
.ua-rooms-wrap.ua-cut .ua-rooms-fade:not(.ua-rooms-fade-l), .ua-rooms-wrap.ua-cut-l .ua-rooms-fade-l { opacity:1; }
.ua-rooms-in { isolation:isolate; display:flex; flex-direction:column; gap:8px; min-width:min-content; padding:12px 12px 10px; background-color:var(--bg); background-image:radial-gradient(var(--hairline-strong) 1px, transparent 1px); background-size:var(--m) var(--m); background-position:calc(12px - var(--m) / 2) calc(8px - var(--m) / 2); }
/* The captions and the foot stay in the frame while a long row is scrolled sideways. */
.ua-rooms-cap, .ua-rooms-foot { position:sticky; left:12px; align-self:flex-start; box-sizing:border-box; width:calc(100cqw - 24px); }
.ua-rooms-cap { display:flex; justify-content:space-between; gap:12px; color:var(--text-2); font:600 11px/1.4 var(--font-ui); letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; }
.ua-rooms-cap .ua-plain { font-weight:400; letter-spacing:0; text-transform:none; }
/* A band's title stands on the ground, not on the dots of the grid. */
.ua-rooms-cap > span { margin:-1px -6px; padding:1px 6px; border-radius:3px; background:var(--bg); }
.ua-rooms-cap.ua-cap-front, .ua-front-mark { color:var(--v2-accent-text); }
/* What a front room gave up when it was made shorter stays here, so the front line does not move (areaSlack). */
.ua-rooms-cap.ua-cap-front { margin-top:var(--slack, 0px); }
.ua-band { display:flex; gap:10px; box-sizing:border-box; }
.ua-band-back { align-items:flex-start; padding-bottom:14px; }
.ua-band-front { align-items:flex-end; padding-top:6px; }
/* A box and, for one too narrow to hold them, its name, size and area outside, right at the box: under a room behind,
   over a front room. The cell is never narrower than that caption, so two narrow neighbours keep their captions apart. */
.ua-cell { flex:none; display:flex; flex-direction:column; align-items:center; min-width:46px; }
.ua-band-front .ua-cell { flex-direction:column-reverse; }
/* The caption lies under the boxes and their grips, on a plain ground of its own: the dots of the diagram would sit
   beside its figures like decimal points. The ground reaches across the gap to the next cell, so neighbours' grounds
   join. --gap (areaCapLine in sog-unit-layout.js) brings near neighbours on one line. */
.ua-capw { position:relative; z-index:-1; align-self:stretch; pointer-events:none; }
.ua-cap { position:relative; display:none; flex-direction:column; align-items:center; gap:1px; color:var(--text-2); white-space:nowrap; }
.ua-cap::before { content:""; position:absolute; z-index:-1; left:-10px; right:-10px; border-radius:3px; background:var(--bg); }
.ua-band-back .ua-cap::before { top:calc(3px + var(--gap, 0px)); bottom:-3px; }
.ua-band-front .ua-cap::before { top:-3px; bottom:calc(3px + var(--gap, 0px)); }
.ua-cap b { color:var(--text-1); font:600 10px/1.2 var(--font-ui); }
.ua-cap span { font:400 10px/1.2 var(--font-mono); }
.ua-band-back .ua-cap { padding-top:calc(6px + var(--gap, 0px)); }
.ua-band-front .ua-cap { padding-bottom:calc(6px + var(--gap, 0px)); }
/* Which boxes carry their caption outside is decided in sog-unit-layout.js (areaCapSide), with a margin, so a box at
   the mark does not flip as an edge is dragged. */
.ua-cell.ua-out .ua-cap { display:flex; }
/* A caption brought onto its neighbours' line stands away from its own box: a hairline ties the two. */
.ua-cap.ua-far::after { content:""; position:absolute; left:50%; width:1px; height:calc(var(--gap, 0px) + 2px); background:var(--text-3); }
.ua-band-back .ua-cap.ua-far::after { top:1px; }
.ua-band-front .ua-cap.ua-far::after { bottom:1px; }
/* The redraw after an edge is let go, eased (areaEaseTo in sog-unit-layout.js). */
.ua-rooms-in.ua-ease { transition:background-size .14s ease-out, background-position .14s ease-out; }
.ua-ease .ua-band { transition:height .14s ease-out; }
.ua-ease .ua-box { transition:width .14s ease-out, height .14s ease-out; }
.ua-ease .ua-cap { transition:padding .14s ease-out; }
.ua-ease .ua-cap::before { transition:top .14s ease-out, bottom .14s ease-out; }
.ua-ease .ua-cap.ua-far::after { transition:height .14s ease-out; }
.ua-ease .ua-scale i { transition:width .14s ease-out; }
.ua-front-line { height:3px; margin-top:-8px; border-radius:2px; background:#4f9db3; }
.ua-rooms-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:-2px; }
.ua-front-mark { display:inline-flex; align-items:center; gap:6px; font:600 11px/1.4 var(--font-ui); letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; }
.ua-front-mark svg { width:14px; height:14px; }
/* The front mark stands on the ground, not on the dots of the grid. */
.ua-front-mark { margin:-1px -6px; padding:1px 6px; border-radius:3px; background:var(--bg); }
/* Why a dragged edge or an arrow key stops (a legal minimum, the longest proportion): said by the room's name in a tag
   over the title strip of its band, at the room (--at, areaLimitPlace in sog-unit-layout.js), so nothing moves for it. */
.ua-rooms-cap > .ua-limit { position:absolute; top:-4px; left:var(--at, 0px); z-index:4; box-sizing:border-box; max-width:100%; margin:0; padding:2px 8px; overflow:hidden; border:1px solid var(--hairline-strong); border-radius:4px; background:var(--bg); color:var(--text-1); font:600 11px/1.4 var(--font-ui); letter-spacing:0; text-overflow:ellipsis; text-transform:none; white-space:nowrap; }
.ua-rooms-cap > .ua-limit:empty { display:none; }
.ua-rooms-cap.ua-over > span:first-child { visibility:hidden; }
.ua-scale { display:inline-flex; align-items:center; gap:6px; margin:-4px -6px; padding:4px 6px; border-radius:5px; color:var(--text-2); font:400 11px/1 var(--font-mono); white-space:nowrap; }
/* The diagram was redrawn at another scale: the scale bar is lit for a moment (AREA_FLASH in sog-unit-layout.js). */
.ua-scale.ua-flash { animation:ua-scale-flash 1.4s ease-out; }
@keyframes ua-scale-flash { 0%, 55% { color:var(--v2-accent-text); background:var(--v2-accent-soft); box-shadow:0 0 0 1px #4f9db3; } }
.ua-scale i { width:calc(var(--m) * 2); height:5px; border:1px solid currentColor; border-top:0; }
.ua-box { position:relative; flex:none; width:calc(var(--m) * var(--w)); height:calc(var(--m) * var(--d)); border:1px solid rgba(10,11,12,.5); border-radius:2px; cursor:pointer; user-select:none; -webkit-user-select:none; }
.ua-box.ua-set { box-shadow:inset 0 0 0 2px rgba(10,11,12,.6); }
.ua-box:focus-visible { outline:none; box-shadow:var(--focus-ring); }
.ua-box.ua-set:focus-visible { box-shadow:inset 0 0 0 2px rgba(10,11,12,.6), var(--focus-ring); }
.ua-box.ua-sel { outline:2px solid var(--text-1); outline-offset:2px; z-index:1; }
.ua-box.ua-dragging { z-index:3; }
.ua-box.ua-bad { outline:2px solid var(--danger); outline-offset:2px; }
.ua-box-in { position:absolute; inset:0; container:uabox / size; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; overflow:hidden; text-align:center; }
.ua-box-tx { display:flex; flex-direction:column; align-items:center; gap:1px; max-width:100%; max-height:100%; }
.ua-box-in b { max-width:100%; padding:0 3px; overflow:hidden; white-space:nowrap; font:600 11px/1.15 var(--font-ui); }
.ua-box-size, .ua-box-m2 { font:400 10px/1.15 var(--font-mono); white-space:nowrap; }
.ua-box-m2 { opacity:.75; }
/* What a master suite holds, under its name: only in a box with room for the line. */
.ua-box-parts { max-width:100%; padding:0 3px; overflow:hidden; white-space:nowrap; font:400 10px/1.15 var(--font-ui); opacity:.75; }
@container uabox (max-width:119px) or (max-height:69px) { .ua-box-parts { display:none; } }
/* The master suite in zones (areaZones in sog-unit-layout.js): bath and wardrobe behind, --zh deep, in their plan
   colours; the lettering, the pin and the box's own colour belong to the bedroom in front of them. */
.ua-zones { position:absolute; inset:0 0 auto; height:var(--zh); pointer-events:none; }
.ua-box.ua-set .ua-zones { inset:2px 2px auto; height:calc(var(--zh) - 2px); }
.ua-zone { position:absolute; top:0; bottom:0; box-sizing:border-box; container:uazone / size; display:flex; align-items:center; justify-content:center; overflow:hidden; border-right:1px solid rgba(10,11,12,.5); border-bottom:1px solid rgba(10,11,12,.5); font:400 10px/1.15 var(--font-ui); font-style:normal; white-space:nowrap; }
@container uazone (max-width:41px) or (max-height:15px) { .ua-zone span { display:none; } }
@container uazone (max-width:53px) { .ua-zone-long span { display:none; } }
.ua-zoned .ua-box-in { top:var(--zh); }
.ua-zoned .ua-pin { top:calc(var(--zh) + 4px); }
.ua-band-front .ua-zoned .ua-handle-d { color:#0a0b0c; }
.ua-short, .ua-sz-short { display:none; }
@container uabox (max-width:103px) { .ua-long { display:none; } .ua-short { display:inline; } }
@container uabox (max-width:69px) { .ua-sz-long { display:none; } .ua-sz-short { display:inline; } }
/* A box too narrow for its name stays empty: the name and the size stand outside it (.ua-cap). */
.ua-cell.ua-out .ua-box-tx { display:none; }
@container uabox (max-height:53px) { .ua-box-m2 { display:none; } }
@container uabox (max-height:35px) { .ua-box-size { display:none; } }
.ua-pin { position:absolute; top:4px; left:4px; width:10px; height:10px; stroke-width:2.4; pointer-events:none; }
.ua-pin.ua-pin-key { position:static; display:inline-block; width:11px; height:11px; margin-right:5px; vertical-align:-1px; }
/* The two free edges of a box, its right side and the side away from the front line, are strips that can be dragged
   along their whole length (--s is half a strip's width). At rest each shows a small grip in the lettering colour;
   on the chosen box, and under the pointer, a solid handle, each in the middle of its edge. A box too small to
   hold a grip beside its lettering shows none until it is chosen or pointed at. */
.ua-rooms { --s:7px; }
.ua-handle { position:absolute; z-index:2; touch-action:none; }
.ua-handle-w { top:0; bottom:0; right:calc(0px - var(--s)); width:calc(var(--s) * 2); cursor:ew-resize; }
.ua-handle-d { left:0; right:0; height:calc(var(--s) * 2); cursor:ns-resize; }
.ua-band-back .ua-handle-d { bottom:calc(0px - var(--s)); }
.ua-band-front .ua-handle-d { top:calc(0px - var(--s)); }
.ua-handle::after { content:""; position:absolute; box-sizing:border-box; opacity:.55; }
.ua-handle-w::after { top:50%; margin-top:-6px; right:calc(var(--s) + 2px); width:4px; height:12px; border-left:1px solid; border-right:1px solid; }
.ua-handle-d::after { left:50%; width:12px; height:4px; margin-left:-6px; border-top:1px solid; border-bottom:1px solid; }
.ua-band-back .ua-handle-d::after { bottom:calc(var(--s) + 2px); }
.ua-band-front .ua-handle-d::after { top:calc(var(--s) + 2px); }
.ua-box:is(.ua-sel, :focus-visible) .ua-handle::after { border:1px solid var(--bg); border-radius:3px; background:var(--text-1); opacity:1; }
.ua-box:is(.ua-sel, :focus-visible) .ua-handle-w::after { right:calc(var(--s) - 5px); margin-top:-9px; width:10px; height:18px; }
.ua-box:is(.ua-sel, :focus-visible) .ua-handle-d::after { width:18px; height:10px; margin-left:-9px; }
.ua-band-back .ua-box:is(.ua-sel, :focus-visible) .ua-handle-d::after { bottom:calc(var(--s) - 5px); }
.ua-band-front .ua-box:is(.ua-sel, :focus-visible) .ua-handle-d::after { top:calc(var(--s) - 5px); }
@media (hover:hover) {
  .ua-box:hover .ua-handle::after { border:1px solid var(--bg); border-radius:3px; background:var(--text-1); opacity:1; }
  .ua-box:hover .ua-handle-w::after { right:calc(var(--s) - 5px); margin-top:-9px; width:10px; height:18px; }
  .ua-box:hover .ua-handle-d::after { width:18px; height:10px; margin-left:-9px; }
  .ua-band-back .ua-box:hover .ua-handle-d::after { bottom:calc(var(--s) - 5px); }
  .ua-band-front .ua-box:hover .ua-handle-d::after { top:calc(var(--s) - 5px); }
}
.ua-box { container:uaedge / size; }
@container uaedge (max-width:69px) or (max-height:29px) { .ua-box:not(.ua-sel, :focus-visible, :hover) .ua-handle-w::after { opacity:0; } }
@container uaedge (max-width:39px) or (max-height:39px) { .ua-box:not(.ua-sel, :focus-visible, :hover) .ua-handle-d::after { opacity:0; } }
/* A finger needs a wider strip than a pointer. */
@media (hover:none) { .ua-rooms { --s:12px; } }
.ua-balance { display:flex; flex-direction:column; gap:6px; }
.ua-bar { position:relative; display:flex; height:8px; border-radius:4px; background:var(--v2-raised); }
.ua-bar i:first-child { border-radius:4px 0 0 4px; }
.ua-bar i:last-of-type { border-radius:0 4px 4px 0; }
.ua-bar i:only-of-type { border-radius:4px; }
.ua-b-rooms { background:#2c5b68; }
.ua-b-pass { background:#6a7276; }
.ua-b-walls { background:#3a4043; }
.ua-bar u { position:absolute; top:-3px; bottom:-3px; width:2px; margin-left:-1px; border-radius:1px; background:var(--text-1); }
/* Between the phone and the wide page the total takes the second line, whatever the first one says: on one line the
   legend wrapped when the first size was set, and the table under it went down a line. */
.ua-balance { container:uabal / inline-size; }
@container uabal (min-width:390px) and (max-width:639.9px) { .ua-legend b { flex-basis:100%; text-align:right; } }
.ua-legend { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; color:var(--text-2); font:400 12px/1.4 var(--font-ui); font-variant-numeric:tabular-nums; }
.ua-legend span { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.ua-legend i { width:8px; height:8px; border-radius:2px; }
.ua-legend b { margin-left:auto; color:var(--text-1); font-weight:500; text-align:right; }
.ua-legend b span { display:inline; }
.ua-legend b.ua-danger { color:var(--danger); }
.ua-legend b.ua-warning { color:var(--warn); }
.ua-size-table { min-width:0; }
.ua-size-table th, .ua-size-table td { height:34px; padding:3px 8px 3px 0; border-top:1px solid var(--hairline); border-bottom:0; }
.ua-size-table thead th { height:26px; border-top:0; }
.ua-size-table thead th:nth-child(5) { padding-left:10px; }
.ua-size-table thead th.ua-th-wrap { white-space:normal; line-height:1.2; }
.ua-size-table th:nth-child(2), .ua-size-table td:nth-child(2) { text-align:left; }
.ua-size-table .ua-num { text-align:right; }
.ua-size-table .ua-group-row th { height:24px; padding-top:7px; border-top:0; font:600 11px/1.4 var(--font-ui); letter-spacing:.06em; text-transform:uppercase; }
.ua-size-table .ua-group-row.ua-cap-front th { color:var(--v2-accent-text); }
.ua-size-table .ua-group-row + tr th, .ua-size-table .ua-group-row + tr td { border-top-color:var(--hairline-strong); }
.ua-size-table th[scope=row] { max-width:150px; padding-left:8px; overflow:hidden; text-overflow:ellipsis; color:var(--text-1); font:400 12px/1.3 var(--font-ui); }
.ua-size-table .ua-diff { color:var(--text-2); font-size:11px; }
/* The rooms of the master suite, under its row and part of it. */
.ua-size-table .ua-parts-row td { height:auto; padding:0 8px 6px 23px; border-top:0; color:var(--text-2); font:400 10px/1.3 var(--font-mono); white-space:normal; cursor:default; }
.ua-size-table .ua-narrow { display:none; margin-left:15px; color:var(--text-2); font:400 10px/1.3 var(--font-mono); }
/* Until a size is set the arrows only describe the suggestion: they stay quiet. */
.ua-size-table.ua-quiet .below, .ua-size-table.ua-quiet .above { color:var(--text-3); }
.ua-size-table .ua-diff.ua-accent { color:var(--v2-accent-text); }
.ua-size-table .ua-range { padding-left:10px; color:var(--text-2); }
.ua-size-cell input { width:54px; height:28px; padding:0 8px; border:1px solid var(--hairline-strong); border-radius:6px; background:var(--bg); color:var(--text-2); font:500 12px var(--font-mono); vertical-align:middle; }
.ua-size-cell input:disabled { opacity:.55; }
/* On the white panel of the light theme a grey field reads as switched off: fields are white there, with a darker edge. */
:root[data-theme=light] .ua-controls input, :root[data-theme=light] .ua-more input, :root[data-theme=light] .ua-more select, :root[data-theme=light] .ua-size-cell input { background:var(--panel); border-color:var(--text-4); }
.ua-size-cell span { display:inline-block; margin:0 5px; color:var(--text-3); vertical-align:middle; }
.ua-room.ua-set .ua-size-cell input { border-color:#4f9db3; background:rgba(79,157,179,.10); color:var(--text-1); }
.ua-room .ua-size-cell input[aria-invalid=true] { border-color:var(--danger); }
.ua-room.ua-sel th, .ua-room.ua-sel td { background:var(--v2-raised); }
.ua-room.ua-sel th[scope=row] { box-shadow:inset 2px 0 0 #4f9db3; }
.ua-size-table .ua-reset-cell { width:26px; padding-right:2px; text-align:right; }
.ua-area .ua-icon { width:24px; min-height:24px; padding:0; border-color:transparent; border-radius:6px; background:transparent; color:var(--text-2); }
.ua-area .ua-icon:hover { background:var(--panel); color:var(--text-1); }
.ua-size-table .ua-err-row td { height:auto; padding:0 8px 8px; border-top:0; white-space:normal; font-family:var(--font-ui); }
.ua-room.ua-sel + .ua-err-row td { background:var(--v2-raised); box-shadow:inset 2px 0 0 #4f9db3; }
#ua-size-error { margin:0; font-size:12px; line-height:1.4; }
.ua-notes { display:flex; flex-direction:column; gap:4px; border-top:1px solid var(--hairline); padding-top:8px; }
.ua-notes p { margin:0; color:var(--text-2); font-size:12px; }
.ua-notes b { font:600 13px/1 var(--font-ui); }
.ua-about summary { width:fit-content; cursor:pointer; color:var(--text-2); font-size:12px; }
.ua-about p { margin-top:4px; }
/* Options that follow set sizes say which, and a grid from an older brief steps back. */
.ua-keeps { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0; color:var(--text-2); font-size:12px; }
.ua-keep { display:inline-flex; align-items:center; padding:2px 8px; border-radius:6px; background:var(--v2-accent-soft); color:var(--v2-accent-text); font:400 11px/1.5 var(--font-mono); white-space:nowrap; }
.ua-keep .ul-sw { width:8px; height:8px; }
.ua-keeps > span[title] { cursor:help; }
.ua-grid.ua-stale { opacity:.55; }
.ua-alert.ua-nofit { align-items:flex-start; border-radius:10px; padding:12px 14px; }
:root[data-theme=light] .ua-front-line { background:var(--v2-accent-text); }
:root[data-theme=light] .ua-legend b.ua-warning { color:#70540e; }
:root[data-theme=light] .ua-legend b.ua-danger { color:#963933; }
:root[data-theme=light] .ua-b-walls { background:#aeb5b3; }
:root[data-theme=light] .ua-rooms-in { background-image:radial-gradient(var(--text-4) 1px, transparent 1px); }
@media (max-width:520px) {
  .ua-size-table .ua-wide { display:none; }
  .ua-size-table th, .ua-size-table td { padding-right:6px; }
  .ua-size-table th[scope=row] { max-width:120px; padding-left:6px; padding-right:2px; }
  .ua-size-table th, .ua-size-table td { height:46px; }
  .ua-size-table thead th, .ua-size-table .ua-group-row th { height:26px; }
  .ua-size-table thead th { vertical-align:top; }
  .ua-size-table thead .ua-narrow { margin-left:21px; }
  .ua-size-table .ua-err-row td { height:auto; }
  .ua-size-cell input { width:48px; height:40px; padding:0 3px; text-align:center; font-size:16px; }
  .ua-size-cell span { margin:0 3px; }
  .ua-area button, .ua-area a { min-height:40px; }
  .ua-area .ua-icon { width:40px; min-height:40px; }
  #ua-sizes-reset, #ua-undo, #ua-redo { min-height:40px; }
  .ua-size-table .ua-reset-cell { width:40px; padding-right:0; }
  .ua-size-table .ua-narrow { display:block; }
}
/* The narrowest phones: slimmer size fields, so a room's name is not cut. */
@media (max-width:375px) {
  .ua-size-cell input { width:44px; padding:0 2px; }
  .ua-size-table .ua-size-cell span { margin:0 1px; }
  .ua-size-table th[scope=row] { padding-left:4px; padding-right:0; }
  .ua-size-table th[scope=row] .ul-sw { margin-right:4px; }
  .ua-size-table .ua-narrow { margin-left:13px; }
  .ua-size-table thead .ua-narrow { margin-left:17px; }
}
/* One step at a time, each the whole width. */
.ua-area { container:uaarea / inline-size; }
/* A Rooms panel of about 500 px (one column just above phone width): the size table closes up so it needs no
   sideways scroll. */
@container uaarea (width < 520px) {
  .ua-size-table th, .ua-size-table td { padding-right:6px; }
  .ua-size-table th[scope=row] { padding-left:6px; }
  .ua-size-table thead th:nth-child(5), .ua-size-table .ua-range { padding-left:6px; }
  .ua-size-table .ua-size-cell span { margin:0 3px; }
}
/* Step 3 in a narrow column: Settings and Generate stay together on the right, the summary line goes under them. */
.ua-run { container:uarun / inline-size; }
@container uarun (width < 600px) { .ua-run-row #ua-summary { order:3; flex-basis:100%; } .ua-run-row #ua-more { margin-left:auto; } }
.ua-run-row kbd + kbd { margin-left:3px; }
.ua-stale-dot { display:inline-block; width:6px; height:6px; margin-right:6px; border-radius:50%; background:var(--warn); vertical-align:1px; }
/* The same dot before the line beside Generate, and a chip in the Rooms head on screens where the options are far below. */
#ua-summary.ua-stale::before { content:""; display:inline-block; width:6px; height:6px; margin-right:6px; border-radius:50%; background:var(--warn); vertical-align:1px; }
.ua-stale-chip { display:none; }
/* The portal's own ring is set with !important (styles.css), so this page's ring has to be too. */
.ua-area :is(button, a, input, select, summary, [tabindex]):focus-visible, .ua-header button:focus-visible { outline:3px solid #4f9db3 !important; outline-offset:1px; box-shadow:none; }
.ua-area .ua-box:focus-visible { outline:3px solid #4f9db3 !important; outline-offset:2px; box-shadow:none; }
.ua-box.ua-set:focus-visible { box-shadow:inset 0 0 0 2px rgba(10,11,12,.6); }
:root[data-theme=light] .ua-area :is(button, a, input, select, summary, [tabindex]):focus-visible, :root[data-theme=light] .ua-header button:focus-visible, :root[data-theme=light] .ua-area .ua-box:focus-visible { outline-color:#17404e !important; }
/* On a phone the options are a step of their own: the Rooms head says when they are out of date. */
@media (max-width:760px) {
  .ua-run-row kbd { display:none; }
  .ua-stale-chip { display:inline-flex; }
}
/* Options column: what the results head, the cards and the Recent runs list say (sog-unit-layout.js, paintAreaResults). */
.ua-results-head > span { font:400 12px/1.5 var(--font-ui); color:var(--text-2); }
/* Card head: the name on the first line, the pills on a line of their own, so every card's plan starts at the same height. */
.ua-card-head { justify-content:flex-start; gap:3px 6px; }
.ua-card-head::after { content:''; order:2; flex:0 0 100%; height:0; }
.ua-card-head > b { margin-right:auto; }
.ua-card-head > .ua-key { order:3; }
.ua-key { padding:2px 8px; border-radius:999px; background:var(--v2-raised); color:var(--text-2); font:400 11px/1.5 var(--font-ui); white-space:nowrap; }
.ua-key.ua-warning { color:var(--warn); }
.ua-card-chips { min-width:0; align-items:center; }
.ua-area .ua-notes-btn { min-height:22px; padding:0 7px; border-radius:6px; background:transparent; color:var(--text-2); font-size:11px; }
.ua-card-notes { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; color:var(--text-2); font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.ua-card-notes ul { margin:0; padding-left:14px; }
.ua-card-notes h4 { margin:2px 0 0; font:600 11px var(--font-ui); }
.ua-how { color:var(--text-2); font-size:12px; }
.ua-how summary { width:fit-content; cursor:pointer; }
.ua-how ol { margin:6px 0 4px; padding-left:18px; }
.ua-how li { margin:2px 0; }
.ua-how p { margin:0; }
.ua-how summary + p { margin-top:6px; }
.ua-how p + p { margin-top:4px; }
.ua-search-text, .ua-recent small { font-variant-numeric:tabular-nums; }
/* The searching line keeps its spinner, its words and Stop on one row; on a narrow screen the words wrap between them. */
.ua-search { flex-wrap:nowrap; }
.ua-search .ul-spin { flex:none; }
.ua-search-text { flex:1 1 auto; min-width:0; }
.ua-recent button { gap:8px; }
.ua-recent button span { min-width:0; }
.ua-recent small { white-space:nowrap; }
.ua-table td.ua-own { color:var(--text-2); cursor:help; }
.ua-own .ua-pin.ua-pin-key { margin-right:0; }
/* A room drawn at the size the person set: outlined in ink, not in the red that marks a fault. */
.ua-plan .ul-p-room.kept .ul-p-fill { stroke:#1d1d1d; stroke-width:40; }
.ua-plan .ul-p-lock { fill:#1d1d1d; }
/* The open option on a phone: its room table fits the screen instead of scrolling sideways. */
@media (max-width:520px) {
  .ua-detail-table { min-width:0; font-size:11.5px; }
  .ua-detail-table .ua-room-col { width:33%; } .ua-detail-table .ua-clear-col { width:25%; } .ua-detail-table .ua-area-col { width:11%; }
  .ua-detail-table .ua-range-col { width:23%; } .ua-detail-table .ua-flag-col { width:8%; }
  .ua-detail-table th, .ua-detail-table td { padding-right:4px; }
  .ua-detail-table td:nth-child(3), .ua-detail-table th:nth-child(3) { padding-right:6px; }
  .ua-detail-table td:nth-child(4), .ua-detail-table th:nth-child(4) { padding-left:6px; }
  .ua-detail-table tbody th { font-size:12px; }
  .ua-detail-table td:nth-child(2) { word-spacing:-.3em; }
}
@media (max-width:375px) { .ua-detail-table { font-size:11px; } .ua-detail-table tbody th { font-size:11.5px; } .ua-detail-table .ua-room-col { width:35%; } .ua-detail-table .ua-clear-col { width:24%; } .ua-detail-table .ua-range-col { width:24%; } .ua-detail-table .ua-flag-col { width:6%; } }
/* The bar's own word on a search, for a screen where the options are below the fold (a phone): the search line with
   Stop in the place of Generate, then a line that leads down to the finished options. */
#ua-bar-search, #ua-bar-stop, #ua-jump { display:none; }
/* The reason for a size that cannot be used, when it is scrolled into view: clear of the edge, and of the bar on a phone. */
#ua-size-error, .ua-size-cell input { scroll-margin:12px 0 16px; }
@media (max-width:760px) { #ua-size-error, .ua-size-cell input { scroll-margin-bottom:112px; } }
/* The same for a room the focus falls back to (Undo after its last step). */
.ua-box { scroll-margin:12px; }
@media (max-width:760px) { .ua-box { scroll-margin-bottom:112px; } }
@media (max-width:760px) {
  .ua-run.ua-told #ua-summary, .ua-run.ua-ready #ua-summary { display:none; }
  .ua-run-row #ua-bar-search:not([hidden]) { display:block; flex:1 1 200px; min-width:0; font-variant-numeric:tabular-nums; }
  .ua-run-row #ua-jump:not([hidden]) { display:inline-flex; flex:1 1 200px; min-width:0; justify-content:flex-start; text-align:left; border:0; background:transparent; padding:0; color:var(--v2-accent-text); font:600 13px/1.3 var(--font-ui); position:relative; height:auto; min-height:0; }
  /* The line is as tall as the one it replaces, so the bar keeps its height; the finger gets the gap above and the padding below as well. */
  .ua-run-row #ua-jump::after { content:""; position:absolute; left:0; right:0; top:-8px; bottom:-10px; }
  /* The three lines of the bar share one height (22 px): with the gap above and the padding below a finger has 40 px. */
  .ua-run-row :is(#ua-summary, #ua-bar-search, #ua-jump:not([hidden])) { line-height:22px; }
  .ua-run-row #ua-jump[data-tone=warn] { color:var(--warn); }
  :root[data-theme=light] .ua-run-row #ua-jump[data-tone=warn] { color:#70540e; }
  .ua-run.ua-searching #ua-generate { display:none; }
  .ua-run-row #ua-bar-stop:not([hidden]) { display:inline-flex; flex:1 1 auto; }
  /* One chip in the Rooms head: out of date takes the place of the sizes' own state, a fault takes the place of both. */
  #ua-rooms-chip:not(.danger):has(+ .ua-stale-chip), #ua-rooms-chip.danger + .ua-stale-chip { display:none; }
}
@container uarun (width < 600px) { .ua-run-row :is(#ua-bar-search, #ua-jump) { order:3; flex-basis:100%; } }
/* What a "target band" is, under the rules that name it; an entry that was not used. */
.ua-band-note { font-size:11px; line-height:1.45; }
.ua-facts .ua-band-note { margin-top:4px; }
.ua-dropped { margin:0; padding:6px 10px; border-radius:6px; background:color-mix(in srgb,var(--warn) 10%,transparent); color:var(--warn); font-size:12px; line-height:1.4; }
:root[data-theme=light] .ua-dropped { color:#70540e; }
.ua-recent button { max-width:600px; }
/* Phone: fields at 16 px (no zoom on focus) and 40 px high; the small text buttons keep their size and take a 40 px
   touch area. */
@media (max-width:520px) {
  .ua-controls input, .ua-more input, .ua-more select { height:40px; font-size:16px; }
  .ua-area .ua-notes-btn { position:relative; min-height:22px; }
  .ua-area .ua-notes-btn::after { content:""; position:absolute; left:-4px; right:-4px; top:-13px; bottom:-7px; }
  .ua-how summary, .ua-about summary { position:relative; }
  .ua-how summary::after, .ua-about summary::after { content:""; position:absolute; left:-6px; right:-6px; top:-17px; bottom:-6px; z-index:1; }
}
/* The open option's plan drawing (unit_layout/drawing.py): wall poche, windows and sliding doors set in it, chains of
   dimensions, the edge kinds just outside the walls, and the furnished plan's SOG furniture. */
.ul-p-poche { fill:#1d1d1b; stroke:none; }
.ul-p-winband { fill:#fff; stroke:#1d1d1b; stroke-width:12; }
.ul-p-glass { stroke:#1d1d1b; stroke-width:10; }
.ul-p-edge-out { stroke-width:36; }
.ul-p-dimline { stroke:#1d1d1b; stroke-width:8; }
.ul-p-dimtick { stroke:#1d1d1b; stroke-width:18; }
.ul-p-dimtxt { fill:#1d1d1b; text-anchor:middle; font-family:Inter, Arial, sans-serif; }
.ul-p-dimtxt.overall { font-weight:700; }
.ul-p-furn { fill:none; stroke:#4a4a4a; stroke-width:8; stroke-linejoin:round; }
.ul-p-furn-fill { fill:#d6d6d6; stroke:none; }
/* Every switch of the page (carpet / built-up, lock / unlock, colour / furnished ...): the chosen half fills its half of
   the frame edge to edge ("要做就做满"), a hairline between the halves. */
.ua-area .ua-seg { display:inline-flex; align-items:stretch; gap:0; padding:0; border:1px solid var(--hairline-strong, #c9c9c4); border-radius:8px; overflow:hidden; }
.ua-area .ua-seg button { border:0; border-radius:0; margin:0; min-height:28px; }
.ua-area .ua-seg button + button { border-left:1px solid var(--hairline-strong, #c9c9c4); }
.ua-area .ua-seg button[aria-pressed="true"], .ua-area .ua-lock button[data-ua-lock][aria-pressed="true"] { background:var(--v2-action, #1d1d1b); color:var(--v2-on-action, #fff); font-weight:600; }

/* The three steps (sog-unit-layout.js, areaToStep): a bar of numbered steps, then the one step on screen. */
.ua-steps { display:flex; align-items:stretch; gap:10px; }
.ua-area .ua-step { flex:1 1 0; min-width:0; justify-content:flex-start; gap:12px; min-height:0; padding:10px 14px; border:1px solid var(--hairline); border-radius:12px; background:var(--panel); text-align:left; }
.ua-area .ua-step.ua-cur { border-color:color-mix(in srgb, #4f9db3 55%, var(--hairline)); background:color-mix(in srgb, #4f9db3 10%, var(--panel)); }
.ua-step-n { flex:none; display:flex; align-items:center; justify-content:center; width:40px; height:40px; box-sizing:border-box; border:2px solid var(--hairline-strong); border-radius:999px; color:var(--text-2); font:700 19px/1 var(--font-ui); }
.ua-step.ua-done .ua-step-n { border-color:#4f9db3; color:var(--v2-accent-text); }
.ua-step.ua-cur .ua-step-n { border-color:#4f9db3; background:#4f9db3; color:#0a0b0c; }
.ua-step-tx { display:flex; flex-direction:column; min-width:0; }
.ua-step-tx b, .ua-step-tx small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ua-step-tx b { color:var(--text-1); font:600 15px/1.3 var(--font-ui); }
.ua-step-tx small { color:var(--text-2); font:400 12px/1.4 var(--font-ui); }
.ua-step-tx small.ua-danger { color:var(--danger); }
.ua-step-tx small.ua-warning { color:var(--warn); }
.ua-step-short { display:none; }
.ua-step-arrow { flex:none; align-self:center; display:flex; color:var(--hairline-strong); }
.ua-step-arrow.ua-on { color:#4f9db3; }
.ua-step-arrow svg { width:30px; height:14px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
@container uaarea (width < 640px) {
  .ua-steps { gap:4px; }
  .ua-area .ua-step { gap:6px; padding:8px; }
  .ua-step-n { width:28px; height:28px; font-size:14px; }
  .ua-step-tx b { font-size:12px; }
  .ua-step-tx small, .ua-step-long { display:none; }
  .ua-step-short { display:inline; }
  .ua-step-arrow svg { width:14px; }
}
.ua-step-panel { display:flex; flex-direction:column; gap:12px; min-width:0; }
.ua-step-panel:focus { outline:none; }
.ua-step-foot { display:flex; justify-content:flex-end; }
.ua-step-foot.ua-step-back { justify-content:flex-start; }
.ua-area .ua-step-foot button, .ua-area .ua-ffoot button { gap:8px; min-height:36px; padding:0 14px; font-size:13px; }
.ua-arrow-i { flex:none; width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.ua-nudge { font-size:12px; }
.ua-scope { margin-top:6px; color:var(--text-2); font-size:12px; }

/* Step 2, frame and access: the sketch at one scale on the left, the fields, the status and the way on at the right. */
.ua-frame-step { flex-direction:row; flex-wrap:wrap; align-items:flex-start; gap:16px 28px; padding:14px 16px; border:1px solid var(--hairline); border-radius:10px; background:var(--panel); --ua-facade:#8cc4d4; }
:root[data-theme=light] .ua-frame-step { --ua-facade:#2f7f96; }
.ua-fs-col { flex:999 1 560px; min-width:0; }
.ua-fs-wrap { overflow-x:auto; padding:6px 0; border:1px solid var(--hairline); border-radius:8px; background:var(--bg); }
.ua-fs { position:relative; margin:0 auto; background-image:radial-gradient(var(--hairline-strong) 1px, transparent 1px); }
:root[data-theme=light] .ua-fs { background-image:radial-gradient(var(--text-4) 1px, transparent 1px); }
.ua-fs-draw { position:absolute; inset:0; }
.ua-fs-draw > * { position:absolute; box-sizing:border-box; }
.ua-fs-in { background:color-mix(in srgb, var(--text-1) 4%, transparent); }
/* A room of step 1 at its size. A front room past the frame is striped red; a service room the sketch found no place
   for is faded (the search arranges those), as is a bedroom whose side or set-back place is taken. */
.ua-fb { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; padding:2px; overflow:hidden; border:1px solid rgba(10,11,12,.55); border-radius:2px; text-align:center; line-height:1.15; }
.ua-fb b { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 11px/1.15 var(--font-ui); }
.ua-fb span:not(.ua-fb-move) { font:400 10px/1.15 var(--font-mono); white-space:nowrap; }
.ua-fb i { font:600 10px/1.15 var(--font-ui); font-style:normal; }
.ua-fb-over { border:2px solid var(--danger); background-image:repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 55%, transparent) 0 4px, transparent 4px 9px); }
.ua-fb-side, .ua-fb-setback { border:2px dashed rgba(10,11,12,.8); }
.ua-fb-clash { opacity:.45; border-style:dashed; }
.ua-fb-recess { border:1px dashed var(--text-3); background:repeating-linear-gradient(-45deg, var(--hairline-strong) 0 1px, transparent 1px 6px); color:var(--text-2); }
.ua-fb-move { display:flex; gap:4px; margin-top:4px; }
.ua-area .ua-fb-move button { width:26px; height:22px; min-height:22px; padding:0; border:1px solid rgba(10,11,12,.45); border-radius:5px; background:rgba(255,255,255,.6); color:#0a0b0c; }
.ua-fb-move .ua-arrow-i { width:12px; height:12px; }
/* The edges: the corridor dashed, a facade a double line, a neighbour a plain one. */
.ua-fe-party { background:var(--text-3); }
.ua-fe-corridor.ua-fe-h { background:repeating-linear-gradient(90deg, #4f9db3 0 8px, transparent 8px 13px); }
.ua-fe-corridor.ua-fe-v { background:repeating-linear-gradient(180deg, #4f9db3 0 8px, transparent 8px 13px); }
.ua-fe-facade { border:0 solid var(--ua-facade); }
.ua-fe-facade.ua-fe-h { border-width:2px 0; }
.ua-fe-facade.ua-fe-v { border-width:0 2px; }
.ua-fl { color:var(--text-2); font:400 11px/16px var(--font-ui); text-align:center; white-space:nowrap; }
.ua-fl-corridor, .ua-fl-facade { color:var(--v2-accent-text); }
.ua-fl-v { display:flex; align-items:center; justify-content:center; writing-mode:vertical-rl; transform:rotate(180deg); }
.ua-fdoor-gap { background:var(--bg); }
.ua-fdoor { color:var(--text-2); border:0 dashed currentColor; }
.ua-fdoor-top { border-width:0 1px 1px 0; border-left:2px solid var(--text-1); border-radius:0 0 100% 0; }
.ua-fdoor-bottom { border-width:1px 1px 0 0; border-left:2px solid var(--text-1); border-radius:0 100% 0 0; }
.ua-fdoor-left { border-width:0 1px 1px 0; border-top:2px solid var(--text-1); border-radius:0 0 100% 0; }
.ua-fdoor-right { border-width:0 0 1px 1px; border-top:2px solid var(--text-1); border-radius:0 0 0 100%; }
.ua-fmark { width:0; height:0; border-top:8px solid #4f9db3; border-left:5px solid transparent; border-right:5px solid transparent; }
.ua-fmark.ua-flip { transform:rotate(180deg); }
.ua-fdim { background:var(--text-3); }
.ua-fdim-tx { color:var(--text-1); font:400 12px/1.25 var(--font-mono); text-align:center; white-space:nowrap; }
.ua-fdim-d { text-align:left; }
.ua-fdim-tx small { display:block; color:var(--text-2); font:inherit; }
.ua-fnorth { display:flex; align-items:center; justify-content:center; border:1px solid var(--hairline-strong); border-radius:999px; background:var(--panel); }
.ua-fnorth svg { width:14px; height:14px; fill:var(--text-1); }
.ua-fnorth-n { color:var(--text-2); font:700 9px/1 var(--font-ui); text-align:center; }
/* The grips and the door slider stay on the page while they are dragged (paintAreaFrame keeps them). */
.ua-area .ua-fs-grip { position:absolute; z-index:2; min-height:0; padding:0; border:1px solid var(--bg); border-radius:4px; background:var(--text-1); touch-action:none; }
.ua-fs-grip-w { width:12px; height:40px; cursor:ew-resize; }
.ua-fs-grip-d { width:40px; height:12px; cursor:ns-resize; }
.ua-fs-range { position:absolute; z-index:2; height:18px; margin:0; accent-color:#4f9db3; cursor:ew-resize; }
.ua-fs-range.ua-free { opacity:.55; }
.ua-fside { flex:1 1 340px; max-width:400px; min-width:0; display:flex; flex-direction:column; gap:14px; }
.ua-ff { display:flex; flex-direction:column; gap:4px; }
.ua-ff-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ua-ff-label { width:74px; color:var(--text-1); font:600 13px/1.3 var(--font-ui); }
.ua-ff-input { width:72px; height:36px; padding:0 10px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--bg); color:var(--text-1); font:500 14px var(--font-mono); }
.ua-ff-input.ua-ff-auto { border-color:var(--hairline); color:var(--text-3); }
.ua-ff-input[aria-invalid=true] { border-color:var(--danger); }
:root[data-theme=light] .ua-ff-input { background:var(--panel); border-color:var(--text-4); }
.ua-ff-unit { color:var(--text-2); font-size:12px; }
.ua-area .ua-ff-lock { width:36px; min-height:36px; padding:0; color:var(--text-2); }
.ua-area .ua-ff-lock[aria-pressed=true] { border-color:#4f9db3; background:var(--v2-accent-soft); color:var(--v2-accent-text); }
.ua-ff-lock svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.ua-area .ua-ff-reset { min-height:36px; padding:0 6px; border:0; background:transparent; color:var(--v2-accent-text); text-decoration:underline; text-underline-offset:3px; }
.ua-area .ua-fside-seg button { min-height:34px; padding:0 10px; }
.ua-ff-hint { padding-left:82px; color:var(--text-2); font-size:11px; }
.ua-ff-hint.ua-danger { color:var(--danger); }
/* The status of the frame: fits (accent), fits with more area (warning), does not fit (danger), with its fixes. */
.ua-fstatus { display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid color-mix(in srgb, #4f9db3 40%, transparent); border-radius:10px; background:color-mix(in srgb, #4f9db3 6%, transparent); --ua-tone:var(--v2-accent-text); }
.ua-fstatus.ua-warn { border-color:color-mix(in srgb, var(--warn) 40%, transparent); background:color-mix(in srgb, var(--warn) 7%, transparent); --ua-tone:var(--warn); }
.ua-fstatus.ua-bad { border-color:color-mix(in srgb, var(--danger) 40%, transparent); background:color-mix(in srgb, var(--danger) 7%, transparent); --ua-tone:var(--danger); }
:root[data-theme=light] .ua-fstatus.ua-warn { --ua-tone:#70540e; }
:root[data-theme=light] .ua-fstatus.ua-bad { --ua-tone:#963933; }
.ua-fstatus:focus { outline:none; }
.ua-fstatus-head { display:flex; align-items:center; gap:8px; }
.ua-fstatus-mark { flex:none; display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:999px; background:color-mix(in srgb, var(--ua-tone) 20%, transparent); color:var(--ua-tone); font:700 12px/1 var(--font-ui); }
.ua-fstatus b { color:var(--ua-tone); font:600 14px/1.3 var(--font-ui); }
.ua-fstatus p { margin:0; color:var(--text-2); font-size:12px; }
.ua-fstatus-fix { display:flex; flex-wrap:wrap; gap:6px; }
.ua-area .ua-fstatus-fix button { min-height:32px; height:auto; padding:4px 12px; font-weight:600; }
.ua-area .ua-fmore-btn { justify-content:flex-start; gap:6px; min-height:28px; padding:0; border:0; background:transparent; color:var(--text-2); text-align:left; }
.ua-fmore-sum { color:var(--text-3); }
.ua-chev { flex:none; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.ua-fmore-btn[aria-expanded=true] .ua-chev { transform:rotate(90deg); }
.ua-fmore-body { display:flex; flex-direction:column; gap:10px; margin-top:10px; padding:10px 12px; border:1px solid var(--hairline); border-radius:10px; background:var(--bg); }
.ua-fmore-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; color:var(--text-2); font-size:12px; }
.ua-fmore-row > span:first-child { width:104px; }
.ua-fmore-row select { height:30px; padding:0 8px; border:1px solid var(--hairline-strong); border-radius:8px; background:var(--bg); color:var(--text-1); font:500 12px var(--font-ui); }
.ua-ffoot { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:4px; }
.ua-ffoot #ua-frame-go { margin-left:auto; }
.ua-ffoot-why { margin:-6px 0 0; text-align:right; }
/* "No layout found": the nearer frames that gave plans, one button each. */
.ua-near { display:flex; flex-direction:column; gap:8px; max-width:720px; margin-top:10px; }
.ua-area .ua-near button { justify-content:space-between; gap:12px; min-height:40px; padding:6px 12px; font-size:13px; text-align:left; }
.ua-near-n { color:var(--v2-accent-text); font-size:12px; white-space:nowrap; }
/* A plan whose corridor is below it (an entrance from the bottom): Entry next to the plan, the word under it. */
.ua-card .ua-plan-strip.ua-plan-below, .ua-plan-below.ua-entry-near-left { height:28px; align-items:flex-end; }
.ua-card .ua-plan-below b, .ua-plan-below.ua-entry-near-left b { top:0; }
.ua-plan-lobby .ua-plan-end { margin-left:auto; }
@media (max-width:520px) { .ua-ff-input { height:40px; font-size:16px; } .ua-area .ua-ff-lock { width:40px; min-height:40px; } .ua-ff-hint { padding-left:0; } }
