:root {
  --ikea-blue: #287d78;
  --ikea-blue-deep: #135d59;
  --ikea-yellow: #a27828;
  --print-orange: #c6922d;
  --print-orange-dark: #916315;
  --ink: #202326;
  --muted: #687178;
  --line: #dfe3e6;
  --paper: #f1f4f3;
  --white: #ffffff;
  --success: #287d78;
  --display: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(40, 125, 120, .28);
  outline-offset: 2px;
}

.app-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  grid-template-columns: 360px 1fr auto;
  align-items: center;
  background: var(--ikea-blue);
  color: var(--white);
  border-bottom: 6px solid var(--ikea-yellow);
  position: relative;
  z-index: 20;
}

.brand {
  align-self: stretch;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  border-right: 1px solid rgba(255,255,255,.2);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 2px solid var(--white);
  border-radius: 50%;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 5px;
  place-content: center;
}

.brand-mark i {
  display: block;
  width: 4px;
  height: 14px;
  border-radius: 4px;
  background: var(--ikea-yellow);
}

.brand-mark i:nth-child(2) { transform: translateY(5px); }

.brand-copy { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand-copy strong { font-family: var(--display); font-size: 24px; letter-spacing: .02em; }
.brand-copy strong em { color: var(--ikea-yellow); font-style: normal; }
.brand-copy small { font-size: 11px; opacity: .8; letter-spacing: .12em; }

.compatibility {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.85);
}
.compatibility b { color: var(--white); font-weight: 700; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ikea-yellow);
  box-shadow: 0 0 0 4px rgba(255,218,26,.18);
}

.top-actions { display: flex; align-items: center; gap: 8px; padding-right: 18px; }
.button {
  height: 42px;
  border: 0;
  border-radius: 4px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-quiet { color: var(--white); background: rgba(255,255,255,.1); }
.button-quiet:hover { background: rgba(255,255,255,.18); }
.button-export { min-width: 116px; }
.button-export-stl { color: var(--white); background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.button-export-stl:hover { background: rgba(255,255,255,.2); }
.button-export-3mf { background: var(--ikea-yellow); color: #1b1b14; }
.button-export-3mf:hover { background: #ffe44d; }
.button-export span { font-size: 18px; line-height: 1; }

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.control-panel {
  min-height: 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 10;
}
.panel-scroll { height: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: #b8c1c9 transparent; }
.control-section { padding: 24px; border-bottom: 1px solid var(--line); }
.intro-section { padding-top: 26px; }
.section-kicker {
  margin: 0 0 5px;
  color: var(--ikea-blue);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
}
h1, h2 { margin: 0; font-family: var(--display); letter-spacing: .01em; }
h1 { font-size: 27px; line-height: 1.1; }
h2 { font-size: 19px; line-height: 1.15; }

.type-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.type-card {
  min-height: 72px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  position: relative;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.type-card:hover { border-color: #97a7b6; transform: translateY(-1px); }
.type-card svg { width: 29px; height: 29px; flex: 0 0 auto; fill: #7d8994; }
.type-card span { display: flex; flex-direction: column; gap: 2px; }
.type-card b { font-size: 13px; }
.type-card small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.type-card.is-active { border: 2px solid var(--ikea-blue); background: #edf6ff; padding: 10px 9px; }
.type-card.is-active::after {
  content: "✓";
  position: absolute;
  top: 5px; right: 7px;
  color: var(--ikea-blue);
  font-size: 11px;
  font-weight: 900;
}
.type-card.is-active svg { fill: var(--ikea-blue); }

.companion-download {
  margin-top: 12px;
  min-height: 60px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 24px;
  align-items: center;
  gap: 10px;
  border: 1px solid #c9d8d5;
  border-left: 3px solid var(--ikea-yellow);
  border-radius: 6px;
  color: var(--ink);
  background: #f4f8f7;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.companion-download:hover {
  border-color: #87aca7;
  background: #edf6f4;
  box-shadow: 0 2px 8px rgba(25,33,36,.08);
  transform: translateY(-1px);
}
.companion-download:focus-visible { outline: 3px solid rgba(40,125,120,.3); outline-offset: 2px; }
.companion-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ikea-blue);
  background: #dfeeed;
}
.companion-icon svg { width: 25px; height: 25px; fill: currentColor; }
.companion-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.companion-copy small { color: #6c7b7a; font-family: var(--mono); font-size: 8px; letter-spacing: .04em; }
.companion-copy strong { overflow: hidden; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.companion-copy > span { color: var(--muted); font-size: 9px; }
.companion-arrow { color: var(--ikea-blue); font-family: var(--mono); font-size: 18px; font-weight: 700; text-align: center; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.unit-chip, .spec-lock {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  border-radius: 2px;
  padding: 5px 7px;
}
.unit-chip { background: var(--paper); color: var(--muted); }
.spec-lock { background: var(--ikea-blue); color: var(--white); }

.param-list { margin-top: 19px; }
.param-row + .param-row { margin-top: 17px; }
.param-row label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.param-row label span { font-size: 12px; font-weight: 700; }
.param-row label small { font-size: 10px; color: var(--muted); }
.range-pair { display: grid; grid-template-columns: minmax(0,1fr) 80px; align-items: center; gap: 12px; }

input[type="range"] {
  width: 100%; height: 18px; margin: 0;
  appearance: none; -webkit-appearance: none;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #cfd6dc; border-radius: 3px; }
input[type="range"]::-moz-range-track { height: 3px; background: #cfd6dc; border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; margin-top: -6px;
  border: 3px solid var(--white); border-radius: 50%;
  background: var(--ikea-blue); box-shadow: 0 0 0 1px var(--ikea-blue);
}
input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px;
  border: 3px solid var(--white); border-radius: 50%;
  background: var(--ikea-blue); box-shadow: 0 0 0 1px var(--ikea-blue);
}
.number-wrap {
  height: 32px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fbfcfd;
  overflow: hidden;
}
.number-wrap:focus-within { border-color: var(--ikea-blue); box-shadow: 0 0 0 2px rgba(0,88,163,.1); }
.number-wrap input {
  width: 100%; min-width: 0; height: 30px;
  border: 0; outline: 0; background: transparent;
  padding: 0 2px 0 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.number-wrap span { padding-right: 7px; color: #8a949e; font-family: var(--mono); font-size: 8px; }

.specific-section { background: #fbfcfd; }
.specific-section #specificControls { margin-top: 18px; }
.shape-choice { margin-bottom: 18px; }
.shape-choice-label {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.shape-choice-label span { color: var(--ink); font-size: 11px; font-weight: 700; }
.shape-choice-label small { color: var(--muted); font-size: 9px; }
.shape-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.shape-selector button {
  min-width: 0;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
}
.shape-selector button:hover { border-color: #9ebdb9; background: #f6faf9; }
.shape-selector button.is-active { border-color: var(--ikea-blue); background: #edf6f4; box-shadow: inset 0 0 0 1px var(--ikea-blue); }
.shape-selector button:focus-visible { outline: 3px solid rgba(40,125,120,.28); outline-offset: 2px; }
.shape-selector button > span { min-width: 0; }
.shape-selector b, .shape-selector small { display: block; }
.shape-selector b { font-size: 11px; line-height: 1.2; }
.shape-selector small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.shape-mark {
  width: 24px;
  height: 20px;
  display: block;
  border: 2px solid #7c898e;
  background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(40,125,120,.12) 4px 6px);
}
.shape-mark-square { border-radius: 3px; }
.shape-mark-round { border-radius: 50%; }
.shape-selector button.is-active .shape-mark { border-color: var(--ikea-blue); background-color: rgba(40,125,120,.12); }
.inline-note {
  margin: 13px 0 0;
  padding: 10px 11px;
  border-left: 3px solid var(--ikea-yellow);
  color: #5d6872;
  background: #fffdf1;
  font-size: 10px;
  line-height: 1.55;
}

.segmented {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.segmented button { border: 0; background: var(--white); padding: 8px; font-size: 11px; font-weight: 700; line-height: 1.1; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button small { font-size: 9px; color: var(--muted); font-weight: 400; }
.segmented button.is-active { color: var(--white); background: var(--ikea-blue); }
.segmented button.is-active small { color: rgba(255,255,255,.75); }
.clearance-row { margin-top: 19px; }

.switch-row {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row b { font-size: 11px; }
.switch-row small { color: var(--muted); font-size: 9px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { width: 38px; height: 21px; border-radius: 12px; background: #bac3cb; position: relative; transition: background .18s ease; }
.switch-row i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--white); transition: transform .18s ease; }
.switch-row input:checked + i { background: var(--ikea-blue); }
.switch-row input:checked + i::after { transform: translateX(17px); }
.switch-row input:focus-visible + i { outline: 3px solid rgba(0,88,163,.25); outline-offset: 2px; }

.select-row { margin-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 700; }
.select-row select { width: 170px; height: 34px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); padding: 0 8px; font-size: 10px; }
.estimate-grid { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.estimate-grid div { padding: 11px; background: var(--paper); border-radius: 3px; }
.estimate-grid small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.estimate-grid strong { font-family: var(--mono); font-size: 13px; }
.estimate-note { margin: 10px 0 0; color: #88929b; font-size: 9px; line-height: 1.5; }

.preview-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 56px minmax(0,1fr) 74px; background: #e8edf1; }
.preview-toolbar {
  padding: 0 12px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96);
}
.model-path { min-width: 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; white-space: nowrap; overflow: hidden; }
.model-path span, .model-path i { color: #93a0ab; }
.model-path i { font-style: normal; }
.model-path b { color: var(--ikea-blue); }
.model-path strong { overflow: hidden; text-overflow: ellipsis; }
.preview-controls { display: flex; align-items: center; gap: 8px; }
.preview-mode-switch { height: 38px; display: flex; align-items: stretch; border: 1px solid #ccd5dd; border-radius: 4px; background: #f5f7f9; overflow: hidden; }
.preview-mode-switch button { min-width: 61px; border: 0; border-right: 1px solid #dbe1e6; padding: 3px 9px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: transparent; color: #56636e; }
.preview-mode-switch button:last-child { border-right: 0; }
.preview-mode-switch span { font-size: 10px; font-weight: 800; }
.preview-mode-switch small { font-size: 8px; color: #89949e; }
.preview-mode-switch button:hover { background: var(--white); }
.preview-mode-switch button.is-active { position: relative; color: var(--white); background: var(--ikea-blue); }
.preview-mode-switch button.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--ikea-yellow); }
.preview-mode-switch button.is-active small { color: rgba(255,255,255,.72); }
.view-actions { display: flex; align-items: center; gap: 3px; }
.view-actions button { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--white); padding: 0; border-radius: 3px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.view-actions button:hover, .view-actions button.is-active { color: var(--ikea-blue); border-color: #8db6d8; background: #eef7ff; }

.canvas-wrap { min-height: 0; position: relative; overflow: hidden; user-select: none; cursor: grab; }
.canvas-wrap:active { cursor: grabbing; }
.canvas-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 86%);
  pointer-events: none;
}
.canvas-wrap::after {
  content: "DRAG TO INSPECT / UNITS MM";
  position: absolute; right: 18px; bottom: 13px;
  color: rgba(26,38,49,.3); font-family: var(--mono); font-size: 7px; letter-spacing: .12em;
  pointer-events: none;
}
#previewCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.inspection-hud {
  position: absolute; left: 20px; top: 18px; z-index: 2;
  min-width: 224px; padding: 11px 13px 11px 11px;
  display: flex; align-items: center; gap: 11px;
  border: 1px solid rgba(183,195,205,.9); border-left: 3px solid var(--ikea-blue); border-radius: 3px;
  background: rgba(255,255,255,.84); backdrop-filter: blur(7px);
  box-shadow: 0 8px 22px rgba(42,58,71,.09);
  pointer-events: none;
}
.inspection-icon { width: 31px; height: 38px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 2px; background: var(--ikea-blue); }
.inspection-icon i { width: 3px; height: 15px; border-radius: 3px; background: var(--ikea-yellow); }
.inspection-icon i:nth-child(2) { transform: translateY(6px); }
.inspection-hud > div { display: flex; flex-direction: column; }
.inspection-hud small { color: var(--ikea-blue); font: 700 8px var(--mono); letter-spacing: .11em; }
.inspection-hud strong { margin-top: 2px; font-size: 12px; line-height: 1.2; }
.inspection-hud p { margin: 3px 0 0; color: #74808a; font: 8px/1.35 var(--mono); }

.standard-chip {
  position: absolute; right: 20px; top: 18px; z-index: 2;
  padding: 9px 11px; display: flex; align-items: center; gap: 9px;
  border: 1px solid rgba(183,195,205,.85); border-radius: 3px; background: rgba(242,246,249,.88); backdrop-filter: blur(6px);
  pointer-events: none;
}
.standard-chip > span { display: flex; gap: 4px; align-items: center; }
.standard-chip > span i { width: 4px; height: 14px; border-radius: 3px; background: #6d7d89; }
.standard-chip > span i:last-child { transform: translateY(7px); }
.standard-chip > div { display: flex; flex-direction: column; gap: 1px; }
.standard-chip small { color: #7a8792; font: 7px var(--mono); letter-spacing: .08em; }
.standard-chip b { color: #33414c; font: 700 9px var(--mono); }
.standard-chip em { color: #87929b; font-size: 7px; font-style: normal; font-weight: 400; }

.drag-hint {
  position: absolute; left: 50%; bottom: 17px; z-index: 2; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.85); border-radius: 3px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(5px);
  color: #64717c; font-size: 8px; box-shadow: 0 5px 18px rgba(45,61,75,.07);
  transition: opacity .3s ease;
}
.drag-hint span { color: var(--ikea-blue); font-size: 14px; }
.drag-hint.is-hidden { opacity: 0; }

.dimension-hud {
  position: absolute; left: 20px; bottom: 17px; z-index: 2;
  height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 9px;
  border: 1px solid rgba(183,195,205,.9); border-radius: 3px; background: rgba(255,255,255,.86); backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(45,61,75,.07); pointer-events: none;
}
.dimension-hud div { display: grid; grid-template-columns: auto auto auto; align-items: baseline; gap: 4px; }
.dimension-hud span { color: var(--print-orange-dark); font: 800 8px var(--mono); }
.dimension-hud strong { font: 700 11px var(--mono); }
.dimension-hud small { color: #8c97a0; font: 7px var(--mono); }
.dimension-hud > i { width: 1px; height: 16px; background: #d5dce2; }

.axis-gizmo { position: absolute; right: 22px; bottom: 38px; z-index: 2; width: 44px; height: 44px; color: #65727d; font: 700 7px var(--mono); pointer-events: none; }
.axis-gizmo i { position: absolute; left: 20px; bottom: 8px; width: 3px; height: 3px; border-radius: 50%; background: #45535e; }
.axis-gizmo::before, .axis-gizmo::after { content: ""; position: absolute; left: 21px; bottom: 9px; height: 1px; transform-origin: left center; }
.axis-gizmo::before { width: 18px; background: #d74d26; transform: rotate(-18deg); }
.axis-gizmo::after { width: 17px; background: #2877b7; transform: rotate(205deg); }
.axis-gizmo span { position: absolute; }
.axis-z { left: 19px; top: 0; color: #26905c; }
.axis-x { right: 0; bottom: 7px; color: #d74d26; }
.axis-y { left: 0; bottom: 2px; color: #2877b7; }
.axis-gizmo > i::after { content: ""; position: absolute; left: 1px; bottom: 1px; width: 1px; height: 23px; background: #26905c; }

.warning-card {
  position: absolute; right: 20px; top: 72px; z-index: 3; max-width: 260px;
  padding: 10px 12px; display: flex; align-items: flex-start; gap: 9px;
  border: 1px solid #efbc31; background: #fff8d8; box-shadow: 0 7px 20px rgba(62,52,20,.1);
}
.warning-card[hidden] { display: none; }
.warning-card > span { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--ikea-yellow); font: 800 11px var(--mono); }
.warning-card p { margin: 0; color: #5b4a18; font-size: 10px; line-height: 1.45; }

.model-readout {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr) minmax(220px, 1.4fr);
  align-items: stretch;
  border-top: 1px solid var(--line); background: var(--white);
}
.model-readout > div { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-right: 1px solid var(--line); }
.model-readout small { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .04em; }
.model-readout strong { margin-top: 3px; font-size: 11px; white-space: nowrap; }
.model-readout .readout-primary { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.readout-primary > div { display: flex; flex-direction: column; }
.ready-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e7f6ef; color: var(--success); font-weight: 900; }
.model-readout > .inline-export-group { padding: 0; border-right: 0; display: grid; grid-template-columns: 1fr 1fr; }
.inline-export { min-width: 0; border: 0; font-size: 11px; font-weight: 700; padding: 0 15px; display: flex; justify-content: space-between; align-items: center; }
.inline-export-stl { background: var(--ikea-blue); color: var(--white); }
.inline-export-stl:hover { background: var(--ikea-blue-deep); }
.inline-export-3mf { background: var(--ikea-yellow); color: #25291d; }
.inline-export-3mf:hover { background: #ffe44d; }
.inline-export span { color: var(--ikea-yellow); font-size: 18px; }
.inline-export-3mf span { color: var(--ikea-blue); }

.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  min-width: 280px; padding: 13px 16px;
  display: flex; align-items: center; gap: 12px;
  color: var(--white); background: #14251e; border-left: 4px solid #41c287;
  box-shadow: 0 14px 36px rgba(17,29,24,.24);
  transform: translateY(130%); opacity: 0; pointer-events: none;
  transition: transform .28s ease, opacity .28s ease;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #41c287; color: #10251b; font-weight: 900; }
.toast p { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toast b { font-size: 12px; }
.toast small { color: rgba(255,255,255,.65); font-size: 9px; }

/* 3D navigation tool-suite theme */
.topbar {
  height: 78px;
  flex-basis: 78px;
  grid-template-columns: 280px 1fr 280px;
  color: var(--ink);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand {
  padding: 0 0 0 22px;
  border-right: 0;
  gap: 0;
}
.brand-logo-image {
  display: block;
  width: 220px;
  height: auto;
  flex: 0 0 auto;
}
.brand-mark {
  width: 58px;
  height: 58px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  grid-template-columns: repeat(3, 5px);
  gap: 6px;
}
.brand-mark i { width: 5px; height: 22px; background: var(--ikea-blue); }
.brand-mark i:nth-child(2) { transform: translateY(8px); background: var(--ikea-yellow); }
.brand-copy { gap: 4px; }
.brand-copy strong { color: var(--ink); font-size: 24px; letter-spacing: -.03em; }
.brand-copy strong em { color: var(--ikea-yellow); }
.brand-copy small { color: #596168; opacity: 1; font-size: 9px; letter-spacing: .04em; }
.compatibility {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink);
  font-family: var(--body);
  letter-spacing: 0;
}
.compatibility strong { font-size: 17px; line-height: 1.2; }
.compatibility small { color: #737c82; font-size: 9px; }
.top-actions { justify-self: end; padding-right: 22px; }
.button { height: 42px; border-radius: 6px; font-size: 12px; }
.button-quiet { color: var(--ink); background: transparent; border: 1px solid transparent; }
.button-quiet:hover { color: var(--ikea-blue); background: #f1f6f5; border-color: #d8e5e3; }
.button-export { min-width: 128px; color: var(--white); background: var(--ikea-blue); border: 1px solid var(--ikea-blue-deep); }
.button-export:hover { background: var(--ikea-blue-deep); }
.button-export span { color: var(--white); }

.breadcrumb-bar {
  height: 40px;
  flex: 0 0 40px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #5e676d;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.breadcrumb-path { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.breadcrumb-path span { font-size: 13px; }
.breadcrumb-path a { color: inherit; font-weight: 400; text-decoration: none; }
.breadcrumb-path a:hover { color: var(--ikea-blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb-path a:focus-visible { color: var(--ikea-blue-deep); outline: 2px solid rgba(40,125,120,.28); outline-offset: 3px; border-radius: 2px; }
.breadcrumb-path i { color: #99a1a6; font-style: normal; }
.breadcrumb-path strong { color: var(--ink); font-weight: 500; }
.breadcrumb-spec { display: flex; align-items: center; gap: 8px; color: #687278; font-family: var(--mono); font-size: 9px; }
.breadcrumb-spec span { width: 7px; height: 7px; border-radius: 50%; background: var(--ikea-blue); box-shadow: 0 0 0 3px #dcecea; }

.workspace { grid-template-columns: 280px minmax(0, 1fr); }
.control-panel { border-right-color: var(--line); }
.panel-scroll { counter-reset: control-step; }
.control-section {
  position: relative;
  counter-increment: control-step;
  padding: 18px;
  background: var(--white);
}
.control-section::after {
  content: counter(control-step, decimal-leading-zero);
  position: absolute;
  top: 20px;
  right: 18px;
  color: var(--ikea-yellow);
  font: 700 11px var(--mono);
  letter-spacing: .04em;
}
.intro-section { padding-top: 18px; }
.section-kicker { display: none; }
h1, h2 { color: var(--ink); font-family: var(--body); letter-spacing: 0; }
h1 { padding-right: 34px; font-size: 15px; line-height: 1.3; }
h2 { padding-right: 0; font-size: 14px; line-height: 1.3; }
.section-heading { padding-right: 38px; }
.type-grid { margin-top: 14px; gap: 7px; }
.type-card {
  min-height: 68px;
  padding: 10px 8px;
  border-color: var(--line);
  border-radius: 6px;
  gap: 7px;
}
.type-card:hover { border-color: #9dbab7; box-shadow: 0 1px 4px rgba(25,33,36,.08); }
.type-card svg { width: 25px; height: 25px; fill: #7d878e; }
.type-card b { font-size: 12px; }
.type-card small { font-size: 9px; }
.type-card.is-active { padding: 9px 7px; border-color: var(--ikea-blue); background: #edf7f6; }
.type-card.is-active svg, .type-card.is-active::after { fill: var(--ikea-blue); color: var(--ikea-blue); }
.unit-chip { color: #6f787e; background: #f1f4f4; }
.spec-lock { color: var(--ikea-blue); background: #e2f0ee; }
.param-list { margin-top: 16px; }
.param-row + .param-row { margin-top: 15px; }
.param-row label span { font-size: 11px; }
.param-row label small { font-size: 9px; }
.range-pair { grid-template-columns: minmax(0,1fr) 76px; gap: 9px; }
input[type="range"]::-webkit-slider-runnable-track { background: #d5dadc; }
input[type="range"]::-moz-range-track { background: #d5dadc; }
input[type="range"]::-webkit-slider-thumb { background: var(--ikea-blue); box-shadow: 0 0 0 1px var(--ikea-blue); }
input[type="range"]::-moz-range-thumb { background: var(--ikea-blue); box-shadow: 0 0 0 1px var(--ikea-blue); }
.number-wrap { height: 34px; border-color: var(--line); border-radius: 6px; background: var(--white); }
.number-wrap input { height: 32px; font-size: 10px; }
.number-wrap:focus-within { border-color: var(--ikea-blue); box-shadow: 0 0 0 2px rgba(40,125,120,.1); }
.specific-section { background: var(--white); }
.inline-note { border-left-color: var(--ikea-yellow); background: #fbf8ef; color: #6f6654; }
.segmented { padding: 3px; gap: 3px; border: 0; border-radius: 6px; background: #eef1f2; }
.segmented button { border: 0 !important; border-radius: 4px; background: transparent; }
.segmented button.is-active { color: var(--ink); background: var(--white); box-shadow: 0 1px 4px rgba(25,33,36,.13); }
.segmented button.is-active small { color: #6b747a; }
.switch-row input:checked + i { background: var(--ikea-blue); }
.select-row select { border-color: var(--line); border-radius: 6px; }
.estimate-grid div { background: #f2f5f4; }

.preview-panel { grid-template-rows: 46px minmax(0,1fr) 64px; background: #e9efee; }
.preview-toolbar { padding: 0 14px; background: var(--white); }
.model-path { display: none; }
.preview-controls { width: 100%; justify-content: space-between; }
.preview-mode-switch { height: 36px; padding: 3px; gap: 2px; border: 0; border-radius: 6px; background: #eef1f2; }
.preview-mode-switch button { min-width: 62px; border: 0; border-radius: 4px; color: #596269; }
.preview-mode-switch button:last-child { border: 0; }
.preview-mode-switch button.is-active { color: var(--ink); background: var(--white); box-shadow: 0 1px 4px rgba(25,33,36,.13); }
.preview-mode-switch button.is-active::after { display: none; }
.preview-mode-switch button.is-active small { color: var(--ikea-blue); }
.view-actions button { border: 0; color: var(--ink); background: transparent; }
.view-actions button:hover, .view-actions button.is-active { color: var(--ikea-blue); border: 0; background: #edf5f4; }
.canvas-wrap:focus-visible { outline: 3px solid rgba(40,125,120,.42); outline-offset: -3px; }
.canvas-wrap::before {
  background-image: linear-gradient(rgba(213,220,219,.46) 1px, transparent 1px), linear-gradient(90deg, rgba(213,220,219,.46) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: none;
}
.inspection-hud, .standard-chip, .dimension-hud {
  border-color: var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 3px 12px rgba(30,40,45,.12);
}
.inspection-hud { border-left: 3px solid var(--ikea-blue); }
.inspection-icon { background: var(--ikea-blue); }
.inspection-icon i { background: var(--white); }
.inspection-icon i:nth-child(2) { background: #d6aa4b; }
.inspection-hud small { color: var(--ikea-blue); }
.dimension-hud span { color: var(--ikea-yellow); }
.drag-hint { border-color: var(--line); border-radius: 6px; background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(30,40,45,.1); }
.drag-hint span { color: var(--ikea-blue); }
.warning-card { border-color: #d8bc7b; background: #fbf7eb; }
.warning-card > span { background: #d6aa4b; }
.model-readout { min-height: 64px; }
.ready-mark { color: var(--ikea-blue); background: #e3f1ef; }
.inline-export { background: var(--ikea-blue); }
.inline-export:hover { background: var(--ikea-blue-deep); }
.inline-export span { color: #d9b35f; }
.toast { background: #203b39; border-left-color: #5eb2ac; }
.toast > span { background: #5eb2ac; }

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; }
  .topbar { grid-template-columns: 260px 1fr auto; }
  .brand { padding: 0 0 0 16px; }
  .compatibility { display: none; }
  .workspace { grid-template-columns: 280px minmax(0,1fr); min-height: 700px; }
  .control-section { padding-left: 19px; padding-right: 19px; }
  .model-path strong, .model-path i:last-of-type { display: none; }
  .preview-mode-switch button { min-width: 54px; padding-left: 7px; padding-right: 7px; }
  .model-readout { grid-template-columns: 1fr 1fr 1fr; }
  .model-readout > div:nth-child(4) { display: none; }
  .inline-export { grid-column: auto; }
}

@media (max-width: 720px) {
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { height: 68px; min-height: 68px; flex-basis: 68px; grid-template-columns: 1fr auto; border-bottom-width: 1px; }
  .brand { padding: 0 0 0 12px; border-right: 0; }
  .brand-logo-image { width: 118px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-mark i { width: 3px; height: 15px; }
  .brand-mark i:nth-child(2) { transform: translateY(5px); }
  .brand-copy strong { font-size: 20px; }
  .brand-copy small { display: none; }
  .button-quiet { display: inline-flex; width: 38px; height: 38px; padding: 0; font-size: 0; }
  .button-quiet span { font-size: 17px; }
  .top-actions { padding-right: 10px; }
  .button-export { min-width: 90px; height: 38px; padding: 0 10px; }
  .breadcrumb-bar { display: none; }
  .workspace { display: flex; flex-direction: column-reverse; min-height: 0; }
  .preview-panel { height: 64vh; min-height: 450px; grid-template-rows: 52px minmax(0,1fr) 62px; }
  .control-panel { border-right: 0; border-top: 1px solid var(--line); }
  .panel-scroll { height: auto; overflow: visible; }
  .control-section { padding: 22px 18px; }
  .type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .type-card { min-height: 74px; justify-content: center; flex-direction: column; text-align: center; gap: 4px; padding: 8px 4px; }
  .type-card.is-active { padding: 7px 3px; }
  .type-card svg { width: 25px; height: 25px; }
  .type-card small { display: none; }
  .companion-download { margin-top: 10px; min-height: 58px; }
  .preview-toolbar { padding: 0 9px; }
  .model-path { display: none; }
  .preview-controls { width: 100%; gap: 6px; }
  .preview-mode-switch { flex: 1 1 auto; height: 38px; }
  .preview-mode-switch button { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; }
  .view-actions { display: none; }
  .inspection-hud { left: 13px; right: 13px; top: 12px; min-width: 0; padding: 8px 10px; }
  .inspection-icon { width: 27px; height: 34px; }
  .inspection-hud p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .standard-chip, .axis-gizmo { display: none; }
  .dimension-hud { left: 13px; bottom: 11px; height: 34px; padding: 0 9px; gap: 7px; }
  .drag-hint { display: none; }
  .warning-card { right: 13px; left: 13px; top: 68px; max-width: none; }
  .model-readout { grid-template-columns: 1fr 1fr 1.3fr; }
  .model-readout > div { padding: 0 10px; }
  .model-readout > div:nth-child(3), .model-readout > div:nth-child(4) { display: none; }
  .model-readout > .inline-export-group { display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .inline-export { padding: 0 10px; font-size: 9px; }
}

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