:root {
  --ink: #20231f;
  --muted: #70736d;
  --paper: #f5f3ee;
  --white: #fff;
  --line: #dfddd5;
  --sage: #48685b;
  --sage-dark: #344f44;
  --peach: #d99a79;
  --shadow: 0 18px 60px rgba(40, 44, 38, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 5%, rgba(222, 205, 183, .28), transparent 25rem),
    var(--paper);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}
button, input { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1500px; margin: auto; padding: 0 42px 52px; }
.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(32, 35, 31, .09);
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font: 700 20px/1 Manrope; letter-spacing: -.5px; }
.brand-mark { position: relative; width: 29px; height: 29px; display: block; transform: rotate(-4deg); }
.brand-mark i { position: absolute; width: 17px; height: 25px; border-radius: 4px 10px 3px 8px; background: var(--sage); transform: skewY(-18deg); }
.brand-mark i:last-child { left: 12px; top: 3px; height: 22px; background: var(--peach); opacity: .94; }
.privacy { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.privacy span { width: 7px; height: 7px; border-radius: 50%; background: #5b8e72; box-shadow: 0 0 0 4px rgba(91, 142, 114, .12); }
.intro { padding: 54px 0 38px; text-align: center; }
.eyebrow { font-weight: 700; font-size: 11px; color: #98725f; letter-spacing: 2px; }
h1 { margin: 13px 0 15px; font: 700 clamp(35px, 4vw, 58px)/1.06 Manrope; letter-spacing: -3px; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--sage); }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}
.canvas-panel { position: relative; min-width: 0; min-height: 600px; background: #eae8e2; overflow: hidden; }
.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h2 { margin: 25px 0 8px; font: 700 22px Manrope; letter-spacing: -.6px; }
.empty-state p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.room-illustration { position: relative; width: 330px; height: 210px; border-radius: 6px; overflow: hidden; background: #d7d2c7; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.floor { position: absolute; inset: 69% 0 0; background: repeating-linear-gradient(100deg, #bc9c7d 0 2px, #c6a88b 2px 48px); }
.picture { position: absolute; left: 130px; top: 33px; width: 70px; height: 55px; padding: 6px; background: #f4efe5; border: 4px solid #8d7662; box-shadow: 0 4px 8px #0001; }
.picture span { display: block; width: 100%; height: 100%; background: linear-gradient(150deg, #758d7b 50%, #a8b49d 51%); }
.sofa { position: absolute; z-index: 2; left: 55px; bottom: 23px; width: 220px; height: 72px; border-radius: 13px 13px 5px 5px; background: #536c62; box-shadow: inset 0 -12px #445b52; }
.sofa:before, .sofa:after { content:""; position: absolute; top: 12px; width: 96px; height: 44px; background: #627a70; border-radius: 7px; }
.sofa:before { left: 10px; } .sofa:after { right: 10px; }
.sofa span { position: absolute; z-index: 2; width: 45px; height: 37px; right: 28px; top: 17px; background: #d69a77; transform: rotate(7deg); border-radius: 4px; }
.plant { position: absolute; z-index: 3; left: 20px; bottom: 29px; width: 38px; height: 84px; border-bottom: 30px solid #806852; border-left: 6px solid transparent; border-right: 6px solid transparent; }
.plant i { position: absolute; bottom: 22px; left: 11px; width: 16px; height: 43px; border-left: 2px solid #496152; transform-origin: bottom; transform: rotate(-28deg); }
.plant i:after { content:""; position: absolute; left: -11px; width: 20px; height: 11px; border-radius: 100% 0 100% 0; background: #5f7967; }
.plant i:nth-child(2) { transform: rotate(16deg); height: 53px; }
.plant i:nth-child(3) { transform: rotate(48deg); height: 39px; }
.sun { position: absolute; right: -65px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.22); }
.primary, .secondary {
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
}
.primary { color: white; background: var(--sage); box-shadow: 0 5px 12px rgba(72, 104, 91, .18); }
.primary:hover { background: var(--sage-dark); }
.primary svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.secondary { color: var(--ink); background: white; border-color: var(--line); }
.secondary:hover { background: #f8f7f3; }
.file-note { margin-top: 12px; color: #979990; font-size: 11px; }
.controls { display: flex; flex-direction: column; background: white; border-left: 1px solid var(--line); }
.control-section { padding: 24px 23px; border-bottom: 1px solid #ebe9e3; transition: opacity .2s; }
.control-section.disabled { opacity: .38; pointer-events: none; }
.step-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 17px; }
.step-title > span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; color: white; background: var(--sage); font-size: 11px; font-weight: 700; }
.step-title div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.step-title strong { font: 700 14px Manrope; }
.step-title small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 225px; }
.control-section > .secondary { width: 100%; }
.mode-tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 3px; border-radius: 8px; background: #efeee9; margin-bottom: 12px; }
.mode { border: 0; border-radius: 6px; padding: 8px 3px; background: transparent; color: #6f716c; font-size: 11px; }
.mode.active { background: white; color: var(--ink); box-shadow: 0 1px 4px #0002; font-weight: 600; }
.mode-help { min-height: 31px; margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.range-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 9px; color: var(--muted); font-size: 11px; }
.range-row + .range-row { margin-top: 17px; }
.range-row output { color: var(--ink); }
.range-row input { grid-column: 1/-1; width: 100%; accent-color: var(--sage); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 18px; }
.swatch { aspect-ratio: 1; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #d6d3cb; }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.suggestions { margin: -3px 0 19px; padding: 12px; border: 1px solid #e4e1d9; border-radius: 11px; background: #faf9f6; }
.suggestion-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.suggestion-heading > div { display: flex; flex-direction: column; gap: 2px; }
.suggestion-heading strong { font: 700 11px Manrope; }
.suggestion-heading small { color: var(--muted); font-size: 10px; }
.text-button { padding: 3px 0; border: 0; background: none; color: var(--sage); font-size: 10px; font-weight: 700; }
.text-button.active { color: #9b654c; }
.suggestion-carousel { display: grid; grid-template-columns: 27px 1fr 27px; gap: 6px; align-items: center; }
.cycle-button { width: 27px; height: 42px; border: 0; border-radius: 7px; background: #eeece6; color: var(--ink); font-size: 23px; line-height: 1; }
.suggestion-current { min-width: 0; height: 48px; display: flex; align-items: center; gap: 9px; padding: 5px 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: white; }
.suggestion-current > span:first-child { flex: 0 0 33px; height: 33px; border-radius: 7px; box-shadow: inset 0 0 0 1px #0001; }
.suggestion-current > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.suggestion-current strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.suggestion-current small { margin-top: 2px; color: var(--muted); font: 9px monospace; }
.suggestion-dots { display: flex; justify-content: center; gap: 6px; margin-top: 9px; }
.suggestion-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; box-shadow: 0 0 0 1px #c8c5bd; }
.suggestion-dot.active { box-shadow: 0 0 0 2px var(--ink); }
.custom-color { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.color-models { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.model-row { display: grid; grid-template-columns: 34px 1fr 1fr 1fr; gap: 6px; align-items: center; }
.model-row > span { font: 700 10px/1 Manrope; letter-spacing: .5px; color: var(--muted); cursor: help; }
.model-row label { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: 3px 5px; }
.model-row input { width: 100%; min-width: 0; border: 0; background: 0; color: var(--ink); font: 600 11px monospace; -moz-appearance: textfield; }
.model-row input::-webkit-outer-spin-button, .model-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.color-input-wrap { display: flex; align-items: center; gap: 7px; color: var(--ink); font: 600 11px monospace; padding: 4px 8px 4px 5px; border: 1px solid var(--line); border-radius: 7px; }
#colorPicker { width: 24px; height: 24px; padding: 0; border: 0; background: 0; }
.control-footer { margin-top: auto; padding: 22px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 9px; background: #faf9f6; }
button:disabled { cursor: not-allowed; opacity: .38; }
.editor { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; background: #252724; }
.editor[hidden] { display: none; }
#photoCanvas { display: block; max-width: none; box-shadow: 0 8px 35px #0006; touch-action: none; }
.canvas-hint { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(25,27,24,.82); backdrop-filter: blur(8px); padding: 9px 14px; border-radius: 20px; font-size: 12px; pointer-events: none; }
.editor-actions { position: absolute; left: 17px; bottom: 16px; display: flex; align-items: center; gap: 5px; padding: 5px; border-radius: 9px; color: white; background: rgba(25,27,24,.82); backdrop-filter: blur(8px); }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: white; font-size: 18px; display: grid; place-items: center; }
.icon-button:hover { background: #ffffff1a; }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#zoomLabel { width: 42px; text-align: center; font-size: 10px; }
.drop-overlay { position: absolute; inset: 14px; z-index: 20; display: none; place-items: center; border: 2px dashed var(--sage); border-radius: 12px; color: var(--sage-dark); background: rgba(245,243,238,.93); font-weight: 700; }
.canvas-panel.dragging .drop-overlay { display: grid; }

@media (max-width: 900px) {
  .shell { padding: 0 18px 30px; }
  .privacy { display: none; }
  .intro { padding: 38px 0 30px; }
  h1 { letter-spacing: -2px; }
  .studio { grid-template-columns: 1fr; }
  .canvas-panel { min-height: 470px; }
  .controls { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .shell { padding: 0; }
  .topbar { margin: 0 18px; }
  .intro { padding-left: 18px; padding-right: 18px; }
  .studio {
    overflow: visible;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .canvas-panel.has-photo {
    position: sticky;
    z-index: 10;
    top: 0;
    height: clamp(300px, 48svh, 410px);
    min-height: 0;
    border-bottom: 1px solid #171916;
    box-shadow: 0 8px 24px rgba(23, 25, 22, .18);
  }
  .canvas-panel.has-photo + .controls {
    position: relative;
    z-index: 1;
  }
  .canvas-panel.has-photo .canvas-hint {
    top: 12px;
    max-width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .controls .control-section { scroll-margin-top: clamp(312px, 50svh, 422px); }
  .room-illustration { width: 280px; }
}
