:root {
  /* AESTIVRA: quiet gallery whites, deep black, one warm champagne detail. */
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6e6e73;
  --line: #e6e3de;
  --accent: #111111;      /* buttons, selections */
  --accent-ink: #ffffff;
  --stage: #f1efeb;
  --gold: #a88b5c;        /* small details only */
  --night: #0c0c0c;       /* dark sections, fixed in both themes */
  --night-ink: #f3f1ed;
  --night-muted: #a1a1a6;
  --focus: #2563eb;
  --radius: 18px;
  --display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f; --panel: #171717; --ink: #f3f1ed; --muted: #a1a1a6; --line: #2b2b2b;
    --accent: #f3f1ed; --accent-ink: #111111; --stage: #1c1c1c; --gold: #c8ab7c; --focus: #60a5fa; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f0f; --panel: #171717; --ink: #f3f1ed; --muted: #a1a1a6; --line: #2b2b2b;
  --accent: #f3f1ed; --accent-ink: #111111; --stage: #1c1c1c; --gold: #c8ab7c; --focus: #60a5fa; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel);
}

.designer {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
  gap: 24px; max-width: 1180px; margin: 0 auto; padding: 24px;
}
.stage {
  position: sticky; top: 16px; align-self: start;
  background: var(--stage); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.view-tabs { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.view-tabs button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
.view-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.canvas-wrap {
  position: relative;
  background: radial-gradient(ellipse at 50% 40%, var(--panel) 0%, var(--stage) 70%);
  border-radius: 10px;
  width: 100%; height: min(68vh, 640px); display: grid; place-items: center;
  perspective: 1100px; overflow: hidden; touch-action: none;
}
.canvas-wrap.actual { overflow: auto; height: auto; min-height: 300px; }
.three { position: absolute; inset: 0; }
.three canvas { display: block; cursor: grab; touch-action: none; }
.three canvas:active { cursor: grabbing; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tilt { transition: transform .15s ease-out; transform-style: preserve-3d; will-change: transform; }
#preview { display: block; cursor: grab; }
#preview.dragging { cursor: grabbing; }
.stage-hint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.stage-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.res-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #78350f; }
.res-badge.ok { background: #dcfce7; color: #14532d; }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; }
.step[open] { padding-bottom: 18px; }
.step summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-weight: 650; padding: 12px 0;
}
.step summary::-webkit-details-marker { display: none; }
.step summary em { margin-left: auto; font-style: normal; font-weight: 400; font-size: 13px; color: var(--muted); text-align: right; }
.n {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 12px; flex: none;
}

.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left;
  border: 1.5px solid var(--line); background: transparent; border-radius: 10px; padding: 12px 14px; cursor: pointer;
}
.choice small { color: var(--muted); grid-column: 1; }
.choice b { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 550; }
.field small { font-weight: 400; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 10px; margin-top: 8px; }
.field.inline input { flex: 1; }
select, input[type="text"], textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
}
textarea { resize: vertical; }
.count { align-self: flex-end; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--panel); cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.swatch.clear { background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 50% / 10px 10px !important; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1.5px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 400;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); }

.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.drop span { font-size: 13px; color: var(--muted); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.row select { width: auto; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check b { margin-left: auto; font-weight: 500; }

button.ghost { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
button.small { font-size: 13px; padding: 5px 10px; }
button.primary {
  width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px;
}
button.primary:disabled { opacity: .6; cursor: progress; }

.ship { display: grid; gap: 6px; }
.ship label { display: flex; gap: 8px; align-items: center; font-weight: 400; cursor: pointer; }
.ship label b { margin-left: auto; font-weight: 500; }
.lines { list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.lines li { display: flex; justify-content: space-between; padding: 3px 0; }
.total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.error { color: #dc2626; font-size: 14px; min-height: 1em; margin: 8px 0 0; }

/* Simple pages (success, order status) */
.page { max-width: 560px; margin: 40px auto; padding: 0 16px; text-align: center; }
.page img { max-width: 220px; margin: 20px auto; display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

@media (max-width: 860px) {
  .designer { grid-template-columns: 1fr; padding: 12px 16px; gap: 14px; }
  .stage { position: relative; top: 0; }
  .canvas-wrap { height: 52vh; }
  .top { padding: 12px 16px; }
}

[hidden] { display: none !important; }

/* Reserve step */
.reserved { margin-top: 16px; padding: 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.reserved h3 { margin: 0 0 6px; }
input[type="email"] { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.legal { max-width: 720px; margin: 32px auto; padding: 0 16px; }
.legal h1 { letter-spacing: -0.02em; }
.legal h2 { font-size: 17px; margin-top: 24px; }
