:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --ink: #1e2329;
  --muted: #6b7280;
  --accent: #e8613c;
  --accent-dark: #c94a28;
  --line: #e5e2db;
  --grid: #ecebe6;
  --wall: #2f3540;
  --sel: #2f80ed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(247, 246, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.logo .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.nav-links { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  font-size: 14px;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
}
.btn-ghost:hover { background: #fff; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 28px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero h1 .accent { color: var(--accent); }

.hero p.sub {
  margin: 18px auto 0;
  max-width: 640px;
  font-size: 17px;
  color: var(--muted);
}

.hero .cta-row {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .badges {
  margin-top: 18px;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.badges span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Room type cards ---------- */
.room-types {
  max-width: 1080px;
  margin: 30px auto 0;
  padding: 0 28px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.room-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(30, 35, 41, 0.08);
  border-color: #d8d4cb;
}
.room-card .icon { font-size: 26px; display: block; margin-bottom: 8px; }
.room-card small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* ---------- Feature strip ---------- */
.features {
  max-width: 1080px;
  margin: 30px auto 70px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.feature h3 { font-size: 16px; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature p { font-size: 14px; color: var(--muted); }
.feature .fi { font-size: 24px; margin-bottom: 10px; display: block; }

/* ---------- Steps ---------- */
.steps {
  max-width: 860px;
  margin: 0 auto 70px;
  padding: 0 28px;
}
.steps h2 { text-align: center; font-size: 30px; letter-spacing: -0.02em; margin-bottom: 34px; }
.step { display: flex; gap: 18px; margin-bottom: 22px; align-items: flex-start; }
.step .num {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.step h4 { font-size: 16px; }
.step p { font-size: 14px; color: var(--muted); }

/* ---------- SEO copy ---------- */
.seo-copy {
  max-width: 760px;
  margin: 0 auto 60px;
  padding: 0 28px;
  color: var(--muted);
  font-size: 14px;
}
.seo-copy h2 { color: var(--ink); font-size: 24px; letter-spacing: -0.02em; margin-bottom: 14px; }
.seo-copy h3 { color: var(--ink); font-size: 17px; margin: 22px 0 8px; }
.seo-copy p, .seo-copy li { margin-bottom: 10px; }
.seo-copy ul { padding-left: 20px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 10px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
.faq details[open] summary::before { content: "− "; }
.faq details p { padding: 0 16px 14px; font-size: 14px; color: var(--muted); }

/* ---------- Dimension tables ---------- */
.dim-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}
.dim-table th, .dim-table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}
.dim-table th { background: #f1efe9; font-weight: 600; color: var(--ink); }
.dim-table td { color: var(--muted); }
.dim-table td:first-child { color: var(--ink); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer a:hover { color: var(--ink); }

/* =========================================================
   App layout (editor pages)
   ========================================================= */
.app-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 61px);
  min-height: 560px;
}

.app-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.app-toolbar .tb-group { display: flex; gap: 8px; align-items: center; }
.app-toolbar .spacer { flex: 1; }

.tb-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tb-btn:hover { border-color: #c9c5bc; }
.tb-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tb-btn.danger { color: #c0392b; }
.tb-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.dim-input {
  width: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  text-align: right;
}

.tb-label { font-size: 13px; color: var(--muted); }

.app-main { display: flex; flex: 1; min-height: 0; }

/* Furniture sidebar */
.furniture-panel {
  width: 244px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 14px;
}

.furniture-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 12px 0 8px; }
.furniture-panel h4:first-child { margin-top: 0; }

.furniture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.furn-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
  font-family: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.furn-item:hover { border-color: var(--accent); background: #fff8f5; }
.furn-item .fi { font-size: 18px; display: block; margin-bottom: 3px; }
.furn-item small { color: var(--muted); font-size: 10px; }

/* Canvas area */
.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

#plan2d, #view3d { position: absolute; inset: 0; width: 100%; height: 100%; }
#view3d { display: none; }
.app-shell.mode-3d #plan2d { display: none; }
.app-shell.mode-3d #view3d { display: block; }

.canvas-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 35, 41, 0.82);
  color: #fff;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

/* Selection floating toolbar */
.sel-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sel-toolbar .tb-btn { background: var(--panel); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* AI render card */
.ai-card {
  position: absolute;
  bottom: 54px;
  right: 14px;
  width: 250px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.ai-card h5 { font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ai-card p { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ai-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  background: #fdeee8; color: var(--accent-dark);
  border-radius: 6px; padding: 2px 6px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Landing CTA to editor */
.editor-entry { text-align: center; padding: 0 28px 60px; }
.editor-entry .big-start {
  font-size: 16px;
  padding: 14px 34px;
  border-radius: 12px;
}

@media (max-width: 760px) {
  .furniture-panel { width: 190px; }
  .nav-links { display: none; }
}
