:root {
  color-scheme: light;
  --bg: #eef1ed;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --ink: #18211f;
  --muted: #68716d;
  --line: #d8ded7;
  --line-strong: #bdc7bf;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #dff2ef;
  --wood: #b98652;
  --wood-dark: #7a4f2f;
  --clay: #b9553f;
  --moss: #596f3d;
  --sky: #316b8f;
  --shadow: 0 18px 55px rgba(30, 39, 36, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1), transparent 30%),
    linear-gradient(135deg, rgba(185, 134, 82, 0.1), transparent 34%),
    linear-gradient(180deg, #f7f8f3 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 82px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 248, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: #0f272a;
  box-shadow: 0 12px 24px rgba(15, 39, 42, 0.16);
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-logo-home {
  display: none;
}

body[data-step="home"] .brand-logo-default {
  display: none;
}

body[data-step="home"] .brand-logo-home {
  display: block;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 0.98rem;
}

.topbar-actions,
.action-row,
.toolbar,
.toolbar-group,
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-action-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.top-action-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body:not([data-step="home"]) .home-page {
  display: none;
}

body[data-step="home"] .topbar-actions,
body[data-step="home"] .guide-strip,
body[data-step="home"] .step-pagebar,
body[data-step="home"] .workspace {
  display: none;
}

.home-page {
  flex: 1;
  background: #eef1ed;
}

.home-hero {
  position: relative;
  min-height: clamp(500px, 68vh, 680px);
  display: flex;
  align-items: center;
  padding: clamp(42px, 7vw, 84px) clamp(18px, 6vw, 84px);
  color: #f8fbef;
  background:
    linear-gradient(90deg, rgba(5, 28, 30, 0.96) 0%, rgba(9, 52, 52, 0.9) 43%, rgba(9, 52, 52, 0.44) 72%, rgba(9, 52, 52, 0.18) 100%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.2), rgba(11, 95, 89, 0.1)),
    url("assets/products/assets/Catify%20no%20back.png") right clamp(22px, 8vw, 110px) center / min(42vw, 440px) auto no-repeat,
    #0f272a;
  overflow: hidden;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(238, 241, 237, 0.12));
  pointer-events: none;
}

.home-hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}

.home-kicker {
  margin: 0 0 8px;
  color: #87d6c8;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  color: #fff8df;
  font-size: clamp(3.3rem, 10vw, 7.5rem);
  line-height: 0.9;
}

.home-lede {
  max-width: 46rem;
  margin: 18px 0 0;
  color: rgba(248, 251, 239, 0.88);
  font-size: clamp(1.02rem, 1.9vw, 1.32rem);
  font-weight: 720;
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.home-action {
  min-width: 156px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.home-section {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 6vw, 84px);
  background: var(--paper);
}

.home-section-heading {
  max-width: 820px;
  margin-bottom: 22px;
}

.home-section-heading .home-kicker,
.home-band .home-kicker {
  color: var(--accent-dark);
}

.home-section-heading h2,
.home-band h2 {
  max-width: 900px;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-feature {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 58%),
    #fff;
}

.home-feature strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

.home-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.48;
}

.home-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(32px, 5vw, 58px) clamp(18px, 6vw, 84px);
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(185, 134, 82, 0.14), transparent 42%),
    #edf3ef;
}

.guide-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px 0;
}

.guide-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.guide-card:hover {
  border-color: var(--accent);
  background: #fff;
}

.guide-card.is-active {
  border-color: rgba(15, 118, 110, 0.72);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), transparent 42%),
    #fff;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.1);
}

.guide-number {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 950;
}

.guide-card strong,
.guide-card small {
  display: block;
}

.guide-card strong {
  font-size: 0.9rem;
}

.guide-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.step-pagebar {
  margin: 12px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.step-pagebar h2 {
  margin: 0;
  font-size: clamp(1.08rem, 1.8vw, 1.45rem);
}

.step-pagebar p {
  margin-bottom: 0;
}

.step-kicker {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

#stepSubtitle {
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.step-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.step-actions button {
  min-width: 112px;
}

.step-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.workspace {
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(420px, 1fr) minmax(270px, 320px);
  gap: 14px;
  padding: 14px;
}

body[data-step="start"] .workspace,
body[data-step="build"] .workspace {
  grid-template-columns: minmax(300px, 380px) minmax(520px, 1fr);
}

body[data-step="tune"] .workspace,
body[data-step="review"] .workspace {
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 380px);
}

body[data-step="start"] #catalogPanel,
body[data-step="start"] #importPanel,
body[data-step="start"] .inspector-panel,
body[data-step="build"] #layoutStarters,
body[data-step="build"] .inspector-panel,
body[data-step="tune"] .catalog-panel,
body[data-step="tune"] #pricePanel,
body[data-step="tune"] #planPanel,
body[data-step="review"] .catalog-panel,
body[data-step="review"] #designBrief,
body[data-step="review"] #wallSettings,
body[data-step="review"] #catSettings,
body[data-step="review"] .selected-panel {
  display: none;
}

.sidebar,
.designer-panel {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-section,
.designer-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.panel-section {
  padding: 14px;
}

.designer-panel {
  min-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.compact-grid,
.dimension-row,
.finish-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.compact-grid {
  grid-template-columns: 1fr 1fr;
}

.dimension-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finish-row {
  grid-template-columns: 72px 1fr;
}

.field input[type="color"] {
  padding: 4px;
}

.filter-row {
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.preset-grid {
  display: grid;
  gap: 8px;
}

.preset-button {
  width: 100%;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 46%),
    #fff;
  text-align: left;
}

.preset-button:hover {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), transparent 46%),
    #fff;
}

.preset-button strong {
  display: block;
  font-size: 0.84rem;
}

.preset-button small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.preset-visual {
  position: relative;
  width: 62px;
  height: 52px;
  border: 1px solid rgba(24, 33, 31, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    #f6f4ed;
  background-size: 15px 13px;
  box-shadow: inset 0 -8px 18px rgba(122, 79, 47, 0.09);
}

.preset-visual::before,
.preset-visual::after,
.preset-visual span {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--wood);
  box-shadow: 0 3px 0 rgba(122, 79, 47, 0.28);
}

.preset-visual::before {
  left: 9px;
  bottom: 9px;
  width: 18px;
  height: 5px;
}

.preset-visual::after {
  right: 9px;
  top: 12px;
  width: 21px;
  height: 6px;
}

.preset-visual.small-space {
  background-size: 15px 13px;
}

.preset-visual.wall-run::before {
  left: 8px;
  bottom: 22px;
  width: 46px;
  height: 5px;
  background: repeating-linear-gradient(90deg, #7a4f2f 0 6px, #d6a66f 6px 12px);
}

.preset-visual.wall-run::after {
  top: auto;
  right: 8px;
  bottom: 12px;
}

.preset-visual.multi-cat::before {
  width: 22px;
  height: 16px;
  border-radius: 5px;
}

.preset-visual.multi-cat::after {
  right: 8px;
  top: 10px;
  width: 24px;
  height: 16px;
  border-radius: 5px;
}

.preset-visual.corner-nook {
  background:
    linear-gradient(90deg, transparent 0 70%, rgba(15, 118, 110, 0.15) 70% 100%),
    linear-gradient(rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    #f6f4ed;
  background-size: auto, 15px 13px, 15px 13px, auto;
}

.chip,
.segmented-control button,
.secondary-button,
.primary-button,
.danger-button,
.icon-button,
.file-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 8px 10px;
  font-weight: 800;
}

.icon-button,
.file-button {
  width: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.top-action-button.file-button {
  width: auto;
  display: inline-flex;
  padding: 8px 12px;
}

.file-button input,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chip {
  min-height: 30px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chip.is-active,
.segmented-control button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-button:hover,
.chip.is-active:hover,
.segmented-control button.is-active:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.secondary-button:hover,
.icon-button:hover,
.file-button:hover,
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: progress;
  opacity: 0.58;
}

.danger-button {
  width: 100%;
  color: #8f261c;
  border-color: #e1aca3;
  background: #fff7f4;
}

.catalog-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 2px;
}

.catalog-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.catalog-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(30, 39, 36, 0.08);
}

.mini-model {
  position: relative;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(49, 107, 143, 0.18), transparent),
    #edf1ee;
  border: 1px solid var(--line);
}

.mini-model.has-photo {
  background: #f7f8f6;
}

.mini-model.has-photo::before,
.mini-model.has-photo::after {
  display: none;
}

.mini-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.mini-model::before,
.mini-model::after {
  content: "";
  position: absolute;
  inset: auto 12px 16px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--wood-dark), var(--wood), #d6a66f);
  box-shadow: 0 8px 0 rgba(122, 79, 47, 0.35);
}

.mini-model::after {
  width: 28px;
  height: 28px;
  left: 21px;
  bottom: 27px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 5px solid var(--wood);
  box-shadow: none;
}

.mini-model[data-type="bridge"]::before {
  height: 8px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, var(--wood-dark) 0 5px, #e0b67e 5px 10px);
  transform: rotate(-8deg);
}

.mini-model[data-type="scratcher"]::after {
  width: 16px;
  height: 46px;
  left: 26px;
  bottom: 9px;
  border-radius: 8px;
  background: repeating-linear-gradient(0deg, #b78955 0 4px, #e1c190 4px 8px);
  border: 0;
}

.mini-model[data-type="hammock"]::before {
  height: 16px;
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(180deg, #789269, var(--moss));
}

.mini-model[data-type="hideout"]::before {
  height: 34px;
  bottom: 14px;
  border-radius: 5px;
}

.mini-model[data-model="frisco-acrylic-bowl"]::after {
  width: 34px;
  height: 22px;
  left: 16px;
  bottom: 29px;
  border-radius: 50%;
  background: rgba(121, 194, 207, 0.54);
  border-color: rgba(49, 107, 143, 0.72);
}

.mini-model[data-model="frisco-silhouette-bridge"]::before {
  height: 9px;
  bottom: 25px;
  background: linear-gradient(90deg, #7a4f2f, #667f53, #7a4f2f);
}

.mini-model[data-model="lotus-leaf"]::before {
  height: 18px;
  border-radius: 80% 12px 80% 12px;
  background: linear-gradient(90deg, #f4f1ea, #c8d6be);
  transform: rotate(-7deg);
}

.mini-model[data-model="trixie-post-perch"]::after {
  width: 14px;
  height: 48px;
  left: 27px;
  bottom: 8px;
  border: 0;
  border-radius: 8px;
  background: repeating-linear-gradient(0deg, #b78955 0 4px, #e1c190 4px 8px);
}

.catalog-content {
  min-width: 0;
}

.catalog-title {
  margin: 0 0 4px;
  font-size: 0.9rem;
  line-height: 1.22;
}

.catalog-meta,
.catalog-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.catalog-source {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.catalog-meta strong {
  color: var(--ink);
}

.catalog-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.catalog-actions button,
.catalog-actions a {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.catalog-actions button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.url-lookup-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: -2px;
}

.lookup-status {
  min-width: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.32;
}

.lookup-status[data-tone="good"] {
  color: #25654f;
}

.lookup-status[data-tone="warn"] {
  color: #94602a;
}

.lookup-status[data-tone="working"] {
  color: #315f7d;
}

.fine-print {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.toolbar {
  padding: 12px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
  min-width: min(360px, 38vw);
}

.quick-stats div {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcf8;
}

.quick-stats span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-stats strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
}

.segmented-control button {
  min-width: 56px;
  border: 0;
  border-radius: 0;
}

.stage-wrap {
  flex: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px;
  min-height: 0;
}

.stage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stage-meta strong {
  display: block;
  font-size: 0.95rem;
}

.stage-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.score-pill {
  min-width: 112px;
  text-align: center;
  border-radius: 999px;
  padding: 7px 10px;
  color: #174f2e;
  background: #e0f3df;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.stage {
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e8ece6;
}

.wall-stage,
.three-stage {
  position: absolute;
  inset: 0;
}

.stage.is-3d .wall-stage,
.stage.is-2d .three-stage {
  display: none;
}

.wall-stage {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(238, 232, 216, 0.74)),
    var(--room-photo, linear-gradient(135deg, color-mix(in srgb, var(--wall-color, #f0eadc), #fff 18%), var(--wall-color, #f0eadc)));
  background-size: cover;
  background-position: center;
}

.stage-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(330px, calc(100% - 48px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(30, 39, 36, 0.16);
  transform: translate(-50%, -50%);
}

.wall-stage.has-pieces .stage-empty {
  display: none;
}

.stage-empty strong {
  font-size: 1.05rem;
}

.empty-preview {
  position: relative;
  width: 122px;
  height: 72px;
  border: 1px solid rgba(24, 33, 31, 0.14);
  border-radius: 6px;
  background:
    linear-gradient(rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.06) 1px, transparent 1px),
    #f6f4ed;
  background-size: 20px 18px;
}

.empty-preview span {
  position: absolute;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wood-dark), var(--wood), #d6a66f);
  box-shadow: 0 4px 0 rgba(122, 79, 47, 0.28);
}

.empty-preview span:nth-child(1) {
  left: 18px;
  bottom: 17px;
  width: 38px;
}

.empty-preview span:nth-child(2) {
  left: 44px;
  bottom: 34px;
  width: 34px;
}

.empty-preview span:nth-child(3) {
  right: 18px;
  top: 15px;
  width: 40px;
}

.empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secondary-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.secondary-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wall-grid {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(55, 63, 56, 0.28);
  background-image:
    linear-gradient(rgba(24, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.08) 1px, transparent 1px);
  background-size: var(--grid-x, 8.333%) var(--grid-y, 12.5%);
  box-shadow: inset 0 -18px 42px rgba(73, 59, 42, 0.12);
}

.wall-stage[data-material="plaster"] .wall-grid {
  background-image:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.34) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 52%, rgba(24, 33, 31, 0.08) 0 1px, transparent 2px),
    linear-gradient(rgba(24, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.08) 1px, transparent 1px);
  background-size: 34px 30px, 42px 38px, var(--grid-x, 8.333%) var(--grid-y, 12.5%), var(--grid-x, 8.333%) var(--grid-y, 12.5%);
}

.wall-stage[data-material="brick"] .wall-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.26) 2px, transparent 2px),
    linear-gradient(rgba(24, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.08) 1px, transparent 1px);
  background-size: 64px 24px, 32px 24px, var(--grid-x, 8.333%) var(--grid-y, 12.5%), var(--grid-x, 8.333%) var(--grid-y, 12.5%);
}

.wall-stage[data-material="wood-panel"] .wall-grid {
  background-image:
    linear-gradient(90deg, rgba(122, 79, 47, 0.22) 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(24, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.08) 1px, transparent 1px);
  background-size: 36px 100%, 100% 18px, var(--grid-x, 8.333%) var(--grid-y, 12.5%), var(--grid-x, 8.333%) var(--grid-y, 12.5%);
}

.wall-stage[data-material="concrete"] .wall-grid {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(24, 33, 31, 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 64%, rgba(255, 255, 255, 0.22) 0 1px, transparent 2px),
    linear-gradient(rgba(24, 33, 31, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 31, 0.08) 1px, transparent 1px);
  background-size: 26px 24px, 38px 36px, var(--grid-x, 8.333%) var(--grid-y, 12.5%), var(--grid-x, 8.333%) var(--grid-y, 12.5%);
}

.corner-strip {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(24%, 150px);
  background:
    linear-gradient(90deg, rgba(64, 75, 67, 0.18), rgba(255, 255, 255, 0.2)),
    repeating-linear-gradient(0deg, rgba(24, 33, 31, 0.08) 0 1px, transparent 1px 32px);
  border-left: 2px solid rgba(55, 63, 56, 0.28);
}

.corner-strip.is-visible {
  display: block;
}

.floor-line {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 4px;
  background: rgba(122, 79, 47, 0.45);
}

.placed-piece {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 20px;
  min-height: 16px;
  border: 2px solid rgba(59, 42, 26, 0.56);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
    linear-gradient(90deg, #84552f, #c99559 48%, #e2ba82);
  box-shadow: 0 8px 18px rgba(42, 35, 29, 0.24);
  color: #1c130d;
  font-size: clamp(0.58rem, 1.1vw, 0.78rem);
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  padding: 3px;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  cursor: grab;
  will-change: left, bottom, transform;
}

.wall-stage.is-dragging {
  cursor: grabbing;
}

.placed-piece.is-dragging {
  z-index: 12;
  cursor: grabbing;
  outline: 3px solid var(--accent-dark);
  outline-offset: 3px;
  box-shadow: 0 16px 34px rgba(42, 35, 29, 0.32);
}

.placed-piece[data-type="bridge"] {
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, #764724 0 8px, #dbb171 8px 15px),
    #c99559;
}

.placed-piece[data-type="hammock"] {
  border-color: rgba(62, 83, 44, 0.7);
  border-radius: 40% 40% 11px 11px;
  background: linear-gradient(180deg, #8fa77c, #516a38);
  color: #fff;
}

.placed-piece[data-type="scratcher"] {
  background: repeating-linear-gradient(0deg, #b78955 0 5px, #e1c190 5px 10px);
}

.placed-piece[data-type="hideout"] {
  border-width: 3px;
  background: linear-gradient(135deg, #684126, #a46f43 54%, #d3a067);
  color: #fff;
}

.placed-piece.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.placed-piece.is-warning {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

.placed-piece.is-reachable {
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.22), 0 8px 18px rgba(42, 35, 29, 0.24);
}

.cat-ghost,
.cat-runner {
  position: absolute;
  left: 42px;
  bottom: 24px;
  width: var(--cat-w, 70px);
  height: var(--cat-h, 34px);
  pointer-events: none;
  opacity: 0.45;
}

.cat-runner {
  opacity: 0;
  z-index: 6;
  transition: left 460ms ease, bottom 460ms ease, opacity 180ms ease;
}

.cat-runner.is-running {
  opacity: 0.86;
}

.cat-body,
.cat-head,
.cat-tail {
  position: absolute;
  display: block;
  border: 1px solid rgba(24, 33, 31, 0.24);
  background: #f1d7a8;
  box-shadow: 0 3px 0 rgba(24, 33, 31, 0.12);
}

.cat-body {
  left: 17%;
  right: 19%;
  bottom: 18%;
  height: 50%;
  border-radius: 58% 48% 44% 52%;
  background:
    radial-gradient(ellipse at 24% 30%, #2a302d 0 17%, transparent 18%),
    radial-gradient(ellipse at 62% 68%, #d58945 0 20%, transparent 21%),
    radial-gradient(ellipse at 76% 26%, #fff1cf 0 16%, transparent 17%),
    linear-gradient(135deg, #f3dfb8, #dba467 68%, #2a302d 69% 100%);
}

.cat-body::before,
.cat-body::after {
  content: "";
  position: absolute;
  bottom: -19%;
  width: 12%;
  height: 39%;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #2a302d 0 48%, #fff2d6 49% 100%);
  box-shadow:
    18px 1px 0 #f0d0a3,
    36px -1px 0 #2a302d,
    54px 1px 0 #d58945;
}

.cat-body::before {
  left: 15%;
}

.cat-body::after {
  right: 12%;
  opacity: 0.9;
}

.cat-head {
  right: 5%;
  bottom: 42%;
  width: 29%;
  height: 38%;
  border-radius: 54% 58% 52% 48%;
  background:
    radial-gradient(circle at 36% 43%, #111716 0 7%, transparent 8%),
    radial-gradient(circle at 66% 43%, #111716 0 7%, transparent 8%),
    radial-gradient(ellipse at 51% 64%, #fff1cf 0 24%, transparent 25%),
    radial-gradient(ellipse at 74% 22%, #d58945 0 28%, transparent 29%),
    linear-gradient(145deg, #f6e1b8, #f0c987);
}

.cat-head::before,
.cat-head::after {
  content: "";
  position: absolute;
  top: -27%;
  width: 36%;
  height: 38%;
  background:
    linear-gradient(135deg, transparent 18%, #e8a5a0 19% 43%, transparent 44%),
    #f1d7a8;
  border: 1px solid rgba(24, 33, 31, 0.22);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.cat-head::before {
  left: 12%;
}

.cat-head::after {
  right: 10%;
}

.cat-tail {
  left: 2%;
  bottom: 50%;
  width: 29%;
  height: 14%;
  border-radius: 999px 999px 999px 40%;
  background: repeating-linear-gradient(90deg, #2a302d 0 18%, #d58945 18% 34%, #f3dfb8 34% 52%);
  transform: rotate(-32deg);
  transform-origin: right center;
}

.cat-tail::after {
  content: "";
  position: absolute;
  left: -8%;
  top: -15%;
  width: 28%;
  height: 125%;
  border-radius: 50%;
  background: #2a302d;
}

.cat-runner.is-running .cat-body {
  animation: cat-bob 520ms ease-in-out infinite alternate;
}

.cat-runner.is-running .cat-tail {
  animation: tail-swish 420ms ease-in-out infinite alternate;
}

@keyframes cat-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-3px);
  }
}

@keyframes tail-swish {
  from {
    transform: rotate(-38deg);
  }
  to {
    transform: rotate(-22deg);
  }
}

.three-stage {
  background:
    radial-gradient(circle at 25% 12%, rgba(255, 255, 255, 0.78), transparent 26%),
    linear-gradient(135deg, #dfe6e0, #cfd6ce);
}

#threeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.three-stage.is-dragging #threeCanvas,
.three-stage.is-orbiting #threeCanvas {
  cursor: grabbing;
}

.canvas-help {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  color: #1b2825;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
}

.estimate-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.estimate-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.estimate-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.estimate-list dd {
  margin: 0;
  font-weight: 900;
}

.estimate-list div:last-child {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.estimate-list div:last-child dd {
  font-size: 1.35rem;
  color: var(--accent-dark);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

#cornerDepthField {
  margin-top: 8px;
}

.brief-budget {
  margin-top: 10px;
}

.analysis-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mood-board {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fbfcf8;
  font-size: 0.73rem;
  font-weight: 900;
}

.mood-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid rgba(24, 33, 31, 0.18);
  border-radius: 50%;
}

.plan-list {
  display: grid;
  gap: 8px;
}

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
}

.analysis-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.82rem;
}

.plan-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
}

.plan-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.82rem;
}

.analysis-item.warning {
  border-color: #dfb5a4;
  background: #fff8f3;
}

.analysis-item.good,
.plan-item.good {
  border-color: #a4cfb1;
  background: #f4fbf5;
}

.plan-item.warning {
  border-color: #dfb5a4;
  background: #fff8f3;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: #fbfcf8;
  font-size: 0.82rem;
  line-height: 1.45;
}

.selected-controls {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(92vw, 460px);
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  background: #1e2926;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 50;
  font-size: 0.86rem;
  font-weight: 800;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1180px) {
  .guide-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: minmax(260px, 310px) minmax(420px, 1fr);
  }

  body[data-step="start"] .workspace,
  body[data-step="build"] .workspace {
    grid-template-columns: minmax(270px, 340px) minmax(420px, 1fr);
  }

  body[data-step="tune"] .workspace,
  body[data-step="review"] .workspace {
    grid-template-columns: minmax(420px, 1fr) minmax(290px, 340px);
  }

  .inspector-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
  }

  body[data-step="tune"] .inspector-panel,
  body[data-step="review"] .inspector-panel {
    grid-column: auto;
    display: flex;
  }

  .plan-panel {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .home-hero {
    min-height: 560px;
    align-items: flex-end;
    background:
      linear-gradient(180deg, rgba(5, 28, 30, 0.72) 0%, rgba(5, 28, 30, 0.92) 58%, rgba(5, 28, 30, 0.98) 100%),
      url("assets/products/assets/Catify%20no%20back.png") center 38px / min(68vw, 340px) auto no-repeat,
      #0f272a;
  }

  .home-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-pagebar {
    align-items: stretch;
    flex-direction: column;
  }

  .step-actions {
    width: 100%;
  }

  .step-actions > * {
    flex: 1;
  }

  .brand-subtitle {
    max-width: 28rem;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  body[data-step="start"] .workspace,
  body[data-step="build"] .workspace,
  body[data-step="tune"] .workspace,
  body[data-step="review"] .workspace {
    grid-template-columns: 1fr;
  }

  .designer-panel {
    min-height: 620px;
    order: -1;
  }

  body[data-step="start"] .catalog-panel {
    order: -1;
  }

  body[data-step="start"] .designer-panel {
    order: 0;
  }

  .stage {
    min-height: 500px;
  }

  .catalog-list {
    max-height: none;
  }

  .inspector-panel {
    display: flex;
  }

  .quick-stats {
    order: 3;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero {
    min-height: 540px;
    padding: 34px 16px;
    background-size: min(82vw, 300px) auto;
  }

  .home-actions,
  .home-action {
    width: 100%;
  }

  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .home-feature {
    min-height: 0;
  }

  .home-section,
  .home-band {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .brand-subtitle {
    font-size: 0.76rem;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .top-action-button,
  .top-action-button.file-button {
    flex: 1;
  }

  .guide-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 10px 0;
  }

  .step-pagebar {
    margin: 10px 10px 0;
    padding: 12px;
  }

  .guide-card {
    padding: 8px;
  }

  .guide-number {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .guide-card small {
    display: none;
  }

  .workspace {
    gap: 10px;
  }

  .toolbar,
  .stage-meta,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-stats div {
    padding: 5px 6px;
  }

  .toolbar-group,
  .segmented-control {
    width: 100%;
  }

  .toolbar-group > *,
  .action-row > * {
    flex: 1;
  }

  .compact-grid,
  .dimension-row {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 430px;
  }

  .stage-wrap {
    padding: 10px;
  }

  .catalog-card {
    grid-template-columns: 58px 1fr;
  }

  .preset-button {
    grid-template-columns: 54px 1fr;
    min-height: 66px;
  }

  .preset-visual {
    width: 54px;
    height: 46px;
  }

  .stage-empty {
    width: min(300px, calc(100% - 32px));
    padding: 14px;
  }

  .empty-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
}

/* Photo -> model import controls */
.import-image {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
}

.import-image-preview {
  flex: 0 0 68px;
  width: 68px;
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
  background: #edf1ee center / cover no-repeat;
  position: relative;
}

.import-image-preview.has-photo {
  border-style: solid;
  border-color: var(--accent);
}

.import-image-preview:not(.has-photo)::after {
  content: "photo";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}

.import-image-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.file-chip:hover {
  border-color: var(--accent);
}

.file-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.detect-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.detect-hint strong {
  color: var(--ink);
  text-transform: capitalize;
}

.detect-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(24, 33, 31, 0.14);
}

.thumb-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.4);
}
