.order-page {
  padding: 28px 0 48px;
}

.order-intro {
  margin-bottom: 22px;
}

.order-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}

.order-intro p {
  margin: 0;
  max-width: 40rem;
  color: var(--cream-dim);
}

.order-grid {
  display: grid;
  gap: 18px;
}

.order-page .card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.order-page .card h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--cream);
}

.previews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pv {
  position: relative;
  text-align: center;
}

.pv canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #e8dccb;
  touch-action: none;
}

.pv .lbl {
  margin-top: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.hint,
.desc,
.opt,
.each,
.seller {
  color: var(--cream-dim);
  font-size: 0.92rem;
}

.hint { margin-top: 10px; }
.desc { margin-top: 6px; }

.order-page label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 14px 0 4px;
}

.order-page select,
.order-page input,
.order-page textarea {
  width: 100%;
  font: inherit;
  color: var(--cream);
  background: #1a1916;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
}

.order-page textarea {
  resize: vertical;
  min-height: 58px;
}

.order-page select:focus,
.order-page input:focus,
.order-page textarea:focus {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.order-page .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#fontSel {
  font-size: 1.05rem;
  line-height: 1.3;
}

.price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.price .tot {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.8rem;
  color: var(--cream);
}

.order-page .note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090909;
}

button.submit {
  margin-top: 16px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
  font: 700 0.95rem system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

button.submit:hover { background: #fff8ec; }
button.submit:disabled { opacity: 0.6; cursor: wait; }
button.submit:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.msg {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  display: none;
}

.msg.ok {
  display: block;
  background: #1c2a1e;
  border: 1px solid #8fbf96;
  color: var(--cream);
}

.msg.err {
  display: block;
  background: #2a1c1c;
  border: 1px solid #e0a0a0;
  color: var(--cream);
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.photo-item { width: 92px; text-align: center; cursor: pointer; }
.photo-item img,
.photo-item .ph {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #e8dccb;
  display: block;
}
.photo-item .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--ink);
  padding: 6px;
}
.photo-item .nm {
  font-size: 0.75rem;
  color: var(--cream-dim);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-item.sel img,
.photo-item.sel .ph { box-shadow: 0 0 0 2px var(--cream); }

.photo-tools {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.photo-tools input[type="range"] { padding: 0; accent-color: var(--cream); }
.lock {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  cursor: pointer;
}
.lock input { width: auto; margin: 0; }

.modes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.modes button {
  flex: 1 1 40%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.modes button.on { box-shadow: inset 0 0 0 2px var(--cream); }

canvas.drag { cursor: grab; }
canvas.dragging { cursor: grabbing; }
.hidden { display: none !important; }

@media (max-width: 520px) {
  .order-page .row { grid-template-columns: 1fr; }
}

@media (min-width: 860px) {
  .order-grid { grid-template-columns: 1.05fr 1fr; align-items: start; }
}

/* ----- design editor ----- */
.pv canvas { touch-action: none; -webkit-user-select: none; user-select: none; outline: none; }
.pv canvas:focus-visible { box-shadow: 0 0 0 2px var(--cream); }
.pv-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pv-tools button, .layer-panel .modes button {
  flex: 1 1 40%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line);
  background: transparent; color: var(--cream); border-radius: 4px; cursor: pointer; font: inherit;
}
.pv-tools button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--cream); }
.layer-panel { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.layer-list { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-list .chip {
  min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #1a1916; color: var(--cream); font: inherit; font-size: 0.86rem; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.layer-list .chip.on { box-shadow: inset 0 0 0 2px var(--cream); background: #262420; }
.layer-edit { margin-top: 8px; }
.layer-edit input[type="range"] { padding: 0; accent-color: var(--cream); width: 100%; }
.layer-edit .val { font-weight: 400; color: var(--cream-dim); margin-left: 4px; }
.layer-panel .modes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.layer-panel .modes button { flex: 1 1 28%; }
.layer-panel .modes button.on { box-shadow: inset 0 0 0 2px var(--cream); }
.warn { margin: 10px 0 0; padding: 8px 10px; border-radius: 4px; background: rgba(196,18,48,0.18); color: #ffd9d9; font-size: 0.9rem; }

.sample-note {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--cream-dim);
  background: rgba(243, 234, 216, 0.06);
  color: var(--cream-dim);
  font-size: 0.86rem;
  line-height: 1.45;
}
.upload-row { display: flex; align-items: center; gap: 8px; }
.upload-row input[type=file] { flex: 1 1 auto; min-width: 0; }
.photo-x {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-width: 44px; min-height: 44px; padding: 0 14px;
  border-radius: 22px;
  border: 1px solid #ff9d9d;
  background: #5a1a22;
  color: #fff;
  font: inherit; font-size: 0.92rem; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer;
}
.photo-x span { font-size: 1.05rem; }
.photo-x:hover, .photo-x:focus-visible { background: #7a2430; }
.order-page .photo-x[hidden], .photo-x[hidden] { display: none !important; }
.lock { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 0.9rem; cursor: pointer; }
.order-page .lock input[type="checkbox"] { width: 20px; height: 20px; padding: 0; margin: 0; accent-color: var(--cream); }
.chip-group { display: inline-flex; align-items: stretch; }
.chip-group .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-x {
  border: 1px solid var(--line); border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #1a1916; color: #ffb3b3; min-height: 38px;
  padding: 0 10px; font-size: 0.85rem; cursor: pointer;
}
.photo-item .ph { font-size: 0.7rem; text-align: center; line-height: 1.2; }

/* two-sided photos: one photo per side, each with its own "Photo for" picker and remove X */
.photo-side-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.photo-side-btn {
  width: auto; min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 1px solid var(--line); background: #1a1916; color: var(--cream);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.photo-side-btn:hover, .photo-side-btn:focus-visible { background: #262420; }
.photo-side-hint { margin: 0 0 8px; }
.photo-item { width: 132px; position: relative; }
.photo-item img, .photo-item .ph { width: 132px; height: 112px; }
.photo-item-x {
  position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; min-height: 30px; padding: 0;
  border-radius: 50%; border: 1px solid #ff9d9d; background: #5a1a22; color: #fff;
  font-size: 0.9rem; line-height: 1; cursor: pointer; z-index: 1;
}
.photo-item-x:hover, .photo-item-x:focus-visible { background: #7a2430; }
.photo-item .pfor { display: block; font-size: 0.72rem; color: var(--cream-dim); margin: 4px 0 0; text-align: left; }
.order-page .photo-item select.photo-for { width: 100%; margin-top: 2px; padding: 6px 4px; font-size: 0.8rem; min-height: 36px; }
.photo-item .pnote { font-size: 0.7rem; color: #ffcf8a; margin-top: 3px; line-height: 1.25; text-align: left; }

/* text shape picker (straight, arches, side curves, circle): 3 big buttons per row, 2 on narrow phones */
.layer-panel .shape-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.layer-panel .shape-modes button { min-height: 52px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 0.86rem; line-height: 1.1; }
.layer-panel .shape-modes .sh-ic { font-size: 1.25rem; line-height: 1; }
#lyBendWrap { margin-top: 8px; }
.shape-hint { margin: 6px 0 0; }
@media (max-width: 360px) { .layer-panel .shape-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- multi-item order (cart), v10 ---------- */
button.add-line {
  margin-top: 14px; width: 100%; min-height: 50px;
  border: 1px solid var(--cream); border-radius: 4px; background: transparent; color: var(--cream);
  font: 700 0.92rem system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.04em; cursor: pointer;
}
button.add-line:hover { background: rgba(243, 234, 216, 0.08); }
button.add-line:disabled { opacity: 0.6; cursor: wait; }
button.add-line.ghost { border-color: var(--line); min-height: 44px; margin-top: 8px; font-weight: 600; }
.cart-hint { font-size: 0.88rem; }
.cart { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #090909; }
.cart h3 { margin: 0 0 8px; font-size: 1.05rem; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-line { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raised); }
.cart-line.editing { border-color: var(--cream); box-shadow: inset 0 0 0 1px var(--cream); }
.cart-line img, .cart-line .cl-noimg { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 4px; object-fit: cover; background: #1a1916; }
.cart-line .cl-noimg { display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--cream-dim); text-align: center; }
.cl-main { flex: 1 1 auto; min-width: 0; }
.cl-name { font-weight: 700; color: var(--cream); }
.cl-opt { font-weight: 400; color: var(--cream-dim); font-size: 0.88rem; }
.cl-text { font-size: 0.86rem; color: var(--cream-dim); margin-top: 3px; overflow-wrap: anywhere; }
.cl-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-top: 8px; }
.cl-q { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.88rem; }
.cl-q input.cl-qty { width: 64px; min-height: 38px; padding: 4px 8px; margin: 0; }
.cl-price { font-size: 0.92rem; }
.cl-btns { display: flex; gap: 8px; margin-top: 8px; }
.cl-btns button, .msg-btns button {
  min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px;
  background: transparent; color: var(--cream); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.cl-btns button:hover, .msg-btns button:hover { border-color: var(--cream); }
.cl-editing { margin-top: 8px; font-size: 0.85rem; font-weight: 700; color: var(--cream); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-weight: 700; }
.cart-total .tot { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-size: 1.6rem; color: var(--cream); }
.msg-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.done-list { margin: 8px 0; padding-left: 20px; }
@media (max-width: 420px) {
  .cart { padding: 10px; }
  .cart-line { gap: 10px; padding: 8px; }
  .cart-line img, .cart-line .cl-noimg { width: 56px; height: 56px; flex-basis: 56px; }
}
