:root {
  --ink: #111111;
  --muted: #757575;
  --line: #dedbd5;
  --paper: #f3f1ec;
  --white: #ffffff;
  --accent: #ef8aae;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

button, input, select { font: inherit; }
button { color: inherit; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid #292929;
}

.brand {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .14em;
}

.brand span { color: var(--accent); font-size: 27px; letter-spacing: -.05em; vertical-align: -3px; margin-right: 8px; }
.step { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #aaa; }
.step span { color: var(--accent); margin-right: 8px; }

.studio { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr) 410px; }

.preview { padding: 44px clamp(24px, 5vw, 76px) 32px; }
.preview-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; max-width: 820px; margin: 0 auto 20px; }
.eyebrow, .label { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.preview h1 { margin: 7px 0 0; font-size: clamp(34px, 5vw, 68px); font-weight: 600; letter-spacing: -.055em; line-height: .95; }
.view-name { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; }

.canvas-shell { position: relative; max-width: min(820px, 72vh); margin: 0 auto; background: var(--white); overflow: hidden; cursor: grab; touch-action: pan-y; }
.canvas-shell:active { cursor: grabbing; }
canvas { display: block; width: 100%; height: auto; }
.drag-hint { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); margin: 0; padding: 7px 11px; background: rgba(255,255,255,.84); color: #777; font-size: 9px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }

.view-controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }
.round { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #bbb; background: transparent; cursor: pointer; }
.view-dots { display: flex; gap: 8px; }
.view-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #b9b6b0; cursor: pointer; transition: width .2s, border-radius .2s, background .2s; }
.view-dot.active { width: 24px; border-radius: 8px; background: var(--ink); }

.panel { background: var(--white); border-left: 1px solid var(--line); padding: 34px; overflow: auto; }
.panel-title, .label-row, .number-row, .r-control { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.text-button, .remove-image { border: 0; padding: 0; background: transparent; text-decoration: underline; font-size: 9px; letter-spacing: .11em; cursor: pointer; }
.control-group { padding: 24px 0; border-bottom: 1px solid var(--line); }
.control-group label > .label, .control-group > .label { display: block; margin-bottom: 12px; }
select, input[type="text"] { width: 100%; height: 48px; border: 1px solid #c9c6c0; border-radius: 0; background: #fff; padding: 0 13px; }
.microcopy, .save-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.upload { min-height: 76px; border: 1px dashed #aaa; display: flex; align-items: center; gap: 15px; padding: 14px; cursor: pointer; }
.upload-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); font-size: 20px; }
.upload strong, .upload small { display: block; }
.upload strong { font-size: 10px; letter-spacing: .09em; }
.upload small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.remove-image { display: block; margin-top: 10px; color: #a52222; }
.remove-image[hidden] { display: none; }

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.number-row > input { flex: 1; }
.color-field { min-width: 95px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
input[type="color"] { width: 100%; height: 27px; display: block; margin-top: 5px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.locked { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.r-control { margin-top: 15px; }
.r-preview { color: var(--accent); font-weight: 800; font-size: 42px; line-height: 1; letter-spacing: -.1em; }

.nudge-grid { display: grid; grid-template-columns: repeat(4, 42px); gap: 6px; }
.nudge-grid button { height: 38px; border: 1px solid #c9c6c0; background: #fff; cursor: pointer; }
.primary { width: 100%; height: 54px; margin-top: 26px; border: 0; background: var(--ink); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .14em; cursor: pointer; }
.primary:hover { background: #2a2a2a; }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { width: 100%; height: 46px; margin-top: 10px; border: 1px solid var(--ink); background: #fff; color: var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .13em; cursor: pointer; }
.price-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 25px; }
.price-summary p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.price-summary strong { font-size: 28px; letter-spacing: -.04em; }
.cart-status { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.cart-status.error { color: #a52222; }

body.embedded .topbar { display: none; }
body.embedded .studio { min-height: 100vh; }
body.embedded .preview { padding-top: 28px; }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .preview { padding: 32px 18px 24px; }
}

@media (max-width: 500px) {
  .topbar { height: 60px; padding: 0 17px; }
  .step { display: none; }
  .preview h1 { font-size: 40px; }
  .panel { padding: 25px 20px; }
  .two-cols { grid-template-columns: 1fr; }
}
