:root {
  --ink: #18201f;
  --muted: #5d6864;
  --line: #dfe5df;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --charcoal: #101820;
  --olive: #65754f;
  --tomato: #b84b38;
  --gold: #d6a85f;
  --blue: #315b7d;
  --ok: #2f7d52;
  --danger: #b64040;
  --shadow: 0 18px 42px rgba(16, 24, 32, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(247, 245, 239, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
  text-decoration: none;
}
.brand::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--tomato), var(--gold) 48%, var(--olive));
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 750;
  font-size: 14px;
}
.nav-links a:hover { border-color: var(--line); color: var(--ink); background: #fff; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(16,24,32,.18);
}
.button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.button.olive { background: var(--olive); }
.button.tomato { background: var(--tomato); }
.button:disabled { opacity: .55; cursor: not-allowed; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 680px;
  display: grid;
  align-items: center;
  padding: 56px max(18px, calc((100vw - 1180px) / 2)) 34px;
  background:
    linear-gradient(90deg, rgba(16,24,32,.90), rgba(16,24,32,.64) 52%, rgba(16,24,32,.18)),
    url("/assets/examples/interior-after.png") center / cover;
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(16,24,32,.18), rgba(16,24,32,.08) 52%, rgba(16,24,32,.22));
  pointer-events: none;
}
.ai-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: .72;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, .72fr);
  gap: 42px;
  align-items: center;
}
.eyebrow {
  width: fit-content;
  margin: 0 0 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  color: #f3dfbb;
  font-weight: 800;
  background: rgba(255,255,255,.08);
}
h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(36px, 5vw, 70px);
  line-height: 1;
  letter-spacing: 0;
}
.lead {
  max-width: 820px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 19px;
  line-height: 1.5;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.note { color: rgba(255,255,255,.72); margin-top: 12px; font-weight: 700; }

.hero-panel {
  background: rgba(255,255,255,.94);
  color: var(--ink);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-panel img { width: 100%; height: 180px; object-fit: cover; display: block; }
.hero-panel-body { padding: 18px; display: grid; gap: 12px; }
.mini-chat {
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.bubble {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef1e9;
  line-height: 1.35;
}
.bubble.user { background: #f6e3d7; justify-self: end; max-width: 88%; }

.section {
  padding: 56px max(18px, calc((100vw - 1180px) / 2));
}
.section h2 { margin: 0 0 16px; font-size: clamp(28px, 4vw, 42px); letter-spacing: 0; }
.section > p { max-width: 760px; color: var(--muted); line-height: 1.55; }
.two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.card {
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,24,32,.06);
}
.card strong { display: block; font-size: 18px; margin-bottom: 8px; }
.card span, .card p { color: var(--muted); line-height: 1.45; margin: 0; }
.card.action { display: grid; align-content: space-between; gap: 18px; min-height: 230px; }
.visual-card {
  min-height: 180px;
  display: grid;
  align-items: end;
  color: #fff;
  background: linear-gradient(rgba(16,24,32,.12), rgba(16,24,32,.72)), var(--image) center / cover;
}
.visual-card span { color: rgba(255,255,255,.82); }

.studio-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 360px);
  gap: 14px;
  margin-top: 22px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 12px;
  scroll-snap-type: inline mandatory;
}
.studio-slide {
  display: grid;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  scroll-snap-align: start;
}
.studio-slide strong {
  padding: 0 2px;
  font-size: 18px;
}
.ba-slider {
  --pos: 50%;
  position: relative;
  height: 235px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--charcoal);
  box-shadow: 0 8px 24px rgba(16,24,32,.08);
}
.ba-before,
.ba-after {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 12px;
  background-position: center;
  background-size: cover;
}
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-after { clip-path: inset(0 0 0 var(--pos)); }
.ba-before::after,
.ba-after::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,24,32,.06), rgba(16,24,32,.52));
}
.ba-before span,
.ba-after span {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(16,24,32,.18);
}
.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(16,24,32,.18);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 20px rgba(16,24,32,.18);
}

.app-shell {
  min-height: calc(100vh - 65px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 310px;
  gap: 14px;
  padding: 16px;
}
.panel {
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,32,.06);
}
.panel-head { padding: 14px; border-bottom: 1px solid var(--line); font-weight: 850; }
.panel-body { padding: 14px; }
.chip-list { display: grid; gap: 8px; }
.chip {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  color: var(--ink);
}
.chip.active, .chip:hover { background: #edf1e7; border-color: #c8d0bd; }

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 97px);
}
.chat-log {
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.message {
  max-width: min(780px, 92%);
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef1e9;
  white-space: pre-wrap;
  line-height: 1.45;
}
.message.user { justify-self: end; background: #f6e3d7; }
.composer { padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.composer textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.form-grid { display: grid; gap: 10px; }
label { display: grid; gap: 5px; font-weight: 750; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}
.source-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }

.dialog-page,
.studio-home {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 54px;
}
.dialog-hero {
  padding: 52px 0 28px;
}
.dialog-hero h1 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 62px);
}
.dialog-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}
.single-chat {
  min-height: 68vh;
}
.render-composer .attach-row,
.attach-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.attach {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px dashed #c8d0bd;
  border-radius: 8px;
  background: #fbfaf6;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
}
.attach input { display: none; }
.small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.photo-consent {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.photo-consent input {
  width: auto;
}
.compact-sources {
  padding-top: 0;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.task-card {
  min-height: 360px;
  display: grid;
  grid-template-rows: 190px 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(16,24,32,.08);
}
.task-card > div:last-child {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.task-card strong { font-size: 20px; line-height: 1.15; }
.task-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.task-card em { color: var(--tomato); font-style: normal; font-weight: 850; }
.task-visual {
  display: grid;
  align-items: end;
  padding: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--charcoal), var(--olive));
}
.task-visual span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(16,24,32,.58);
  font-weight: 900;
}
.tone-0 { background: linear-gradient(135deg, #1b2a24, #d6a85f); }
.tone-1 { background: linear-gradient(135deg, #182536, #b84b38); }
.tone-2 { background: linear-gradient(135deg, #315b7d, #65754f); }
.tone-3 { background: linear-gradient(135deg, #482f36, #c99649); }
.tone-4 { background: linear-gradient(135deg, #70403a, #f0d9a6); }
.tone-5 { background: linear-gradient(135deg, #202b2f, #8d9b71); }
.tone-6 { background: linear-gradient(135deg, #233247, #b84b38); }

.visual-hero {
  color: #fff;
  background:
    linear-gradient(120deg, rgba(16,24,32,.94), rgba(16,24,32,.76)),
    linear-gradient(135deg, var(--olive), var(--tomato) 58%, var(--gold));
}
.visual-hero-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 30px;
}
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.app-toplinks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 950;
  font-size: 20px;
}
.app-brand::before {
  content: "";
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--tomato), var(--gold), var(--olive));
}
.change-task {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: rgba(255,255,255,.86);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 800;
  font-size: 13px;
  background: rgba(255,255,255,.08);
}
.visual-hero h1 {
  color: #fff;
}
.visual-hero p {
  max-width: 760px;
  margin: 12px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 17px;
  line-height: 1.45;
}
.visual-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 14px auto 48px;
}
.visual-layout {
  display: grid;
  grid-template-columns: minmax(380px, .9fr) minmax(460px, 1.1fr);
  gap: 14px;
  align-items: start;
}
.visual-chat {
  min-height: calc(100vh - 215px);
}
.result-panel {
  overflow: hidden;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}
.stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd3c7;
  border-radius: 8px;
  background: #fbfaf6;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}
.stage img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  display: block;
}
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.thumb {
  width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.thumb img {
  width: 100%;
  height: 62px;
  object-fit: cover;
  display: block;
}
.thumb span {
  display: block;
  padding: 5px;
  color: var(--muted);
  font-size: 11px;
}
.actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.result-actions {
  padding: 0 12px 12px;
}
.plans {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.visualizer .plans,
.result-panel .plans {
  display: grid;
}
.history {
  border-top: 1px solid var(--line);
  padding: 12px;
}
.history h3 {
  margin: 0 0 10px;
}
.history-list {
  display: grid;
  gap: 8px;
}
.history-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}
.history-item:not(.has-image) {
  grid-template-columns: 1fr;
}
.history-item img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
}
.history-item a {
  color: var(--tomato);
  font-weight: 850;
}
.progress {
  width: min(320px, 90%);
  display: grid;
  gap: 10px;
  text-align: left;
}
.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #e8e5da;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--tomato), var(--gold));
}

.studio-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 20px auto 54px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}
.studio-main { display: grid; gap: 16px; }
.result-img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.status { color: var(--muted); font-size: 14px; }
.price-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
.legal {
  width: min(900px, calc(100% - 32px));
  margin: 34px auto 60px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.legal p, .legal li { color: var(--muted); line-height: 1.6; }

@media (max-width: 920px) {
  .hero { min-height: auto; padding-top: 48px; }
  .hero-grid, .two-grid, .studio-shell, .visual-layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 1fr; padding: 10px; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare { grid-template-columns: 1fr; }
  .chat { order: -1; }
  .chat { min-height: 70vh; }
}
@media (max-width: 560px) {
  .nav { align-items: flex-start; }
  .nav-links { justify-content: flex-end; }
  .card-grid, .price-row, .task-grid, .plans, .render-composer .attach-row, .attach-row { grid-template-columns: 1fr; }
  .section { padding-top: 38px; padding-bottom: 38px; }
  .studio-strip { grid-auto-columns: minmax(250px, 84vw); }
  .visual-shell, .visual-hero-inner, .dialog-page, .studio-home { width: min(100% - 22px, 1280px); }
  .stage { min-height: 280px; }
}
