:root {
  color-scheme: light dark;
  --blue: #15458d;
  --blue-strong: #0c326c;
  --blue-soft: #eaf1fb;
  --ink: #132031;
  --muted: #647184;
  --line: #dce3ec;
  --surface: #ffffff;
  --surface-alt: #f4f6f8;
  --viewer: #e8edf2;
  --focus: #3d75c7;
  --warning: #72521a;
  --shadow: 0 16px 42px rgba(31, 46, 67, 0.12);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.galaxy-traction-source {
  position: fixed;
  left: 0;
  top: 0;
  z-index: -1;
  width: 960px;
  height: 720px;
  border: 0;
  opacity: 0.001;
  pointer-events: none;
}

/* Embedded model mode: the parent workbench owns all product controls. */
body.embedded-mode {
  overflow: hidden;
  background: #edf1ec;
}
body.embedded-mode .access-gate,
body.embedded-mode .topbar,
body.embedded-mode .controls,
body.embedded-mode .stair-drawer,
body.embedded-mode .menu-backdrop,
body.embedded-mode .full-demo-banner,
body.embedded-mode .stair-live-panel,
body.embedded-mode .viewer-head,
body.embedded-mode .presentation-metrics,
body.embedded-mode .view-toolbar,
body.embedded-mode .part-inspector,
body.embedded-mode .loading-state strong,
body.embedded-mode .loading-state small {
  display: none !important;
}
body.embedded-mode .app-shell,
body.embedded-mode .workspace,
body.embedded-mode .viewer-panel,
body.embedded-mode .viewer-stage {
  width: 100%;
  height: 100vh;
  min-height: 0;
}
body.embedded-mode .workspace {
  display: block;
}
body.embedded-mode .viewer-panel {
  position: relative;
  top: 0;
}
* { box-sizing: border-box; }

html { height: 100%; overflow-x: hidden; background: var(--surface-alt); }

body {
  overflow-x: hidden;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--surface-alt);
  font-size: 14px;
  line-height: 1.55;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 5%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--blue) 5%, transparent) 1px, transparent 1px),
    var(--surface-alt);
  background-size: 48px 48px;
}
body:not(.full-demo-expired) .access-gate,
#logout { display: none !important; }
body.auth-pending .app-shell { visibility: visible; }
.full-demo-banner {
  position: fixed;
  z-index: 90;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 33, 55, .88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  pointer-events: none;
}
.full-demo-banner strong { font-size: 12px; white-space: nowrap; }
.full-demo-banner span { color: rgba(255, 255, 255, .74); font-size: 11px; white-space: nowrap; }
.full-demo-expired .access-form { display: none; }
@media (max-width: 720px) {
  .full-demo-banner { top: 8px; gap: 6px; padding: 7px 10px; }
  .full-demo-banner strong { font-size: 11px; }
  .full-demo-banner span { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
}
.access-panel {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 26px 76px rgba(31, 46, 67, 0.16);
}
.access-brand { display: inline-flex; align-items: center; gap: 11px; }
.access-brand > span:last-child { display: grid; line-height: 1.2; }
.access-brand strong { font-size: 18px; letter-spacing: 0.12em; }
.access-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.access-copy { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.access-copy > span { color: var(--blue); font-size: 10px; font-weight: 720; letter-spacing: 0.08em; }
.access-copy h1 { margin: 7px 0 0; font-size: 27px; letter-spacing: -0.035em; }
.access-copy p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.access-form { display: grid; gap: 13px; margin-top: 23px; }
.access-form label { display: grid; gap: 7px; }
.access-form label > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.access-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.access-form input:hover { border-color: #aeb9c8; }
.access-form button { min-height: 44px; margin-top: 3px; border: 1px solid var(--blue); border-radius: 6px; color: #fff; background: var(--blue); font-weight: 740; }
.access-form button:hover { background: var(--blue-strong); }
.access-form button:disabled { opacity: 0.58; cursor: wait; }
.access-error { margin: -3px 0 0; color: #b3263d; font-size: 11px; font-weight: 650; }
.access-note { margin: 16px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

button, input, select { font: inherit; }

button, select, input { color: inherit; }

button:focus-visible, select:focus-visible, input:focus-visible, canvas:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent);
  outline-offset: 2px;
}

button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.app-shell.parameter-open, .app-shell.stair-panel-open { overflow: hidden; }

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: 370px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  text-decoration: none;
}

.brand-navigation {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-strong);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: 160ms ease;
}
.brand-home-link:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--blue);
  font-size: 21px;
  font-weight: 800;
}

.brand > span:last-child { display: grid; line-height: 1.2; }
.brand strong { font-size: 20px; letter-spacing: 0.12em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }

.project-title { display: grid; justify-items: center; min-width: 0; line-height: 1.25; text-align: center; }
.project-title span { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.project-title strong { margin-top: 5px; font-size: 16px; }
.project-title small { margin-top: 4px; max-width: 620px; overflow: hidden; color: var(--muted); font-size: 10px; letter-spacing: 0.025em; text-overflow: ellipsis; white-space: nowrap; }

.top-actions { display: flex; gap: 8px; }
.top-actions button, .view-toolbar button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: 160ms ease;
}

.top-actions button:hover, .view-toolbar button:hover { border-color: var(--blue); color: var(--blue); }
.top-actions .primary-button { border-color: var(--blue); color: #fff; background: var(--blue); }
.top-actions .primary-button:hover { color: #fff; background: var(--blue-strong); }
.top-actions .temporary-demo-button { border-color: color-mix(in srgb, var(--blue) 58%, var(--line)); color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.top-actions .temporary-demo-button:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }

.workspace {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) 0;
  grid-template-rows: minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

#viewer { scroll-margin-top: 124px; }
.app-shell.parameter-open .workspace { grid-template-columns: clamp(280px, 33.333vw, 520px) minmax(0, 1fr) 0; }
.app-shell.stair-panel-open .workspace { grid-template-columns: 0 minmax(0, 1fr) clamp(280px, 33.333vw, 520px); }
.app-shell.parameter-open.stair-panel-open .workspace { grid-template-columns: clamp(270px, 27vw, 430px) minmax(320px, 1fr) clamp(270px, 27vw, 430px); }

.controls {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 76px;
  z-index: 20;
  width: 100%;
  height: calc(100vh - 76px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  container: elevator-controls / inline-size;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 12px 0 32px rgba(17, 35, 58, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-12px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}
.app-shell.parameter-open .controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}
.popover-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(14px);
}
.popover-head > div { display: grid; }
.popover-head span { color: var(--blue); font-size: 9px; font-weight: 760; letter-spacing: 0.14em; }
.popover-head strong { margin-top: 2px; font-size: 13px; }
.popover-head button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.popover-backdrop {
  display: none;
}

.stair-drawer {
  grid-column: 3;
  grid-row: 1;
  position: sticky;
  top: 76px;
  z-index: 20;
  width: 100%;
  height: calc(100vh - 76px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(17, 35, 58, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}
.app-shell.stair-panel-open .stair-drawer { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
.stair-drawer-footer { position: sticky; bottom: 0; z-index: 3; padding: 14px 18px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); }
.stair-drawer-footer button { width: 100%; min-height: 44px; border: 1px solid var(--blue); border-radius: 6px; color: #fff; background: var(--blue); font-weight: 720; }
.stair-drawer-footer button:hover { background: var(--blue-strong); }

.control-section { padding: 24px 26px; border-bottom: 1px solid var(--line); }
.elevator-reserve-editor { display: grid; gap: 12px; margin-bottom: 16px; padding: 14px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.elevator-reserve-heading { display: grid; gap: 3px; }
.elevator-reserve-heading strong { font-size: 13px; }
.elevator-reserve-heading small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.control-section.intro { padding-top: 30px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 10px; font-weight: 750; letter-spacing: 0.18em; }
.intro h1 { max-width: 300px; margin: 0; font-size: 26px; line-height: 1.18; letter-spacing: -0.04em; }
.intro p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.section-heading span { color: var(--blue); font-size: 11px; font-weight: 760; }
.section-heading h2 { margin: 0; font-size: 15px; }

.field { display: grid; gap: 7px; margin-top: 13px; }
.field.is-disabled { opacity: 0.46; }
.field.is-locked input:disabled { opacity: 1; color: var(--blue-strong); background: var(--surface-alt); cursor: default; }
.field > span, legend { color: var(--muted); font-size: 11px; font-weight: 650; }
select, input[type="number"], input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
select:hover, input[type="number"]:hover, input[type="text"]:hover { border-color: #aeb9c8; }
.field-note { min-height: 38px; margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.input-help { display: block; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.input-error { display: block; color: #b3263d; font-size: 10px; font-weight: 650; }
input[aria-invalid="true"] { border-color: #b3263d; box-shadow: 0 0 0 2px rgba(179, 38, 61, 0.1); }
#elevator-reserve-link-note[data-state="error"] { color: #b3263d; font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.structure-result { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; }
.structure-result span { color: var(--muted); }
.structure-result strong { min-width: 0; color: var(--blue); overflow-wrap: anywhere; text-align: right; }
.structure-result.cop-result { margin-top: 8px; padding-top: 8px; border-top-style: dashed; }
.structure-result.dimension-mode, .structure-result.floor-summary-result { display: grid; gap: 4px; }
.structure-result.dimension-mode strong, .structure-result.floor-summary-result strong { text-align: left; }
.structure-result.dimension-mode small, .structure-result.floor-summary-result small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.structure-result.platform-structure-result { display: grid; gap: 4px; }
.structure-result.platform-structure-result strong { text-align: left; }
.structure-result.platform-structure-result small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.traction-settings { display: grid; gap: 10px; margin-top: 10px; }
.traction-editor-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.traction-editor-tabs button, .traction-choice-buttons button { min-height: 36px; padding: 7px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 720; line-height: 1.25; }
.traction-editor-tabs button.active, .traction-editor-tabs button[aria-expanded="true"], .traction-choice-buttons button.active { border-color: var(--blue); color: #fff; background: var(--blue); }
.traction-editor-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line)); border-radius: 7px; background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.traction-editor-panel[hidden] { display: none; }
.traction-editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.traction-editor-heading strong { color: var(--ink); font-size: 12px; }
.traction-editor-heading small { color: var(--muted); font-size: 9px; text-align: right; }
.traction-editor-hint { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.traction-door-recommendation { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 6px; background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.traction-door-recommendation span { color: var(--blue-strong); font-size: 9px; font-weight: 760; letter-spacing: .04em; }
.traction-door-recommendation strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.traction-door-recommendation small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.traction-editor-fields { display: grid; gap: 8px; }
.traction-editor-fields.three-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.traction-editor-fields .field span { font-size: 9px; }
.traction-editor-fields .field input { min-width: 0; }
.traction-editor-status { display: block; color: var(--muted); font-size: 9px; line-height: 1.55; }
.traction-editor-status[data-state="valid"], .traction-editor-status[data-state="applied"] { color: #17734f; }
.traction-editor-status[data-state="error"] { color: #b3263d; }
.traction-editor-status[data-state="pending"] { color: #9a640f; }
.traction-editor-status[data-state="review"] { color: #9a640f; }
.traction-editor-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 7px; }
.traction-editor-actions.single-action { grid-template-columns: 1fr; }
.traction-editor-actions button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--blue); border-radius: 5px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 720; line-height: 1.25; }
.traction-editor-actions button + button { color: var(--blue-strong); background: var(--surface); }
.traction-native-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.traction-choice-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.traction-choice-buttons.two-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.traction-choice-buttons button { border-color: var(--line); background: var(--surface); }
.app-shell:not([data-product-series="GT"]) .traction-shaft-option { display: none; }
.traction-contract-result { border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.traction-rule-card { display: grid; gap: 9px; padding: 12px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line)); border-radius: 5px; background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.traction-rule-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.traction-rule-head strong { color: var(--ink); font-size: 12px; }
.traction-rule-head small, .traction-source-files { color: var(--muted); font-size: 9px; line-height: 1.55; }
.traction-rule-card dl { display: grid; gap: 0; margin: 0; }
.traction-rule-card dl div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); }
.traction-rule-card dt { color: var(--muted); font-size: 10px; }
.traction-rule-card dd { margin: 0; color: var(--ink); font-size: 10px; font-weight: 650; line-height: 1.5; }
.traction-rule-card[data-status="review"] { border-color: #c7892d; background: color-mix(in srgb, #f5c05d 9%, var(--surface)); }
.app-shell:not([data-product-series="GT"]) .traction-settings { display: none; }
.app-shell[data-product-series="GT"] .platform-only-field { display: none; }
.app-shell[data-product-series="DF"] .pit-depth-field { display: none; }
.app-shell[data-product-series="GT"] .dimension-mode small::after { content: " · 售前空间演示"; }
.app-shell:not([data-product-series="DF"]) .df-settings { display: none; }
.app-shell[data-product-series="DF"] .platform-only-field:not(.df-keep) { display: none; }
.app-shell[data-product-series="DF"] .traction-shaft-option { display: none; }
.df-settings { display: grid; gap: 13px; margin: 14px 0; padding: 14px; border: 1px solid #9fb9dc; border-radius: 7px; background: linear-gradient(145deg, #f7faff, #edf4fd); }
.df-rule-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.df-rule-head > div { display: grid; gap: 3px; }
.df-rule-head strong { color: var(--blue-strong); font-size: 13px; }
.df-rule-head small, .df-rule-head > span { color: var(--muted); font-size: 9px; }
.df-rule-head > span { padding: 4px 7px; border-radius: 99px; color: #fff; background: var(--blue); white-space: nowrap; }
.df-rule-hint, .df-source-boundary { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.df-source-boundary { padding-top: 9px; border-top: 1px dashed #b9c9dc; }
.df-opening-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #c7d4e5; border-radius: 6px; overflow: hidden; background: #fff; }
.df-opening-result > div { display: grid; gap: 4px; padding: 11px; }
.df-opening-result > div + div { border-left: 1px solid #d5dee9; }
.df-opening-result span, .df-opening-result small { color: var(--muted); font-size: 9px; }
.df-opening-result strong { color: var(--blue-strong); font-size: 13px; }
.df-door-faces { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 10px; border: 1px solid #c7d4e5; border-radius: 6px; background: #fff; }
.df-door-faces legend { width: 100%; padding: 0 0 6px; color: var(--ink); font-size: 10px; font-weight: 750; }
.df-door-faces label { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue-strong); font-size: 10px; font-weight: 750; }
.df-door-faces input { margin: 0; accent-color: var(--blue); }
.df-rule-status { color: var(--blue-strong); font-size: 10px; line-height: 1.55; }
.traction-editor-fields.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) {
  .df-opening-result { grid-template-columns: 1fr; }
  .df-opening-result > div + div { border-top: 1px solid #d5dee9; border-left: 0; }
  .df-rule-head { flex-direction: column; }
  .traction-editor-fields.two-fields { grid-template-columns: 1fr; }
}
.dimension-apply { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 13px; padding: 12px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line)); border-radius: 5px; background: var(--blue-soft); }
.dimension-apply > div { display: grid; gap: 3px; min-width: 0; }
.dimension-apply span, .dimension-apply small { color: var(--muted); font-size: 10px; }
.dimension-apply strong { color: var(--blue-strong); font-size: 11px; font-variant-numeric: tabular-nums; }
.dimension-apply button { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--blue); border-radius: 5px; color: #fff; background: var(--blue); font-size: 11px; font-weight: 720; line-height: 1.2; white-space: nowrap; }
.dimension-apply button:disabled { border-color: var(--line); color: var(--muted); background: var(--surface); cursor: default; }
.dimension-apply[data-dirty="true"] { border-color: var(--blue); background: color-mix(in srgb, var(--blue-soft) 72%, var(--surface)); }

.dimension-section { background: var(--blue-soft); }
.dimension-grid { display: grid; gap: 1px; border: 1px solid color-mix(in srgb, var(--blue) 15%, var(--line)); background: color-mix(in srgb, var(--blue) 13%, var(--line)); }
.dimension-grid div { display: grid; grid-template-columns: 88px 1fr; align-items: center; padding: 10px 12px; background: var(--surface); }
.dimension-grid span { color: var(--muted); font-size: 11px; }
.dimension-grid strong { color: var(--blue-strong); font-size: 15px; font-variant-numeric: tabular-nums; }
.dimension-grid small { grid-column: 2; color: var(--muted); font-size: 10px; }
.dimension-rule { display: grid; grid-template-columns: 22px auto 22px auto; align-items: center; gap: 6px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.dimension-rule strong { grid-column: 1 / -1; margin-top: 4px; color: var(--ink); font-size: 11px; }
.rule-line { height: 0; border-top: 2px solid var(--blue); }
.rule-line.dashed { border-top-style: dashed; }

fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; }
.face-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.face-options label { position: relative; min-height: 54px; }
.face-options input { position: absolute; opacity: 0; pointer-events: none; }
.face-options span {
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-weight: 800;
}
.face-options input:checked + span { border-color: var(--blue); color: #fff; background: var(--blue); }
.face-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 2px; }
.face-options label:not(.disabled) span { cursor: pointer; }
.face-options .disabled span { color: #9aa4b2; background: var(--surface-alt); }
.face-options small { position: absolute; right: 5px; bottom: 3px; color: #9aa4b2; font-size: 8px; }
.door-default-apply { width: 100%; min-height: 38px; margin-top: 12px; padding: 0 11px; border: 1px solid var(--blue); border-radius: 5px; color: var(--blue); background: var(--surface); font-size: 10px; font-weight: 720; }
.door-default-apply:hover { color: #fff; background: var(--blue); }
.door-result { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; }
.door-result span { color: var(--muted); }
.door-result strong { color: var(--blue); text-align: right; }

.floor-door-config { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.floor-door-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.floor-door-heading > span { font-weight: 700; font-size: 12px; }
.floor-door-heading small { color: var(--muted); font-size: 9px; text-align: right; }
.floor-door-list { display: grid; gap: 8px; }
.floor-door-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.floor-door-level { display: grid; gap: 3px; padding-top: 8px; color: var(--blue-strong); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.floor-door-level small { color: var(--muted); font-size: 8px; font-weight: 600; line-height: 1.35; }
.floor-opening-field { grid-column: 1 / -1; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 2px; }
.floor-opening-field > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.floor-opening-direction { width: 100%; min-height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--blue); border-radius: 5px; color: var(--blue-strong); background: var(--surface); font-size: 10px; font-weight: 750; }
.floor-face-list { display: grid; gap: 6px; }
.floor-face-row { display: grid; grid-template-columns: 52px minmax(112px, 1fr) 112px; align-items: center; gap: 6px; }
.floor-face-name { display: inline-grid; min-height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-alt); font-size: 11px; font-weight: 800; }
.floor-face-row.is-active .floor-face-name { border-color: var(--blue); color: #fff; background: var(--blue); }
.floor-face-row.is-unavailable { opacity: 0.48; }
.floor-face-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 11px; font-weight: 750; white-space: nowrap; }
.floor-face-toggle input { margin: 0; accent-color: var(--blue); }
.floor-face-toggle.is-unavailable { opacity: 0.42; }
.floor-face-row select { width: 100%; min-height: 32px; padding: 0 26px 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 10px; }
.floor-face-row select:disabled { opacity: 0.48; }
.floor-face-dimension-input { width: 100%; min-height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 10px; font-variant-numeric: tabular-nums; }
.floor-face-dimension-input[aria-invalid="true"] { border-color: #b3263d; color: #8f1d31; background: color-mix(in srgb, #b3263d 4%, var(--surface)); }
.floor-face-dimension-input:disabled { opacity: 0.48; }
.floor-face-size { min-width: 0; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; white-space: normal; }

@container elevator-controls (max-width: 430px) {
  .control-section { padding-right: 18px; padding-left: 18px; }
  .traction-editor-heading, .floor-door-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .traction-editor-heading small, .floor-door-heading small { text-align: left; }
  .traction-editor-fields.three-fields, .traction-editor-actions, .traction-choice-buttons, .traction-choice-buttons.two-buttons { grid-template-columns: 1fr; }
  .floor-door-row { grid-template-columns: 1fr; }
  .floor-door-level { grid-template-columns: auto auto; align-items: baseline; justify-content: start; gap: 8px; padding-top: 0; }
  .floor-opening-field { grid-column: 1; grid-template-columns: 1fr; gap: 5px; }
  .floor-face-row { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
  .floor-face-row select, .floor-face-dimension-input { grid-column: 1 / -1; }
}

.switch-field { display: flex; align-items: flex-start; gap: 9px; margin-top: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-alt); cursor: pointer; }
.switch-field input { margin: 2px 0 0; accent-color: var(--blue); }
.switch-field > span { display: grid; gap: 3px; }
.switch-field strong { color: var(--ink); font-size: 11px; }
.switch-field small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.directional-top-heights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.directional-top-heights[aria-disabled="true"] { opacity: .56; }
.top-slope-direction-field { grid-column: 1 / -1; }

.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stair-space-combined { margin-top: 10px; }
.stair-space-combined input { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.stair-space-combined input[aria-invalid="true"] { border-color: #b3263d; box-shadow: 0 0 0 2px rgba(179, 38, 61, 0.1); }
.space-fields { margin-top: 2px; }
.material-fields { margin-top: 2px; }
.stair-direction-widths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stair-direction-widths .field span { font-size: 9px; }
input[readonly] { color: var(--blue-strong); background: var(--surface-alt); cursor: default; }
.stair-space-rule { margin-top: 12px; padding: 10px 11px; border-left: 3px solid var(--blue); color: var(--blue-strong); background: var(--blue-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.stair-space-rule.stair-orientation { margin-top: 7px; border-left-color: #7d8da2; color: var(--text); background: rgba(125, 141, 162, 0.09); }
.stair-result { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 14px; border: 1px solid var(--line); background: var(--line); }
.stair-result div { display: grid; gap: 3px; padding: 10px; background: var(--surface); }
.stair-result span { color: var(--muted); font-size: 10px; }
.stair-result strong { font-size: 12px; }

.caveat { border-left: 3px solid var(--warning); color: var(--warning); background: color-mix(in srgb, #f2dcae 25%, var(--surface)); }
.caveat strong { font-size: 12px; }
.caveat p { margin: 7px 0 0; font-size: 11px; }

.viewer-panel {
  grid-column: 2;
  grid-row: 1;
  height: calc(100vh - 76px);
  min-height: 560px;
  overflow: hidden;
  position: sticky;
  top: 76px;
  background: var(--viewer);
}
.viewer-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--viewer);
}
.app-shell.stair-only #door-demo,
.app-shell.stair-only #run-demo,
.app-shell.stair-only #xray-toggle,
.app-shell.stair-only #stair-display,
.app-shell.stair-only .view-toolbar [data-view],
.app-shell.stair-only .part-inspector { display: none; }

.app-shell[data-product-series="DF"] #stair-settings-open,
.app-shell[data-product-series="DF"] #stair-display,
.app-shell[data-product-series="DF"] #stair-visibility,
.app-shell[data-product-series="DF"] #guardrail-toggle { display: none; }
.app-shell[data-product-series="DF"] .dimension-section,
.app-shell[data-product-series="DF"] .df-hide-field { display: none; }
.app-shell:not([data-product-series="DF"]) #df-lower-obstacle-demo,
.app-shell:not([data-product-series="DF"]) #df-upper-obstacle-demo { display: none; }

#three-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  align-content: center;
  justify-items: center;
  background: var(--viewer);
  transition: opacity 280ms ease, visibility 280ms ease;
}
.loading-state.hidden { opacity: 0; visibility: hidden; }
.loading-state span { width: 38px; height: 38px; border: 3px solid color-mix(in srgb, var(--blue) 18%, transparent); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.85s linear infinite; }
.loading-state strong { margin-top: 18px; font-size: 15px; }
.loading-state small { margin-top: 5px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-head {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.viewer-head > div:first-child { display: grid; grid-template-columns: 9px auto; align-items: center; column-gap: 9px; }
.viewer-head strong { font-size: 16px; }
.viewer-head small { grid-column: 2; margin-top: 3px; color: var(--muted); font-size: 10px; }

.presentation-metrics {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 7;
  display: none;
  width: min(292px, calc(100% - 32px));
  padding: 7px 10px;
  border: 1px solid rgba(97, 111, 130, 0.18);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  box-shadow: 0 8px 28px rgba(31, 46, 67, 0.08);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.presentation-metrics div { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: baseline; gap: 7px; padding: 4px 0; }
.presentation-metrics div + div { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.presentation-metrics span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.presentation-metrics strong { overflow: hidden; font-size: 9px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3aa36e; box-shadow: 0 0 0 4px rgba(58, 163, 110, 0.12); }
.truth-label { padding: 7px 10px; border: 1px solid rgba(21, 69, 141, 0.18); color: var(--blue-strong); background: color-mix(in srgb, var(--surface) 86%, transparent); font-size: 10px; letter-spacing: 0.04em; }

.df-safety-alert {
  position: absolute;
  top: 74px;
  left: 24px;
  z-index: 8;
  display: grid;
  width: min(360px, calc(100% - 48px));
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 42%, var(--line));
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 14px 36px rgba(31, 46, 67, 0.14);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.df-safety-alert[hidden] { display: none; }
.df-safety-alert span { color: var(--blue-strong); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.df-safety-alert strong { font-size: 13px; line-height: 1.45; }
.df-safety-alert small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.df-safety-alert[data-state="warning"] { border-color: color-mix(in srgb, #b3263d 52%, var(--line)); border-left-color: #b3263d; }
.df-safety-alert[data-state="warning"] span,
.df-safety-alert[data-state="warning"] strong { color: #a2263a; }
.df-safety-alert[data-state="safe"] { border-color: color-mix(in srgb, #2b7a4b 42%, var(--line)); border-left-color: #2b7a4b; }
.df-safety-alert[data-state="safe"] span { color: #2b7a4b; }

.stair-live-panel {
  position: absolute;
  top: 74px;
  right: 24px;
  z-index: 4;
  width: 238px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  box-shadow: 0 12px 34px rgba(31, 46, 67, 0.1);
  backdrop-filter: blur(14px);
  pointer-events: none;
}
.stair-live-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.stair-live-head span { color: var(--ink); font-size: 12px; font-weight: 760; }
.stair-live-head strong { color: var(--blue-strong); font-size: 10px; text-align: right; }
.stair-live-metrics { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.stair-live-metrics div { display: grid; gap: 2px; min-width: 0; padding: 8px 0 7px; border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.stair-live-metrics span { color: var(--muted); font-size: 9px; }
.stair-live-metrics strong { overflow: hidden; color: var(--ink); font-size: 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.stair-live-metrics .stair-live-pit-metric { grid-column: 1 / -1; }
.stair-live-metrics .stair-live-pit-metric strong { white-space: normal; }
.stair-live-panel p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.stair-live-panel[data-fit="insufficient"] { border-color: color-mix(in srgb, #b3263d 45%, var(--line)); border-left-color: #b3263d; }
.stair-live-panel[data-fit="insufficient"] .stair-live-head strong,
.stair-live-panel[data-fit="insufficient"] p { color: #b3263d; }
.stair-live-panel[data-pending="true"] { border-style: dashed; }
.app-shell.stair-only .stair-live-panel { display: none; }

.view-toolbar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: min(720px, calc(100% - 48px));
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid rgba(97, 111, 130, 0.18);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.view-toolbar button { min-height: 34px; padding: 0 11px; background: transparent; font-size: 11px; }
.view-toolbar button.active { border-color: var(--blue); color: #fff; background: var(--blue); }
.view-toolbar .df-demo-control.active { border-color: #a2263a; background: #a2263a; }

.part-inspector {
  position: absolute;
  left: 24px;
  bottom: 92px;
  display: grid;
  min-width: 180px;
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 8px 28px rgba(31, 46, 67, 0.08);
  pointer-events: none;
}
.part-inspector span, .part-inspector small { color: var(--muted); font-size: 9px; }
.part-inspector strong { margin: 3px 0; font-size: 12px; }

.orientation {
  position: absolute;
  right: 28px;
  bottom: 94px;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(19, 32, 49, 0.18);
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  font-size: 9px;
  pointer-events: none;
}
.orientation span { position: absolute; font-weight: 750; }
.orientation span:nth-child(1) { left: 5px; top: 29px; }
.orientation span:nth-child(2) { left: 31px; bottom: 3px; color: var(--blue); }
.orientation span:nth-child(3) { right: 5px; top: 29px; }
.orientation span:nth-child(4) { left: 31px; top: 3px; }

.output-dialog {
  width: min(1280px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(17, 35, 58, 0.28);
}
.output-dialog::backdrop { background: rgba(12, 26, 44, 0.5); backdrop-filter: blur(5px); }
.output-dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 40px); }
.output-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}
.output-dialog-head > div { display: grid; gap: 3px; }
.output-dialog-head span { color: var(--blue); font-size: 9px; font-weight: 780; letter-spacing: 0.16em; }
.output-dialog-head h2 { margin: 0; font-size: 18px; }
.output-dialog-head button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.output-dialog-body { min-height: 0; padding: 16px 20px 24px; overflow: auto; background: var(--surface-alt); }
.output-status { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.output-owner-editor, .output-share-card, .output-live-card, .output-report-card, .output-parameter-card, .owner-proposal-banner { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.output-owner-editor { margin-bottom: 14px; }
.output-owner-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 48px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.output-owner-editor > header > div { display: flex; align-items: baseline; gap: 9px; }
.output-owner-editor > header span { color: var(--blue); font-size: 9px; font-weight: 820; letter-spacing: 0.1em; }
.output-owner-editor h3 { margin: 0; font-size: 14px; }
.output-owner-editor header small { color: var(--muted); font-size: 9px; }
.output-owner-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; }
.output-owner-fields label { display: grid; gap: 6px; }
.output-owner-fields label > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.output-owner-fields input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font: inherit; font-size: 12px; }
.output-owner-fields input:focus { outline: 2px solid color-mix(in srgb, var(--focus) 45%, transparent); border-color: var(--focus); }
.output-owner-fields .owner-address-field { grid-column: 1 / -1; }
.output-live-card, .output-report-card, .output-parameter-card { margin-top: 14px; }
.output-share-card > header, .output-live-card > header, .output-report-card > header, .output-parameter-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 48px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.output-share-card > header > div, .output-live-card > header > div, .output-report-card > header > div, .output-parameter-card > header > div { display: flex; align-items: baseline; gap: 9px; }
.output-share-card > header span, .output-live-card > header span, .output-report-card > header span, .output-parameter-card > header span { color: var(--blue); font-size: 9px; font-weight: 820; letter-spacing: 0.1em; }
.output-share-card h3, .output-live-card h3, .output-report-card h3, .output-parameter-card h3 { margin: 0; font-size: 14px; }
.output-share-card header small, .output-live-card header small, .output-report-card header small, .output-parameter-card header small { color: var(--muted); font-size: 9px; text-align: right; }
.output-share-layout { display: grid; grid-template-columns: minmax(0, 1fr) 158px; gap: 18px; padding: 16px; }
.output-share-copy { min-width: 0; }
.output-share-brand { display: flex; align-items: center; gap: 10px; }
.output-share-brand > span { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 2px solid var(--blue); border-radius: 50%; color: var(--blue); font-size: 17px; font-weight: 850; }
.output-share-brand > div { display: grid; gap: 2px; }
.output-share-brand strong { font-size: 11px; }
.output-share-brand small { color: var(--muted); font-size: 8px; }
.output-share-copy h4 { margin: 13px 0 4px; font-size: 18px; }
.output-share-copy > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.output-share-copy .output-share-owner { margin-bottom: 4px; color: var(--blue); font-weight: 720; }
.output-share-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 12px; }
.output-share-link-row a { min-width: 0; min-height: 38px; display: flex; align-items: center; overflow: hidden; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); background: var(--surface-alt); font-size: 10px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.output-share-actions { display: flex; gap: 7px; }
.output-share-link-row button { min-height: 38px; padding: 0 13px; border: 1px solid var(--blue); border-radius: 6px; color: #fff; background: var(--blue); font-size: 10px; white-space: nowrap; }
.output-share-link-row #output-share-download { color: var(--blue); background: var(--surface); }
.output-share-note { margin-top: 7px !important; font-size: 8px !important; }
.output-share-qr-wrap { display: grid; align-content: center; justify-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
#output-share-qr { width: 128px; height: 128px; display: grid; place-items: center; overflow: hidden; }
#output-share-qr img, #output-share-qr canvas { width: 128px !important; height: 128px !important; display: block; }
#output-share-qr small { color: #69778a; font-size: 8px; text-align: center; line-height: 1.4; }
.output-share-qr-wrap > span { color: #52647a; font-size: 8px; font-variant-numeric: tabular-nums; }
.owner-proposal-banner { display: none; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-left: 5px solid var(--blue); }
.owner-proposal-banner > div:first-child { min-width: 0; }
.owner-proposal-banner span { color: var(--blue); font-size: 9px; font-weight: 820; letter-spacing: 0.14em; }
.owner-proposal-banner h3 { margin: 5px 0 4px; font-size: 22px; }
.owner-proposal-banner p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.owner-proposal-meta { display: grid; flex: none; gap: 4px; text-align: right; }
.owner-proposal-meta strong { color: var(--blue); font-size: 12px; font-variant-numeric: tabular-nums; }
.owner-proposal-meta small { color: var(--muted); font-size: 9px; }
.owner-proposal-mode { overflow: hidden; background: var(--surface-alt); }
.owner-proposal-mode .access-gate { display: none !important; }
.owner-proposal-mode > .app-shell { visibility: hidden; }
.owner-proposal-mode .output-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
.owner-proposal-mode .output-dialog::backdrop { background: var(--surface-alt); backdrop-filter: none; }
.owner-proposal-mode .output-dialog-shell { height: 100dvh; max-height: 100dvh; grid-template-rows: auto minmax(0, 1fr); }
.owner-proposal-mode .output-dialog-head button,
.owner-proposal-mode .output-owner-editor,
.owner-proposal-mode .output-share-card,
.owner-proposal-mode .output-dialog-actions { display: none; }
.owner-proposal-mode .owner-proposal-banner { display: flex; }
.owner-proposal-mode .output-status { margin-bottom: 12px; }
.output-live-frame { height: min(58dvh, 620px); min-height: 440px; background: var(--viewer); }
.output-live-frame .viewer-stage { width: 100%; height: 100%; min-height: 0; }
.output-live-frame .presentation-metrics { display: grid; }
.output-live-frame .viewer-head { right: 326px; }
.output-live-frame .truth-label, .output-live-frame .part-inspector { display: none; }
.output-live-frame .view-toolbar { bottom: 14px; width: auto; max-width: calc(100% - 28px); flex-wrap: nowrap; }
.output-live-frame .view-toolbar button { display: none; }
.output-live-frame .view-toolbar #stair-display,
.output-live-frame .view-toolbar #stair-visibility,
.output-live-frame .view-toolbar #run-demo { display: inline-flex; align-items: center; justify-content: center; }
.output-live-frame .orientation { bottom: 82px; }
.app-shell.output-presentation-active .stair-drawer { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(100%); }
.output-shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.output-shot-grid figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--viewer); }
.output-shot-grid img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--viewer); }
.output-shot-grid img:not([src]) { visibility: hidden; }
.output-shot-grid figcaption { padding: 8px 10px; border-top: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 9px; }
.output-parameter-card #output-parameter-content { padding: 12px; }
.output-parameter-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.output-parameter-summary div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.output-parameter-summary div:last-child { border-right: 0; }
.output-parameter-summary span { display: block; color: var(--muted); font-size: 8px; }
.output-parameter-summary strong { display: block; margin-top: 4px; overflow: hidden; font-size: 11px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.output-parameter-block { margin-top: 12px; }
.output-parameter-block h4 { margin: 0 0 7px; font-size: 11px; }
.output-parameter-table-wrap { overflow-x: auto; }
.output-parameter-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.output-parameter-table th, .output-parameter-table td { padding: 7px 8px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.output-parameter-table th { color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.output-parameter-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.output-preview { min-height: 300px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--viewer); }
.output-preview img { display: block; width: 100%; height: auto; background: #fff; }
.output-preview img[hidden] { display: none; }
.output-placeholder { min-height: 300px; display: grid; place-content: center; justify-items: center; padding: 36px; text-align: center; }
.output-placeholder[hidden] { display: none; }
.output-placeholder span { width: 34px; height: 34px; border: 3px solid color-mix(in srgb, var(--blue) 18%, transparent); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.85s linear infinite; }
.output-placeholder strong { margin-top: 14px; font-size: 14px; }
.output-placeholder small { max-width: 420px; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.output-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.output-dialog-actions a { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--blue); border-radius: 6px; color: #fff; background: var(--blue); font-size: 12px; font-weight: 720; text-decoration: none; }
.output-dialog-actions a:first-child { background: var(--blue-strong); }
.output-dialog-actions a[aria-disabled="true"] { pointer-events: none; border-color: var(--line); color: var(--muted); background: var(--surface-alt); }

.temporary-share-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(18, 42, 72, .2);
}
.temporary-share-dialog::backdrop { background: rgba(12, 26, 44, .48); backdrop-filter: blur(5px); }
.temporary-share-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; margin: 0; }
.temporary-share-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.temporary-share-head > div { display: grid; gap: 3px; }
.temporary-share-head span { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.temporary-share-head h2 { margin: 0; font-size: 18px; }
.temporary-share-head button, .temporary-share-actions button, .temporary-share-actions a { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font: inherit; font-size: 12px; text-decoration: none; white-space: nowrap; }
.temporary-share-body { display: grid; gap: 16px; min-height: 0; padding: 20px; overflow: auto; background: var(--surface-alt); }
.temporary-share-body > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.temporary-share-link-field { display: grid; gap: 7px; }
.temporary-share-link-field span, .temporary-share-meta span { color: var(--muted); font-size: 10px; font-weight: 700; }
.temporary-share-link-field input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); background: var(--surface); font: inherit; font-size: 12px; }
.temporary-share-link-field input:focus { outline: 2px solid color-mix(in srgb, var(--blue) 30%, transparent); outline-offset: 1px; border-color: var(--blue); }
.temporary-share-meta { display: grid; grid-template-columns: .65fr 1.35fr; gap: 10px; }
.temporary-share-meta > div { display: grid; gap: 5px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.temporary-share-meta strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.temporary-share-status { padding: 10px 12px; border-left: 3px solid var(--blue); color: var(--muted) !important; background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.temporary-share-status[data-state="ready"] { border-left-color: #2b7a4b; }
.temporary-share-status[data-state="error"] { border-left-color: #b54242; color: #8f3030 !important; }
.temporary-share-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.temporary-share-actions #temporary-share-copy { border-color: var(--blue); color: #fff; background: var(--blue); }
.temporary-share-actions #temporary-share-open { border-color: var(--blue); color: var(--blue); }
.temporary-share-actions a[aria-disabled="true"] { pointer-events: none; border-color: var(--line); color: var(--muted); background: var(--surface-alt); }
.temporary-share-actions button:active, .temporary-share-actions a:active { transform: translateY(1px); }

/* Unified form treatment. Field contracts and validation logic stay unchanged. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
select:not([multiple]),
textarea {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, var(--muted));
  border-radius: 8px;
  color: var(--ink);
  background-color: color-mix(in srgb, var(--surface) 97%, var(--blue-soft));
  box-shadow: 0 1px 2px rgba(17, 35, 58, 0.04), inset 0 1px 0 color-mix(in srgb, var(--surface) 88%, transparent);
  font: inherit;
  font-variant-numeric: tabular-nums;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

select:not([multiple]) {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #647184 50%),
    linear-gradient(135deg, #647184 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

textarea {
  min-height: 96px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):hover:not(:disabled):not([readonly]),
select:not([multiple]):hover:not(:disabled),
textarea:hover:not(:disabled):not([readonly]) {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--muted));
  background-color: var(--surface);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):focus-visible,
select:not([multiple]):focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 16%, transparent), 0 2px 8px rgba(17, 35, 58, 0.08);
}

.field:focus-within > span,
.output-owner-fields label:focus-within > span {
  color: var(--blue);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"])[readonly],
textarea[readonly] {
  color: var(--blue-strong);
  background-color: var(--surface-alt);
  box-shadow: none;
  cursor: default;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):disabled,
select:not([multiple]):disabled,
textarea:disabled,
.field.is-locked input:disabled {
  opacity: 1;
  border-color: var(--line);
  color: var(--muted);
  background-color: color-mix(in srgb, var(--surface-alt) 88%, var(--line));
  box-shadow: none;
  cursor: not-allowed;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"])[aria-invalid="true"],
select:not([multiple])[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #b3263d;
  color: color-mix(in srgb, #b3263d 82%, var(--ink));
  background-color: color-mix(in srgb, #b3263d 5%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, #b3263d 13%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  opacity: 1;
}

input[type="range"] {
  min-height: 32px;
  accent-color: var(--blue);
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 2px;
}

.switch-field:focus-within,
.face-options label:focus-within span {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 14%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #4e8bdc;
    --blue-strong: #8ab5ee;
    --blue-soft: #172944;
    --ink: #e8edf4;
    --muted: #9aa8ba;
    --line: #2a3747;
    --surface: #121a24;
    --surface-alt: #0d141d;
    --viewer: #17212c;
    --focus: #73a8ed;
    --warning: #e4bd71;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 980px) {
  .topbar {
    height: 118px;
    grid-template-columns: minmax(180px, 1fr) auto;
    grid-template-rows: 56px 44px;
    grid-template-areas:
      "brand actions"
      "project project";
    gap: 0 18px;
    padding: 8px 20px 10px;
  }
  .brand-navigation { grid-area: brand; }
  .top-actions { grid-area: actions; }
  .project-title {
    grid-area: project;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: start;
    align-content: center;
    column-gap: 14px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
    text-align: left;
  }
  .project-title span { align-self: end; font-size: 9px; letter-spacing: 0.08em; }
  .project-title strong { align-self: end; margin-top: 0; font-size: 13px; }
  .project-title small { grid-column: 1 / -1; max-width: none; margin-top: 3px; font-size: 9px; }
  .workspace { min-height: calc(100vh - 118px); }
  .controls, .stair-drawer { top: 118px; height: calc(100vh - 118px); }
  .viewer-panel { top: 118px; height: calc(100vh - 118px); }
}

@media (max-width: 760px) {
  .access-gate { padding: 12px; }
  .access-panel { padding: 22px 18px; }
  .access-copy { margin-top: 20px; padding-top: 16px; }
  .access-copy h1 { font-size: 23px; }
  .topbar {
    height: auto;
    min-height: 126px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "brand"
      "project"
      "actions";
    gap: 8px 10px;
    padding: 10px 12px 11px;
  }
  .brand { gap: 8px; }
  .brand-navigation { justify-content: space-between; }
  .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .brand strong { font-size: 17px; }
  .brand small { display: none; }
  .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .top-actions #export-glb { display: inline-flex; align-items: center; justify-content: center; }
  .top-actions button { width: 100%; min-height: 34px; padding: 0 8px; font-size: 11px; white-space: nowrap; }
  .project-title {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 2px;
    padding-top: 8px;
  }
  .project-title span, .project-title strong, .project-title small { grid-column: 1; }
  .project-title span { font-size: 8px; }
  .project-title strong { font-size: 11px; line-height: 1.35; }
  .project-title small { overflow: visible; font-size: 8px; line-height: 1.4; text-overflow: clip; white-space: normal; }
  .workspace, .app-shell.parameter-open .workspace, .app-shell.stair-panel-open .workspace, .app-shell.parameter-open.stair-panel-open .workspace { display: flex; flex-direction: column; }
  .workspace { min-height: 0; }
  .viewer-panel { order: -1; position: relative; top: 0; width: 100%; height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; background: var(--surface); }
  .viewer-stage { order: 1; height: 64dvh; min-height: 480px; flex: none; }
  .controls { position: fixed; top: 10px; bottom: 10px; left: 10px; z-index: 60; width: calc(100vw - 20px); height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 70px rgba(17, 35, 58, 0.22); }
  .stair-drawer { position: fixed; top: auto; right: 10px; bottom: 10px; left: 10px; z-index: 60; width: auto; height: min(58dvh, 560px); max-height: calc(100dvh - 160px); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 70px rgba(17, 35, 58, 0.22); transform: translateY(18px); }
  .app-shell.stair-panel-open .stair-drawer { transform: translateY(0); }
  .app-shell.parameter-open.stair-panel-open .controls { top: 10px; bottom: auto; height: calc(50dvh - 15px); }
  .app-shell.parameter-open.stair-panel-open .stair-drawer { top: calc(50dvh + 5px); bottom: 10px; height: auto; max-height: none; }
  .popover-backdrop { position: fixed; inset: 0; z-index: 50; display: block; border: 0; background: rgba(18, 31, 49, 0.18); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 160ms ease, visibility 160ms ease; }
  .app-shell.parameter-open .popover-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
  .view-toolbar { bottom: 12px; width: calc(100% - 24px); }
  .view-toolbar button { min-height: 32px; padding: 0 9px; }
  .app-shell[data-product-series="DF"] .viewer-stage { padding-bottom: 28px; }
  .df-safety-alert { top: 72px; left: 12px; width: calc(100% - 24px); padding: 10px 12px; }
  .part-inspector { display: none; }
  .orientation { right: 14px; bottom: 116px; }
  .viewer-head { top: 14px; left: 14px; right: 14px; }
  .truth-label { display: none; }
  .stair-live-panel {
    order: 2;
    position: relative;
    top: auto;
    right: auto;
    z-index: 1;
    width: 100%;
    padding: 11px 14px 12px;
    border-width: 0 0 1px;
    border-left-width: 0;
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    backdrop-filter: none;
  }
  .stair-live-head { padding-bottom: 7px; }
  .stair-live-metrics { column-gap: 18px; }
  .stair-live-metrics div { padding: 6px 0 5px; }
  .stair-live-panel p { margin-top: 7px; }
  .floor-face-row { grid-template-columns: 48px minmax(96px, 1fr) 108px; }
  .traction-editor-fields.three-fields { grid-template-columns: 1fr; }
  .traction-editor-tabs button { min-height: 40px; }
  .traction-choice-buttons { grid-template-columns: 1fr; }
  .stair-direction-widths { grid-template-columns: 1fr; }
  .output-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 10px; }
  .output-dialog-shell { max-height: calc(100dvh - 16px); }
  .output-dialog-head { padding: 13px 14px; }
  .output-dialog-head h2 { font-size: 16px; }
  .output-dialog-body { padding: 12px; }
  .output-share-card > header, .output-live-card > header, .output-report-card > header, .output-parameter-card > header { align-items: flex-start; padding: 9px 10px; }
  .output-share-card header small, .output-live-card header small, .output-report-card header small, .output-parameter-card header small { max-width: 150px; line-height: 1.4; }
  .output-share-layout { grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; padding: 11px; }
  .output-share-copy h4 { margin-top: 10px; font-size: 15px; }
  .output-share-link-row { grid-template-columns: 1fr; }
  .output-share-actions { display: grid; grid-template-columns: 1fr; }
  .output-share-link-row button { width: 100%; }
  #output-share-qr { width: 92px; height: 92px; }
  #output-share-qr img, #output-share-qr canvas { width: 92px !important; height: 92px !important; }
  .output-live-frame { height: 54dvh; min-height: 380px; }
  .output-live-frame .viewer-head { top: 10px; right: 10px; left: 10px; }
  .output-live-frame .viewer-head small { display: none; }
  .output-live-frame .presentation-metrics { display: none; }
  .output-live-frame .view-toolbar { bottom: 10px; max-width: calc(100% - 20px); padding: 6px; }
  .output-live-frame .view-toolbar button { min-height: 32px; padding: 0 9px; }
  .output-live-frame .orientation { right: 10px; bottom: 76px; width: 58px; height: 58px; }
  .output-shot-grid { grid-template-columns: 1fr; padding: 9px; }
  .output-parameter-card #output-parameter-content { padding: 9px; }
  .output-parameter-summary { grid-template-columns: 1fr 1fr; }
  .output-parameter-summary div:nth-child(2) { border-right: 0; }
  .output-parameter-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .output-placeholder { min-height: 240px; }
  .output-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 12px; }
  .output-dialog-actions a { min-height: 42px; padding: 0 8px; text-align: center; }
  .output-dialog-actions a:last-child { grid-column: 1 / -1; }
  .temporary-share-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .temporary-share-head { min-height: 58px; padding: 11px 13px; }
  .temporary-share-body { padding: 14px; }
  .temporary-share-meta { grid-template-columns: 1fr; }
  .temporary-share-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 11px 13px; }
  .temporary-share-actions button, .temporary-share-actions a { width: 100%; min-height: 42px; }
  .temporary-share-actions button:last-child { grid-column: 1 / -1; }
  .output-owner-fields { grid-template-columns: 1fr; padding: 11px; }
  .output-owner-fields .owner-address-field { grid-column: 1; }
  .owner-proposal-banner { align-items: flex-start; padding: 14px; }
  .owner-proposal-banner h3 { font-size: 18px; }
  .owner-proposal-meta { display: none; }
  .owner-proposal-mode .output-dialog,
  .owner-proposal-mode .output-dialog-shell { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  select:not([multiple]) { min-height: 46px; }
}

/* Apple-style consolidation: retain the existing HOMELIFT blue/white palette and
   all model controls, while simplifying hierarchy, spacing and progressive disclosure. */
.apple-consolidated {
  --apple-radius-large: 20px;
  --apple-radius-medium: 14px;
  --apple-radius-control: 11px;
  --apple-hairline: color-mix(in srgb, var(--line) 72%, transparent);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-optical-sizing: auto;
  letter-spacing: -0.006em;
}

.apple-consolidated .topbar {
  height: 70px;
  grid-template-columns: minmax(220px, 1fr) auto minmax(380px, 1fr);
  gap: 20px;
  padding: 0 18px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 1px 0 var(--apple-hairline), 0 8px 28px rgba(31, 46, 67, 0.05);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}
.apple-consolidated .brand { gap: 10px; }
.apple-consolidated .brand-mark { width: 36px; height: 36px; font-size: 19px; }
.apple-consolidated .brand strong { font-size: 17px; letter-spacing: .09em; }
.apple-consolidated .brand small { margin-top: 2px; font-size: 10px; }
.apple-consolidated .project-title span { font-size: 9px; letter-spacing: .1em; }
.apple-consolidated .project-title strong { margin-top: 3px; font-size: 15px; letter-spacing: -.015em; }

.apple-consolidated .top-actions {
  position: relative;
  justify-self: end;
  align-items: center;
  gap: 8px;
}
.apple-consolidated .top-action-cluster {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface-alt) 82%, transparent);
}
.apple-consolidated .top-actions button,
.apple-consolidated .top-more summary {
  min-height: 38px;
  border-radius: var(--apple-radius-control);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -.005em;
}
.apple-consolidated .top-action-cluster button {
  min-width: 86px;
  border-color: transparent;
  background: transparent;
}
.apple-consolidated .top-action-cluster button.active {
  border-color: var(--apple-hairline);
  color: var(--blue-strong);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(31, 46, 67, .08);
}
.apple-consolidated .top-actions > .primary-button { min-width: 90px; padding-inline: 16px; }
.apple-consolidated .top-more { position: relative; }
.apple-consolidated .top-more summary {
  display: grid;
  min-width: 54px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--apple-hairline);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.apple-consolidated .top-more summary::-webkit-details-marker { display: none; }
.apple-consolidated .top-more[open] summary {
  border-color: color-mix(in srgb, var(--blue) 32%, var(--line));
  color: var(--blue-strong);
  background: var(--blue-soft);
}
.apple-consolidated .top-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 220px;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 18px 54px rgba(17, 35, 58, .17);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  transform-origin: top right;
}
.apple-consolidated .top-more-menu button {
  justify-content: flex-start;
  width: 100%;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.apple-consolidated .workspace {
  min-height: calc(100dvh - 70px);
  padding: 12px;
  background: var(--surface-alt);
  transition: grid-template-columns 300ms cubic-bezier(.2, .8, .2, 1);
}
.apple-consolidated .app-shell.parameter-open .workspace { grid-template-columns: clamp(320px, 31vw, 460px) minmax(0, 1fr) 0; }
.apple-consolidated .app-shell.stair-panel-open .workspace { grid-template-columns: 0 minmax(0, 1fr) clamp(320px, 31vw, 460px); }
.apple-consolidated .app-shell.parameter-open.stair-panel-open .workspace { grid-template-columns: clamp(300px, 25vw, 410px) minmax(320px, 1fr) clamp(300px, 25vw, 410px); }
.apple-consolidated .controls,
.apple-consolidated .stair-drawer {
  top: 82px;
  height: calc(100dvh - 94px);
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-large);
  background: color-mix(in srgb, var(--surface-alt) 88%, transparent);
  box-shadow: 0 18px 52px rgba(17, 35, 58, .11);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
}
.apple-consolidated .controls { width: calc(100% - 12px); border-right-width: 1px; }
.apple-consolidated .stair-drawer { width: calc(100% - 12px); margin-left: 12px; border-left-width: 1px; }
.apple-consolidated .popover-head {
  padding: 15px 17px 13px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--surface-alt) 76%, transparent);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.apple-consolidated .popover-head::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--apple-hairline) 10%, var(--apple-hairline) 90%, transparent);
  content: "";
}
.apple-consolidated .popover-head span { font-size: 8px; letter-spacing: .13em; }
.apple-consolidated .popover-head strong { margin-top: 3px; font-size: 15px; letter-spacing: -.012em; }
.apple-consolidated .popover-head button {
  min-height: 36px;
  padding: 0 12px;
  border-color: transparent;
  border-radius: var(--apple-radius-control);
  color: var(--blue-strong);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  font-weight: 650;
}
.apple-consolidated .control-section {
  margin: 12px;
  padding: 17px;
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 5px 18px rgba(31, 46, 67, .035);
}
.apple-consolidated .section-heading { margin-bottom: 13px; }
.apple-consolidated .section-heading span { font-size: 9px; }
.apple-consolidated .section-heading h2 { font-size: 16px; letter-spacing: -.018em; }
.apple-consolidated .field { gap: 6px; margin-top: 12px; }
.apple-consolidated .field > span,
.apple-consolidated legend { font-size: 10px; letter-spacing: .01em; }
.apple-consolidated select,
.apple-consolidated input[type="number"],
.apple-consolidated input[type="text"] {
  min-height: 44px;
  padding: 0 12px;
  border-color: var(--apple-hairline);
  border-radius: var(--apple-radius-control);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  font-variant-numeric: tabular-nums;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.apple-consolidated select:focus,
.apple-consolidated input[type="number"]:focus,
.apple-consolidated input[type="text"]:focus {
  border-color: color-mix(in srgb, var(--focus) 56%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 12%, transparent);
}
.apple-consolidated .traction-editor-tabs {
  gap: 3px;
  padding: 4px;
  border-color: var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
}
.apple-consolidated .traction-editor-tabs button,
.apple-consolidated .traction-choice-buttons button,
.apple-consolidated .traction-editor-actions button,
.apple-consolidated .door-default-apply,
.apple-consolidated .stair-drawer-footer button {
  border-radius: var(--apple-radius-control);
}
.apple-consolidated .traction-editor-panel,
.apple-consolidated .traction-door-recommendation,
.apple-consolidated .elevator-reserve-editor,
.apple-consolidated .dimension-apply,
.apple-consolidated .df-settings,
.apple-consolidated .df-opening-result,
.apple-consolidated .df-door-faces {
  border-radius: var(--apple-radius-medium);
}
.apple-consolidated button:active,
.apple-consolidated .top-more summary:active {
  transform: scale(.975);
  transition: transform 90ms ease-out;
}

.apple-consolidated .apple-disclosure { overflow: hidden; }
.apple-consolidated .apple-disclosure > summary {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 34px 0 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.apple-consolidated .apple-disclosure > summary::-webkit-details-marker { display: none; }
.apple-consolidated .apple-disclosure > summary::after {
  position: absolute;
  right: 13px;
  color: var(--muted);
  content: "›";
  font-size: 20px;
  font-weight: 450;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.apple-consolidated .apple-disclosure[open] > summary::after { transform: rotate(-90deg); }
.apple-consolidated .traction-rule-card.apple-disclosure { gap: 0; padding: 0; border-radius: var(--apple-radius-medium); }
.apple-consolidated .traction-rule-card.apple-disclosure > dl { padding: 0 13px 8px; }
.apple-consolidated .traction-rule-card.apple-disclosure > .traction-source-files { display: block; padding: 0 13px 13px; }
.apple-consolidated .floor-door-config.apple-disclosure {
  margin-top: 15px;
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface-alt) 54%, var(--surface));
}
.apple-consolidated .floor-door-config.apple-disclosure > summary { margin: 0; }
.apple-consolidated .floor-door-config.apple-disclosure > summary small { max-width: 190px; text-align: right; }
.apple-consolidated .floor-door-config.apple-disclosure .floor-door-list { padding: 0 11px 11px; }
.apple-consolidated .stair-drawer-footer {
  padding: 12px 16px 16px;
  border-top: 0;
  background: linear-gradient(0deg, color-mix(in srgb, var(--surface-alt) 96%, transparent) 78%, transparent);
  backdrop-filter: blur(22px);
}

.apple-consolidated .viewer-panel {
  top: 82px;
  height: calc(100dvh - 94px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--apple-hairline);
  border-radius: var(--apple-radius-large);
  box-shadow: 0 14px 44px rgba(31, 46, 67, .08);
}
.apple-consolidated .viewer-stage { border-radius: inherit; }
.apple-consolidated .viewer-head { top: 18px; left: 20px; right: 20px; }
.apple-consolidated .viewer-head strong { font-size: 15px; letter-spacing: -.014em; }
.apple-consolidated .truth-label,
.apple-consolidated .stair-live-panel,
.apple-consolidated .presentation-metrics,
.apple-consolidated .df-safety-alert,
.apple-consolidated .part-inspector,
.apple-consolidated .orientation {
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.apple-consolidated .stair-live-panel { top: 68px; right: 18px; border-left-width: 1px; }
.apple-consolidated .view-toolbar {
  bottom: 16px;
  gap: 4px;
  width: auto;
  max-width: calc(100% - 32px);
  flex-wrap: nowrap;
  padding: 6px;
  overflow-x: auto;
  border-color: var(--apple-hairline);
  border-radius: var(--apple-radius-medium);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 14px 42px rgba(31, 46, 67, .13);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  scrollbar-width: none;
}
.apple-consolidated .view-toolbar::-webkit-scrollbar { display: none; }
.apple-consolidated .view-toolbar button {
  min-height: 38px;
  flex: 0 0 auto;
  border-color: transparent;
  border-radius: var(--apple-radius-control);
  white-space: nowrap;
}
.apple-consolidated .view-toolbar button:hover { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.apple-consolidated .view-toolbar button.active { box-shadow: 0 4px 12px color-mix(in srgb, var(--blue) 18%, transparent); }

@media (max-width: 1180px) {
  .apple-consolidated .topbar { grid-template-columns: minmax(210px, 1fr) auto; }
  .apple-consolidated .project-title { display: none; }
}

@media (max-width: 760px) {
  .apple-consolidated .topbar {
    position: sticky;
    height: 108px;
    min-height: 108px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 38px 52px;
    grid-template-areas: "brand" "actions";
    gap: 5px;
    padding: 8px 10px 10px;
  }
  .apple-consolidated .brand { align-self: center; }
  .apple-consolidated .brand-mark { width: 31px; height: 31px; font-size: 16px; }
  .apple-consolidated .brand strong { font-size: 15px; }
  .apple-consolidated .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    width: 100%;
  }
  .apple-consolidated .top-action-cluster { min-width: 0; }
  .apple-consolidated .top-action-cluster button { min-width: 0; flex: 1 1 0; padding-inline: 8px; }
  .apple-consolidated .top-actions > .primary-button { min-width: 82px; padding-inline: 11px; }
  .apple-consolidated .top-more summary { min-width: 50px; padding-inline: 9px; }
  .apple-consolidated .top-more-menu { position: fixed; top: 102px; right: 10px; width: min(240px, calc(100vw - 20px)); }
  .apple-consolidated .workspace,
  .apple-consolidated .app-shell.parameter-open .workspace,
  .apple-consolidated .app-shell.stair-panel-open .workspace,
  .apple-consolidated .app-shell.parameter-open.stair-panel-open .workspace { padding: 8px; }
  .apple-consolidated .viewer-panel {
    top: 0;
    height: auto;
    border-radius: 18px;
  }
  .apple-consolidated .viewer-stage { height: calc(100dvh - 124px); min-height: 500px; }
  .apple-consolidated .controls,
  .apple-consolidated .stair-drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(17, 35, 58, .24);
  }
  .apple-consolidated .stair-drawer { top: auto; height: min(72dvh, 680px); max-height: calc(100dvh - 20px); }
  .apple-consolidated .app-shell.parameter-open.stair-panel-open .controls { top: 10px; height: calc(50dvh - 15px); }
  .apple-consolidated .app-shell.parameter-open.stair-panel-open .stair-drawer { top: calc(50dvh + 5px); height: auto; }
  .apple-consolidated .popover-backdrop { background: rgba(18, 31, 49, .24); backdrop-filter: blur(3px); }
  .apple-consolidated .control-section { margin: 10px; padding: 15px; }
  .apple-consolidated .view-toolbar { bottom: 10px; max-width: calc(100% - 20px); justify-content: flex-start; }
  .apple-consolidated .stair-live-panel { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .apple-consolidated .workspace,
  .apple-consolidated .controls,
  .apple-consolidated .stair-drawer,
  .apple-consolidated .apple-disclosure > summary::after { transition: none !important; }
  .apple-consolidated button:active,
  .apple-consolidated .top-more summary:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .apple-consolidated .topbar,
  .apple-consolidated .controls,
  .apple-consolidated .stair-drawer,
  .apple-consolidated .view-toolbar,
  .apple-consolidated .top-more-menu { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
