/* ─────────────────────────────────────────────────────────────
   bosma — design system + layout
   ───────────────────────────────────────────────────────────── */

:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --accent: #C8F03C;
  --accent-hover: #D7F76E;
  --accent-ink: #12140A;
  --sel: #3D7BFF;
  --guide: #FF3DA6;
  --danger: #FF5A4E;
  --warn: #FFB020;
  --ok: #2FBF71;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root,
:root[data-theme="dark"] {
  --bg: #0E0F11;
  --surface: #16171A;
  --surface-2: #1D1F23;
  --surface-3: #26282D;
  --line: #2A2D33;
  --line-2: #383B42;
  --text: #F2F3F5;
  --muted: #9A9EA7;
  --faint: #6B707A;
  --stage: #121316;
  --grid: rgba(255, 255, 255, .035);
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --garment-shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F3F3F0;
  --surface: #FFFFFF;
  --surface-2: #F5F5F2;
  --surface-3: #EBEBE6;
  --line: #E3E3DD;
  --line-2: #D2D2CA;
  --text: #121316;
  --muted: #5F636B;
  --faint: #8E929A;
  --stage: #E8E8E3;
  --grid: rgba(0, 0, 0, .045);
  --shadow: 0 24px 60px rgba(20, 20, 10, .16);
  --garment-shadow: rgba(40, 40, 20, .22);
  color-scheme: light;
}

/* ── base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; }
.ic--sm { width: 14px; height: 14px; }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn--accent:disabled { opacity: .45; }
.btn--outline { background: var(--surface-2); border-color: var(--line-2); }
.btn--outline:hover { border-color: var(--text); }
.btn--ghost { border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn--lg { height: 52px; font-size: 15px; border-radius: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s;
}
.link-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn .ic { width: 18px; height: 18px; }

.text-link {
  font-size: 13px; font-weight: 600; color: var(--text);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2);
}
.text-link:hover { text-decoration-color: var(--text); }

/* ── top bar ──────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 20px;
  height: 60px; padding: 0 16px 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.logo {
  display: inline-flex; align-items: baseline; gap: 3px;
  font: 700 22px/1 var(--font-display); letter-spacing: -.03em; text-decoration: none;
}
.logo__dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.topbar__tagline { color: var(--muted); font-size: 14px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.menu { position: relative; }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
  display: none;
}
.menu.open .menu__list { display: block; }
.menu__list button {
  width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
}
.menu__list button:hover { background: var(--surface-2); }
.menu__list button[aria-checked="true"] { background: var(--surface-3); }

:root[data-theme="dark"] .theme-btn__moon,
:root[data-theme="light"] .theme-btn__sun { display: none; }

/* ── app layout ───────────────────────────────────────────── */
.page-app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }

/* ── stage ────────────────────────────────────────────────── */
.stage {
  position: relative; min-height: 0;
  display: flex; flex-direction: column;
  background-color: var(--stage);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  overflow: hidden;
}
.stage__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 0;
  position: relative; z-index: 3;
}
.stage__right { display: flex; align-items: center; gap: 8px; }
.stage__history { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px; }
.stage__viewport { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }

.garment { position: relative; }
.garment__art { position: absolute; inset: 0; filter: drop-shadow(0 24px 30px var(--garment-shadow)); }
.garment__art svg { width: 100%; height: 100%; }

.print-area {
  position: absolute;
  touch-action: none; user-select: none; -webkit-user-select: none;
  outline: 1px dashed rgba(0, 0, 0, .28); outline-offset: 0;
  --on: rgba(0, 0, 0, .72);
  --on-muted: rgba(0, 0, 0, .45);
}
.print-area.on-dark { outline-color: rgba(255, 255, 255, .3); --on: rgba(255, 255, 255, .9); --on-muted: rgba(255, 255, 255, .5); }
.print-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.print-area__label {
  position: absolute; left: -40px; right: -40px; bottom: 100%;
  padding-bottom: 4px; text-align: center;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--on-muted);
  white-space: nowrap; pointer-events: none;
}

.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 8px; text-align: center;
}
.empty__main { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.empty__hint { font-size: 11px; line-height: 1.3; color: var(--on-muted); max-width: 22ch; }
.empty .btn--ghost { color: var(--on); border-color: var(--on-muted); background: transparent; }
.empty .btn--ghost:hover { background: rgba(127, 127, 127, .12); }
.is-short .empty__hint { display: none; }
.is-short .empty { flex-direction: row; flex-wrap: wrap; }
.empty.pulse { animation: pulse .6s var(--ease); }
@keyframes pulse { 30% { transform: scale(1.06); } 60% { transform: scale(.98); } }

.guide { position: absolute; background: var(--guide); pointer-events: none; }
.guide--v { left: 50%; top: 0; bottom: 0; width: 1px; }
.guide--h { top: 50%; left: 0; right: 0; height: 1px; }

.sel {
  position: absolute;
  border: 1.5px solid var(--sel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5);
  cursor: move;
}
.h {
  position: absolute; width: 28px; height: 28px; margin: -14px;
  display: grid; place-items: center;
  border-radius: 50%; background: #fff; color: #111;
  border: 1.5px solid var(--sel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.h .ic { width: 14px; height: 14px; }
.h-del { left: 0; top: 0; background: var(--danger); border-color: var(--danger); color: #fff; }
.h-rot { right: 0; top: 0; cursor: grab; }
.h-scale { right: 0; bottom: 0; cursor: nwse-resize; }
.sel.is-small .h-del { left: -12px; top: -12px; }
.sel.is-small .h-rot { right: -12px; top: -12px; }
.sel.is-small .h-scale { right: -12px; bottom: -12px; }
@media (pointer: coarse) {
  .h { width: 34px; height: 34px; margin: -17px; }
}

/* 3D view */
.view3d {
  position: absolute; inset: 0; z-index: 1;
  display: none;
  touch-action: none;
}
.view3d canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.view3d canvas:active { cursor: grabbing; }
.is-3d .view3d { display: block; }
.is-3d .stage__viewport { visibility: hidden; }
.is-3d .stage__history { display: none; }
.view3d__hint {
  position: absolute; left: 0; right: 0; bottom: 16px; padding: 0 16px;
  text-align: center; font-size: 12px; font-weight: 600; color: var(--muted);
  pointer-events: none;
}
.view3d__loading {
  position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 12px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.is-loading-3d .view3d__loading { display: grid; }
.is-loading-3d .view3d__hint { display: none; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { rotate: 360deg; } }

.drop-overlay {
  position: absolute; inset: 12px; z-index: 6;
  display: none; place-items: center;
  border: 2px dashed var(--accent); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  pointer-events: none;
  font: 700 18px var(--font);
}
.drop-overlay > div { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); }
.is-dropping .drop-overlay { display: grid; }

/* ── panel ────────────────────────────────────────────────── */
.panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-left: 1px solid var(--line);
}
.panel__scroll { flex: 1; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.block + .block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block__head .block__title { margin: 0; }
.block__title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.block__value { font-size: 13px; font-weight: 600; }

.garments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.garment-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.garment-opt:hover { border-color: var(--line-2); }
.garment-opt[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.garment-opt__icon { color: var(--faint); margin-bottom: 6px; }
.garment-opt__icon svg { width: 40px; height: 46px; }
.garment-opt[aria-pressed="true"] .garment-opt__icon { color: var(--text); }
.garment-opt__name { font-size: 13px; font-weight: 700; }
.garment-opt__price { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sw); border: 1px solid var(--line-2);
  transition: transform .1s;
}
.swatch:hover { transform: scale(1.06); }
.swatch[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 3px; }
.swatches--sm { gap: 8px; }
.swatches--sm .swatch { width: 26px; height: 26px; }
.swatch--custom { background: conic-gradient(#ff4d3d, #ffc531, #c8f03c, #1fbf75, #2f6bff, #8c5cff, #ff3da6, #ff4d3d); cursor: pointer; }
.swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-width: 48px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  font-size: 13px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* selected layer */
.props {
  margin-top: 12px; padding: 14px; display: grid; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
}
.props__row { display: flex; flex-wrap: wrap; gap: 8px; }
.props__row .select { flex: 1 1 140px; }
.props__actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; }
.tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 10px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  transition: background .15s, color .15s;
}
.tool:hover { background: var(--surface-3); color: var(--text); }
.tool[data-danger]:hover { color: var(--danger); }

.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.seg__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; min-width: 34px; padding: 0 7px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 700;
  transition: background .15s, color .15s;
}
.seg__btn .ic { width: 17px; height: 17px; }
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg--pill { border-radius: 12px; }
.seg--pill .seg__btn { height: 34px; padding: 0 14px; border-radius: 9px; }
.seg--pill .seg__btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800;
}

.quality { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; }
.quality small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.quality__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.quality--ok .quality__dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 20%, transparent); }
.quality--bad .quality__dot { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }

/* layer list */
.layers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.layers__empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.layer { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.layer.is-selected { border-color: var(--sel); }
.layer__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; text-align: left; }
.layer__thumb {
  width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex: none;
  display: grid; place-items: center;
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface) 0 50%) 0 0 / 10px 10px;
}
.layer__thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer__thumb--text { background: var(--surface-3); font-size: 15px; font-weight: 700; }
.layer__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer__del { margin-right: 4px; }
.layer__del:hover { color: var(--danger) !important; }

/* checkout bar */
.checkout {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface);
}
.checkout__price { display: grid; line-height: 1.2; }
.checkout__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.checkout__total { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checkout__note { font-size: 11px; color: var(--muted); }
.checkout .btn { flex: 1; }

/* ── form controls ────────────────────────────────────────── */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; }
.field__error { font-size: 12px; color: var(--danger); font-weight: 600; }
.field__error:empty { display: none; }
.field input, .field textarea, .select select {
  width: 100%; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 15px; font-weight: 500; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 44px; line-height: 1.4; }
.field input:focus, .field textarea:focus, .select select:focus, .phone:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field.has-error input, .field.has-error textarea, .field.has-error .phone { border-color: var(--danger); }
.props .field textarea { background: var(--surface); font-size: 16px; font-weight: 600; }

.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; height: 38px; padding: 0 34px 0 12px; font-weight: 600; cursor: pointer; }
.select .ic { position: absolute; right: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; pointer-events: none; color: var(--muted); }
.select--sm { width: 110px; flex: none; }

.phone { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.phone__code { display: flex; align-items: center; padding-left: 12px; color: var(--muted); font-weight: 700; }
.field .phone input { border: 0; background: transparent; box-shadow: none; padding-left: 8px; letter-spacing: .02em; }

.radio-cards { display: grid; gap: 8px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.radio-card:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.radio-card input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; }
.radio-card b { display: block; font-size: 14px; }
.radio-card small { display: block; color: var(--muted); font-size: 12px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.stepper .icon-btn { width: 32px; height: 32px; }
.stepper span { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── dialogs ──────────────────────────────────────────────── */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }

.modal { margin: auto; width: min(440px, calc(100% - 32px)); }
.modal__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal__head h2 { font-size: 18px; font-weight: 800; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; }
.table tr.is-current td { background: var(--surface-2); font-weight: 800; }

.drawer { margin: 0 0 0 auto; width: min(460px, 100%); height: 100vh; height: 100dvh; }
.drawer[open] { animation: slide-in .28s var(--ease); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer__box { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 18px; font-weight: 800; }
.drawer__scroll { flex: 1; overflow: auto; padding: 20px; overscroll-behavior: contain; }
#order-form { display: grid; gap: 16px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.thumb { margin: 0; padding: 8px 8px 6px; border-radius: 12px; background: var(--stage); }
.thumb__img { aspect-ratio: 600 / 700; }
.thumb__img img { width: 100%; height: 100%; }
.thumb figcaption { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }

.o-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.o-item__name { font-weight: 800; }
.o-item__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.totals { display: grid; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.totals__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.totals__row--total { color: var(--text); font-size: 18px; font-weight: 800; margin-top: 4px; }

.pay { display: grid; gap: 14px; }
.pay h3 { font-size: 20px; font-weight: 800; }
.pay__card { padding: 4px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.pay__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay__row:last-child { border-bottom: 0; }
.pay__number { display: inline-flex; align-items: center; gap: 4px; }
.pay__number b { font-size: 16px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.upload {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload:hover { border-color: var(--text); }
.upload.has-file { border-style: solid; border-color: var(--ok); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload small { display: block; color: var(--muted); font-size: 12px; }

/* ── toasts ───────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 1000;
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px);
}
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast--error { background: var(--danger); color: #fff; }
.toast--warn { background: var(--warn); color: #1A1200; }
.toast--ok { background: var(--ok); color: #fff; }

/* ── doc pages (help) ─────────────────────────────────────── */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 20px 64px; }
.doc h1 { font: 700 clamp(30px, 5vw, 44px)/1.05 var(--font-display); letter-spacing: -.03em; margin-bottom: 28px; }
.doc h2 { font-size: 20px; font-weight: 800; margin: 40px 0 12px; }
.doc p { color: var(--muted); }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: rotate .2s; color: var(--muted); }
.faq details[open] summary .ic { rotate: 180deg; }
.faq details p { padding: 0 18px 16px; }
.contact-card { margin-top: 32px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; }
.contact-card .btn { justify-self: start; }
.footer { border-top: 1px solid var(--line); padding: 24px 20px; color: var(--muted); font-size: 13px; }
.footer__in { max-width: 720px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ── order status page ────────────────────────────────────── */
.doc--order { display: grid; gap: 20px; align-content: start; min-height: 60vh; }
.doc--order h1 { margin-bottom: 0; font-size: clamp(26px, 5vw, 36px); }
.doc--order h2 { margin: 0 0 12px; font-size: 16px; }
.st-loading { display: grid; place-items: center; padding: 80px 0; }
.st-empty { display: grid; gap: 16px; justify-items: start; padding: 40px 0; }
.st-empty p { color: var(--muted); font-size: 16px; }
.st-head { display: grid; gap: 6px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.steps__item { display: grid; justify-items: center; gap: 6px; text-align: center; position: relative; color: var(--faint); font-size: 12px; font-weight: 700; }
.steps__item::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: var(--line-2); z-index: 0; }
.steps__item:first-child::before { display: none; }
.steps__item.is-done::before, .steps__item.is-current::before { background: var(--accent); }
.steps__dot {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line-2); font-size: 12px;
}
.steps__dot .ic { width: 16px; height: 16px; }
.steps__item.is-done { color: var(--muted); }
.steps__item.is-done .steps__dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps__item.is-current { color: var(--text); }
.steps__item.is-current .steps__dot { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.st-badge { justify-self: start; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.st-badge--cancelled { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.st-msg { padding: 14px 16px; border-radius: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.st-msg--action { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.st-msg--warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.st-msg--ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.st-msg--muted { color: var(--muted); }
.st-pay { display: grid; gap: 12px; }
.st-card { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.st-card p { color: var(--text); }
.st-card p.muted { color: var(--muted); }
.st-card .thumbs { grid-template-columns: repeat(auto-fill, minmax(140px, 180px)); }
.st-item { font-weight: 700; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc--order .contact-card { margin-top: 0; }
.st-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-list a {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none;
}
.st-list a:hover { border-color: var(--line-2); }
.st-list__status { font-size: 13px; font-weight: 700; }
.st-list__status[data-status="new"] { color: var(--warn); }

/* ── admin ────────────────────────────────────────────────── */
.page-admin { min-height: 100vh; }
.adm-login { max-width: 360px; margin: 12vh auto; padding: 0 20px; display: grid; gap: 16px; }
.adm-login h1 { font: 700 28px var(--font-display); letter-spacing: -.02em; }
.adm-app { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.adm-list { border-right: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; align-content: start; background: var(--surface); }
.adm-filters { display: grid; gap: 10px; }
.adm-search { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); outline: none; }
.adm-search:focus { border-color: var(--accent); }
.chips--sm .chip { height: 32px; min-width: 0; font-size: 12px; }
.chip small { opacity: .7; margin-left: 2px; }
.adm-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adm-row { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; }
.adm-row:hover { border-color: var(--line-2); }
.adm-row.is-active { border-color: var(--sel); }
.adm-row__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.adm-row__mid { font-size: 14px; font-weight: 600; }
.adm-row__bot { font-size: 12px; }
.adm-placeholder { padding: 24px 4px; }
.adm-tg { padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.adm-tg h3 { font-size: 14px; }
.adm-tg__ok { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; font-size: 13px; }
.adm-detail { padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.adm-detail__head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.adm-detail__head h1 { font: 700 26px var(--font-display); letter-spacing: -.02em; }
.adm-back { display: none; }
.adm-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.kv { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > span:last-child { text-align: right; display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.kv .icon-btn { width: 28px; height: 28px; }
.kv .icon-btn .ic { width: 15px; height: 15px; }
.adm-receipt { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); }
.adm-files { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.adm-assets { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.adm-assets a { word-break: break-all; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill--new { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.pill--checking { background: color-mix(in srgb, var(--sel) 22%, transparent); color: var(--sel); }
.pill--paid, .pill--printing { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.pill--shipped { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.pill--done { background: var(--surface-3); color: var(--text); }
.pill--cancelled { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

/* ── mobile ───────────────────────────────────────────────── */
@media (max-width: 899px) {
  .adm-app { grid-template-columns: 1fr; }
  .adm-list { border-right: 0; }
  .has-detail .adm-list { display: none; }
  body:not(.has-detail) .adm-detail { display: none; }
  .adm-back { display: inline-flex; }
}
@media (max-width: 560px) {
  .steps__label { font-size: 10px; }
  .st-list a { grid-template-columns: auto 1fr auto; }
  .st-list a .muted { display: none; }
}
@media (max-width: 899px) {
  .page-app { height: auto; overflow: visible; display: block; }
  .topbar { position: sticky; top: 0; height: 56px; padding: 0 8px 0 16px; }
  .topbar__tagline { display: none; }
  .app { grid-template-columns: 1fr; }
  .stage { height: 62svh; min-height: 380px; max-height: 640px; }
  .stage__bar { padding: 12px 12px 0; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .panel__scroll { overflow: visible; padding: 18px 16px 120px; }
  .checkout {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .25);
  }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .field input, .field textarea, .select select { font-size: 16px; }
  .drawer { margin: auto 0 0; width: 100%; height: auto; max-height: 94dvh; }
  .drawer[open] { animation-name: slide-up; }
  @keyframes slide-up { from { transform: translateY(60px); opacity: 0; } }
  .drawer__box { height: auto; max-height: 94dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; }
  .drawer__scroll { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .topbar .link-btn span:not([data-lang-short]) { display: none; }
  .checkout__total { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
