:root { --ak-autowarn: #730000; --ak-autowarncorner: #7300007e; }
body[data-step="1"] { --ak-vertex-locked: #131313; }
.measured-edge { display: none; }
body[data-step="1"] #shape-editor .measured-edge {
  display: inline; stroke: var(--ak-vertex-locked); stroke-width: 3;
  vector-effect: non-scaling-stroke; pointer-events: none;
}
body[data-step="1"] #shape-editor .measured-edge--auto-updated,
body[data-step="1"] #shape-editor .auto-updated-edge-hover {
  stroke: var(--ak-autowarn);
}
body[data-step="1"] #shape-editor .vertex.protected-corner { fill: var(--ak-vertex-locked); }
body[data-step="1"] #shape-editor .vertex.auto-updated-corner {
  fill: var(--ak-autowarncorner); stroke: none;
}
#drawing-auto-update {
  position: absolute; top: calc(var(--s16-p-) - var(--s28-p-)); left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: stretch; width: 256px; max-width: calc(100% - 32px); min-height: 40px;
  box-sizing: border-box; padding: 0; border: 1px solid var(--ak-autowarn); border-radius: 10px;
  color: var(--ak-autowarn); background: #fff; font: inherit;
  font-size: var(--app_font_label-size-ui); letter-spacing: var(--app_font_label--letter-spacing);
}
#drawing-auto-update[hidden], body:not([data-step="1"]) #drawing-auto-update { display: none; }
#drawing-auto-update > span { display: flex; align-items: center; flex: 1; padding: 0 15px; }
#drawing-auto-update button {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  border: 0; border-left: 1px solid #f1f1f1; border-radius: 0 9px 9px 0; padding: 0 12px 0 8px;
  color: var(--ak-dark, #131313); background: transparent; font: inherit; letter-spacing: inherit; cursor: pointer;
}
#drawing-auto-update button img { width: 24px; height: 24px; }
/* Step 1 actions use CSS pixels, independently of the drawing camera. */
body[data-step="1"] .toolbar-row .icon-btn {
  min-width: 44px; min-height: 44px; flex-shrink: 0;
}
body[data-step="1"] .toolbar-row [data-drawing-name] {
  width: 44px; height: 44px; padding: 0;
  position: relative; background-size: 24px 24px; background-position: center;
}
body[data-step="1"] .toolbar-row .drawing-tool-name {
  display: none;
}
body[data-step="1"] .toolbar-row .icon-btn img,
body[data-step="1"] .toolbar-row .icon-btn svg { width: 24px; height: 24px; }
body[data-step="1"] .toolbar-row .icon-btn:disabled { opacity: .35; cursor: default; }
#drawing-status {
  position: absolute; top: 84px; left: 50%; transform: translateX(-50%); z-index: 40;
  max-width: calc(100% - 24px); width: max-content; padding: 8px 12px;
  color: var(--ak-vertex-fill, #3c3c3c); background: #f8fbfb; border: 1px solid #c5d7d6; border-radius: 8px;
  font: 13px/1.4 system-ui; pointer-events: none;
}
#drawing-status[data-kind="error"] { color: #752323; background: #fff4f2; border-color: #e8b5b0; }
body:not([data-step="1"]) #drawing-status { display: none; }
#canvas-exit-hint {
  display: none; position: absolute; top: 0; left: var(--s12-p-, 12px); z-index: 5;
  margin: 0; max-width: calc(100% - 96px); pointer-events: none;
  color: #858585; font: inherit; font-size: 12px; font-style: italic; line-height: 1.4; letter-spacing: normal;
}
@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
  #canvas-exit-hint:not([hidden]) { display: block; }
}
#btn-draw-walls { --icon-src: url("/_releases/dxf-e779d6d76fe89da3/icons/drawwalls.svg"); }
/* Retain the Divider implementation and existing dividers; hide new placement. */
#btn-adddivider[hidden] { display: none !important; }
#opening-placement-row[hidden] { display: none; }
#shape-editor[data-wall-openings="true"] .shape-outline { stroke: none !important; }
#shape-editor .opening-split { stroke: none; fill: transparent; }
#shape-editor .opening-split.opening-selected { fill: #008580; fill-opacity: .12; }
#wall-wrap {
  position: absolute; inset: 16px auto auto 16px; transform: none; z-index: 45;
  display: flex; flex-direction: column; gap: 0; padding: 0;
  width: 300px; max-width: calc(100% - 32px); max-height: calc(100% - 110px);
  overflow: visible; font: inherit; font-size: 13px; color: var(--ak-vertex-fill, #3c3c3c);
}
#wall-wrap[hidden], #wall-wrap [hidden], body:not([data-step="1"]) #wall-wrap { display: none !important; }
#wall-wrap button { min-height: 32px; border: 0; border-radius: 5px; padding: 4px 8px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
#wall-wrap button:hover, #wall-wrap button:focus-visible { background-color: #09566818; }
#wall-wrap button[aria-pressed="true"] { background-color: #095668; color: white; }
#wall-wrap button:disabled { opacity: .4; cursor: default; }
.wall-panel-heading, .wall-alignment, .wall-panel-actions, .wall-thickness-row { display: flex; align-items: center; gap: 8px; }
.wall-panel-heading { justify-content: space-between; }
#wall-wrap .floating-panel__header { cursor: grab; touch-action: none; flex-shrink: 0; }
#wall-wrap .floating-panel__body { gap: 12px; overflow-y: auto; }
#wall-wrap .floating-panel__btn { padding: 0; min-height: 0; width: auto; }
.wall-done-label { display: none; }
#wall-wrap.move-mode .floating-panel__header { cursor: grabbing; }
.wall-panel-title { font-size: 15px; font-weight: 500; }
#wall-wrap .wall-alignment button { padding: 2px; width: 32px; height: 32px; border: 1px solid #3c3c3c18; }
#editor-wrap .wall-alignment svg { position: static; inset: auto; display: block; width: 26px; height: 26px; overflow: hidden; pointer-events: none; }
#wall-wrap .wall-thickness { display: grid; grid-template-columns: 26px minmax(0,1fr) 26px 26px; flex: 1; min-width: 0; align-items: center; }
#wall-wrap .in-input { width: 100%; min-width: 0; text-align: center; }
.wall-delete::before { content: ''; display: block; width: 22px; height: 22px; background: currentColor; mask: url("/_releases/dxf-e779d6d76fe89da3/icons/clear.svg") center / contain no-repeat; }
#wall-wrap .wall-delete { color: #991d30; }
#wall-wrap .wall-delete:hover { background: #991d3033; }
.wall-panel-actions { flex-wrap: wrap; gap: 4px; font-size: 11px; }
#wall-wrap .wall-panel-actions button { min-height: 26px; padding: 3px 6px; }
#wall-wrap .wall-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#wall-wrap[data-mode="edit"] .wall-panel-actions,
#wall-wrap .wall-panel-actions:not(:has(button:not([hidden]))) { display: none; }
.interior-wall-solid { fill: none; stroke: var(--ak-vertex-fill, #3c3c3c); stroke-width: 1; vector-effect: non-scaling-stroke; }
body[data-step="1"] .interior-wall-fill { fill: var(--ak-accent2, #03747f); fill-opacity: .14; }
.wall-hit { cursor: pointer; }
.wall-handle { fill: #2aa49f; fill-opacity: .85; stroke: none; cursor: move; }
.wall-axis { fill: none; stroke: #008580; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wall-boundary-corner { fill: var(--ak-vertex-fill, #3c3c3c); fill-opacity: .22; stroke: none; cursor: move; }
.wall-boundary-edge { cursor: move; pointer-events: stroke; }
.wall-preview { fill: #008580; fill-opacity: .12; stroke: none; }
.wall-draft-axis { fill: none; stroke: #2ac6c1; stroke-width: 2; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.wall-snap-guide { fill: #2ac6c1; stroke: white; stroke-width: 1; vector-effect: non-scaling-stroke; }
#shape-editor:is([data-wall-drawing="true"], [data-corner-adding="true"]):not([data-navigation-tool="pan"], [data-navigation-tool="zoom-area"]),
#shape-editor:is([data-wall-drawing="true"], [data-corner-adding="true"]):not([data-navigation-tool="pan"], [data-navigation-tool="zoom-area"]) * { cursor: crosshair !important; }
#shape-editor[data-wall-drawing="true"] :is(#labels-layer, #vertices-layer, #hiwi-layer),
#shape-editor[data-wall-drawing="true"] :is(#labels-layer, #vertices-layer, #hiwi-layer) * { pointer-events: none; }
@media (max-width: 820px), (pointer: coarse) {
  /* Keep room boundaries legible when the drawing is fitted to a small screen. */
  #shape-editor .shape-outline,
  #shape-editor .interior-wall-solid {
    stroke: #262626;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
  }
  #wall-wrap { top: auto; bottom: 72px; left: 12px; width: 300px; }
  #wall-wrap .wall-alignment button { width: 40px; height: 40px; }
  #wall-wrap .wall-panel-actions button { min-height: 36px; }
}
body[data-step="1"] #edge-wrap button,
body[data-step="1"] #angle-wrap button,
body[data-step="1"] #hole-wrap button,
body[data-step="1"] #points-wrap button { min-width: 44px; min-height: 44px; }
@media (max-width: 820px) {
  /* Align the top controls with the fixed bottom toolbar. */
  .project-column {
    padding-inline: var(--s16-p-);
  }
  .toolbar-row #btn-adddivider { display: none !important; }
  body[data-step] .toolbar-row {
    --mobile-tool-font: clamp(6px, 2vw, 8px);
    --mobile-step-gap: 0px;
    --mobile-panel-padding: 8px;
    --mobile-step-size: 44px;
    --mobile-tool-size: min(44px, calc((100vw - var(--s16-p-) * 2 - var(--mobile-panel-padding) * 2 - 4px - var(--s1-p-) * 2 - var(--mobile-step-size) - var(--mobile-step-gap)) / 7));
    height: 62px; gap: var(--mobile-step-gap); padding-inline: var(--mobile-panel-padding);
    border-radius: 14px; background: #f7f7f7;
    border: var(--s1-p-) solid rgba(0, 0, 0, 0.10);
    /* Fade inside the mobile viewport gutter instead of beneath browser chrome. */
    box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, .20);
    backdrop-filter: blur(var(--ak-glass-blur)); -webkit-backdrop-filter: blur(var(--ak-glass-blur));
  }
  body[data-step="1"] .toolbar-row { --mobile-step-gap: 12px; }
  body[data-step="2"] .toolbar-row { --mobile-tool-size: 44px; }
  body[data-step] .toolbar-row .toolbar {
    height: 100%; min-width: 0; background: transparent; border: 0; box-shadow: none;
    border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body[data-step] .toolbar-row .toolbar-content {
    padding: 0 2px; gap: 0; overflow: visible; max-width: 100%;
  }
  body[data-step] .toolbar-row .toolbar-group-left {
    display: flex !important; flex: 1 1 0; min-width: 0; margin: 0 0 14px; gap: 0;
    justify-content: space-around;
  }
  body[data-step] .toolbar-row .toolbar-content > .toolbar-group-left > .icon-btn {
    position: relative; flex: 0 0 var(--mobile-tool-size); width: var(--mobile-tool-size);
    height: var(--mobile-tool-size); min-width: 0; min-height: 0;
    justify-content: center; padding: 0; overflow: visible !important;
    border-radius: 8px; background-position: center;
  }
  body[data-step] .toolbar-row .toolbar-group-left > .icon-btn::before {
    width: clamp(20px, 6.5vw, 28px); height: clamp(20px, 6.5vw, 28px); flex-shrink: 0;
  }
  body[data-step] .toolbar-row :is(.drawing-tool-name, .mobile-tool-name) {
    display: block; flex: 0 0 auto; width: max-content; max-width: none;
    position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
    font: 400 var(--mobile-tool-font)/1.2 Arial, sans-serif; letter-spacing: 0;
    color: #777; white-space: nowrap; text-transform: capitalize;
    pointer-events: none;
  }
  body[data-step] .toolbar-row .step-pill {
    flex: 0 0 var(--mobile-step-size); width: var(--mobile-step-size);
    min-width: 0; height: var(--mobile-step-size); margin: 0;
    border-radius: 14px; box-shadow: none;
  }
  body[data-step] .toolbar-row .step-pill-icon { order: 0; width: 28px; height: 28px; }
  body[data-step] .toolbar-row .step-pill-text {
    /* Keep the step button's accessible name without a visible mobile caption. */
    display: block !important; position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  body[data-step] .mobile-step-hint { display: none; }
  #editor-wrap #editor-tools-topright #info-mode-btn {
    background: var(--ak-white, #fff) !important; color: var(--ak-dark, #222) !important;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
}

.wall-boundary-corner.wall-boundary-selected { fill: var(--ak-accent2, #03747f); fill-opacity: .8; }
.wall-boundary-edge.wall-boundary-selected { stroke: var(--ak-accent2, #03747f); stroke-opacity: .5; }

.wall-body-hit.wall-selected { fill: var(--ak-accent2, #03747f); fill-opacity: .14; }
.wall-axis.wall-selected { stroke-width: 2; }

/* Step 1 canvas actions share dimensions; each control retains its own colors. */
body[data-step="1"] .canvas-action { cursor: pointer; }
body[data-step="1"] .hole-action[data-action="move"] .canvas-action-bg {
  fill: var(--ak-white-sec, #f4f4f4); stroke: var(--ak-shape-accenta, #2ac6c1);
  filter: drop-shadow(0 2px 5px #00000066);
}
body[data-step="1"] .hole-action[data-moving="true"] .canvas-action-bg { fill: var(--ak-shape-accenta, #2ac6c1); }
body[data-step="1"] .hole-action[data-moving="true"] .canvas-action-icon { filter: brightness(0) invert(.957); }
#editor-wrap[data-geometry-dragging="1"] :is(#edge-wrap, #wall-wrap) { display: none !important; }

/* Step 1 inspectors: compact measurements and a consistent remove action. */
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #points-wrap, #hole-wrap, #floating-panel, #wall-wrap) {
  --inspector-rule: #00000014;
  --inspector-remove: #991d30;
  padding: 0; border: 1px solid var(--inspector-rule); border-radius: 14px;
  background: #edededf5; box-shadow: 0 1px 7px #00000020;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #points-wrap) .floating-row_shape { gap: 0; }
body[data-step="1"] :is(#angle-wrap, #edge-wrap) .inputfield--grid {
  height: 44px; column-gap: 0; padding: 0 4px; width: auto;
}
body[data-step="1"] #angle-wrap .inputfield--grid { grid-template-columns: 28px max-content 28px; }
body[data-step="1"] #edge-wrap .inputfield--grid { grid-template-columns: 28px minmax(0, 1fr) 28px; }
body[data-step="1"] #edge-wrap .edge-mm-group { width: 152px; }
html:not([data-units="imperial"]) body[data-step="1"] #edge-wrap .edge-mm-group { display: grid; }
body[data-step="1"] #edge-wrap .edge-ftin-group { gap: 0; }
body[data-step="1"] #edge-wrap .in-input { min-inline-size: 0; padding: 0; }
body[data-step="1"] #edge-wrap .edge-ft-group { grid-template-columns: 24px 48px 24px; }
body[data-step="1"] #edge-wrap .edge-in-group { grid-template-columns: 24px 90px 24px; }
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel) :is(.in-input, .ii-input) {
  width: 100%; min-width: 0; height: 38px; padding: 0; border-radius: 4px;
  background: transparent; font-size: 16px; font-weight: 400; color: #222;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel) :is(.in-input, .ii-input):focus-visible {
  outline: 1px solid #2abdb9; outline-offset: -1px; background: #ffffff80;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel) :is(.in-unit, .ii-unit) {
  font-size: 11px; font-weight: 500; text-align: center;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel, #wall-wrap) .measurement-value {
  display: flex; align-items: center; justify-content: center; min-width: 0; gap: 2px;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel, #wall-wrap) .measurement-value input {
  flex: 0 1 auto; width: 6ch; min-width: 0; text-align: center; padding: 0;
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel, #wall-wrap) .measurement-value :is(.in-unit, .ii-unit, .wall-unit) {
  flex: 0 0 auto; width: auto; height: auto; margin: 0; text-align: left;
  font: 500 9px/1 system-ui; transform: translateY(-4px); white-space: nowrap;
}
body[data-step="1"] #angle-wrap #corner-lock {
  display: grid; place-items: center; align-self: stretch; flex: 0 0 44px;
  width: 44px; padding: 0; margin: 0; border: 0; border-right: 1px solid var(--inspector-rule);
  border-radius: 13px 0 0 13px; background: transparent; color: #333; cursor: pointer;
}
body[data-step="1"] #corner-lock .corner-lock-icon {
  display: block; width: 22px; height: 22px; background: currentColor; opacity: .6;
  mask: url('/_releases/dxf-23bd140f68860a12/icons/unlocked.svg') center / contain no-repeat;
  -webkit-mask: url('/_releases/dxf-23bd140f68860a12/icons/unlocked.svg') center / contain no-repeat;
}
body[data-step="1"] #corner-lock[data-manual="true"] .corner-lock-icon { opacity: 1; }
body[data-step="1"] #angle-wrap #corner-lock[aria-pressed="true"] { background: #333; color: var(--ak-white-sec, #f4f4f4); }
body[data-step="1"] #corner-lock[aria-pressed="true"] .corner-lock-icon {
  opacity: 1; mask-image: url('/_releases/dxf-23bd140f68860a12/icons/locked.svg'); -webkit-mask-image: url('/_releases/dxf-23bd140f68860a12/icons/locked.svg');
}
body[data-step="1"] #angle-wrap #corner-lock:focus-visible { outline: 2px solid var(--ak-shape-accent); outline-offset: -3px; }
body[data-step="1"] #angle-wrap .measurement-value input { flex: none; }
body[data-step="1"] #angle-wrap .measurement-value .in-unit,
body[data-step="1"] #edge-wrap .edge-ftin-group .in-unit { font-size: 12px; transform: none; }
body[data-step="1"] :is(#hole-wrap, #floating-panel) { width: 204px; inline-size: 204px; max-width: calc(100vw - 24px); }
body[data-step="1"] #floating-panel-body { padding: 0; }
body[data-step="1"] :is(#hole-wrap, #openings-panel) .floating-row {
  width: 100%; height: auto; min-height: 0; margin: 0; gap: 0; box-sizing: border-box;
}
body[data-step="1"] :is(#hole-wrap, #openings-panel) .icon_inputfield {
  width: 100%; height: 48px; padding: 0 12px; gap: 0;
  display: grid; grid-template-columns: 28px 28px minmax(0, 1fr) 28px;
  box-sizing: border-box;
}
body[data-step="1"] :is(#hole-wrap, #openings-panel) .ii-icon { width: 24px; height: 24px; }
body[data-step="1"] #openings-panel input::-webkit-inner-spin-button,
body[data-step="1"] #openings-panel input::-webkit-outer-spin-button { appearance: none; margin: 0; }
html[data-units="imperial"] body[data-step="1"] :is(#hole-wrap, #floating-panel) { width: 252px; inline-size: 252px; }
body[data-step="1"] #hole-wrap > .floating-row { padding-top: 4px; }
body[data-step="1"] #hole-wrap .hole-remove-row { width: 100%; margin-top: 4px; }
body[data-step="1"] .drawing-remove {
  color: var(--inspector-remove); background: transparent; border: 0; border-radius: 0;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 5px; padding: 0; font: 12px/1.2 var(--default-font-family, sans-serif); cursor: pointer;
}
body[data-step="1"] .drawing-remove--footer {
  width: 100%; min-height: 32px; border-top: 1px solid var(--inspector-rule);
  border-radius: 0 0 13px 13px; text-transform: lowercase;
}
body[data-step="1"] #hole-wrap #hole-remove-btn { min-height: 32px; }
body[data-step="1"] .drawing-remove--inline { align-self: stretch; border-left: 1px solid var(--inspector-rule); border-radius: 0 13px 13px 0; }
body[data-step="1"] .drawing-remove-icon {
  display: block; flex: 0 0 22px; width: 22px; height: 22px;
  background: currentColor; mask: url("/_releases/dxf-e779d6d76fe89da3/icons/clear.svg") center / contain no-repeat;
  -webkit-mask: url("/_releases/dxf-e779d6d76fe89da3/icons/clear.svg") center / contain no-repeat;
}
body[data-step="1"] .icon-btn:is([data-icon="remove-corner"], [data-icon="remove-hole"], [data-icon="remove-opening"], [data-icon="remove-divider"]) { --icon-src: url("/_releases/dxf-e779d6d76fe89da3/icons/clear.svg"); }
body[data-step="1"] :is(#clearhole-confirm, #cleardivider-confirm, #delete-reference-confirm) .ak-modal__pill[data-confirm] {
  --pill-leading-src: url("/_releases/dxf-e779d6d76fe89da3/icons/clear.svg"); color: #991d30;
}
body[data-step="1"] .drawing-remove:is(:hover, :active, :focus-visible) { background: #991d3040; }
body[data-step="1"] #wall-wrap .wall-delete {
  min-height: 32px; padding: 0; border-top: 1px solid var(--inspector-rule); border-radius: 0 0 13px 13px;
}
body[data-step="1"] #wall-wrap { width: 268px; }
body[data-step="1"] #wall-wrap .wall-thickness { grid-template-columns: 28px minmax(0, 1fr) 28px; }
body[data-step="1"] #wall-wrap .in-input { background: transparent; font-size: 16px; }
body[data-step="1"] #openings-panel .openings-actions { padding: 0 12px 8px; justify-content: space-between; }
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn {
  width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 9px;
  background: transparent; box-sizing: border-box;
}
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn::before {
  width: 34px; height: 34px; background: #888;
}
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn[aria-pressed="true"] { border-color: #4dceca; }
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn[aria-pressed="true"]::before { background: #333; }
body[data-step="1"] #openings-panel button:focus-visible { outline: 2px solid #008580; outline-offset: 1px; }
body[data-step="1"] #door-variant-row {
  display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center;
  padding: 8px 0; border-top: 1px solid var(--inspector-rule);
}
body[data-step="1"] #door-direction-wrap { grid-column: 1; grid-row: 2; margin: 0; padding-top: 3px; }
body[data-step="1"] #door-variant-row:has([data-variant="double"][aria-pressed="true"]) #door-direction-wrap { display: none !important; }
body[data-step="1"] #door-variant-row:has([data-variant="sliding"][aria-pressed="true"]) #door-direction-wrap { grid-column: 3; }
body[data-step="1"] #door-direction-toggle { width: 36px; height: 14px; background: #fff; }
body[data-step="1"] #door-direction-toggle .switch-thumb {
  width: 36px; height: 14px; top: 0; left: 0; border: 0; background: transparent; transform: none;
}
body[data-step="1"] #door-size-row { padding: 4px 0; border-top: 1px solid var(--inspector-rule); }
body[data-step="1"] #openings-panel :is(#door-width-row, #opening-placement-row) {
  padding: 8px 20px; min-height: 42px; justify-content: flex-start; gap: 14px;
}
body[data-step="1"] #openings-panel .floating-label { font-size: 12px; line-height: 1.4; }
body[data-step="1"] #openings-panel :is(#door-width-toggle, #opening-placement-toggle) { flex: 0 0 32px; background: #999; }
body[data-step="1"] #openings-panel :is(#door-width-toggle, #opening-placement-toggle)[aria-pressed="true"] { background: #60c9c5; }
@media (max-width: 820px), (pointer: coarse) {
  body[data-step="1"] :is(#hole-wrap, #floating-panel) { width: 232px; inline-size: 232px; }
  body[data-step="1"] :is(#hole-wrap, #openings-panel) .icon_inputfield { grid-template-columns: 28px 44px minmax(0, 1fr) 44px; padding-inline: 8px; }
  body[data-step="1"] :is(#hole-wrap, #openings-panel) :is(.ii-minus, .ii-plus) { width: 44px; height: 44px; }
  body[data-step="1"] .drawing-remove--footer, body[data-step="1"] #hole-wrap #hole-remove-btn, body[data-step="1"] #wall-wrap .wall-delete { min-height: 44px; }
  body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn { width: 44px; height: 44px; }
  body[data-step="1"] #door-direction-wrap { padding: 0; }
  body[data-step="1"] #door-direction-toggle { width: 44px; height: 32px; background: transparent; }
  body[data-step="1"] #door-direction-toggle .switch-thumb { top: 9px; left: 4px; background: #fff; }
}

body[data-step="1"] #hole-wrap {
  width: 244px; inline-size: 244px; padding: 0; flex-direction: column; align-items: stretch;
  box-shadow: 0 3px 18px #00000030;
}
body[data-step="1"] #hole-header { box-sizing: border-box; }
body[data-step="1"] #hole-wrap .icon_inputfield { grid-template-columns: 28px 28px minmax(0, 1fr) 28px 28px; padding: 0 6px; }
body[data-step="1"] #hole-wrap .ii-unit { width: auto; margin: 0; font: 14px/1 var(--default-font-family, sans-serif); }
body[data-step="1"] #hole-wrap .hole-remove-row { display: flex; justify-content: space-between; padding: 6px 6px 2px; box-sizing: border-box; }
body[data-step="1"] #hole-wrap .hole-panel-action {
  display: grid; place-items: center; width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  border: 0; border-radius: 9px; padding: 0; background: #00000008; cursor: pointer;
}
body[data-step="1"] #hole-wrap #hole-remove-btn { min-height: 36px; margin-left: auto; }
body[data-step="1"] #hole-duplicate-btn { color: #333; }
body[data-step="1"] #hole-duplicate-btn[aria-pressed="true"] { background: var(--ak-shape-accenta, #2ac6c1); color: var(--ak-white-sec, #f4f4f4); }
body[data-step="1"] .hole-duplicate-icon { width: 22px; height: 22px; background: currentColor; mask: url('/_releases/dxf-23bd140f68860a12/icons/duplicatehole.svg') center / contain no-repeat; }
@media (max-width: 820px), (pointer: coarse) {
  body[data-step="1"] #hole-wrap { width: 276px; inline-size: 276px; }
  body[data-step="1"] #hole-wrap .hole-panel-action { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  body[data-step="1"] #hole-wrap .icon_inputfield { grid-template-columns: 28px 44px minmax(0, 1fr) 44px 28px; }
}

/* Step 1 measurements follow selection; keep the geometry visually dominant. */
body[data-step="1"] #shape-editor :is(.feedback-label-bg, .edge-label-bg) {
  rx: 3px;
  ry: 3px;
  fill-opacity: .68;
}
body[data-step="1"] #shape-editor :is(.drag-projection-line, .drag-length-line) {
  stroke-width: 1px;
  opacity: .4;
  vector-effect: non-scaling-stroke;
}

/* The selection toolbar stays at the user's chosen canvas position. */
body[data-step="1"] #points-wrap {
  position: absolute !important; height: 46px; width: max-content; inline-size: max-content;
  top: 8px; left: 8px; right: auto; bottom: auto; transform: none;
  align-items: center; gap: 8px; overflow: hidden; padding: 0;
}
body[data-step="1"] #points-wrap .points-align-actions {
  display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto;
  scrollbar-width: none;
}
body[data-step="1"] #points-wrap button {
  position: relative; display: grid; place-items: center; flex: 0 0 44px;
  width: 44px; height: 44px; padding: 0; margin: 0; border: 0;
  background: transparent; cursor: pointer;
}
body[data-step="1"] #points-wrap button[hidden] { display: none; }
body[data-step="1"] #points-wrap :is([data-align], [data-distribute]) img { position: relative; width: 36px; height: 36px; pointer-events: none; }
body[data-step="1"] #points-wrap :is([data-align], [data-distribute])::before { content: ''; position: absolute; inset: 4px; border-radius: 10px; }
body[data-step="1"] #points-wrap :is([data-align], [data-distribute]):is(:hover, :active)::before { background: var(--ak-shape-accenta, #2ac6c1); opacity: .55; }
body[data-step="1"] #points-wrap button:focus-visible { outline: 2px solid var(--ak-shape-accenta, #2ac6c1); outline-offset: -4px; border-radius: 10px; }
body[data-step="1"] #points-wrap #points-move { flex-basis: 32px; width: 32px; min-width: 32px; cursor: grab; touch-action: none; }
body[data-step="1"] #points-wrap #points-move:active { cursor: grabbing; }
body[data-step="1"] #points-wrap #points-move img { width: 16px; height: 16px; pointer-events: none; }
body[data-step="1"] #points-wrap #btn-remove-points { border-left: 1px solid var(--inspector-rule); }
body[data-step="1"] #points-wrap #btn-remove-points:is(:hover, :active) { background: #991d3040; }
body[data-step="1"] #points-wrap #points-duplicate-cutouts { color: #333; }
body[data-step="1"] #points-wrap #points-duplicate-cutouts[aria-pressed="true"] { background: var(--ak-shape-accenta, #2ac6c1); color: var(--ak-white-sec, #f4f4f4); border-radius: 9px; }

body[data-step="1"] #shape-editor .hole-outline.cutout-selected {
  stroke: var(--ak-shape-accenta, #2ac6c1); stroke-width: 2.5px;
}
body[data-step="1"] #hole-wrap #hole-duplicate-btn[hidden] { display: none; }

.pattern-choices { display: contents; }
.pattern-choices + .floating-row { margin-top: var(--s12-p-); }
@media (max-width: 820px), (pointer: coarse) {
  /* Allow ordinary UI scrolling, while pinch belongs to the drawing camera. */
  html, body { touch-action: pan-x pan-y; }
}
@media (max-width: 820px) {
  body[data-step="2"] #floating-panel { height: auto; min-height: 0; }
  body[data-step="2"] #floating-panel-body {
    height: auto; max-height: calc(var(--step2-panel-height, 42dvh) - 38px);
  }
  #tilespattern-panel .pattern-choices {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px;
    width: 100%; align-items: center;
  }
  #tilespattern-panel .pattern-choices > .floating-row--choices { display: contents; }
  #tilespattern-panel .pattern-choices .pattern-option-btn { justify-self: center; min-width: 0; }
  :is(#pattern-panel, #tilespattern-panel) .floating-row--choices { flex-wrap: nowrap; }
  body[data-step="2"] #floating-panel::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
    pointer-events: none; opacity: 0; mix-blend-mode: multiply;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .03) 35%, rgba(0, 0, 0, .12) 70%, rgba(0, 0, 0, .24) 100%);
  }
  body[data-step="2"] #floating-panel[data-bottom-shadow="1"]::after { opacity: 1; }
}

/* Use the Step 2 settings scale for drawing inspectors as well. */
body[data-step="1"] :is(#floating-panel, #hole-wrap, #wall-wrap) .floating-panel__header {
  box-sizing: border-box; height: var(--s42-p-); padding: 0 var(--s8-p-);
}
body[data-step="1"] :is(#floating-panel, #hole-wrap, #wall-wrap) .floating-panel__header .floating-panel__btn {
  width: auto; height: auto; min-width: 0; min-height: 0; padding: 0; margin: 0;
  border: 0; background: transparent;
}
body[data-step="1"] :is(#floating-panel, #hole-wrap, #wall-wrap) .floating-panel__header img { width: var(--s16-p-); height: var(--s16-p-); }
body[data-step="1"] :is(#floating-panel, #hole-wrap, #wall-wrap) {
  width: calc(var(--s260-p-) + var(--s40-p-)); inline-size: calc(var(--s260-p-) + var(--s40-p-));
}
body[data-step="1"] #floating-panel-body,
body[data-step="1"] #hole-wrap > .floating-row { box-sizing: border-box; padding: 0 var(--s20-p-) var(--s20-p-); }
body[data-step="1"] :is(#hole-wrap, #openings-panel) .icon_inputfield {
  display: flex; width: 100%; height: var(--s40-p-); padding: 0; gap: var(--s12-p-);
}
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel, #wall-wrap) :is(.ii-input, .in-input) {
  height: var(--s38-p-); font-size: var(--input-text-size); border-radius: var(--ak-radius-pill); background: var(--ak-btn-bg);
}
body[data-step="1"] :is(#hole-wrap, #openings-panel) .ii-icon { width: var(--s36-p-); height: var(--s36-p-); flex: 0 0 var(--s36-p-); }
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel) :is(.ii-minus, .ii-plus, .in-minus, .in-plus) {
  width: var(--s16-p-); height: var(--s16-p-); flex: 0 0 var(--s16-p-);
}
body[data-step="1"] :is(#hole-wrap, #openings-panel) .measurement-value { flex: 1 1 auto; min-width: 0; }
body[data-step="1"] :is(#hole-wrap, #openings-panel, #wall-wrap) .measurement-value { gap: var(--s12-p-); }
body[data-step="1"] :is(#hole-wrap, #openings-panel, #wall-wrap) .measurement-value input { flex: 1 1 auto; width: 100%; }
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #hole-wrap, #openings-panel, #wall-wrap) :is(.ii-unit, .in-unit, .wall-unit) {
  font: 600 var(--unit-text-size)/1 var(--default-font-family, sans-serif); transform: none;
}
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn,
body[data-step="1"] #hole-wrap .hole-panel-action,
body[data-step="1"] #hole-wrap #hole-remove-btn {
  width: var(--s40-p-); height: var(--s40-p-); min-width: 0; min-height: 0;
}
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row) .icon-btn::before { width: var(--s32-p-); height: var(--s32-p-); }
body[data-step="1"] #openings-panel :is(.openings-actions, #door-variant-row, #door-size-row) { padding-inline: 0; }
body[data-step="1"] #openings-panel :is(#door-width-row, #opening-placement-row) { padding: var(--s8-p-) 0; gap: var(--s8-p-) !important; }
body[data-step="1"] #openings-panel .floating-label { font-size: var(--app_font_small-size-ui); }
body[data-step="1"] #hole-wrap .hole-remove-row { padding: 0; margin-top: var(--s8-p-); }
body[data-step="1"] #hole-wrap :is(.hole-panel-action, #hole-remove-btn) { width: var(--s36-p-); height: var(--s36-p-); }
@media (max-width: 820px) {
  body[data-step="1"] :is(#floating-panel, #hole-wrap, #wall-wrap) .floating-panel__header { height: 36px; }
  body[data-step="1"] #floating-panel-body,
  body[data-step="1"] #hole-wrap > .floating-row,
  body[data-step="1"] #wall-wrap .floating-panel__body { padding: 0 12px 12px; }
}
