@font-face { font-family: Inter; src: url(/fonts/Inter-400.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-700.ttf) format('truetype'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url(/fonts/ArchivoBlack-400.ttf) format('truetype'); font-display: swap; }
:root { --navy: #100831; --light: #F7F5FF; --cyan: #00B5E9; --ink: #100831; --muted: #5d5878; --line: #ddd8f0; --warn: #9a3412; --ok: #166534; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--light); line-height: 1.45; }
a { color: var(--navy); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.announce { background: var(--cyan); color: var(--navy); text-align: center; font-size: 14px; font-weight: 600; padding: 7px 12px; }
.top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 44px; height: auto; background: #fff; border-radius: 8px; padding: 3px; }
.brand strong { display: block; font-family: 'Archivo Black', Inter, sans-serif; letter-spacing: .5px; font-size: 17px; }
.brand span { font-size: 13px; color: #cfe9f5; }
.layout { max-width: 1240px; margin: 0 auto; padding: 18px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stage { position: sticky; top: 12px; }
.stage-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 6px 24px rgba(16,8,49,.06); }
.stage-bar, .stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#preview { display: block; width: 100%; height: auto; max-height: 72vh; aspect-ratio: 1 / 1; object-fit: contain; cursor: zoom-in; border-radius: 10px; background: linear-gradient(#fbfaff, #f1eefc); margin: 8px 0; }
#preview:focus-visible { outline: 3px solid var(--cyan); }
.note { font-size: 13px; color: var(--muted); margin: 8px 4px; }
.muted { color: var(--muted); font-size: 13px; }
.controls { display: grid; gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel h2 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0; }
.chips { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chips.three { grid-template-columns: repeat(3, 1fr); }
.chip { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink); display: grid; gap: 2px; position: relative; }
.chip span { font-size: 12px; color: var(--muted); }
.chip[aria-pressed=true] { border-color: var(--cyan); background: #eefaff; box-shadow: 0 0 0 2px rgba(0,181,233,.18); }
.chip .tick { display: none; position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 700; color: #fff; background: var(--navy); border-radius: 999px; padding: 1px 7px; }
.chip.has-art .tick { display: inline-block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: var(--sw); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { outline: 3px solid var(--cyan); outline-offset: 2px; }
.field { display: grid; gap: 4px; font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
.lbl { font-weight: 600; font-size: 14px; }
.size-field select { max-width: 180px; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid #cbc5e3; border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; font-weight: 400; }
input[type=range] { padding: 0; border: 0; accent-color: var(--cyan); }
input[type=radio] { width: auto; accent-color: var(--navy); }
textarea { resize: vertical; }
.count { text-align: right; }
.btn { font: inherit; font-weight: 700; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 2px solid var(--navy); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #22175a; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.small { padding: 6px 11px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.danger { color: #9b1c1c; border-color: #e5b4b4; }
.btn.armed { background: #9b1c1c; color: #fff; border-color: #9b1c1c; }
.btn:focus-visible, .chip:focus-visible, .swatch:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: wait; }
.top-send { background: var(--cyan); color: var(--navy); border-color: var(--cyan); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--cyan); outline-offset: 2px; }
.upload, .actions, .nudge { display: flex; flex-wrap: wrap; gap: 8px; }
.art-row { margin-top: 8px; font-size: 14px; word-break: break-all; }
.msg { font-size: 14px; margin: 8px 0 0; }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); }
.msg.warn { color: var(--warn); background: #fff7ed; border: 1px solid #fed7aa; padding: 8px 10px; border-radius: 10px; }
.msg.notice { background: #eefaff; border: 1px solid #9fdcf2; border-left: 5px solid var(--cyan); padding: 10px 12px; border-radius: 10px; color: var(--navy); font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.styles legend { grid-column: 1 / -1; }
.styles label { border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.styles label:has(input:checked) { border-color: var(--cyan); background: #eefaff; }
.styles span { display: grid; font-size: 14px; }
.styles em { font-style: normal; font-size: 12px; color: var(--muted); }
.ai-mode { display: grid; gap: 4px; font-size: 14px; margin-top: 8px; }
.ai-mode label { display: flex; gap: 8px; align-items: center; }
.ai-mode label:has(input:disabled) { color: #a29db8; }
.send-panel { border: 2px solid var(--navy); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: #fff; color: var(--navy); padding: 7px 14px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--navy); color: #fff; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 16px 36px; display: grid; gap: 4px; }
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--ink); box-shadow: 0 20px 60px rgba(16,8,49,.35); }
dialog::backdrop { background: rgba(16,8,49,.6); }
dialog h2 { margin-top: 0; }
#zoom-dialog { width: min(1100px, calc(100vw - 16px)); padding: 12px; }
.zoom-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.zoom-hint { margin: 6px 0; }
.zoom-scroll { overflow: auto; max-height: calc(100vh - 140px); border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.zoom-scroll img { display: block; width: 100%; height: auto; }
.summary { background: var(--light); border-radius: 10px; padding: 10px 10px 10px 28px; font-size: 14px; margin: 8px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 10px; gap: 12px; }
  /* Phone: the preview stays pinned at the top so the art can be seen moving while the controls scroll. */
  .stage { position: sticky; top: 0; z-index: 20; align-self: start; background: var(--light); margin: 0 -10px; padding: 6px 10px 6px; box-shadow: 0 6px 12px -8px rgba(16,8,49,.35); }
  .stage-card { padding: 6px 8px; border-radius: 12px; }
  #preview { max-height: 34vh; width: auto; margin: 4px auto; }
  .stage-bar .seg button { padding: 5px 12px; }
  .stage-foot .muted, .stage-bar .muted { font-size: 12px; }
  .top { padding: 8px 12px; }
  .brand strong { font-size: 14px; }
  .top-send { padding: 7px 10px; font-size: 13px; }
  .chips.three { grid-template-columns: repeat(3, 1fr); }
  .chip { padding: 8px; }
  .announce { font-size: 12.5px; }
}
