/* Print Studio styles (architecture.md §41). Reuses the photobooth design tokens +
   base component classes (.scene, .btn, .code, .swatch, #toast…) from app.css and
   adds the editor system: mockup stage, tool rail, options panel, element handles,
   the AI snap modal, and the order sheet. Pastel, near-sharp corners, minimal words. */

.start-tagline { color: var(--ink-soft); font-size: 15px; text-align: center; max-width: 38ch; }

/* ============ EDITOR shell ============ */
.editor-scene { max-width: none; width: 100%; height: 100dvh; padding: 0; gap: 0; display: flex; flex-direction: column; }

.ed-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.ed-brand { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 15px; }
.ed-spacer { flex: 1; }
.ed-variants { display: flex; gap: 6px; }
.ed-vtab {
  padding: 7px 12px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--line);
  border-radius: var(--r-ctrl); background: var(--paper-raised); white-space: nowrap;
}
.ed-vtab.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ed-products { display: flex; gap: 4px; }
.ed-ptab {
  padding: 7px 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--line); border-radius: var(--r-ctrl); background: var(--paper-raised); color: var(--ink-soft);
}
.ed-ptab.is-on { border-color: var(--pink); color: var(--pink); background: #fff6f9; }
.ed-top-btn {
  padding: 7px 12px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--line);
  border-radius: var(--r-ctrl); background: var(--paper-raised);
}
.ed-top-btn:hover { border-color: var(--ink); }
.ed-order-btn {
  padding: 9px 18px; font-size: 13.5px; font-weight: 800; color: #fff; border: 0;
  border-radius: var(--r-ctrl); background: linear-gradient(120deg, var(--pink), var(--blue));
  box-shadow: 0 6px 16px rgba(213, 81, 134, 0.25);
}
.ed-order-btn:hover { transform: translateY(-1px); }

.ed-body { flex: 1; display: grid; grid-template-columns: 76px 1fr 300px; min-height: 0; }

/* ---- tool rail ---- */
.ed-rail {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 8px;
  border-right: 1px solid var(--line); background: var(--paper);
}
.ed-tool {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px; border: 1px solid transparent; border-radius: var(--r-ctrl);
  background: transparent; color: var(--ink-soft);
}
.ed-tool:hover { background: var(--paper-raised); }
.ed-tool.is-on { border-color: var(--ink); background: var(--paper-raised); color: var(--ink); }
.ed-tool-ic { font-size: 19px; line-height: 1; font-weight: 800; }
.ed-tool-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- stage ---- */
.ed-stage-wrap { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 14px; background: var(--paper-raised); overflow: hidden; }
.ed-stage { position: relative; height: 100%; max-height: 78vh; aspect-ratio: 400 / 480; max-width: 100%; }
.mockup { position: absolute; inset: 0; }
.mock-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 14px 30px rgba(23, 24, 28, 0.10)); }
.ed-area { position: absolute; touch-action: none; }
.ed-area::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1.5px dashed rgba(23, 24, 28, 0.14); border-radius: 2px;
}
.ed-area.is-drawing { cursor: crosshair; }
.ed-els { position: absolute; inset: 0; }
.ed-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 500; }

/* ---- elements ---- */
.ed-el { position: absolute; user-select: none; -webkit-user-select: none; touch-action: none; }
.ed-el.is-hidden { display: none; }
.ed-el.is-ghost { opacity: 0.18; pointer-events: none; filter: grayscale(0.6); }
.ed-el-img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ed-el-text { display: block; white-space: nowrap; text-align: center; line-height: 1.15; pointer-events: none; }
.ed-el .ed-h { display: none; position: absolute; z-index: 5; }
.ed-el.is-selected { outline: 1.5px solid var(--pink); outline-offset: 3px; }
.ed-el.is-selected .ed-h { display: grid; place-items: center; }
.ed-h {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink);
  font-size: 11px; font-weight: 800; box-shadow: 0 3px 8px rgba(23,24,28,.18); cursor: pointer;
}
.ed-h-del { top: -12px; right: -12px; color: #d6483b; border-color: #d6483b; }
.ed-h-rot { top: -12px; left: -12px; cursor: grab; }
.ed-h-rot::after { content: "⟳"; }
.ed-h-scale { bottom: -12px; right: -12px; cursor: nwse-resize; }
.ed-h-scale::after { content: "⤡"; }

/* ---- options panel ---- */
.ed-panel { padding: 14px; border-left: 1px solid var(--line); background: var(--paper); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ed-panel-head { display: flex; flex-direction: column; gap: 2px; }
.ed-panel-head b { font-family: var(--font-display); font-size: 15px; font-weight: 800; }
.ed-panel-head i { font-style: normal; font-size: 11.5px; color: var(--ink-soft); }
.ed-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-chip {
  padding: 7px 11px; font-size: 12px; font-weight: 700; border: 1px solid var(--line);
  border-radius: var(--r-ctrl); background: var(--paper-raised);
}
.ed-chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ed-chip-danger { color: #d6483b; border-color: #eeb9b3; }
.ed-colors { gap: 6px; }
.ed-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.ed-color.is-on { box-shadow: 0 0 0 2.5px var(--ink); transform: scale(1.12); }
.ed-slider { flex: 1; accent-color: var(--ink); }
.ed-size-dot { border-radius: 50%; background: var(--ink); flex: none; }
.ed-mini-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.ed-vpick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed var(--line); }
.ed-vpick-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.ed-text-input {
  width: 100%; padding: 11px 12px; font-size: 15px; border: 1.5px solid var(--line);
  border-radius: var(--r-ctrl); background: var(--paper-raised);
}
.ed-text-input:focus { outline: 0; border-color: var(--pink); }
.ed-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ed-font {
  padding: 10px 8px; font-size: 17px; border: 1.5px solid var(--line); border-radius: var(--r-ctrl);
  background: #fff; text-align: center; overflow: hidden; white-space: nowrap;
}
.ed-font.is-on { border-color: var(--pink); background: #fff6f9; }
.ed-add-btn {
  padding: 12px; font-size: 14px; font-weight: 800; color: var(--paper); background: var(--ink);
  border: 0; border-radius: var(--r-ctrl);
}
.ed-tray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-tray-item { padding: 6px; border: 1px solid var(--line); border-radius: var(--r-ctrl); background: #fff; }
.ed-tray-item:hover { border-color: var(--pink); transform: translateY(-1px); }
.ed-tray-item img { width: 100%; height: 44px; object-fit: contain; display: block; }
.ed-tray-strips { grid-template-columns: repeat(3, 1fr); }
.ed-tray-strip img { height: 84px; }
.ed-hint { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.ed-hint a { color: var(--pink); font-weight: 700; }
.ed-starters { display: flex; flex-direction: column; gap: 8px; }
.ed-starter {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-card); background: var(--paper-raised);
}
.ed-starter:hover { border-color: var(--pink); transform: translateY(-1px); }
.ed-starter b { font-family: var(--font-display); font-size: 14.5px; }
.ed-starter i { font-style: normal; font-size: 11.5px; color: var(--ink-soft); }
.ed-sel-info { display: flex; flex-direction: column; gap: 10px; }

/* mobile: rail becomes a bottom bar, panel slides under the stage */
@media (max-width: 860px) {
  .ed-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; }
  .ed-rail { flex-direction: row; justify-content: space-around; order: 3; border-right: 0; border-top: 1px solid var(--line); padding: 6px; }
  .ed-panel { order: 2; border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; }
  .ed-stage-wrap { order: 1; padding: 8px; }
  .ed-stage { max-height: none; height: auto; width: 100%; max-width: 380px; aspect-ratio: 400 / 480; }
  .ed-top { padding: 8px 10px; gap: 6px; }
  .ed-brand { display: none; }
}

/* ============ AI snap modal ============ */
.ai-overlay, .os-overlay {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(23, 24, 28, 0.45); backdrop-filter: blur(4px); padding: 14px;
}
.ai-modal, .os-sheet {
  position: relative; width: min(560px, 100%); max-height: 92dvh; overflow-y: auto;
  background: var(--paper); border-radius: var(--r-card); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 30px 80px rgba(23, 24, 28, 0.35);
}
.ai-x, .os-x {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--paper-raised); font-size: 13px; font-weight: 700; z-index: 2;
}
.ai-eyebrow, .os-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.ai-title, .os-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.ai-sub { margin: 0; font-size: 13px; color: var(--ink-soft); }
.ai-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-pane {
  position: relative; aspect-ratio: 1; border-radius: var(--r-card); overflow: hidden;
  background: #17181c; border: 2px solid var(--line);
}
.ai-pane.is-snapped { border-color: var(--pink); }
.ai-video, .ai-their { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-video { transform: scaleX(-1); }
.ai-pane.is-empty .ai-their { display: none; }
.ai-pane-tag {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; font-size: 11px; font-weight: 800;
  color: #fff; background: rgba(23, 24, 28, 0.55); border-radius: 999px; letter-spacing: 0.04em;
}
.ai-pane-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #9a958c; font-size: 12.5px; }
.ai-row { display: flex; justify-content: center; }
.ai-snap-btn {
  padding: 11px 22px; font-size: 14px; font-weight: 800; border: 0; border-radius: var(--r-ctrl);
  color: #fff; background: var(--ink);
}
.ai-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ai-style {
  display: flex; flex-direction: column; gap: 3px; padding: 8px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--r-card); background: #fff;
}
.ai-style img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.ai-style.is-on { border-color: var(--pink); box-shadow: 0 0 0 1.5px var(--pink); }
.ai-style b { font-size: 12px; font-weight: 800; }
.ai-style i { font-style: normal; font-size: 10px; color: var(--ink-soft); }
.ai-wish {
  width: 100%; padding: 10px 12px; font-size: 13.5px; border: 1.5px solid var(--line);
  border-radius: var(--r-ctrl); background: var(--paper-raised);
}
.ai-quota { margin: 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.ai-gen-btn {
  padding: 13px; font-size: 15px; font-weight: 800; border: 0; border-radius: var(--r-ctrl);
  color: #fff; background: linear-gradient(120deg, var(--pink), var(--blue));
}
.ai-gen-btn:disabled { opacity: 0.55; }
.ai-result { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ai-result-img { width: min(300px, 80%); border-radius: var(--r-card); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.ai-place-btn { padding: 11px 20px; font-size: 14px; font-weight: 800; border: 0; border-radius: var(--r-ctrl); color: #fff; background: var(--ink); }
.ai-error { color: #d6483b; font-size: 13px; font-weight: 600; text-align: center; }
.ai-loading { display: flex; gap: 8px; padding: 26px; }
.ai-loading-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); animation: ai-bounce 1s ease-in-out infinite; }
.ai-loading-dot:nth-child(2) { background: var(--blue); animation-delay: 0.15s; }
.ai-loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-bounce { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-9px); opacity: 1; } }

/* ============ order sheet ============ */
.os-sheet { width: min(640px, 100%); }
.os-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.os-preview { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.os-preview-img { width: 100%; aspect-ratio: 3 / 4; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); display: grid; place-items: center; overflow: hidden; }
.os-preview-img img { width: 100%; height: 100%; object-fit: contain; }
.os-products { display: flex; flex-direction: column; gap: 10px; }
.os-product { border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px 12px; background: var(--paper-raised); }
.os-product-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.os-product-head b { font-family: var(--font-display); font-size: 15px; }
.os-price { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.os-line { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.os-owner { font-size: 12.5px; font-weight: 800; min-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-owner.is-a { color: var(--pink); }
.os-owner.is-b { color: var(--blue); }
.os-size { padding: 6px 8px; font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--r-ctrl); background: #fff; }
.os-size-one { font-size: 11.5px; color: var(--ink-soft); }
.os-qty { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.os-qbtn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 800; }
.os-qty-num { font-family: var(--font-mono); font-weight: 700; min-width: 16px; text-align: center; }
.os-addr { display: flex; flex-direction: column; gap: 8px; }
.os-addr-head { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.os-split { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 6px 0; }
.os-split i { font-style: normal; color: var(--ink-soft); }
.os-couriers { display: flex; flex-direction: column; gap: 6px; }
.os-courier {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--r-ctrl); background: #fff; font-size: 12.5px;
}
.os-courier.is-on { border-color: var(--ink); }
.os-courier b { font-weight: 800; }
.os-courier span { color: var(--ink-soft); }
.os-courier-price { margin-left: auto; font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.os-summary { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.os-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-soft); }
.os-row span:last-child { font-family: var(--font-mono); color: var(--ink); }
.os-row.is-total { font-weight: 800; font-size: 15px; color: var(--ink); }
.os-hint { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.os-note { margin: 0; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.os-note.is-err { color: #d6483b; font-weight: 600; }
.os-pay {
  padding: 14px; font-size: 15px; font-weight: 800; border: 0; border-radius: var(--r-ctrl);
  color: #fff; background: linear-gradient(120deg, var(--pink), var(--blue));
}
.os-pay:disabled { opacity: 0.5; }
.os-secure { margin: 0; font-size: 11.5px; color: var(--ink-soft); text-align: center; }
