/* Opaque editor surfaces keep the floor drawing out of the controls. */
html:is([data-step="1"], [data-step="2"]) {
  --editor-panel-bg: #fafafa;
  --editor-panel-section-bg: #f7f7f7;
  --ak-white-sec: var(--editor-panel-bg);
  --ak-glass-bg: var(--editor-panel-bg);
  --ak-glassdark: #000011fa;
}
html[data-step] .tile-editor-host :is(.tile-purchase, .tile-coverage) { background: var(--editor-panel-section-bg); }
html:is([data-step="1"], [data-step="2"]) :is(.floating-panel, .detail-panel, .angle-panel, .lang-switch__panel, .pop-container) {
  --ak-glass-bg: var(--editor-panel-bg);
  --float-svg-default: #323232fa;
}
/* Piece details previously supplied their own, more transparent glass token. */
html:is([data-step="1"], [data-step="2"]) #piecedetail-wrap.detail-panel {
  --ak-glass-bg: var(--editor-panel-bg);
}
/* The compact inspectors use a separate fill instead of the glass token. */
body[data-step="1"] :is(#angle-wrap, #edge-wrap, #points-wrap, #hole-wrap, #floating-panel, #wall-wrap),
body[data-step="2"] #position-distance-toolbar {
  background-color: var(--editor-panel-bg);
}

/* One measurement control system for both editor steps. */
html:is([data-step="1"], [data-step="2"]) {
  --editor-field-height: var(--s24-p-, 24px);
  --editor-field-font-size: var(--s16-p-, 16px);
  --editor-row-height: var(--s32-p-, 32px);
  --editor-step-size: var(--s24-p-, 24px);
  --editor-step-art-size: var(--s22-p-, 22px);
  --editor-icon-size: var(--s24-p-, 24px);
  --editor-action-size: var(--s32-p-, 32px);
  --editor-inspector-width: calc(224px * var(--app-scale, 1));
  --editor-panel-inset: var(--s16-p-, 16px);
  --editor-control-gap: var(--s4-p-, 4px);
  --editor-field-fill: #e9e9e9;
  --editor-field-radius: 4px;
  --editor-value-width: calc(90px * var(--app-scale, 1));
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.floating-panel, .detail-panel, .angle-panel) {
  border-color: #00000014; border-radius: var(--ak-radius-panel, 20px);
  box-shadow: var(--ak-shadow-soft, 0 3px 18px #0003);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .floating-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box; height: var(--s32-p-, 32px); padding: var(--s4-p-, 4px) var(--s8-p-, 8px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .floating-panel__btn {
  display: grid; place-items: center; width: var(--editor-step-size); height: var(--editor-step-size);
  min-width: var(--editor-step-size); padding: 0; border: 0; background: transparent;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .floating-panel__btn :is(img, svg) {
  position: static; width: var(--s18-p-, 18px); height: var(--s18-p-, 18px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.icon_inputfield, .inputfield):has(:is(.ii-minus, .in-minus, [data-wall-action="minus"])) {
  position: relative; box-sizing: border-box; align-items: center; min-width: 0;
  height: auto; min-height: var(--editor-row-height); column-gap: var(--editor-control-gap);
  padding: 0; background: transparent;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(.ii-minus) {
  display: grid; grid-template-columns: var(--editor-icon-size) var(--editor-step-size) minmax(0, 1fr) auto var(--editor-step-size);
  width: 100%;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(> .measurement-value) {
  grid-template-columns: var(--editor-icon-size) minmax(0, 1fr) var(--editor-step-size) minmax(0, var(--editor-value-width)) var(--editor-step-size) minmax(0, 1fr);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(> .measurement-value) > :is(.ii-icon, .position-field-icon) { grid-area: 1 / 1; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(> .measurement-value) > .ii-minus { grid-area: 1 / 3; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(> .measurement-value) > .measurement-value { grid-area: 1 / 4; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .icon_inputfield:has(> .measurement-value) > .ii-plus { grid-area: 1 / 5; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .inputfield:has(:is(.in-minus, [data-wall-action="minus"])) {
  display: grid; grid-template-columns: var(--editor-step-size) minmax(0, 1fr) auto var(--editor-step-size);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .inputfield:has(> .measurement-value) {
  grid-template-columns: minmax(0, 1fr) var(--editor-step-size) minmax(0, var(--editor-value-width)) var(--editor-step-size) minmax(0, 1fr);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .inputfield:has(> .measurement-value) > :is(.in-minus, [data-wall-action="minus"]) { grid-area: 1 / 2; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .inputfield:has(> .measurement-value) > .measurement-value { grid-area: 1 / 3; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .inputfield:has(> .measurement-value) > :is(.in-plus, [data-wall-action="plus"]) { grid-area: 1 / 4; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-minus, .ii-plus, .in-minus, .in-plus, [data-wall-action="minus"], [data-wall-action="plus"]) {
  position: static; flex: 0 0 var(--editor-step-size); box-sizing: border-box;
  width: var(--editor-step-size); height: var(--editor-step-size); min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  background: #b3b3b3; cursor: pointer; font-size: 0;
  mask: var(--editor-step-art) center / var(--editor-step-art-size) var(--editor-step-art-size) no-repeat;
  -webkit-mask: var(--editor-step-art) center / var(--editor-step-art-size) var(--editor-step-art-size) no-repeat;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-minus, .in-minus, [data-wall-action="minus"]) { --editor-step-art: url('/_releases/dxf-4861fd10d9366e39/icons/cf_zoomout.svg'); }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-plus, .in-plus, [data-wall-action="plus"]) { --editor-step-art: url('/_releases/dxf-4861fd10d9366e39/icons/cf_zoomin.svg'); }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-minus, .ii-plus, .in-minus, .in-plus, [data-wall-action="minus"], [data-wall-action="plus"]):is(:hover, :focus-visible) { background-color: #555; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-icon, .position-field-icon) {
  flex: 0 0 var(--editor-icon-size); width: var(--editor-icon-size); height: var(--editor-icon-size);
  object-fit: contain; mask-size: contain; -webkit-mask-size: contain;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-input, .in-input, .measurement-value) {
  position: static; box-sizing: border-box; min-width: 0; max-width: 100%;
  height: var(--editor-field-height); min-height: 0; line-height: var(--editor-field-height);
  margin: 0; padding: 0 4px; border: 0; border-radius: var(--editor-field-radius);
  background: var(--editor-field-fill); color: #111; box-shadow: none;
  font-family: var(--default-mono-font-family, monospace); font-size: var(--editor-field-font-size); font-weight: 400;
  text-align: center;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-input, .in-input) { width: 100%; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .measurement-value {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .measurement-value :is(.ii-input, .in-input) {
  background: transparent; flex: 0 1 auto; padding: 0; width: 7ch;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) [data-editor-measurement="value"] .measurement-value input { width: 100% !important; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-input, .in-input):focus-visible {
  outline: 1px solid #008f85; outline-offset: 0;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.ii-unit, .in-unit, .wall-unit) {
  position: static; flex: 0 0 auto; width: auto; height: auto; margin: 0; padding: 0;
  transform: none; color: #888; font: 400 var(--s10-p-, 10px)/1.2 var(--default-font-family, sans-serif);
}
/* Length-only panels share a single unit key; the dots identify those fields. */
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(#hole-wrap, #position-panel) .floating-panel__header {
  position: relative; margin-bottom: var(--s12-p-, 12px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .editor-measurement-unit {
  position: absolute; top: calc(-1 * var(--s12-p-, 12px)); right: 0;
  display: flex; align-items: center; gap: 4px; color: #aaa;
  font: 400 var(--s10-p-, 10px)/1 var(--default-font-family, sans-serif);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.editor-measurement-unit, .editor-unit-key)::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #b6b6b6;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.editor-unit-repeat, .editor-unit-key-source) { display: none; }
html[data-step] :is(#editor-wrap, #floating-panel) .editor-unit-key {
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  color: #aaa; font: 400 10px/1 var(--default-font-family, sans-serif); pointer-events: none;
}
html[data-step] :is(#editor-wrap, #floating-panel) .editor-unit-key[hidden] { display: none; }
html[data-step] :is(#editor-wrap, #floating-panel) .editor-settings-meta {
  grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center;
  box-sizing: border-box; min-height: 16px; padding: 0 12px;
}
html[data-step] :is(#editor-wrap, #floating-panel) .editor-settings-meta[hidden] { display: none; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is([data-editor-measurement="value"] .measurement-value, #wall-wrap .measurement-value)::after {
  content: ''; position: absolute; top: 0; right: 0; width: 7px; height: 7px; border-radius: 50%; background: #b6b6b6;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) #position-panel [data-field="angle"] .position-unit { color: #111; font-size: var(--editor-field-font-size); }
/* Step 1's selection inspector writes inline character widths; these editable
   Step 2 fields must retain their full input width when switching steps. */
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) #position-panel .measurement-value input { width: 100% !important; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) #position-panel [data-field="angle"] input { width: calc(var(--position-angle-chars, 3) * 1ch) !important; }
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(#hole-wrap, #position-panel, #wall-wrap) {
  width: var(--editor-inspector-width); inline-size: var(--editor-inspector-width);
  max-width: calc(100vw - 32px); padding: 0; border: 0; overflow: hidden;
  background: var(--editor-panel-bg);
}
/* The cutout has a row wrapper; it must not add a second inset or shrink its children. */
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) #hole-wrap > .floating-row {
  display: flex; flex-direction: column; align-items: stretch; width: 100%; height: auto; padding: 0; gap: 0;
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(#hole-wrap, #position-panel) .icon_inputfield {
  width: auto; margin: 0 var(--editor-panel-inset) var(--s8-p-, 8px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) #hole-wrap .hole-remove-row {
  padding: var(--s12-p-, 12px) var(--editor-panel-inset); gap: var(--s8-p-, 8px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.hole-panel-action, .openings-actions .icon-btn, #door-variant-row .icon-btn, #wall-wrap .wall-alignment button) {
  box-sizing: border-box; width: var(--editor-action-size); height: var(--editor-action-size);
  min-width: var(--editor-action-size); min-height: var(--editor-action-size); padding: 0; border-radius: var(--s10-p-, 10px);
}
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.hole-duplicate-icon, .drawing-remove-icon, #wall-wrap .wall-alignment svg),
html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) :is(.openings-actions .icon-btn, #door-variant-row .icon-btn)::before {
  width: var(--editor-icon-size); height: var(--editor-icon-size);
}
/* Opening and door-variant SVGs include a half-canvas artboard margin. Size their
   visible artwork to the same icon box as the other inspector actions. */
html:is([data-step="1"], [data-step="2"]) #floating-panel :is(.openings-actions, #door-variant-row) .icon-btn {
  display: grid; place-items: center;
}
html:is([data-step="1"], [data-step="2"]) #floating-panel :is(.openings-actions, #door-variant-row) .icon-btn::before {
  mask-size: 185%; -webkit-mask-size: 185%; background-color: #333;
}
@media (max-width: 820px), (pointer: coarse) {
  html:is([data-step="1"], [data-step="2"]) {
    --editor-inspector-width: 264px; --editor-step-size: 44px; --editor-action-size: 44px; --editor-row-height: 48px;
  }
  html:is([data-step="1"], [data-step="2"]) :is(#editor-wrap, #floating-panel) .floating-panel__header { height: 44px; }
}
#centerline-upgrade-overlay img { display: block; width: 18px; height: 18px; opacity: .6; }

/* Shared mobile editor layout: Step 1 and Step 2 use the same shell and rows. */
:where(#floating-panel-title), .editor-settings-title, .editor-settings-icon { display: none; }
@media (max-width: 820px) {
  html[data-step] { --mobile-control-label-size: clamp(8.5px, 2.5vw, 10px); }
  html[data-step] .editor-settings-panel {
    --editor-step-size: 24px; --editor-step-art-size: 30px; --editor-icon-size: 24px; --editor-panel-inset: 12px;
    --editor-field-height: 32px; --editor-value-width: 88px; --editor-field-font-size: 16px;
    box-sizing: border-box; width: var(--editor-panel-width, 100vw) !important;
    inline-size: var(--editor-panel-width, 100vw) !important; max-width: 100vw !important;
    height: auto !important; padding: 0 !important; border-radius: 0 !important;
    background: var(--editor-panel-bg) !important;
    border: 0 !important;
    box-shadow: 0 -5px 16px #00000026 !important;
  }
  html[data-step] .editor-settings-panel .editor-settings-header {
    position: static !important; height: 48px !important; margin: 0 !important;
    padding: 2px 12px !important; cursor: default !important; gap: 8px; background: #e9e9e9;
  }
  html[data-step] .editor-settings-panel .editor-settings-title {
    display: block; flex: 1; width: auto;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 14px; font-weight: 600; text-transform: capitalize;
  }
  html[data-step] .editor-settings-panel .editor-settings-icon {
    display: block; flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain;
  }
  html[data-step] .editor-settings-panel:has(> .editor-settings-meta:not([hidden])) { --editor-meta-height: 20px; }
  html[data-step] .editor-settings-panel > .editor-settings-meta { height: var(--editor-meta-height, 16px); }
  html[data-step] .editor-settings-panel .editor-settings-header > button:not(.editor-settings-close) { display: none !important; }
  html[data-step] .editor-settings-panel .editor-settings-close { width: 44px !important; height: 44px !important; margin-left: auto; }
  html[data-step] .editor-settings-panel .editor-settings-close img { display: none; }
  html[data-step] .editor-settings-panel .editor-settings-close::after {
    content: ''; width: 10px; height: 10px; border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg);
  }
  html[data-step] .editor-settings-panel > .floating-panel__body {
    position: static; box-sizing: border-box; height: auto !important;
    max-height: calc(var(--editor-panel-height, 100dvh) - 48px - var(--editor-meta-height, 0px)) !important;
    padding: 8px 12px 12px !important; overflow-y: auto; overscroll-behavior: contain;
  }
  html[data-step] .editor-settings-panel .editor-settings-grid,
  html[data-step] .editor-settings-panel.editor-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; column-gap: 8px; row-gap: 8px;
  }
  html[data-step] .editor-settings-panel .editor-settings-grid:not([hidden]):not([style*="display: none"]):not([style*="display:none"]),
  html[data-step] .editor-settings-panel.editor-settings-grid:not([hidden]):not([style*="display: none"]):not([style*="display:none"]) { display: grid !important; }
  html[data-step] .editor-settings-panel .editor-settings-wide { grid-column: 1 / -1; min-width: 0; }
  html[data-step] .editor-settings-panel .editor-settings-field {
    box-sizing: border-box; min-width: 0; width: 100% !important; height: auto;
    min-height: 48px; margin: 0 !important; padding: 0 !important;
  }
  html[data-step] .editor-settings-panel > .editor-settings-grid:not(.floating-panel__body) { padding: 8px 12px 12px !important; }
  html[data-step] .editor-settings-panel .icon_inputfield:has(> .measurement-value) {
    grid-template-columns: var(--editor-icon-size) var(--editor-step-size) minmax(0, var(--editor-value-width)) var(--editor-step-size) !important;
    column-gap: 1px !important; width: 100% !important; padding: 0 !important; margin: 0 !important;
  }
  html[data-step] .editor-settings-panel .icon_inputfield:has(> .measurement-value) > .ii-minus { grid-area: 1 / 2 !important; }
  html[data-step] .editor-settings-panel .icon_inputfield:has(> .measurement-value) > .measurement-value { grid-area: 1 / 3 !important; }
  html[data-step] .editor-settings-panel .icon_inputfield:has(> .measurement-value) > .ii-plus { grid-area: 1 / 4 !important; }
  html[data-step] .editor-settings-panel :is(.ii-minus, .ii-plus, .in-minus, .in-plus, [data-wall-action="minus"], [data-wall-action="plus"]) { width: 24px !important; min-width: 24px !important; height: 44px !important; }
  html[data-step] :is(#editor-wrap, #floating-panel) :is(.ii-minus, .ii-plus, .in-minus, .in-plus, [data-wall-action="minus"], [data-wall-action="plus"]):not(:disabled):not([aria-disabled="true"]) { background-color: #707070; }
  html[data-step] .editor-settings-panel :is(.ii-icon, .position-field-icon) { width: var(--editor-icon-size) !important; height: var(--editor-icon-size) !important; }
  html[data-step] .editor-settings-panel .measurement-value input { width: 100% !important; font-size: 16px !important; }
  html[data-step] .editor-settings-panel :is(.ii-input, .in-input) { max-width: var(--editor-value-width); }
  /* Selects, estimates and prices share rows that grow with their content. */
  html[data-step] .editor-settings-panel .icon_inputfield:where(:has(> .ii-icon)):not(:has(.ii-minus)) {
    display: grid; grid-template-columns: 24px minmax(0, 88px) auto;
    align-items: center; gap: 6px 4px; width: 100%; min-width: 0;
    height: auto; min-height: 48px; margin: 0; padding: 0; background: transparent;
  }
  html[data-step] .editor-settings-panel .icon_inputfield:where(:has(> .ii-icon)):not(:has(.ii-minus)) > .ii-icon { grid-area: 1 / 1; }
  html[data-step] .editor-settings-panel .icon_inputfield:where(:has(> .ii-icon)):not(:has(.ii-minus)) > .ii-input { grid-area: 1 / 2; }
  html[data-step] .editor-settings-panel .icon_inputfield:where(:has(> .ii-icon)):not(:has(.ii-minus)) > .ii-unit { grid-area: 1 / 3; }
  html[data-step] .editor-settings-panel .icon_inputfield:where(:has(> .ii-icon)):not(:has(.ii-minus)) > .ii-select {
    grid-area: 1 / 2 / auto / -1; width: 100%; min-width: 0; height: 32px; padding: 0 4px; font-size: 14px;
  }
  html[data-step] .editor-settings-panel .icon_inputfield > .adhesive-badge {
    grid-area: 2 / 2; justify-self: start; box-sizing: border-box;
    max-width: 100%; height: auto; min-height: 22px; padding: 3px 5px;
    white-space: normal; font-size: 9px;
  }
  html[data-step] .editor-settings-panel .icon_inputfield > .adhesive-reset-btn { grid-area: 2 / 3; width: 24px; height: 24px; }
  html[data-step] .editor-settings-panel .icon_inputfield--price:not(:has(.ii-minus)) { grid-template-columns: 24px 36px minmax(0, 88px); }
  html[data-step] .editor-settings-panel .icon_inputfield--price > .ii-currency {
    grid-area: 1 / 2; width: 36px; min-width: 0; height: 32px; padding: 0; font-size: 14px;
  }
  html[data-step] .editor-settings-panel .icon_inputfield--price:not(:has(.ii-minus)) > .ii-input { grid-area: 1 / 3; }
  /* Options remain in their original owners and flow below the shared title/key. */
  html[data-step] .editor-settings-panel .editor-settings-options {
    position: static; display: flex; align-items: center; flex-wrap: wrap;
    justify-content: flex-start !important; width: 100% !important; min-width: 0;
    min-height: 44px; height: auto; margin: 0 0 8px; gap: 8px; padding: 0;
    overflow: visible;
  }
  html[data-step] .editor-settings-panel .editor-settings-options :is(.pattern-choices, .floating-row--choices) {
    display: flex; flex-wrap: wrap; gap: 8px; width: auto; flex: 0 1 auto; padding: 0; margin: 0;
  }
  html[data-step] .editor-settings-panel :is(.pattern-option-btn, .underlay-option-btn, .tile-recent-choice, .tile-shape-art) {
    box-sizing: border-box; flex: 0 0 44px; width: 44px !important; height: 44px !important; padding: 2px;
    border: 0 !important; border-radius: 8px; background: transparent !important; box-shadow: none !important;
  }
  html[data-step] .editor-settings-panel :is(.pattern-option-btn.is-current, .underlay-option-btn[aria-pressed="true"], .tile-recent-choice[aria-pressed="true"], .tile-shape-choice[aria-pressed="true"] .tile-shape-art) {
    background: #d8f5f2 !important;
  }
  html[data-step] .editor-settings-panel :is(.pattern-option-btn, .underlay-option-btn) > .icon-btn {
    display: block; width: 100%; height: 100%; margin: 0; padding: 0;
    border: 0; background: transparent !important; box-shadow: none !important;
  }
  html[data-step] .editor-settings-panel :is(.pattern-option-btn, .underlay-option-btn) > .icon-btn::before { inset: 0; width: 100%; height: 100%; }
  html[data-step] .editor-settings-panel .tile-colour {
    --tile-button-size: 44px; flex: 0 0 44px; width: 44px; height: 44px;
    display: grid; place-items: center; padding: 10px; margin: 0;
    border: 0; border-radius: 8px; box-shadow: none !important;
  }
  html[data-step] .editor-settings-panel .tile-colour .tile-appearance-icon { width: 24px; height: 24px; }
  html[data-step] .editor-settings-panel :is(.floating-row__copy, .tile-field-label, .wall-panel-label) {
    color: #555; font-size: 11px; line-height: 1.35; font-weight: 500;
  }
  html[data-step] .editor-settings-panel .tile-field-label { margin-bottom: 4px; }
  html[data-step] :is(#editor-wrap, #floating-panel) .editor-unit-key { color: #666; }
  html[data-step] .editor-settings-panel .tile-coverage span { font-size: 11px; }
  html[data-step] .editor-settings-panel :is(.pattern-option-btn, .underlay-option-btn, .tile-colour, .tile-recent-choice):focus-visible {
    outline: 2px solid #007d86 !important; outline-offset: 2px;
  }
  html[data-step] .editor-settings-panel .tile-editor-host .tile-card {
    --tile-inset: 12px; --tile-button-size: 44px; --tile-input-height: var(--editor-field-height);
  }
  html[data-step] .editor-settings-panel .tile-field-control {
    max-width: calc(var(--tile-icon-size) + var(--tile-control-gap) + var(--editor-value-width));
  }
  html[data-step] .editor-settings-panel .plank-card-hero {
    display: grid; grid-template-columns: var(--tile-button-size) minmax(0, 1fr); align-items: center;
    gap: 12px; padding-top: 0; margin-bottom: 16px;
  }
  html[data-step] .editor-settings-panel .plank-card-hero > .tile-colour { margin: 0; }
  html[data-step] .editor-settings-panel #plank-live-preview {
    width: min(100%, 220px, calc(88px * var(--plank-preview-ratio, 6)));
  }
  html[data-step] .editor-settings-panel .tile-piece-preview { max-width: 132px; }
  html[data-step] .editor-settings-panel .tile-purchase .tile-field-group { padding-bottom: 8px; }
  /* The two secondary popups use the same readable type and touch controls. */
  html[data-step] :is(.tile-appearance, .tile-picker-expanded) {
    padding: 12px; border: 0; border-radius: 12px; background: #fafafa;
    box-shadow: 0 4px 20px #0003;
  }
  html[data-step] :is(.tile-appearance header, .tile-picker-header) { min-height: 44px; margin-bottom: 12px; }
  html[data-step] :is(.tile-appearance h3, .tile-picker-header h3) { font-size: 14px; font-weight: 600; gap: 8px; }
  html[data-step] :is(.tile-appearance h3 img, .tile-picker-header h3 img) { width: 20px; height: 20px; }
  html[data-step] :is(.appearance-close, .tile-picker-close) { width: 44px; height: 44px; padding: 10px; }
  html[data-step] :is(.tile-appearance h4, .appearance-modes button, .tile-shape-label, .tile-picker-toggle, .tile-picker-divider) { font-size: 11px; color: #555; }
  html[data-step] .tile-appearance .appearance-thumbnail { min-width: 36px; }
  html[data-step] .appearance-modes .appearance-thumbnail { width: 44px; }
  html[data-step] .tile-editor-host .tile-picker-expanded .tile-shape-art { width: 44px; height: 44px; }
  html[data-step] .tile-editor-host .tile-picker-grid { gap: 16px 8px; }
  html[data-step] .tile-editor-host .tile-picker-toggle { --tile-button-size: 44px; margin-top: 4px; }
  html[data-step] .tile-editor-host .tile-picker-toggle > img { padding: 5px; }
  html[data-step] .toolbar-row {
    left: 0; right: 0; bottom: 0;
    height: calc(64px + max(6px, env(safe-area-inset-bottom))); min-height: 70px;
    padding: 6px 12px max(6px, env(safe-area-inset-bottom)); background: var(--editor-panel-bg);
    border: 0; border-radius: 0; box-shadow: 0 -4px 12px #00000020;
  }
  html[data-step] .toolbar-row .toolbar { height: 58px; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; }
  html[data-step] .toolbar-row .toolbar-group-left { height: 44px; }
  html[data-step] .toolbar-row .toolbar-content > .toolbar-group-left > .icon-btn { height: 44px; }
  /* Drawing history floats on the canvas, below inspectors in the same stack. */
  body[data-step="1"] #editor-wrap > .mobile-canvas-history {
    display: flex !important; position: absolute; left: 12px; bottom: 8px; top: auto;
    gap: 4px; margin: 0; z-index: 5;
  }
  #editor-wrap > .mobile-canvas-history > button {
    position: static; width: 44px; min-width: 44px; height: 44px;
  }
  body[data-step="2"] #editor-wrap > .mobile-canvas-history { display: none !important; }
  html[data-step] .toolbar-row .toolbar-content > .toolbar-group-left > [aria-controls="floating-panel"][aria-expanded="true"] { background-color: #92eeea; }
}
