/* Storefront styles. Shared by every page. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #1f1b16;
  --ink-2: #4a433b;
  --muted: #6f665c;
  --border: #e6dfd3;
  --border-strong: #cfc5b6;
  --accent: #b9532a;
  --accent-ink: #ffffff;
  --accent-soft: #f7e4d9;
  --focus: #2d6cdf;
  --ok: #2f6b45;
  --ok-soft: #e1f0e5;
  --warn: #8a5a00;
  --warn-soft: #fbefd2;
  --err: #a32727;
  --err-soft: #f9e0de;
  --info: #285a8a;
  --info-soft: #e0ebf6;
  --stage: #efe9df;
  --checker-a: #e9e4dc;
  --checker-b: #f8f5f0;
  --shadow: 0 1px 2px rgba(31, 27, 22, 0.06), 0 6px 24px rgba(31, 27, 22, 0.06);
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --maxw: 1180px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120f;
    --surface: #1e1a16;
    --surface-2: #26211b;
    --ink: #f3eee6;
    --ink-2: #d6cec2;
    --muted: #a69c8f;
    --border: #322b24;
    --border-strong: #4a4137;
    --accent: #e27b4f;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2519;
    --focus: #7aa7ff;
    --ok: #7cc597;
    --ok-soft: #1d3326;
    --warn: #e8bd5c;
    --warn-soft: #3a2f14;
    --err: #f08a84;
    --err-soft: #3d1c1a;
    --info: #8fbbe8;
    --info-soft: #182a3c;
    --stage: #221d18;
    --checker-a: #2b2620;
    --checker-b: #35302a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 12px; top: -48px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; }

/* ---------- header / footer ---------- */

.site-header { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { font-family: var(--font-display); font-weight: 650; font-size: 1.25rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; fill: var(--accent-ink); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 0.95rem; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }

.site-footer { margin-top: 56px; border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink-2); }

/* ---------- generic components ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; word-break: break-all; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 0.95rem; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 10px; min-height: 34px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }

label { font-weight: 600; font-size: 0.92rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="url"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; min-height: 42px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[type="color"] { width: 48px; height: 42px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }

.notice { border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid transparent; font-size: 0.95rem; }
.notice strong { font-weight: 700; }
.notice-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice-error { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.notice-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner { border-radius: 0; border-left: 0; border-right: 0; text-align: center; padding: 10px 16px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-info { background: var(--info-soft); color: var(--info); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } * { scroll-behavior: auto !important; } }

.checker {
  background-color: var(--checker-b);
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* ---------- storefront designer ---------- */

.hero { padding: 36px 0 18px; }
.hero p { color: var(--muted); max-width: 60ch; font-size: 1.05rem; }

.studio { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.studio-preview { position: sticky; top: 76px; }
@media (max-width: 920px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-preview { position: static; }
  /* One column: the design prompt comes first, above the shirt preview. */
  .studio-steps { display: contents; }
  .studio .art-step { order: -1; }
  .studio { gap: 16px; }
  .studio .card + .card { margin-top: 0; }
}

.stage-card { padding: 16px; }
.stage-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stage {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 600 / 700;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--surface) 70%, var(--stage)) 0%, var(--stage) 70%);
  border-radius: 12px; overflow: hidden; user-select: none; -webkit-user-select: none;
}
.stage svg.shirt { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Printful's photo of the shirt: the shirt is translucent shading over the stage colour (or fabric texture). */
.stage.photo { aspect-ratio: 1 / 1; background-image: none; background-size: cover; }
.stage.photo svg.shirt { display: none; }
.shirt-photo { position: absolute; height: auto; max-width: none; display: block; pointer-events: none; -webkit-user-drag: none; }
.shirt-photo[hidden] { display: none; }
.print-area {
  position: absolute; left: 32.5%; top: 21.4286%; width: 35%; height: 40%;
  container-type: size; outline: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 0;
  touch-action: none;
}
.print-area.clean { outline-color: transparent; }
.print-area-label {
  position: absolute; top: -22px; left: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap; pointer-events: none;
}
.print-area.clean .print-area-label { display: none; }
.art-clip { position: absolute; inset: 0; overflow: hidden; }
.layer { position: absolute; transform: translate(-50%, -50%); cursor: grab; touch-action: none; line-height: 0; }
.layer:active { cursor: grabbing; }
.layer:focus-visible { outline: none; }
.layer img { width: 100%; height: auto; display: block; pointer-events: none; -webkit-user-drag: none; }
.layer-text { white-space: pre; line-height: 1.1; text-align: center; padding: 0; }
.sel-box { position: absolute; border: 1.5px solid var(--focus); pointer-events: none; border-radius: 2px; }
.sel-handle {
  position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 3px;
  background: var(--surface); border: 2px solid var(--focus); pointer-events: auto; cursor: nwse-resize; touch-action: none;
}
/* Rotate: a filled round knob with a turn arrow on a stem. Resize: a hollow square corner. */
.rot-handle {
  position: absolute; left: 50%; top: -38px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%;
  background: var(--focus); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  pointer-events: auto; cursor: grab; touch-action: none;
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700; line-height: 1;
}
.rot-handle::before { content: "\21BB"; }
.rot-handle::after { content: ""; position: absolute; left: 50%; top: 24px; width: 2px; height: 12px; margin-left: -1px; background: var(--focus); }
.rot-handle:active { cursor: grabbing; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 8px; pointer-events: none; color: color-mix(in srgb, var(--accent) 80%, transparent); font-size: 12px; font-weight: 600; line-height: 1.3; }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; background: var(--surface); }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); padding: 7px 14px; border-radius: 7px; cursor: pointer; min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.step { scroll-margin-top: 80px; }
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.step-num { font-family: var(--font-display); color: var(--accent); font-weight: 650; font-size: 1.05rem; }
.step-head h2 { margin: 0; font-size: 1.2rem; }

.fit-seg { display: flex; width: fit-content; margin-bottom: 10px; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product-card {
  appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.product-card:hover { border-color: var(--border-strong); }
.product-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.product-card .p-name { font-weight: 700; }
.product-card .p-desc { font-size: 0.85rem; color: var(--muted); }
.product-card .p-price { font-weight: 600; font-size: 0.9rem; margin-top: auto; padding-top: 6px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; max-height: 236px; overflow-y: auto; padding: 6px; margin: -6px; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); cursor: pointer; padding: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15); position: relative;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.swatch-label { font-size: 0.9rem; color: var(--muted); margin-top: 8px; }

.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .tool-row { grid-template-columns: 1fr; } }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.layers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.layer-chip { appearance: none; font: inherit; font-size: 0.85rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 12px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-chip[aria-pressed="true"] { border-color: var(--focus); color: var(--ink); box-shadow: 0 0 0 1px var(--focus); }

.editor { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.editor-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.font-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.font-pick { appearance: none; font-size: 1.1rem; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.size-cell { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.size-cell label { display: flex; justify-content: space-between; gap: 6px; font-size: 0.9rem; }
.size-cell .up { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.size-cell input { margin-top: 6px; text-align: center; padding: 8px 6px; }
.size-cell.has-qty { border-color: var(--accent); background: var(--accent-soft); }

.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-lines li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cart-lines li:last-child { border-bottom: 0; }
.cart-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.2); flex: none; }

.proof-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 520px) { .proof-wrap { grid-template-columns: minmax(0, 1fr); } }
.proof-img { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; border: 1px solid var(--border); display: block; object-fit: contain; }

.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { font-weight: 700; font-size: 1.15rem; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.summary .discount { color: var(--ok); }
.summary .sub { padding-left: 14px; font-size: 0.92rem; }
.todo { list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.92rem; }
.todo li { padding: 3px 0 3px 22px; position: relative; color: var(--muted); }
.todo li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); }
.todo li.done { color: var(--ink-2); }
.todo li.done::before { background: var(--ok); border-color: var(--ok); }

details.disclosure { margin-top: 12px; }
details.disclosure summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }

/* ---------- order / support / policy pages ---------- */

.page-head { padding: 36px 0 12px; }
.status-hero { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex: none; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.err { background: var(--err); }
.order-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .order-grid { grid-template-columns: minmax(0, 1fr); } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .t-when { color: var(--muted); font-size: 0.85rem; }
.design-thumb { width: 100%; max-width: 260px; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); display: block; }
.design-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.design-fig { margin: 0; min-width: 0; }
.design-fig figcaption { margin-top: 4px; }
.seg-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.proof-files { margin-bottom: 14px; }
.proof-fig { margin: 0; min-width: 0; }
.proof-fig .proof-img { aspect-ratio: auto; max-height: 260px; }
.proof-fig figcaption { margin-top: 4px; }
.mockup-block { margin-bottom: 14px; }
.mockup-block #mockup-area { margin-top: 8px; }
.mockup-figs { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.mockup-img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--border); }

.policy { padding-bottom: 20px; }
.policy h2 { margin-top: 1.6em; }
.policy ul { padding-left: 1.2em; }
.policy li { margin-bottom: 0.4em; }
.draft-notice { margin: 24px 0 8px; font-size: 1.02rem; border-width: 2px; }
.tbd { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 600; }

/* ---------- admin ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { appearance: none; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; font-size: 0.92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.action-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.action-box h3 { font-family: var(--font-sans); font-size: 0.95rem; margin-bottom: 8px; }
.action-box .field + .field { margin-top: 8px; }
.action-box .btn { margin-top: 10px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.event-detail { white-space: pre-wrap; font-size: 0.82rem; color: var(--muted); margin: 2px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .card { padding: 16px; }
  .site-nav { flex-wrap: nowrap; }
  .site-nav a { padding: 6px 7px; font-size: 0.9rem; }
  .site-nav a[href="/"] { display: none; } /* the brand already links home */
  .brand { font-size: 1.1rem; }
}

/* ---- Turnstile, honeypot, order progress, admin panels ---- */
.turnstile-slot { margin-top: 14px; min-height: 65px; max-width: 100%; overflow: hidden; }
.turnstile-slot[hidden] { display: none; }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.progress { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.progress li { font-size: 0.85rem; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.progress li.done { background: var(--ok-soft); color: var(--ok); }
.progress li.current { background: var(--info-soft); color: var(--info); font-weight: 600; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.check-list li:last-child { border-bottom: 0; }
.check-list .check-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.thread li { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.thread li.from-operator { background: var(--surface-2); }
.thread .msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.email-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: 0.85rem; }
.email-frame { width: 100%; min-height: 420px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.admin-toolbar .tabs { flex: 1 1 100%; min-width: 0; margin-bottom: 0; border-bottom: 0; }
@media (max-width: 640px) { .btn-sm { min-height: 40px; } .seg button { min-height: 40px; } .swatch { width: 42px; height: 42px; } }

/* Design ideas and the AI upload guide (Artwork step) */
.ai-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.ai-results:empty { display: none; }
.ai-result img { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--border); border-radius: 8px;
  background: repeating-conic-gradient(#e6e6e6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.guide-list { margin: 8px 0 0; padding-left: 20px; }
.guide-list li { margin: 4px 0; }
.prompt-template { white-space: pre-wrap; font-size: 0.85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 0 0 8px; }
.art-step { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ai-gen textarea { width: 100%; min-height: 84px; font-size: 1.05rem; }
.ai-gen-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.ai-quota { font-size: 0.9rem; color: var(--muted); }
.ai-quota.low { color: var(--accent); font-weight: 600; }
.ai-result { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.ai-result[aria-pressed="true"] { border-color: var(--accent); }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 0.85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* Saved designs (optional sign-in) */
.saved-card { margin-top: 16px; }
.saved-title { font-size: 1.15rem; margin: 0 0 10px; }
.saved-card .notice { margin-bottom: 10px; }
.saved-who { margin: 0 0 12px; }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.saved-actions input { flex: 1 1 180px; min-width: 0; }
.saved-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.saved-list li.is-open { border-color: var(--accent); background: var(--accent-soft); }
.saved-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; }
.saved-meta { display: flex; flex-direction: column; min-width: 0; }
.saved-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-list .btn-sm { min-height: 40px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 0; }
.linklike.muted { color: var(--muted); }
.btn-google { gap: 10px; }
.g-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 700; border: 1px solid var(--border); font-size: 0.85rem; }
@media (max-width: 480px) {
  .saved-list li { grid-template-columns: 44px 1fr auto auto; gap: 6px; }
  .saved-thumb { width: 44px; height: 44px; }
  .saved-list .btn-sm { padding: 6px 8px; }
}
