@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

/* Palette from Kendi's .interiors. board: dark coffee, rich mahogany, wine plum, blue slate, dark khaki */
:root {
  --bg: #f5efe6;
  --surface: #fffcf7;
  --surface-2: #ede4d7;
  --ink: #3b2c26;          /* dark coffee */
  --ink-2: #6f6158;
  --line: #e0d4c4;
  --accent: #5a1f24;       /* rich mahogany */
  --accent-ink: #fffcf7;
  --accent-soft: #f0e0dc;
  --slate: #8fa3ad;        /* blue slate */
  --khaki: #6b6a2e;        /* dark khaki */
  --plum: #6e3a4b;         /* wine plum */
  --ok: #5b6b2e;
  --warn: #9a6a1f;
  --danger: #a33a3a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 38, 34, .06), 0 4px 16px rgba(43, 38, 34, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 500; margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; white-space: nowrap; align-items: center; gap: 10px; font-family: Fraunces, Georgia, serif; font-size: 1.3rem; font-weight: 500; color: var(--ink); text-decoration: none; text-transform: lowercase; }
.brand::before { content: ''; width: 32px; height: 32px; background: url(/logo.svg) center / contain no-repeat; flex: none; }
.brand::after { content: '.'; color: var(--accent); margin-left: -8px; }
.topbar nav { display: flex; gap: 14px; margin-left: auto; align-items: center; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.topbar nav a.active, .topbar nav a:hover { color: var(--ink); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.narrow { max-width: 640px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-2); font-size: 13px; }
input[type=text], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; font: 500 14px Inter, system-ui, sans-serif;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(.95); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
button.small { padding: 5px 10px; font-size: 13px; }
button.recording { background: var(--danger); border-color: var(--danger); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; user-select: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); }
.badge.intake { background: var(--accent-soft); color: var(--accent); }
.badge.revising { background: #f6ebd4; color: var(--warn); }
.badge.approved, .badge.done { background: #e1ede4; color: var(--ok); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.thumbs img.selected { outline: 3px solid var(--accent); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast-error { background: var(--danger); }

/* Chat */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: #ead0bf; }
.msg .meta { font-size: 11px; color: var(--ink-2); margin-bottom: 3px; }
.msg img { border-radius: 8px; margin-top: 4px; cursor: zoom-in; }
.msg audio { width: 240px; max-width: 100%; margin-top: 4px; }
.msg .transcript { font-size: 13px; color: var(--ink-2); font-style: italic; margin-top: 4px; }
.msg.layout { border: 2px solid var(--accent); }
.chat-compose { display: flex; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); align-items: flex-end; }
.chat-compose textarea { min-height: 42px; height: 42px; flex: 1; }

/* Queue */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; }
.col h3 { font-family: Inter, sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.pcard:hover { border-color: var(--accent); }

/* Catalog */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.citem { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; cursor: pointer; }
.citem:hover { border-color: var(--accent); }
.citem img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--surface-2); border-radius: 6px; margin-bottom: 6px; }
.dropzone { border: 2px dashed var(--line); border-radius: 8px; padding: 18px; text-align: center; color: var(--ink-2); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone img { max-height: 160px; margin: 0 auto; }

/* Editor */
.editor { display: grid; grid-template-columns: 260px 1fr 340px; gap: 14px; padding: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel h3 { font-family: Inter, sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 10px; }
.picker { max-height: 60vh; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picker .citem { padding: 6px; font-size: 12px; }
.stage-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.stage { position: relative; width: 100%; overflow: hidden; background: var(--surface-2); user-select: none; touch-action: none; border-radius: 6px; min-height: 300px; }
.stage > img.bg { width: 100%; pointer-events: none; }
.stage .item { position: absolute; left: 0; top: 0; cursor: grab; transform-origin: center; }
.stage .item img { width: 100%; pointer-events: none; }
.stage .item.sel { outline: 2px dashed var(--accent); outline-offset: 2px; }
.stage .item .handle { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; display: none; }
.stage .item.sel .handle { display: block; }
.stage.calibrating { cursor: crosshair; }
.stage .calpt { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; pointer-events: none; }
.stage .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.shoplist { width: 100%; border-collapse: collapse; font-size: 13px; }
.shoplist td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shoplist td:last-child { text-align: right; white-space: nowrap; }
.shoplist tfoot td { font-weight: 600; border-bottom: 0; }

.concept img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }

@media (max-width: 1000px) {
  .editor { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .picker { max-height: 300px; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .wrap { padding: 16px 16px 40px; }
  .board { grid-template-columns: repeat(5, 78vw); }
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar nav { gap: 12px; }
  .brand { font-size: 1.1rem; }
}

/* Intake package picker */
.pkg-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg-option { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 400; }
.pkg-option input { accent-color: var(--accent); margin: 0; }
.pkg-option .pkg-name { font-weight: 600; }
.pkg-option .pkg-price { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.pkg-option .pkg-tag { grid-column: 2 / 4; }
.pkg-option.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 11px 13px; }
@media (max-width: 600px) { .pkg-pick { grid-template-columns: 1fr; } }

/* AI render: the real products, to check the render against */
.ai-compare { display: flex; gap: 8px; overflow-x: auto; }
.ai-compare figure { margin: 0; width: 84px; flex: none; }
.ai-compare img { width: 84px; height: 84px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.ai-compare figcaption { font-size: 11px; color: var(--ink-2); line-height: 1.25; margin-top: 3px; }

/* Catalog: paste a product link to fill the form */
.link-fill { display: flex; gap: 8px; }
.link-fill input { flex: 1; }

/* Intake: launch offer claim */
.offer-claim { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.offer-claim input { width: auto; margin-top: 3px; }

/* Editor: payment / completion / portfolio strip */
.biz { margin-top: 8px; gap: 8px; flex-wrap: wrap; }

/* Studio: active / completed tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.done-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* Client project: photos of each 3D view */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.shot { position: relative; display: block; border-radius: 8px; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; margin: 0 !important; }
.shot span { position: absolute; left: 6px; bottom: 6px; background: rgba(251, 247, 241, .92); color: var(--ink); border-radius: 999px; font-size: 11px; padding: 2px 8px; }

/* Studio welcome tour */
.welcome { position: fixed; inset: 0; background: rgba(59, 44, 38, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.welcome-card { background: var(--surface); border-radius: 16px; padding: 28px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
