:root {
  --ink: #294438;
  --muted: #5f7467;
  --paper: #f5faef;
  --panel: #fbfdf6;
  --white: #fffef8;
  --mint: #d7ebcf;
  --mint-deep: #557f66;
  --coral: #c9825d;
  --yellow: #f0d59f;
  --line: rgba(41, 72, 58, 0.17);
  --shadow: 4px 4px 0 rgba(55, 94, 73, .10), 0 24px 70px rgba(57, 91, 72, 0.10);
  --cute-font: "YouYuan", "幼圆", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --pixel-font: "Courier New", Consolas, monospace;
  --serif: var(--cute-font);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(245, 250, 239, .76), rgba(240, 248, 234, .84)),
    var(--pixel-house-pattern, none),
    radial-gradient(circle, rgba(85, 127, 102, .11) 0 3px, transparent 3.5px),
    radial-gradient(circle at 85% 5%, rgba(215, 235, 207, .74), transparent 34rem),
    var(--paper);
  background-position: 0 0, 0 0, 0 0, center top, 0 0;
  background-size: auto, 112px 112px, 32px 32px, auto, auto;
  background-attachment: fixed;
  font-family: var(--cute-font);
  font-size: 14px;
  animation: house-wallpaper-drift 30s linear infinite;
}

button, input, select { font: inherit; color: inherit; }
button, label, select, input[type="range"], input[type="color"] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, label:focus-within {
  outline: 3px solid rgba(79, 131, 104, .26);
  outline-offset: 2px;
}

.topbar {
  min-height: 72px;
  padding: 0 clamp(18px, 3.4vw, 58px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 252, 242, .94);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; width: max-content; }
.brand > span:last-child { display: grid; gap: 4px; }
.brand strong { font-size: 13px; letter-spacing: .18em; line-height: 1; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.brand-house {
  width: 42px;
  height: 42px;
  position: relative;
  display: block;
  border: 1px solid rgba(201, 111, 141, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 20px rgba(201, 111, 141, .13);
}
.brand-house::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 19px;
  left: 8px;
  bottom: 7px;
  border: 1.6px solid var(--mint-deep);
  border-radius: 3px;
  background: #fff9e9;
}
.brand-house::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 11px;
  top: 7px;
  border-left: 1.6px solid var(--mint-deep);
  border-top: 1.6px solid var(--mint-deep);
  background: #fff9e9;
  transform: rotate(45deg);
  border-radius: 4px 0 0;
}
.brand-house i, .brand-house b { position: absolute; z-index: 2; border: 1.5px solid var(--mint-deep); }
.brand-house i { width: 7px; height: 10px; bottom: 8px; left: 17px; background: var(--mint); border-radius: 3px 3px 1px 1px; }
.brand-house b { width: 6px; height: 6px; top: 16px; left: 18px; border-radius: 50%; background: #fff; }

.topbar-center { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.topbar-center i { width: 1px; height: 14px; background: var(--line); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(223, 142, 170, .14); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar-actions a { color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 700; padding: 9px 11px; }
.topbar-actions button {
  border: 0;
  border-radius: 999px;
  background: var(--mint-deep);
  color: #fff;
  min-height: 38px;
  padding: 0 16px;
  font-size: 10px;
  font-weight: 750;
}
.topbar-actions button span { margin-left: 8px; color: #fff4f7; }

.workspace {
  width: min(1640px, calc(100% - clamp(28px, 5vw, 76px)));
  margin: 0 auto;
}
.hero {
  display: grid;
  grid-template-columns: 180px minmax(520px, 820px) minmax(240px, 1fr);
  gap: 24px;
  align-items: end;
  padding: clamp(38px, 5vw, 76px) 0 34px;
}
.hero-kicker { align-self: stretch; padding-top: 9px; }
.hero-kicker span { display: inline-block; padding: 6px 8px; border: 1px solid var(--ink); border-radius: 999px; font: 700 9px/1 monospace; }
.hero-kicker p { margin: 12px 0 0; max-width: 130px; color: var(--muted); font: 700 8px/1.55 monospace; letter-spacing: .12em; }
.hero-title { position: relative; }
.hero h1 {
  margin: 0;
  max-width: 780px;
  font: 500 clamp(38px, 4.5vw, 72px)/.98 var(--serif);
  letter-spacing: -.06em;
}
.hero h1 em { color: var(--mint-deep); font-weight: 500; }
.hero-stamp {
  width: 66px;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--yellow);
  display: grid;
  place-content: center;
  text-align: center;
  position: absolute;
  right: 4%;
  top: -22px;
  transform: rotate(8deg);
  box-shadow: 0 12px 25px rgba(201, 111, 141, .14);
}
.hero-stamp span { font: 700 26px/.9 var(--serif); }
.hero-stamp small { margin-top: 5px; font: 800 7px/1 monospace; letter-spacing: .12em; }
.hero-copy { color: var(--muted); font-size: 12px; line-height: 1.8; max-width: 340px; margin: 0 0 3px auto; }

.builder {
  display: grid;
  grid-template-columns: minmax(286px, 336px) minmax(420px, 1fr) minmax(250px, 290px);
  min-height: 840px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: clip;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel, .result-panel { min-width: 0; }
.control-panel { border-right: 1px solid var(--line); background: rgba(255, 253, 253, .94); }
.step-nav {
  height: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 72px;
  z-index: 4;
  background: rgba(255, 253, 253, .96);
  backdrop-filter: blur(12px);
}
.step-tab {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  display: grid;
  place-content: center;
  gap: 4px;
  position: relative;
}
.step-tab:last-child { border-right: 0; }
.step-tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--coral); transform: scaleX(0); transition: .2s; }
.step-tab span { color: #aa8d97; font: 700 8px/1 monospace; }
.step-tab b { font-size: 10px; }
.step-tab.is-active { background: rgba(244, 191, 208, .2); }
.step-tab.is-active::after { transform: scaleX(1); }
.step-tab.is-active span { color: var(--mint-deep); }

.control-scroll { max-height: calc(100vh - 132px); min-height: 780px; overflow: auto; scrollbar-width: thin; scrollbar-color: #dcc5cd transparent; }
.control-section { padding: 24px 21px 26px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.control-section:last-child { border-bottom: 0; }
.section-heading { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; margin-bottom: 21px; }
.section-heading > span {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font: 700 8px/1 monospace;
}
.section-heading h2 { margin: 1px 0 0; font-size: 14px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.section-heading.with-toggle { grid-template-columns: 28px 1fr auto; }

.range-control { margin: 18px 0 0; }
.range-control > div:first-child { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.range-control label { font-size: 10px; font-weight: 750; }
.range-control output { padding: 5px 7px; background: #ece9e2; border-radius: 5px; font: 700 9px/1 monospace; }
input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 6px 0 0;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint-deep), var(--mint));
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px var(--coral), 0 2px 7px rgba(98, 68, 79, .18);
}
.range-scale { display: flex; justify-content: space-between; color: #aa8d97; font: 700 7px/1 monospace; padding-top: 6px; }
.range-scale-three { padding-inline: 2px; }
.color-scale { font-size: 6px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.field-grid label > span, .color-row label > span { display: block; font-size: 9px; font-weight: 750; margin-bottom: 7px; }
.unit-field { height: 40px; display: flex; align-items: center; border: 1px solid var(--line); background: #fff; }
.unit-field input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0 9px; font: 700 12px/1 monospace; background: transparent; }
.unit-field b { height: 100%; display: grid; place-items: center; padding: 0 8px; color: var(--muted); border-left: 1px solid var(--line); font: 700 8px/1 monospace; }

.color-row { margin-top: 13px; padding: 10px 11px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: #fff; }
.color-row label > span { margin-bottom: 3px; }
.color-row label small { color: var(--muted); font-size: 8px; }
.color-input { width: 40px; height: 34px; padding: 3px; border: 1px solid var(--line); background: #fff; position: relative; }
.color-input input { width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; opacity: 0; position: absolute; inset: 0; }
.color-input i { display: block; width: 100%; height: 100%; background: var(--house-color, #d7ebcf); pointer-events: none; }

.shape-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.roof-options { grid-template-columns: repeat(2, 1fr); }
.shape-card { min-height: 94px; border: 1px solid var(--line); background: #fff; padding: 9px 5px; display: grid; justify-items: center; align-content: center; gap: 5px; }
.shape-card:hover { border-color: #d88ba5; }
.shape-card.is-active { border-color: var(--mint-deep); background: #fff0f5; box-shadow: inset 0 0 0 1px rgba(201, 111, 141, .13); }
.shape-card b { font-size: 9px; }
.shape-card small { color: var(--muted); font-size: 7px; }
.roof-icon { width: 38px; height: 28px; display: block; position: relative; color: var(--mint-deep); }
.roof-triangle::before {
  content: ""; position: absolute; left: 5px; top: 8px; width: 27px; height: 27px;
  border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg);
}
.roof-trapezoid::before {
  content: ""; position: absolute; inset: 4px 3px 2px;
  border: 2px solid currentColor; clip-path: polygon(24% 0,76% 0,100% 100%,0 100%);
}
.print-rule { margin-top: 11px; padding: 10px; display: grid; grid-template-columns: 24px 1fr; gap: 8px; background: #fff2f6; border: 1px solid #efbed0; }
.print-rule > span { width: 23px; height: 23px; border-radius: 50%; background: var(--mint-deep); color: #fff; display: grid; place-items: center; font-size: 10px; }
.print-rule p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.print-rule strong { display: block; color: var(--ink); font-size: 9px; }

.switch { display: grid; grid-template-columns: 31px auto; align-items: center; gap: 6px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch > span { width: 31px; height: 17px; border-radius: 99px; background: #dbc4cc; position: relative; transition: .2s; }
.switch > span::after { content: ""; width: 13px; height: 13px; background: #fff; border-radius: 50%; position: absolute; left: 2px; top: 2px; transition: .2s; }
.switch input:checked + span { background: var(--mint-deep); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch b { font-size: 8px; }
.minor-label { margin: 17px 0 9px; font-size: 9px; font-weight: 750; }
.window-shapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.window-shape { min-height: 63px; border: 1px solid var(--line); background: #fff; display: grid; justify-items: center; align-content: center; gap: 6px; }
.window-shape:hover, .window-shape.is-active { border-color: var(--mint-deep); background: #fff0f5; }
.window-shape i { width: 22px; height: 22px; display: grid; place-items: center; border: 1.5px solid currentColor; color: var(--mint-deep); font-style: normal; font-family: var(--serif); }
.window-shape span { font-size: 8px; font-weight: 700; }
.window-shape .window-arch { border-radius: 12px 12px 2px 2px; }
.window-shape .window-round { border-radius: 50%; }
.window-shape .window-heart { border: 0; color: var(--coral); font-size: 24px; line-height: 1; }
.window-shape .window-custom { border-style: dashed; font: 500 17px/1 sans-serif; }

.mini-upload { margin-top: 10px; padding: 9px; border: 1px dashed #c7aab4; background: #fff; display: grid; grid-template-columns: 44px 1fr auto; gap: 9px; align-items: center; cursor: pointer; }
.mini-upload[hidden] { display: none; }
.mini-upload input, .wallpaper-drop input { position: absolute; opacity: 0; pointer-events: none; }
.mini-upload canvas { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff4f7; }
.mini-upload b, .mini-upload small { display: block; }
.mini-upload b { font-size: 9px; }
.mini-upload small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.mini-upload em, .wallpaper-drop em, .sample-wallpaper em { font-style: normal; font-size: 8px; font-weight: 750; color: var(--mint-deep); }
.upload-result { min-height: 12px; margin: 7px 0 0; color: var(--mint-deep); font-size: 8px; line-height: 1.5; }

.wallpaper-drop, .sample-wallpaper {
  width: 100%;
  min-height: 65px;
  border: 1px dashed #c7aab4;
  background: #fff;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
}
.wallpaper-drop.is-dragging { background: #fff0f5; border-color: var(--mint-deep); }
.upload-plus { width: 29px; height: 29px; border: 1px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 16px; }
.wallpaper-drop strong, .wallpaper-drop small, .sample-wallpaper strong, .sample-wallpaper small { display: block; }
.wallpaper-drop strong, .sample-wallpaper strong { font-size: 9px; }
.wallpaper-drop small, .sample-wallpaper small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.sample-wallpaper { margin-top: 7px; border-style: solid; }
.sample-pattern { width: 36px; height: 36px; border: 1px solid var(--line); background-color: #f8fbe9; background-image: radial-gradient(circle, #fffef3 0 2px, #7eaf83 2px 3px, transparent 3px); background-size: 12px 12px; position: relative; }
.color-count-control { margin-top: 19px; }
.palette-head { display: flex; justify-content: space-between; margin-top: 16px; }
.palette-head span { font-size: 9px; font-weight: 750; }
.palette-head small { color: var(--muted); font-size: 7px; }
.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.palette button { min-width: 0; border: 1px solid var(--line); background: #fff; padding: 4px; display: grid; gap: 4px; position: relative; }
.palette button i { height: 23px; background: var(--swatch); display: block; }
.palette button span { overflow: hidden; font: 700 6px/1 monospace; text-overflow: ellipsis; }
.palette button.is-discarded { opacity: .42; }
.palette button.is-discarded::after { content: "舍弃"; position: absolute; inset: 4px 4px auto; height: 23px; display: grid; place-items: center; background: rgba(98, 68, 79, .76); color: #fff; font-size: 7px; }
.palette-note { color: var(--muted); font-size: 8px; line-height: 1.5; margin: 8px 0 0; }

.wallpaper-layout-controls {
  min-width: 0;
  margin: 19px 0 0;
  padding: 14px 12px 13px;
  border: 1px solid rgba(79, 131, 104, .28);
  border-radius: 6px;
  background: #f1f8ec;
}

.wallpaper-layout-controls:disabled {
  opacity: .48;
}

.wallpaper-layout-controls legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.wallpaper-mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.wallpaper-mode-options button {
  min-width: 0;
  padding: 9px 5px 8px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffef3;
  color: var(--ink);
}

.wallpaper-mode-options button b {
  font-size: 8px;
}

.wallpaper-mode-options button small {
  color: var(--muted);
  font-size: 6px;
  line-height: 1.3;
}

.wallpaper-mode-options button.is-active {
  border-color: var(--mint-deep);
  background: #e7f3e1;
  box-shadow: 2px 2px 0 rgba(56, 93, 72, .12);
}

.wallpaper-transform-control {
  margin-top: 16px;
}

.wallpaper-stretch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallpaper-stretch-grid .range-control {
  min-width: 0;
  margin-top: 14px;
}

.wallpaper-stretch-grid .range-control > div:first-child {
  display: grid;
  gap: 5px;
  align-items: start;
}

.wallpaper-stretch-grid output {
  width: max-content;
}

.wallpaper-layout-controls > p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
}

.stage-panel { min-width: 0; background: #f8edf1; display: grid; grid-template-rows: 58px minmax(620px, 1fr) 70px; position: sticky; top: 72px; align-self: start; height: calc(100vh - 92px); min-height: 820px; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 253, .9); }
.view-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); background: #f4e7ec; }
.view-tabs button { border: 0; background: transparent; padding: 7px 10px; font-size: 8px; font-weight: 750; }
.view-tabs button.is-active { background: var(--white); color: var(--mint-deep); box-shadow: 0 2px 8px rgba(98,68,79,.08); }
.stage-actions { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; }
.stage-actions button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 14px; }
.stage-canvas {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background-color: #f9f0f3;
  background-image:
    linear-gradient(rgba(98,68,79,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98,68,79,.04) 1px, transparent 1px);
  background-size: 22px 22px;
}
.stage-canvas::after { content: ""; position: absolute; inset: 22px; border: 1px solid rgba(98,68,79,.08); pointer-events: none; }
#houseCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#houseCanvas:active { cursor: grabbing; }
.model-badge { position: absolute; left: 24px; top: 23px; z-index: 2; }
.model-badge span { display: block; color: var(--mint-deep); font: 800 7px/1 monospace; letter-spacing: .16em; }
.model-badge strong { display: block; margin-top: 6px; font: 600 14px/1 var(--serif); }
.print-axis { position: absolute; right: 25px; top: 23px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.print-axis i { width: 7px; height: 44px; border-right: 1px solid var(--coral); position: relative; }
.print-axis i::before { content: ""; position: absolute; top: -1px; right: -3px; width: 6px; height: 6px; border-top: 1px solid var(--coral); border-left: 1px solid var(--coral); transform: rotate(45deg); }
.print-axis span { writing-mode: vertical-rl; color: var(--muted); font-size: 7px; letter-spacing: .08em; }
.print-axis b { color: var(--coral); }
.canvas-help { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; white-space: nowrap; padding: 7px 11px; border: 1px solid rgba(98,68,79,.14); border-radius: 999px; background: rgba(255,253,253,.85); backdrop-filter: blur(10px); color: var(--muted); font-size: 8px; pointer-events: none; }
.stage-footer { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 19px; background: rgba(255, 253, 249, .9); }
.material-stack, .stage-dimension { display: grid; gap: 5px; }
.material-stack > span, .stage-dimension span { color: var(--muted); font-size: 7px; }
.material-stack { grid-template-columns: auto 1fr auto; align-items: center; column-gap: 8px; }
.material-stack > span { grid-column: 1 / -1; }
.material-stack div { display: flex; }
.material-stack i { width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 1px rgba(98,68,79,.13); margin-left: -3px; }
.material-stack i:first-child { margin-left: 0; }
.material-stack b, .stage-dimension b { font: 750 9px/1 monospace; }
.stage-dimension { text-align: right; }

.result-panel { border-left: 1px solid var(--line); background: var(--white); padding: 25px 20px; }
.result-heading > span { color: var(--coral); font: 800 8px/1 monospace; letter-spacing: .14em; }
.result-heading > strong { display: block; margin-top: 8px; font: 600 19px/1 var(--serif); }
.result-heading p { color: var(--muted); font-size: 8px; line-height: 1.5; margin: 6px 0 0; }
.score-card { margin-top: 20px; padding: 13px; border: 1px solid #efbed0; background: #fff2f6; display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: center; }
.score-ring { width: 58px; height: 58px; border-radius: 50%; border: 5px solid var(--mint-deep); background: #fff; display: grid; grid-template-columns: 1fr; place-content: center; text-align: center; }
.score-ring strong { font: 700 18px/.9 var(--serif); }
.score-ring small { margin-top: 3px; color: var(--muted); font: 700 6px/1 monospace; }
.score-card > div:last-child span, .score-card > div:last-child strong, .score-card > div:last-child small { display: block; }
.score-card > div:last-child span { color: var(--muted); font-size: 7px; }
.score-card > div:last-child strong { margin-top: 4px; font-size: 10px; }
.score-card > div:last-child small { margin-top: 4px; color: var(--muted); font-size: 7px; line-height: 1.4; }
.score-card.is-warning { border-color: #e1ac5d; background: #fff2dc; }
.score-card.is-warning .score-ring { border-color: #df9438; }
.model-specs { margin: 18px 0 0; border-top: 1px solid var(--line); }
.model-specs div { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.model-specs dt { color: var(--muted); font-size: 8px; }
.model-specs dd { margin: 0; text-align: right; font-size: 8px; font-weight: 750; }
.printer-select { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 16px; }
.printer-select span { font-size: 8px; font-weight: 750; }
.printer-select select { width: 100%; border: 1px solid var(--line); background: #fff; min-height: 35px; padding: 0 8px; font-size: 8px; font-weight: 700; }
.check-list { margin-top: 14px; display: grid; gap: 7px; }
.check-list > div { padding: 9px; border: 1px solid var(--line); display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; }
.check-list i { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: #fbe0e9; color: var(--mint-deep); font-size: 9px; font-style: normal; }
.check-list b, .check-list small { display: block; }
.check-list b { font-size: 8px; }
.check-list small { margin-top: 3px; color: var(--muted); font-size: 7px; line-height: 1.35; }
.check-list .check-warning { border-color: #dfad62; background: #fff8eb; }
.check-list .check-warning i { background: #f6ca83; color: #75460d; }
.export-block { margin-top: 18px; display: grid; gap: 7px; }
.primary-export { min-height: 56px; border: 0; background: var(--mint-deep); color: #fff; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.primary-export:hover { background: #b95f7e; }
.primary-export span strong, .primary-export span small { display: block; }
.primary-export span strong { font-size: 10px; }
.primary-export span small { margin-top: 4px; color: #fff0f5; font-size: 7px; }
.primary-export > b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--mint); }
.secondary-export { min-height: 37px; border: 1px solid var(--ink); background: #fff; font-size: 8px; font-weight: 750; }
.export-note { color: var(--muted); font-size: 7px; line-height: 1.5; text-align: center; margin: 9px 0 0; min-height: 22px; }
.manual-download-link {
  display: block;
  margin: 4px 0 0;
  padding: 9px 10px;
  border: 1px solid #efbed0;
  border-radius: 8px;
  background: #fff2f6;
  color: var(--mint-deep);
  text-align: center;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.5;
}
.manual-download-link[hidden] { display: none; }

.how-it-prints { margin: 28px 0 70px; min-height: 300px; display: grid; grid-template-columns: .8fr 1.25fr 1fr; gap: 38px; align-items: center; padding: 35px clamp(28px, 4vw, 64px); border: 1px solid rgba(98, 68, 79, .2); border-radius: 22px; background: #62444f; color: #fff8fa; overflow: hidden; }
.section-kicker { color: var(--mint); font: 800 8px/1 monospace; letter-spacing: .14em; }
.how-it-prints h2 { margin: 13px 0 0; font: 500 clamp(30px, 3.4vw, 50px)/1.02 var(--serif); letter-spacing: -.04em; }
.print-diagram { min-height: 220px; position: relative; perspective: 700px; }
.plate { width: 310px; height: 150px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-35%) rotateX(62deg) rotateZ(-14deg); border: 1px solid #a4828e; background-color: #4f3840; background-image: linear-gradient(rgba(244,191,208,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(244,191,208,.09) 1px, transparent 1px); background-size: 20px 20px; box-shadow: 0 25px 35px rgba(0,0,0,.24); }
.plate span { position: absolute; right: 8px; bottom: 7px; color: #d9bfc8; font-size: 7px; }
.flat-house { width: 122px; height: 145px; position: absolute; left: 50%; top: 50%; transform: translate(-55%,-45%) rotateX(62deg) rotateZ(-14deg) translateZ(18px); background: var(--mint); border: 2px solid #fff1f6; clip-path: polygon(0 35%,50% 0,100% 35%,100% 100%,0 100%); box-shadow: 8px 10px 0 rgba(244,191,208,.25); }
.flat-house i, .flat-house b { position: absolute; left: 8%; right: 8%; height: 2px; background: #4f8368; }
.flat-house i { top: 57%; }
.flat-house b { top: 78%; }
.flat-house em { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); color: #8c4d64; font: 800 7px/1 monospace; white-space: nowrap; }
.layer-lines { position: absolute; right: 8%; top: 12%; display: grid; gap: 9px; }
.layer-lines i { width: 30px; height: 1px; background: var(--coral); position: relative; }
.layer-lines i::before { content: ""; position: absolute; left: -5px; top: -2px; width: 4px; height: 4px; border-left: 1px solid var(--coral); border-bottom: 1px solid var(--coral); transform: rotate(45deg); }
.print-explanation > p { color: #e2cbd3; font-size: 10px; line-height: 1.8; max-width: 330px; margin: 0 0 22px; }
.print-explanation { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 14px; }
.print-explanation > p { grid-column: 1 / -1; }
.print-explanation > div { border-top: 1px solid #84606e; padding-top: 10px; }
.print-explanation strong, .print-explanation span { display: block; }
.print-explanation strong { color: var(--mint); font: 600 25px/1 var(--serif); }
.print-explanation span { margin-top: 5px; color: #d7bac5; font-size: 7px; }

footer { min-height: 84px; padding: 0 clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); }
footer > div { display: flex; align-items: center; gap: 16px; }
footer strong { color: var(--ink); font-size: 10px; letter-spacing: .15em; }
footer span, footer p { font-size: 8px; }

@media (max-width: 1180px) {
  .topbar-center { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .hero { grid-template-columns: 112px minmax(0, 1fr); }
  .hero-copy { grid-column: 2; margin: 0; }
  .builder { grid-template-columns: minmax(280px, 32%) minmax(0, 1fr); }
  .result-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: 18px clamp(24px, 5vw, 56px);
  }
  .result-heading, .score-card, .model-specs { grid-column: 1; }
  .printer-select, .check-list, .export-block, .export-note { grid-column: 2; }
  .printer-select { grid-row: 1; align-self: end; }
  .check-list { grid-row: 2 / span 2; align-self: start; }
  .export-block { grid-row: 4; }
  .export-note { grid-row: 5; }
}

@media (max-width: 900px) {
  .workspace { width: min(760px, calc(100% - 32px)); }
  .topbar-actions a { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-kicker { display: none; }
  .hero-copy { grid-column: auto; margin-top: 8px; }
  .hero-stamp { right: 0; transform: scale(.82) rotate(8deg); }
  .builder { display: flex; flex-direction: column; }
  .control-panel { border-right: 0; }
  .control-scroll {
    max-height: none;
    min-height: 0;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .control-section { min-width: 0; }
  .step-nav { top: 72px; }
  .stage-panel {
    position: relative;
    top: 0;
    width: 100%;
    height: clamp(560px, 76vh, 720px);
    min-height: 0;
    grid-template-rows: 58px minmax(0, 1fr) 70px;
    order: -1;
  }
  .result-panel { display: block; }
  .result-panel > * { margin-top: 16px; }
  .how-it-prints { grid-template-columns: minmax(0, 1fr); }
  .print-diagram { min-height: 190px; }
}

@media (max-width: 680px) {
  .topbar { min-height: 64px; padding-inline: 14px; }
  .topbar-actions button { min-height: 34px; padding-inline: 12px; }
  .brand small { display: none; }
  .workspace { width: 100%; }
  .hero { padding: 35px 18px 24px; }
  .hero h1 { font-size: clamp(34px, 11vw, 50px); }
  .hero-stamp { display: none; }
  .builder { border-radius: 0; border-inline: 0; }
  .stage-panel { height: clamp(500px, 72vh, 620px); }
  .stage-toolbar { padding-inline: 10px; }
  .stage-actions span { display: none; }
  .view-tabs button { padding-inline: clamp(6px, 2vw, 9px); }
  .control-scroll { display: block; }
  .step-nav { top: 64px; }
  .stage-canvas::after { inset: 12px; }
  .model-badge { left: 17px; top: 17px; }
  .print-axis { right: 17px; top: 17px; }
  .how-it-prints { margin-bottom: 35px; border-radius: 0; border-inline: 0; padding: 30px 22px; }
  .plate { width: 270px; }
  footer { flex-direction: column; justify-content: center; text-align: center; padding-block: 20px; }
  footer > div { flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  .topbar {
    gap: 8px;
    padding-inline: 10px;
  }
  .brand-house {
    width: 40px;
    height: 40px;
  }
  .brand > span:last-child { display: none; }
  .topbar-actions button {
    min-width: 92px;
    padding-inline: 9px;
  }
  .hero { padding-inline: 14px; }
  .hero h1 {
    font-size: clamp(31px, 10.5vw, 42px);
    letter-spacing: -.045em;
  }
  .step-tab b { font-size: 9px; }
  .control-section { padding-inline: 16px; }
  .field-grid,
  .wallpaper-stretch-grid { grid-template-columns: 1fr; }
  .window-shapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallpaper-mode-options { grid-template-columns: 1fr; }
  .wallpaper-mode-options button {
    grid-template-columns: auto 1fr;
    align-items: center;
    text-align: left;
  }
  .stage-panel { height: 520px; }
  .stage-toolbar { gap: 6px; }
  .stage-actions { gap: 4px; }
  .stage-footer {
    gap: 8px;
    padding-inline: 12px;
  }
  .material-stack i { width: 14px; height: 14px; }
  .canvas-help { max-width: calc(100% - 24px); white-space: normal; text-align: center; }
  .result-panel { padding-inline: 16px; }
  .printer-select { grid-template-columns: 1fr; }
  .print-diagram { transform: scale(.9); }
  .plate { width: 245px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Selected visual system: mint pixel bakery */
.brand-house {
  width: 47px;
  height: 47px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-house::before,
.brand-house::after,
.brand-house i,
.brand-house b {
  display: none;
}

.brand-house canvas,
.hero-pixel-house {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.topbar {
  border-bottom: 2px solid rgba(56, 96, 74, .18);
}

.brand strong {
  letter-spacing: .08em;
}

.brand small {
  letter-spacing: .08em;
}

.live-dot {
  border-radius: 0;
  background: var(--mint-deep);
  box-shadow: 0 0 0 4px rgba(79, 131, 104, .13);
}

.topbar-actions button {
  border: 1px solid #416b55;
  border-radius: 4px;
  background: var(--mint-deep);
  box-shadow: 3px 3px 0 #416b55;
}

.hero {
  position: relative;
}

.hero-pixel-house {
  width: 105px;
  height: 105px;
  margin: 26px 0 0 -3px;
  filter: drop-shadow(0 8px 2px rgba(47, 79, 61, .12));
}

.hero h1 {
  color: #2f4c3e;
}

.hero h1 em {
  color: var(--mint-deep);
}

.hero-kicker span,
.hero-stamp {
  border-radius: 3px;
}

.hero-stamp {
  border: 1px solid #9d7a4e;
  background: #efd49a;
  box-shadow: 3px 3px 0 rgba(77, 60, 39, .16);
}

.builder {
  border: 2px solid rgba(48, 83, 64, .25);
  border-top: 9px solid #8fb69b;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  background: rgba(251, 253, 246, .97);
}

.step-nav {
  background:
    repeating-linear-gradient(90deg, rgba(215, 235, 207, .7) 0 44px, rgba(244, 248, 235, .9) 44px 88px),
    #f0f7ea;
}

.step-tab::after {
  height: 4px;
  background: var(--mint-deep);
}

.step-tab.is-active {
  background: rgba(255, 254, 243, .78);
}

.section-heading > span,
.score-ring {
  border-radius: 4px;
}

.section-heading > span {
  background: var(--mint-deep);
  box-shadow: 2px 2px 0 #416b55;
}

.range-control output,
.unit-field,
.shape-card,
.window-shape,
.wallpaper-drop,
.sample-wallpaper,
.printer-select select,
.check-pass,
.primary-export,
.secondary-export {
  border-radius: 5px;
}

.range-control output {
  background: #e8f3e2;
}

input[type="range"] {
  background: linear-gradient(90deg, var(--mint-deep), var(--mint));
}

.shape-card.is-active,
.window-shape.is-active {
  border-color: var(--mint-deep);
  background: #edf7e8;
  box-shadow: 2px 2px 0 rgba(56, 93, 72, .12);
}

.stage-panel {
  background: #ebf5e6;
}

.stage-toolbar,
.stage-footer {
  background: rgba(248, 251, 234, .95);
}

.stage-canvas {
  background-color: #ebf5e6;
  background-image:
    linear-gradient(rgba(57, 92, 72, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 92, 72, .045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.view-tabs {
  border-radius: 4px;
  background: #e4f0de;
}

.view-tabs button.is-active {
  border-radius: 3px;
  background: #fffef3;
  box-shadow: 2px 2px 0 rgba(54, 88, 69, .10);
}

.result-panel {
  background: #fffef3;
}

.primary-export {
  border: 1px solid #416b55;
  background: var(--mint-deep);
  box-shadow: 3px 3px 0 #416b55;
}

.secondary-export {
  border-color: #7ea388;
  background: #eff7eb;
}

.manual-download-link {
  color: var(--mint-deep);
}

.how-it-prints {
  border-radius: 10px;
  background: #f7faef;
}

footer {
  border-top-color: rgba(49, 88, 67, .16);
}

@media (max-width: 900px) {
  .hero-pixel-house {
    display: none;
  }
}

@media (max-width: 620px) {
  .builder {
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }
}

/* Cute pixel bakery typography */
.brand strong,
.hero h1,
.section-heading h2,
.result-heading > strong,
.model-badge strong,
.how-it-prints h2 {
  font-family: var(--cute-font);
  font-weight: 900;
  letter-spacing: .01em;
}

.brand strong {
  font-size: 14px;
  text-shadow: 1px 1px 0 rgba(255,255,255,.75);
}

.brand small,
.topbar-center,
.hero-kicker,
.section-heading > span,
.range-control output,
.stage-meta,
.result-heading > span {
  font-family: var(--pixel-font);
}

.hero h1 {
  letter-spacing: -.025em;
  line-height: 1.08;
  text-shadow: 2px 2px 0 rgba(255,255,246,.9), 4px 4px 0 rgba(85,127,102,.09);
}

.hero-copy {
  font-size: 13px;
  font-weight: 650;
}

.section-heading h2 {
  font-size: 16px;
}

.section-heading p,
.range-control label,
.field-grid label > span,
.color-row label > span,
.shape-card strong,
.window-shape span {
  font-size: 11px;
}

.shape-card small,
.wallpaper-drop small,
.sample-wallpaper small,
.result-heading p,
.check-list small {
  font-size: 8px;
}

.control-panel,
.result-panel {
  background-image:
    linear-gradient(rgba(251, 253, 246, .96), rgba(251, 253, 246, .96)),
    var(--pixel-house-pattern, none);
  background-size: auto, 96px 96px;
}

@keyframes house-wallpaper-drift {
  to {
    background-position: 0 0, 112px 56px, 32px 32px, center top, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
  }
}

/* White studio preview. Watermark is screen-only and never enters model data. */
.stage-canvas {
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 38%, #ffffff 0%, #fffefc 55%, #eef1ec 100%);
}

.stage-canvas::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 12%;
  right: 12%;
  bottom: 8%;
  height: 24%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(58, 78, 65, .13), transparent 68%);
  filter: blur(25px);
  pointer-events: none;
}

.stage-canvas::after {
  display: none;
}

#houseCanvas {
  z-index: 1;
}

.stage-canvas .model-watermark {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, .82);
  font: 400 clamp(34px, 5vw, 62px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: .025em;
  text-shadow: 0 1px 2px rgba(45, 61, 50, .34), 0 0 16px rgba(255, 255, 255, .22);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.model-badge,
.print-axis,
.canvas-help {
  z-index: 7;
}

@media (max-width: 640px) {
  .stage-canvas .model-watermark {
    font-size: clamp(30px, 11vw, 48px);
  }
}
