@import url("/brand-tokens.css");
/* Swagpay design editor. Tokens come from /brand-tokens.css; the fallbacks keep it usable until
   that file is committed. Mobile first. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page, #f5f6f9); color: var(--text, #171a38); font-family: var(--font-body, "Figtree", system-ui, sans-serif); font-size: 16px; line-height: 1.5; }
main { max-width: 1180px; margin: 0 auto; padding: 12px 16px 96px; display: grid; gap: 16px; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
a { color: var(--action, #d7266f); }
button, input, select { font: inherit; }
button, .tool, .product { min-height: 44px; }
button { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--action, #d7266f); color: var(--action-text, #ffffff); font-weight: 700; cursor: pointer; }
button.secondary, .tool { background: var(--surface, #ffffff); color: var(--text, #171a38); border: 1px solid var(--line, #d9dcea); }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible, #logo-file:focus-visible + .tool { outline: 2px solid var(--focus, #d7266f); outline-offset: 2px; }
input, select { min-height: 44px; padding: 10px; border: 1px solid var(--line, #d9dcea); border-radius: 8px; background: var(--page, #f5f6f9); color: var(--text, #171a38); width: 100%; }
input[type="color"] { padding: 4px; }
label { display: grid; gap: 4px; font-weight: 700; font-size: 0.9rem; }
.muted { color: var(--text-muted, #4a4f72); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet { background: var(--surface, #ffffff); border: 1px solid var(--line, #d9dcea); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home { display: inline-flex; align-items: center; min-height: 44px; }
.home img { display: block; height: 32px; width: auto; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; font-size: 0.85rem; color: var(--text-muted, #4a4f72); }
.steps li { padding: 2px 8px; border-radius: 999px; }
main[data-step="product"] .steps [data-for="product"],
main[data-step="design"] .steps [data-for="design"],
main[data-step="details"] .steps [data-for="details"],
main[data-step="review"] .steps [data-for="review"] { background: var(--agent-bubble, #fbe3ee); color: var(--text, #171a38); font-weight: 700; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product { text-align: left; display: grid; gap: 4px; padding: 14px; background: var(--surface, #ffffff); color: var(--text, #171a38); border: 1px solid var(--line, #d9dcea); border-radius: 12px; font-weight: 400; }
.product b { font-size: 1.05rem; }
.product small { color: var(--text-muted, #4a4f72); }
.product .owner { color: var(--error, #b91e5a); font-size: 0.8rem; }

.editor { display: grid; gap: 12px; }
/* The stage stays white in dark mode: garments, print areas and exports are drawn for white. */
.stage-wrap { position: relative; background: #ffffff; border: 1px solid var(--line, #d9dcea); border-radius: 12px; padding: 8px; }
/* Empty stage: the mascot invites the first logo. Clicks pass through to the stage. */
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; pointer-events: none; color: #4a4f72; font-weight: 700; text-align: center; }
.stage-empty[hidden] { display: none; }
.stage-empty img { width: min(120px, 30vw); height: auto; }
.stage-empty p { margin: 0; padding: 6px 12px; background: rgba(255, 255, 255, 0.9); border-radius: 999px; }
#stage { display: block; width: 100%; height: min(58vh, 560px); touch-action: none; user-select: none; -webkit-user-select: none; }
#stage .garment { stroke: #171a38; stroke-width: 2; }
#stage .print-area { fill: none; stroke: #2466c4; stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
#stage .safe-area { fill: none; stroke: #2466c4; stroke-opacity: 0.35; stroke-width: 1; vector-effect: non-scaling-stroke; }
#stage .cut-preview { fill: #ffffff; stroke: #d7266f; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
#stage .frame { fill: #ffffff; stroke: #171a38; stroke-width: 2; vector-effect: non-scaling-stroke; }
#stage .layer { cursor: move; }
#stage .selection rect { fill: none; stroke: #d7266f; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#stage .selection circle { fill: #ffffff; stroke: #d7266f; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }

.toolbar { position: sticky; bottom: 72px; display: flex; gap: 8px; flex-wrap: wrap; padding: 8px; background: var(--page, #f5f6f9); z-index: 2; }
.tool { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.controls, .panel { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; padding: 8px 12px; border-radius: 999px; background: var(--surface, #ffffff); color: var(--text, #171a38); border: 1px solid var(--line, #d9dcea); font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--action, #d7266f); box-shadow: inset 0 0 0 1px var(--action, #d7266f); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #171a38; display: inline-block; margin-right: 6px; vertical-align: -4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quality { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.quality li { padding: 8px 10px; border-radius: 8px; background: var(--agent-bubble, #fbe3ee); font-size: 0.9rem; }
.quality li[data-status="block"] { color: var(--error, #b91e5a); font-weight: 700; }
.notice { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; z-index: 4; pointer-events: none; padding: 10px 14px; border-radius: 8px; background: var(--text, #171a38); color: var(--page, #f5f6f9); }
.notice:empty { padding: 0; background: transparent; }
.row { display: grid; gap: 14px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } }
.send-status { display: flex; align-items: center; gap: 12px; }
.send-status img { flex: none; }
.send-status p, .send-error { margin: 0; }
.send-error { color: var(--error, #b91e5a); font-weight: 700; }
.send-error:empty { display: none; }
.send-error, .order-link { scroll-margin-bottom: 96px; }
.order-link { font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.send-status[hidden], .order-link[hidden] { display: none; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface, #ffffff); border-top: 1px solid var(--line, #d9dcea); z-index: 3; }
.estimate-bar { flex: 1; text-align: center; font-size: 0.9rem; color: var(--text-muted, #4a4f72); }

@media (min-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  #stage { height: min(70vh, 680px); }
  .toolbar { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.link-button { background: none; color: var(--text, #171a38); text-decoration: underline; padding: 10px 0; min-height: 44px; justify-self: start; }
.link-button[hidden] { display: none; }
