/* The new drawing screen (step 2 of the new look): where the kit's bars sit on today's plan. Colours, sizes and speeds
   come from the kit's tokens (ui/ui.css; the release refuses a stylesheet naming the assets folder); this file places things only. The old panels, dialogs and the plan
   keep their own stylesheet (dxf.css): the kit's .ui-app wrapper holds only the new bars (display: contents), so their
   fonts and form rules do not reach the old screens. */
#screen { display: contents; }
.screen-top { position: fixed; left: 0; right: 0; top: 0; z-index: 100; }
.screen-top .ui-topbar__titles { flex: 1 1 auto; }
#fileInfo[hidden] { display: none; }   /* kept for the old code's writes; dxf.css's .file-info would show it (Task 7 picture 20) */
.screen-hintbox { position: fixed; left: 12px; right: 12px; top: 72px; z-index: 96; display: flex; justify-content: center; pointer-events: none; }
.screen-hintbox[hidden] { display: none; }
.screen-hint { display: flex; align-items: center; gap: 10px; max-width: 100%; pointer-events: auto; }
.screen-hint:has(.screen-hint__done:not([hidden])) { padding: 4px 4px 4px 14px; }
.screen-hint__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-hint__done { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--ui-surface); color: var(--ui-ink); font: inherit; font-weight: 600; cursor: pointer; }
.screen-rounds { position: fixed; right: 14px; bottom: calc(76px + 14px + env(safe-area-inset-bottom, 0px)); z-index: 95; display: flex; gap: 10px; }
.screen-rounds--left { right: auto; left: 14px; }
.screen-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; }
.screen-kinds { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 100; }
.screen-kinds[hidden] { display: none; }
.screen-kinds .ui-bottombar { height: 76px; padding-bottom: 0; background: var(--ui-bg); }
/* step 8 (C5): a kind's button lets the browser pan the row sideways only, so a finger pulled up from it reaches the page (the bar's drag) */
#screenKinds .ui-barbtn { touch-action: pan-x; }
/* No Edit mode (N6, the owner's correction of 2026-11-12): the bar shows the kind that is on, and the closed group holding
   it: tinted, with a line under it (an open group is tinted only); the kind a finger pulls up lifts until the pull ends */
#screenBar .ui-barbtn[aria-current="true"], #screenKinds .ui-barbtn[aria-current="true"] { background: var(--ui-brand-tint); color: var(--ui-brand-ink); box-shadow: inset 0 -3px 0 var(--ui-brand); }
#screenKinds .ui-barbtn.is-lifted { position: relative; z-index: 2; transform: translateY(-6px) scale(1.12); background: var(--ui-surface); border-radius: 12px; box-shadow: 0 8px 18px rgba(0, 0, 0, .28); transition: transform .12s ease-out, box-shadow .12s ease-out; }
@media (prefers-reduced-motion: reduce) { #screenKinds .ui-barbtn.is-lifted { transition: none; } }
body.has-kinds .screen-rounds { bottom: calc(76px + 76px + 14px + env(safe-area-inset-bottom, 0px)); }
.screen-height { width: min(320px, calc(100vw - 16px)); padding: 12px; }
.screen-height__note { margin: 8px 0 0; font-size: 14px; color: var(--ui-ink-2); }
.screen-height__note:empty { display: none; }
.screen-height__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.screen-height__acts .ui-btn[hidden] { display: none; }
.screen-menu__title { font-weight: 600; font-size: 18px; }
.screen-menu__group { padding: 12px 10px 4px; font-size: 13px; font-weight: 600; color: var(--ui-ink-2); }
.screen-menu__note { padding: 6px 10px; font-size: 14px; color: var(--ui-ink-2); }
.screen-menu__note[hidden] { display: none; }
.ui-row[aria-current="true"] { background: var(--ui-brand-tint); color: var(--ui-brand-ink); }
.screen-old { position: fixed; left: 12px; right: 12px; top: 72px; z-index: 97; }
.screen-old[hidden] { display: none; }
/* 3D: the plan's own tools go (the objects, the hint); Undo, Redo and Show stay (Object handles shows in 3D too). */
body[data-view="3d"] .screen-bar, body[data-view="3d"] .screen-kinds, body[data-view="3d"] .screen-hintbox { display: none; }
body[data-view="3d"] .screen-rounds { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
/* The 3D view starts below the top bar, so its camera frames the room where it shows; a wall's top is never under the
   bar (ui/35, Task 8). Each view fits its own box, as the future split view wants. */
#canvas3d { top: 60px; height: calc(100% - 60px); }   /* it is position: relative here: shifted down, and 60 px shorter */
/* The old panels sit between the bars (90-app.js layoutPanels sets top and bottom); the round buttons keep clear of them. */
@media (min-width: 769px) {
  body:has(.panel-right.open) .screen-rounds:not(.screen-rounds--left) { right: calc(12px + 300px + 14px); }
  body:has(.panel-left.open) .screen-rounds--left { left: calc(12px + 300px + 14px); }
  body:has(.panel-right.open) .screen-hintbox { right: calc(12px + 300px + 12px); }
  body:has(.panel-left.open) .screen-hintbox { left: calc(12px + 300px + 12px); }
}
@media (max-width: 768px) {
  .panel-left, .panel-right { max-width: min(320px, calc(100vw - 84px)); }
  body:has(.panel-right.open) .screen-rounds:not(.screen-rounds--left) { right: auto; left: 14px; top: 72px; bottom: auto; flex-direction: column; }
  body:has(.panel-left.open) .screen-rounds:not(.screen-rounds--left) { top: 72px; bottom: auto; flex-direction: column; }
  body:has(.panel-right.open, .panel-left.open) .screen-rounds--left, body:has(.panel-right.open, .panel-left.open) .screen-hintbox { display: none; }
}
/* The old 3D overlays below the top bar; on a narrow screen the 3D tools under the 3D info, and the wall views above
   Undo and Redo, wrapping onto a second line rather than leaving the screen. */
.view3d-info, .edit3d-toolbar { top: 72px; }
.wall-selector { bottom: calc(14px + 56px + 14px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
@media (max-width: 600px) { .edit3d-toolbar { top: 176px; } }
/* 3D's own tools (Move, Rotate, Local, World) stay clear of the open inspector (the other Claude's R7-1): beside it on a
   wide screen, and on a narrow one in the column the panel leaves free, under Undo and Redo. */
@media (min-width: 769px) { body:has(.panel-right.open) .edit3d-toolbar { right: calc(12px + 300px + 14px); } }
@media (max-width: 768px) { body:has(.panel-right.open) .edit3d-toolbar { top: 206px; right: auto; left: 8px; flex-direction: column; align-items: stretch; z-index: 95; } }   /* above the phone's dimming layer, as Undo and Redo are */
.ceiling-pt-toggle { top: 132px; }   /* under the hint, which is 52 px with its Done (72 + 52 + 8; ui/60, Task 7) */
@media (max-width: 459px) { .ui-topbar__sub { font-size: 12px; } }
/* The object's card (step 3 of the new look): the kit's sheet at the bottom on a phone, at the side between the bars on a
   tablet. On a phone it covers the bottom bar, which hides while it is open; the round buttons and the hint give way to
   it, as in the approved preview (pictures 38-45). */
.obj-card { z-index: 101; }
.obj-card[hidden] { display: none; }
.obj-card:not([hidden]) { display: block; }
@media (min-width: 900px) and (min-height: 481px) { .obj-card { --ui-sheet-bottom: 88px; } }
body.has-objcard .screen-rounds, body.has-objcard .screen-hintbox { display: none; }
@media (max-width: 899px) and (min-height: 481px) { body.has-objcard #screenBar, body.has-objcard #screenKinds { visibility: hidden; } }
/* The length card (step 6): the same sheet, the same give-way rules; its ask row and Yes button */
body.has-lencard .screen-rounds, body.has-lencard .screen-hintbox { display: none; }
@media (max-width: 899px) and (min-height: 481px) { body.has-lencard #screenBar, body.has-lencard #screenKinds { visibility: hidden; } }
.len-card .ui-sheet__row > span { flex: none; }
.len-ask { margin-top: 6px; }
.len-ask .ui-btn { min-height: 46px; flex: 1 1 auto; }
/* Step 6b: the wall card's HEIGHT, its own part below LENGTH (a rule and a title between them): one field with the key
   lock closed, A and B with it open; the lock a finger's 44 px, closed teal and filled, open grey and outlined */
.len-part { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--ui-line); }
.len-part__title { margin-bottom: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ui-ink-2); }
.len-height { display: flex; align-items: flex-end; gap: 8px; }
.len-height .ui-number { flex: 1 1 0; min-width: 0; }
.len-card .ui-number__label { overflow: hidden; text-overflow: ellipsis; }
.len-lock { flex: none; width: 48px; height: 48px; border: 1.5px solid var(--ui-line); border-radius: 10px; color: var(--ui-ink-2); }
.len-lock[aria-pressed="true"] { border-color: var(--ui-brand); background: var(--ui-brand-tint); color: var(--ui-brand); }
.len-lock ui-icon { width: 22px; height: 22px; }
.len-card .ui-number.is-bad .ui-number__field { border-color: var(--ui-open); box-shadow: 0 0 0 1px var(--ui-open); }
@media (max-height: 680px) { .len-card .ui-number__field { min-height: 42px; } .len-lock { height: 44px; } }
/* "··· → Wall details": the card's second page; taller than half the screen it scrolls inside the card */
.len-details { max-height: min(62vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.len-details .len-part__title { margin-top: 12px; }
.len-rooms { display: grid; gap: 8px; }
.len-room { display: grid; gap: 6px; }
.len-room__acts { display: flex; gap: 6px; }
.len-select { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface, #fff); color: var(--ui-ink); font: 15px/1.2 var(--ui-font); }
.len-rm, .len-newbtn { min-height: 44px; padding: 0 12px; font-size: 14px; }
.len-newbtn { justify-self: start; }
.len-newroom { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; }
.len-newroom .ui-number { flex: 1 1 0; min-width: 0; }
.len-newroom .ui-btn { min-height: 48px; padding: 0 10px; font-size: 14px; }
.len-ops { display: grid; gap: 2px; }
.len-op { min-height: 44px; }
.len-geo { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.len-geo dt { color: var(--ui-ink-2); }
.len-geo dd { margin: 0; }
.len-drawn { font-size: 14px; color: var(--ui-ink-2); text-align: right; }
/* The door and window card (step 6): the object card's sheet and give-way rules */
body.has-opcard .screen-rounds, body.has-opcard .screen-hintbox { display: none; }
@media (max-width: 899px) and (min-height: 481px) { body.has-opcard #screenBar, body.has-opcard #screenKinds { visibility: hidden; } }
.op-card .ui-sheet__row > span { flex: none; min-width: 84px; }
.obj-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.obj-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#objFreeFields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }   /* X and Y with their ±: one row each when the card is narrow (release 19) */
.obj-card [hidden] { display: none !important; }
.obj-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 6px; }
.obj-row .ui-number { flex: 1 1 0; min-width: 0; }
.obj-card .ui-number__label { overflow: hidden; text-overflow: ellipsis; }   /* a long label (Croatian) never runs over the buttons beside it */
.obj-presets { display: contents; }
.obj-row .ui-btn { min-height: 48px; padding: 0 10px; font-size: 14px; }
.obj-quiet { margin-top: 2px; font-size: 13px; color: var(--ui-ink-2); }
/* the ± of a field that can be negative (release 19): inside the field, after its unit, a finger's 44 px */
.obj-sign { flex: none; align-self: stretch; min-width: 44px; margin-right: -8px; border: 0; border-radius: 8px; background: none; color: var(--ui-brand); font: 600 20px/1 var(--ui-font); cursor: pointer; }
.obj-sign:focus-visible { outline: 2px solid var(--ui-brand); outline-offset: -2px; }
.obj-actions { display: flex; gap: 8px; margin-top: 8px; }
.obj-actions .ui-btn { flex: 1 1 0; min-height: 46px; padding: 0 6px; gap: 2px; white-space: nowrap; font-size: 14px; }
.obj-bad { color: var(--ui-open); font-weight: 500; }
.obj-warn { color: var(--ui-warm); }
.obj-card .ui-number.is-bad .ui-number__field { border-color: var(--ui-open); box-shadow: 0 0 0 1px var(--ui-open); }
.obj-page__head { display: flex; align-items: center; gap: 4px; min-height: 48px; font-size: 16px; font-weight: 600; }
.obj-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.obj-types .ui-btn { min-height: 44px; padding: 0 12px; font-size: 14px; }
.obj-types .ui-btn[aria-pressed="true"] { background: var(--ui-brand-tint); color: var(--ui-brand-ink); border-color: var(--ui-brand); }
.obj-row__sub { display: block; font-size: 13px; color: var(--ui-ink-2); }
#objExportDetails { max-width: 320px; white-space: pre-line; font-size: 13px; color: var(--ui-ink-2); }
@media (max-height: 680px) { .obj-card .ui-number__field { min-height: 42px; } .obj-actions .ui-btn { min-height: 44px; } }
/* Step 9: Wall view (98-wall-view.js; the approved preview ui-kit/preview/wall.html). Its own screen over the plan: its top
   bar, the drawing and the mini plan; the plan's bottom bar, Show, Undo and Redo and the cards stay above it. While it is on the
   plan's top bar, Sketch, hint and handles' buttons go, and the plan gets no input (the screen covers it). */
.wv[hidden], .wv [hidden] { display: none !important; }
.wv { position: fixed; inset: 0; z-index: 90; background: var(--ui-sk-paper, var(--ui-surface)); touch-action: none; }
.wv-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.wv-top { position: fixed; left: 0; right: 0; top: 0; z-index: 100; }
.wv-top .ui-topbar__titles { flex: 1 1 auto; min-width: 0; }
.wv-face { min-height: 44px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
/* Step 9, Part C (C2): the small plan, its own drawing: the room with its walls' numbers, this wall lit, an arrow from you */
.wv-mini { position: fixed; top: 70px; right: 12px; z-index: 91; width: 176px; height: 136px; border-radius: 12px; background: var(--ui-plan-bg); pointer-events: none; }
@media (max-width: 499px), (max-height: 559px) { .wv-mini { width: 96px; height: 76px; } }
.wv-mini svg { display: block; width: 100%; height: 100%; }
.wv-mini .wm-room { fill: var(--ui-surface); stroke: var(--ui-ink); stroke-width: 1.6; stroke-linejoin: round; }
.wv-mini .wm-grey { fill: var(--ui-sunken); stroke: var(--ui-off); stroke-width: 1.2; stroke-dasharray: 3 2; stroke-linejoin: round; }
.wv-mini .wm-lit { stroke: var(--ui-brand); stroke-width: 4; stroke-linecap: round; }
.wv-mini .wm-num circle { fill: var(--ui-surface); stroke: var(--ui-ink); stroke-width: 1; }
.wv-mini .wm-num text { font: 700 9px var(--ui-font, system-ui, sans-serif); fill: var(--ui-ink); text-anchor: middle; dominant-baseline: central; }
.wv-mini .wm-num.wm-on circle { fill: var(--ui-brand); stroke: var(--ui-brand); }
.wv-mini .wm-num.wm-on text { fill: var(--ui-on-brand); }
.wv-mini .wm-lead { stroke: var(--ui-ink-2); stroke-width: 1; }   /* a number moved off its wall's middle: back to its wall */
.wv-mini .wm-arrow line { stroke: var(--ui-brand); stroke-width: 2; stroke-linecap: round; }
.wv-mini .wm-arrow polygon, .wv-mini .wm-arrow .wm-you { fill: var(--ui-brand); }
.wv-mini .wm-word { font: 600 9px var(--ui-font, system-ui, sans-serif); fill: var(--ui-brand); text-anchor: middle; dominant-baseline: central; }
.wv-hintbox { position: fixed; left: 12px; right: 12px; top: 72px; z-index: 96; display: flex; justify-content: center; pointer-events: none; }
.wv-anchor { position: fixed; width: 1px; height: 1px; pointer-events: none; }
.wv .ui-sk-obj.wv-held { stroke-width: 3.5; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .28)); }
#showMenu .wv-only { display: none; }
body.is-wallview #showMenu .wv-only { display: flex; }
body.is-wallview .screen-top, body.is-wallview #btnSketch, body.is-wallview #screenHintBox, body.is-wallview #screenOldBrowser,
body.is-wallview #canvasOverlay, body.is-wallview #objMarks, body.is-wallview .panel-left, body.is-wallview .panel-right { display: none !important; }
@media (max-height: 480px) { .wv-mini { display: none; } .wv-face { padding: 0 6px; } }
.len-wallview { min-height: 40px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
body.is-wallview #screenKinds [data-free] { opacity: .45; }   /* placed on the plan (B5): its tap only says so */
/* Step 9 (A3, the owner: "a small line drawer saying edit"): a card folded to its strip, its name, two numbers, Edit and ✕;
   the ··· and every field wait for Edit (92-card-shell.js sets is-folded) */
.obj-card .card-strip__nums, .obj-card .card-strip__edit { display: none; }
.obj-card.is-folded .ui-sheet__title { flex: 0 1 auto; }
.obj-card.is-folded { padding-bottom: 4px; }   /* (the card's own width: the 3D tools and the plan keep clear of it as of the card) */
.obj-card.is-folded .card-strip__nums { display: block; flex: 1 1 auto; min-width: 0; padding: 0 6px; overflow-wrap: anywhere; line-height: 1.25; font-size: 14px; color: var(--ui-ink-2); font-variant-numeric: tabular-nums; cursor: pointer; }   /* two short lines rather than a cut number */
.obj-card.is-folded .card-strip__edit { display: inline-flex; min-height: 44px; }
.obj-card.is-folded.is-said .card-strip__nums { color: var(--ui-open); font-weight: 500; }   /* a refusal's reason on the strip */
.obj-card.is-folded .ui-sheet__in > :not(.ui-sheet__head) { display: none !important; }
.obj-card.is-folded .ui-sheet__head [popovertarget] { display: none; }
/* Step 9 (A2): the field a label asked for, marked; its keyboard comes with his own tap in it */
.obj-card .is-asked .ui-number__field, .obj-card ui-length.is-asked { border-color: var(--ui-brand); box-shadow: 0 0 0 2px var(--ui-brand); border-radius: 10px; }
/* The handles' and marks' buttons: for the keyboard only, so a tap, a pinch or a pan stays the canvas's (CROW-3). */
.obj-marks { position: fixed; inset: 0; z-index: 84; pointer-events: none; }
.obj-mark { position: fixed; left: 0; top: 0; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; pointer-events: none; }
.obj-mark:focus-visible { outline: 3px solid var(--ui-brand); outline-offset: 2px; }
.obj-mark[hidden] { display: none; }
body[data-view="3d"] .obj-marks { display: none; }
/* The bottom bar's counts (approved screen item 7). */
#screenBar [data-group] { position: relative; }
.screen-count { position: absolute; top: 4px; left: 50%; min-width: 20px; height: 20px; padding: 0 5px; transform: translateX(6px); border-radius: 10px; background: var(--ui-brand); color: var(--ui-on-brand); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.screen-count[hidden] { display: none; }
/* The 3D tools stay beside the card (ui/47, as beside the panel). */
@media (min-width: 900px) and (min-height: 481px) { body.has-objcard .edit3d-toolbar, body.has-lencard .edit3d-toolbar { right: calc(12px + var(--ui-sheet-w, 348px) + 14px); } }
@media (max-height: 480px) { body.has-objcard .edit3d-toolbar, body.has-lencard .edit3d-toolbar { right: calc(6px + var(--ui-sheet-w, 330px) + 10px); } }
.obj-anchor { position: fixed; width: 1px; height: 1px; pointer-events: none; }

/* Step 4: the first screen, laid out as the approved mockup (ui-kit/preview/first.html: its .screen, .start and .saved
   rules, here .home__screen, .home__start and .home__saved). It covers the app, above its bars, and scrolls on its own;
   its top bar stays (the kit's sticky .ui-topbar). */
.home { position: fixed; inset: 0; z-index: 150; overflow-y: auto; overscroll-behavior: contain; }
.home[hidden] { display: none; }
.home__screen { display: grid; gap: 16px; max-width: 1240px; margin: 0 auto; padding: 16px; }
.home__start, .home__saved { display: grid; gap: 12px; align-content: start; min-width: 0; }
.home__saved .ui-head { margin: 8px 2px 0; }
@media (min-width: 700px) { .home__screen { gap: 20px; padding: 24px; } }
@media (min-width: 980px) and (orientation: landscape) {
  .home__screen { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
  .home__start { position: sticky; top: 84px; height: calc(100dvh - 108px); grid-template-rows: auto 1fr auto; }
  .home__start:has(> #homeContinue[hidden]) { grid-template-rows: 1fr auto; }   /* no Continue card: the hero takes its room */
  .home__start .ui-hero { min-height: 0; --ui-hero-art-w: 400px; --ui-hero-art-r: 40px; --ui-hero-art-t: 36px; }
  .home__saved .ui-head { margin-top: 0; }
}
.home__empty, .home__note { margin: 4px 2px; color: var(--ui-ink-2); font-size: 15px; }
.home [hidden] { display: none !important; }   /* the kit's parts set their own display (.ui-notice is flex) */
/* a short note for a moment (Sketch a room and Walk the room come later), above the page, out of its grid */
.home__hint { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 151; display: flex; justify-content: center; pointer-events: none; }
.home__hint .ui-hint[hidden] { display: none; }
/* the account parts before accounts come (the owner: shown greyed out) */
.home-off { opacity: .45; pointer-events: none; }
.ui-row.home-off, .ui-row:disabled { cursor: default; }
.home .ui-avatar:empty, #appMenu .ui-avatar:empty { background: var(--ui-off); }
/* the Menu's rows by screen: the first screen's or the drawing's; the rest (language, dark look, help, version) both */
#appMenu div.screen-menu__part:not(.ui-drawer__head) { display: contents; }
body.home-on #appMenu [data-screen="draw"], body:not(.home-on) #appMenu [data-screen="home"] { display: none !important; }
#appMenu .ui-row[hidden] { display: none; }   /* Delete this project, only for a project saved on this device (.ui-row is flex) */
/* the name card, asked once on a project's first save on this device */
.save-name { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--ui-r-l); background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-4); }
.save-name::backdrop { background: var(--ui-scrim); }
/* centred (the page's old margin reset took the dialog's own auto margins: it sat at the top left, Codex CR21-V1) */
.save-name[open] { margin: auto; }
.save-name .ui-field:focus-within { border-color: var(--ui-brand); }
.save-name .ui-field input:focus-visible { outline: 0; }   /* the field shows the focus, not a second ring inside it */
.save-name__card { display: grid; gap: 14px; padding: 20px; }
.save-name__title { font-size: 19px; font-weight: 600; }
.save-name__note { margin: 0; color: var(--ui-open); font-size: 15px; }
.save-name__note[hidden] { display: none; }
.save-name__acts { display: flex; justify-content: flex-end; gap: 10px; }
.save-name__acts--stack { flex-direction: column; align-items: stretch; }
.save-name__acts [hidden] { display: none; }
.save-name__text { margin: 0; color: var(--ui-ink-2); }

/* ── step 5: Pick a shape (79-shape-window.js). The window sits in what the number keyboard leaves: the script sets the
   background's top and height to the visual viewport's (--shape-h too), and the window scrolls inside itself. ── */
.shape-bg { position: fixed; left: 0; right: 0; top: 0; height: 100%; z-index: 200; align-items: center; justify-content: center; background: var(--ui-scrim); }
.shape-win { box-sizing: border-box; width: min(680px, calc(100vw - 32px)); max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain; display: grid; gap: 12px; padding: 14px 18px 18px;
  border-radius: var(--ui-r-l); background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-4); font-family: var(--ui-font); }
.shape-win:focus { outline: 0; }
.shape-win [hidden] { display: none !important; }   /* the kit's parts set their own display */
.shape-head { display: flex; align-items: center; gap: 6px; }
.shape-head h3 { flex: 1; margin: 0 0 0 4px; font-size: 19px; font-weight: 600; color: var(--ui-ink); }
/* step 1: the shapes, each drawn small */
.shape-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .shape-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shape-pick { display: grid; gap: 6px; justify-items: center; align-content: center; min-height: 128px; padding: 10px 6px; border: 1px solid var(--ui-line); border-radius: var(--ui-r-m);
  background: var(--ui-surface); color: var(--ui-ink); font: inherit; cursor: pointer; }
.shape-pick:active { background: var(--ui-sunken); }
.shape-pick:focus-visible { outline: 2px solid var(--ui-brand); outline-offset: 2px; }
.shape-pick__svg { display: block; width: 100%; height: 80px; }
.shape-pick__own { --ui-icon-size: 44px; margin: 18px 0; color: var(--ui-ink-2); }
.shape-pick__name { font-size: 15px; font-weight: 600; }
/* step 2: the drawing (two fingers turn it: the page itself never zooms or scrolls there) */
.shape-body { display: grid; gap: 12px; }
.shape-left, .shape-right { display: grid; gap: 12px; align-content: start; min-width: 0; }
.shape-draw { position: relative; height: clamp(150px, calc(var(--shape-h, 100vh) * 0.36), 340px); border-radius: var(--ui-r-m); background: var(--ui-plan-bg); touch-action: none; user-select: none; -webkit-user-select: none; }
.shape-svg { display: block; width: 100%; height: 100%; }
.shape-angle { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: var(--ui-ink); color: var(--ui-surface); font-size: 14px; font-weight: 600; pointer-events: none; }
.shape-floor { fill: var(--ui-surface); }
.shape-wall { stroke: var(--ui-ink); stroke-width: 6; stroke-linecap: round; }
.shape-wall--on { stroke: var(--ui-brand); stroke-width: 10; }
.shape-wall--worked { stroke: var(--ui-ink-2); }
.shape-wall--rec { stroke: var(--ui-warm); stroke-dasharray: 10 8; }
.shape-wall--bad { stroke: var(--ui-open); stroke-width: 8; }
.shape-hit { stroke: transparent; stroke-width: 30; fill: none; pointer-events: stroke; cursor: pointer; }
.shape-letter { cursor: pointer; }
.shape-letter circle { fill: var(--ui-surface); stroke: var(--ui-ink); stroke-width: 2; }
.shape-letter text { font: 600 14px var(--ui-font); fill: var(--ui-ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.shape-letter--on circle { fill: var(--ui-brand); stroke: var(--ui-brand); }
.shape-letter--on text { fill: var(--ui-on-brand); }
.shape-letter--worked circle { fill: var(--ui-sunken); stroke: var(--ui-line); }
.shape-letter--worked text { fill: var(--ui-ink-2); }
.shape-letter--rec circle { fill: var(--ui-warm-tint); stroke: var(--ui-warm-line); }
.shape-letter--rec text { fill: var(--ui-warm-ink); }
.shape-letter--bad circle { fill: var(--ui-open); stroke: var(--ui-open); }
.shape-letter--bad text { fill: #FFFFFF; }
.shape-mm { font: 600 13px var(--ui-font); fill: var(--ui-ink); dominant-baseline: central;   /* anchored by the script: beside an upright wall, to its line */ paint-order: stroke; stroke: var(--ui-surface); stroke-width: 4px; pointer-events: none; }
.shape-mm--on { fill: var(--ui-brand-ink); font-size: 15px; }
.shape-mm--worked { fill: var(--ui-ink-2); font-weight: 400; }
.shape-mm--rec { fill: var(--ui-warm-ink); font-weight: 400; font-style: italic; }
.shape-mm--bad { fill: var(--ui-open); }
.shape-ang { font: 500 11px var(--ui-font); fill: var(--ui-ink-2); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.shape-arc { fill: none; stroke: var(--ui-ink-2); stroke-width: 1.5; pointer-events: none; }
.shape-turn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shape-turn .ui-btn { min-height: 44px; gap: 6px; padding: 0 12px; }
.shape-turn ui-icon { --ui-icon-size: 22px; }
.shape-turn__hint { margin-left: auto; font-size: 14px; color: var(--ui-ink-2); }
/* the wall being typed, and its box: a calculated wall's number is the box's hint, orange and dashed when recommended,
   grey when worked out, so the first key typed replaces it */
.shape-lengths { display: grid; gap: 10px; }
.shape-which { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.shape-which__dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ui-brand); color: var(--ui-on-brand); font-size: 15px; }
.shape-which__of { margin-left: auto; font-size: 14px; font-weight: 400; color: var(--ui-ink-2); }
.shape-len.is-rec .ui-length__field { border-style: dashed; border-color: var(--ui-warm); background: var(--ui-warm-tint); }
.shape-len.is-exact .ui-length__field { border-color: var(--ui-line); background: var(--ui-sunken); }
.shape-len.is-rec .ui-length__value::placeholder, .shape-len.is-exact .ui-length__value::placeholder { font-size: 28px; font-weight: 600; }
.shape-len.is-rec .ui-length__value::placeholder { font-style: italic; color: var(--ui-warm-ink); }
.shape-len.is-exact .ui-length__value::placeholder { color: var(--ui-ink-2); }
@media (max-height: 480px) { .shape-len.is-rec .ui-length__value::placeholder, .shape-len.is-exact .ui-length__value::placeholder { font-size: 22px; } }
.shape-calc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ui-ink-2); }
.shape-calc__tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.shape-calc__tag--rec { color: var(--ui-warm-ink); background: var(--ui-warm-tint); border: 1px solid var(--ui-warm-line); }
.shape-calc__tag--exact { color: var(--ui-ink-2); background: var(--ui-sunken); border: 1px solid var(--ui-line); }
/* the wall's height beside its length (step 5, the owner ~11:20): typed, the wall's own; empty, the height it follows
   is the box's hint and the note says from where */
.shape-hrow { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.shape-hrow > ui-number { flex: 0 1 220px; min-width: 0; }
.shape-hnote { padding-bottom: 14px; font-size: 14px; color: var(--ui-ink-2); }
.shape-hrow input::placeholder { color: var(--ui-ink-2); font-weight: 400; }
.shape-h { font: 500 11px var(--ui-font); fill: var(--ui-ink-2); dominant-baseline: central; paint-order: stroke; stroke: var(--ui-surface); stroke-width: 4px; pointer-events: none; }
.shape-h--typed { fill: var(--ui-ink); font-weight: 600; }
.shape-h--worked { font-style: italic; }
.shape-stepmark { fill: var(--ui-warm); stroke: var(--ui-surface); stroke-width: 2; pointer-events: none; }
.shape-problem { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ui-open); font-size: 15px; font-weight: 500; }
.shape-problem ui-icon { --ui-icon-size: 22px; flex: none; }
.shape-problem > span { flex: 1 1 200px; min-width: 0; }   /* the words beside their icon, wrapping inside */
.shape-fixes { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }   /* the one-tap fixes, under the words */
.shape-fixes .ui-btn { min-height: 44px; }
.shape-fixes__head { flex: 1 1 100%; margin-top: 2px; color: var(--ui-ink); font-size: 14px; font-weight: 500; }   /* "Keep D 5000 straight, slant another wall:" */
/* the wall that slants when the lengths cannot make right angles (the owner ~17:05): one tap picks another */
.shape-slant { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shape-slant__label { font-size: 14px; color: var(--ui-ink-2); }
.shape-slant__walls { display: flex; flex-wrap: wrap; gap: 6px; }
.shape-slant__walls .ui-btn { min-width: 44px; min-height: 44px; padding: 0 10px; font-weight: 600; }
.shape-slant__walls .ui-btn[aria-pressed="true"] { background: var(--ui-brand-tint); color: var(--ui-brand-ink); border-color: var(--ui-brand); }
/* the room as it would be, small, on each slanted-wall button and each choice (the owner ~17:15) */
.shape-slant__walls .ui-btn, .shape-fixes .ui-btn { gap: 8px; }
.shape-mini { display: block; flex: none; width: 40px; height: 28px; }
.shape-mini__floor { fill: var(--ui-surface); }
.shape-mini__wall { stroke: var(--ui-ink-2); stroke-width: 2; stroke-linecap: round; }
.shape-mini__wall--on { stroke: var(--ui-brand); stroke-width: 3.5; }
.shape-own { margin: 0; font-size: 15px; color: var(--ui-ink); }
/* the rest of today's last step (the owner: "Keep all three"): the room's name, its height, where it goes */
.shape-more { display: grid; gap: 10px; }
.shape-name { color: var(--ui-ink-2); }
.shape-name:focus-within { border-color: var(--ui-brand); }
.shape-name input:focus-visible { outline: 0; }
.shape-name__label { flex: none; font-size: 14px; }
.shape-note { margin: 0; font-size: 14px; color: var(--ui-warm-ink); }
.shape-acts { display: flex; justify-content: flex-end; gap: 10px; }
.shape-acts .ui-btn { min-height: 48px; }
.shape-acts .ui-btn:disabled { opacity: .45; cursor: default; }   /* Create room waits for a problem to be fixed: shown */
/* sideways: the drawing on the left, the lengths on the right */
@media (orientation: landscape) and (min-width: 700px) {
  .shape-win { width: min(1000px, calc(100vw - 32px)); }
  .shape-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .shape-draw { height: clamp(200px, calc(var(--shape-h, 100vh) - 170px), 460px); }
}

/* Step 7: Sketch a room (98-sketch-mode.js). While it is on, its own bar replaces the plan's bars (every other way out
   is blocked: plan v3.1); during a stroke its bar and Undo fade, as the approved mockup's is-drawing does. */
body.is-sketching .screen-top, body.is-sketching #screenBar, body.is-sketching #screenKinds, body.is-sketching #screenRounds,
body.is-sketching #screenShowWrap, body.is-sketching #screenHintBox, body.is-sketching #screenOldBrowser,
body.is-sketching .panel-left, body.is-sketching .panel-right, body.is-sketching #objInspector,
body.is-sketching #canvasOverlay, body.is-sketching #objMarks, body.is-sketching #objList,   /* the stacked objects' marks and list (the other Claude 19:53) */
body.is-sketch-drawing .sketch-empty { display: none !important; }
.sketch[hidden], .sketch [hidden], .sketch-note[hidden] { display: none !important; }
.sketch-top { position: fixed; left: 0; right: 0; top: 0; z-index: 100; }
.sketch-top .ui-topbar__titles { flex: 1 1 auto; }
.sketch-state--open { color: var(--ui-open); font-weight: 600; }
.sketch .ui-btn:disabled, .sketch .ui-roundbtn:disabled { opacity: .45; cursor: default; }   /* nothing drawn yet: Convert and Undo wait, shown */
.sketch-empty { position: fixed; left: 16px; right: 16px; top: 60px; bottom: 76px; z-index: 90; display: grid; place-items: center; pointer-events: none; }
.sketch-say, .sketch-note { position: fixed; left: 50%; transform: translateX(-50%); top: 72px; z-index: 101; max-width: calc(100vw - 32px); pointer-events: none; }
.sketch-note { top: 128px; }   /* below the plan's own hint (the select tool's), never over it */
.sketch-rounds { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.sketch-top, .sketch-rounds, .sketch-say { transition: opacity var(--ui-fast, 120ms) ease-out, visibility var(--ui-fast, 120ms); }
body.is-sketch-drawing .sketch-top, body.is-sketch-drawing .sketch-rounds, body.is-sketch-drawing .sketch-say { opacity: 0; visibility: hidden; }
/* the magnifier: a round window in a top corner, the other one when the finger comes near (never under the finger) */
.sketch-loupe { position: fixed; top: 14px; right: 14px; width: 124px; height: 124px; z-index: 102; border-radius: 50%; border: 4px solid var(--ui-surface); box-shadow: var(--ui-shadow-4); background: var(--ui-surface); pointer-events: none; }
.sketch-loupe--left { right: auto; left: 14px; }
.sketch-loupe--close { border-color: #1f9d55; box-shadow: 0 0 0 3px rgba(31, 157, 85, .35), var(--ui-shadow-4); }   /* lifting now closes the room */
/* the test recorder's bar (?sketchlog only): under the sketch's bar, out of the way while drawing */
.sketch-log { position: fixed; left: 12px; right: 12px; top: 68px; z-index: 101; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid var(--ui-open); border-radius: var(--ui-r-m, 10px); background: var(--ui-surface); color: var(--ui-ink); font-size: 14px; }
.sketch-log__sent { color: var(--ui-ink-2, inherit); font-size: 13px; }
.sketch-log__text { flex: 1 1 100%; box-sizing: border-box; width: 100%; font: 12px/1.3 ui-monospace, monospace; }   /* Copy where the clipboard is refused */
body.is-sketch-drawing .sketch-log { opacity: 0; visibility: hidden; }
.sketch-ask { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: var(--ui-scrim); }
.sketch-ask > .save-name__card { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; background: var(--ui-surface); color: var(--ui-ink); border-radius: var(--ui-r-l); box-shadow: var(--ui-shadow-4); }
