:root {
  --cream: #f4eee6; --ink: #262422; --terra: #b85c40; --sage: #8e9e82;
  --line: #e2d9cc; --muted: #7b736a;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head: 'Cormorant Garamond', Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--ui); color: var(--ink); background: var(--cream); }
button { font: inherit; cursor: pointer; }

.top { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: #fbf8f3; }
.brand { font: 600 22px var(--head); letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand img { height: 36px; width: auto; }
.loginLogo { display: block; height: 63px; width: auto; margin: 0 auto 10px; }
.brand span { color: var(--terra); }
.order { font-size: 13px; color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100% - 56px); }

/* ---------- sahne ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-height: 0; }
.viewSwitch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.viewSwitch button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.viewSwitch button.on { background: var(--ink); color: #fff; }

.wall { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 25%, #fbf8f3 0%, #efe7dc 60%, #e4d9ca 100%); }
.wall.room { align-items: flex-end; background:
  linear-gradient(to bottom, transparent 0 calc(100% - 64px), #cbb79d calc(100% - 64px) calc(100% - 60px), #b8a183 calc(100% - 60px)),
  radial-gradient(110% 80% at 40% 20%, #f6f0e7, #e7dccd); }

.piece { position: relative; transition: width .25s ease, height .25s ease; }
.frame { position: absolute; inset: 0; padding: var(--fw, 0); background: var(--frameBg, transparent);
  box-shadow: var(--shadow, 0 10px 28px rgba(38, 36, 34, .22), 0 2px 6px rgba(38, 36, 34, .18)); }
.mat { width: 100%; height: 100%; background: #fff; padding: var(--mw, 0); box-shadow: var(--inner, none); }
.art { width: 100%; height: 100%; position: relative; overflow: hidden; background: #ddd; }
.art > svg, .art > img { display: block; width: 100%; height: 100%; }
.art > img { object-fit: fill; }

/* çerçeve renkleri (Gelato): profil ~0.8″ */
.f-black   { --frameBg: linear-gradient(135deg, #1d1d1d, #050505 45%, #151515); --inner: inset 0 0 0 1px rgba(0,0,0,.35), inset 0 2px 5px rgba(0,0,0,.35); }
.f-white   { --frameBg: linear-gradient(135deg, #ffffff, #f1f0ec 50%, #fbfaf7); --inner: inset 0 0 0 1px rgba(0,0,0,.08), inset 0 2px 5px rgba(0,0,0,.14); }
.f-natural { --frameBg: repeating-linear-gradient(92deg, rgba(120,82,40,.10) 0 2px, transparent 2px 7px), linear-gradient(135deg, #ead6b7, #dcc09a 50%, #e8d2b0); --inner: inset 0 0 0 1px rgba(80,50,20,.25), inset 0 2px 5px rgba(60,40,10,.25); }
.f-darkwood{ --frameBg: repeating-linear-gradient(91deg, rgba(0,0,0,.18) 0 2px, transparent 2px 6px), linear-gradient(135deg, #4b2a12, #321a08 50%, #452610); --inner: inset 0 0 0 1px rgba(0,0,0,.4), inset 0 2px 5px rgba(0,0,0,.4); }
.f-unframed { --shadow: 0 6px 16px rgba(38, 36, 34, .18), 0 1px 3px rgba(38, 36, 34, .2); }
.f-lamp    { --shadow: 0 10px 30px rgba(20, 24, 40, .35); }
.piece.lamp .art { background: radial-gradient(120% 100% at 50% 40%, #1c2236, #0b0d14); color: #fff; }
.f-canvas  { --shadow: 6px 12px 22px rgba(38, 36, 34, .30); }

/* kanvas yan kenarı (0.75″ ayna sarma) */
.edge { display: none; position: absolute; top: 0; right: calc(-1 * var(--depth, 10px)); width: var(--depth, 10px); height: 100%;
  transform-origin: left center; transform: perspective(500px) rotateY(58deg); overflow: hidden; filter: brightness(.62); }
.edge img, .edge svg { position: absolute; right: 0; top: 0; height: 100%; transform: scaleX(-1); transform-origin: center; }
.f-canvas ~ .edge, .piece.canvas .edge { display: block; }

.sofa { display: none; position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); background: url('sofa.svg') center bottom / contain no-repeat; }
.wall.room .sofa { display: block; }

.busy { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.busy span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(38,36,34,.15); border-top-color: var(--terra); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.caption { margin: 0; padding: 10px 18px 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- panel ---------- */
.panel { display: flex; flex-direction: column; min-height: 0; background: #fbf8f3; border-left: 1px solid var(--line); }
.steps { display: flex; gap: 4px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); }
.steps button { flex: 1; border: 0; background: none; padding: 10px 4px 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.steps button.on { color: var(--ink); border-bottom-color: var(--terra); font-weight: 600; }
.pane { display: none; flex: 1; overflow: auto; padding: 18px 20px 24px; }
.pane.on { display: block; }
h2 { font: 600 26px/1.15 var(--head); margin: 0 0 14px; }
h3 { font: 600 19px var(--head); margin: 20px 0 10px; }

.kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.kinds button, .chips button, .opt { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 13px; font-size: 13px; }
.kinds button.on, .chips button.on, .opt.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips small { opacity: .65; margin-left: 4px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; text-align: left; font-size: 12px; line-height: 1.25; }
.card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; background: #eee; margin-bottom: 6px; }
.card.on { border-color: var(--terra); box-shadow: 0 0 0 2px var(--terra); }

.field { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); position: relative; }
.field input, .field textarea, .field select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 15px var(--ui); color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--sage); border-color: var(--sage); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note { font-size: 12px; color: var(--muted); margin: 0; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 2px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.suggest li:hover, .suggest li.on { background: var(--cream); }

.group { margin-bottom: 16px; }
.group > b { display: block; font-size: 13px; margin-bottom: 7px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw.on { box-shadow: 0 0 0 2px var(--terra); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; aspect-ratio: 3 / 4; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button.on { box-shadow: 0 0 0 2px var(--terra); }
.typeOpts { grid-column: 1 / -1; }
.thumbs .plain { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.range { width: 100%; accent-color: var(--terra); }
.eventRow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.eventRow input { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--ui); }
.eventRow button { padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }

.finishes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.finish { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px 8px; font-size: 12px; text-align: center; }
.finish i { display: block; width: 38px; height: 46px; margin: 0 auto 6px; border: 5px solid var(--c); background: #f4f1ea; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.finish.on { border-color: var(--terra); box-shadow: 0 0 0 2px var(--terra); }
.finish:disabled { opacity: .4; cursor: not-allowed; }

.cta { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.cta button { flex: 1; padding: 12px; border-radius: 8px; font-weight: 600; }
.primary { border: 0; background: var(--terra); color: #fff; }
.primary:hover { background: #a24f36; }
.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }

dialog { border: 0; border-radius: 12px; padding: 22px; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(38, 36, 34, .45); }
dialog .approveArt { display: flex; justify-content: center; margin: 12px 0; }
dialog .approveArt > * { display: block; max-width: 100%; height: 52vh; width: auto; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
dialog .cta { padding: 12px 0 0; border: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 48vh auto; height: auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .pane { overflow: visible; }
}

/* Round (saat/kolye): şeffaf tuval, gölge diskin kendisine */
.f-round { --shadow: none; }
.piece.round .mat, .piece.round .art { background: transparent; }
.piece.round .art > svg { filter: drop-shadow(0 6px 14px rgba(38, 36, 34, .28)); }
.art .hint { display: grid; place-items: center; height: 100%; margin: 0; padding: 20px; text-align: center; color: #cfd3e0; font-size: 14px; }
dialog .err { color: #b85c40; min-height: 1.4em; margin: 6px 0 0; }
#tsBox { margin-top: 12px; min-height: 65px; }
.done { margin: 6px auto 0; max-width: 560px; text-align: center; font-weight: 600; color: var(--terra); }
