/* MM Client Showcase: iPad-first, touch-first. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1b1915;
  --ink-2: #4a453d;
  --muted: #8a8276;
  --line: #e7e0d4;
  --gold: #a8894f;
  --danger: #9b3b3b;
  --radius: 14px;
  --display: "Bodoni 72", "Didot", "Bodoni MT", "Playfair Display", Georgia, serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(16px, 3vw, 36px);
  --topbar: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 400; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; letter-spacing: 0; }
.overdue { color: var(--danger); font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark { font-family: var(--display); font-size: 19px; letter-spacing: 0.18em; }
.brand-sub { font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 10px 14px; border-radius: 999px; white-space: nowrap;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
}
.nav-link.active { background: var(--ink); color: var(--bg); }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #3f7d58; box-shadow: 0 0 0 3px rgba(63, 125, 88, 0.18); }
.sync.offline .sync-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(155, 59, 59, 0.18); }

.view { padding: 0 var(--pad) 64px; max-width: 1600px; margin: 0 auto; }
.loading, .empty { padding: 80px 20px; text-align: center; color: var(--muted); }
.empty h2 { font-family: var(--display); font-size: 30px; color: var(--ink); margin-bottom: 8px; }
.empty a { text-decoration: underline; }

/* ---------- headings ---------- */
.eyebrow { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.hero { padding: 48px 0 28px; }
.hero.small { padding-bottom: 12px; }
.hero h1, .browse-head h1 { font-family: var(--display); font-size: clamp(36px, 5vw, 60px); line-height: 1.05; }
.lede { color: var(--ink-2); max-width: 46ch; margin: 12px 0 0; font-size: 17px; }
.section-title { font-family: var(--display); font-size: 26px; margin: 48px 0 16px; }

/* ---------- tiles ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tiles.three { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tile {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 3 / 4; background: #ece5d8;
}
.tile.wide { grid-column: span 2; aspect-ratio: 4 / 3; }
.tile.wide img { object-position: center 18%; }
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s ease; }
.tile:active img { transform: scale(1.03); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(20, 16, 10, 0.62)); }
.tile-text { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; color: #fff; display: flex; flex-direction: column; }
.tile-name { font-family: var(--display); font-size: 24px; line-height: 1.15; }
.tile.wide .tile-name { font-size: 34px; }
.tile-count { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; margin-top: 4px; }

.chips-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
.chip.big { padding: 12px 18px; font-size: 15px; }
.chip span { color: var(--muted); font-size: 12px; }

/* ---------- browse ---------- */
.browse-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 36px 0 18px; flex-wrap: wrap; }
.count { color: var(--muted); margin: 0; }
.filters {
  position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top)); z-index: 10;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 0; margin-bottom: 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.filters select, .search, .filters .toggle {
  height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 0 14px; font-size: 14px;
}
.filters select { appearance: none; -webkit-appearance: none; padding-right: 30px; max-width: 220px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8276' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.search { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 220px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); height: 100%; }
.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }

.grid { display: grid; gap: 22px 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { display: block; }
.card-img { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: #ece5d8; }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Sold: dark veil with a clear SOLD mark, so it reads instantly across the room. */
.sold-veil { display: none; }
.card.st-sold .card-img img { filter: grayscale(1) brightness(0.55); }
.card.st-sold .sold-veil {
  display: grid; place-items: center; position: absolute; inset: 0;
  background: rgba(14, 11, 8, 0.55);
}
.card.st-sold .sold-veil span {
  font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: 0.32em; color: #fff;
  padding: 8px 6px 8px 16px; border-top: 1px solid rgba(255,255,255,0.7); border-bottom: 1px solid rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.card.st-sold .card-badge { display: none; }
.card.st-sold .card-name, .card.st-sold .card-meta { color: var(--muted); }
.card.st-sold .card-name { text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.35); }
.bo-row.st-sold .bo-thumb img { filter: grayscale(1) brightness(0.5); }

.sold-banner { display: none; }
.gallery-wrap.is-sold .sold-banner {
  display: block; position: absolute; z-index: 2; top: 18px; left: 18px;
  background: rgba(14, 11, 8, 0.82); color: #fff; padding: 10px 22px 10px 26px; border-radius: 999px;
  font-family: var(--display); font-size: 20px; letter-spacing: 0.32em; text-transform: uppercase; pointer-events: none;
}
.gallery-wrap.is-sold .gallery img { filter: grayscale(0.85) brightness(0.62); }

/* Back button + home sections */
.back-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 14px 0 8px; margin-left: -8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--ink);
}
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile.feature { aspect-ratio: 4 / 3; }
.tile.feature img { object-position: center 18%; }
.section-tabs {
  position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top)); z-index: 10;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 36px calc(-1 * var(--pad)) 0; padding: 12px var(--pad); background: var(--bg); border-bottom: 1px solid var(--line);
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
}
.section-tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.section-tabs + #section-body .section-title:first-child { margin-top: 24px; }
.tile-all { background: var(--ink); display: block; }
.tile-all::after { display: none; }
.tile-all .tile-text { top: 0; bottom: 0; justify-content: center; align-items: center; text-align: center; }
.card-badge { position: absolute; top: 10px; left: 10px; }
.card-flag { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.92); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; }
.card-body { padding: 10px 2px 0; }
.card-name { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.more { height: 1px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: #fff; background: var(--c);
  white-space: nowrap;
}

/* ---------- product page ---------- */
.pdp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); padding: 8px 0; }
.pager { display: flex; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
}
.icon-btn.disabled { opacity: 0.3; pointer-events: none; }
.pdp-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 36px; align-items: start; }
.gallery-wrap { position: sticky; top: calc(var(--topbar) + 12px); }
.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius);
  background: #ece5d8; scrollbar-width: none; overscroll-behavior-x: contain;
  height: calc(100vh - var(--topbar) - 150px); min-height: 420px;
}
.gallery::-webkit-scrollbar { display: none; }
.slide { margin: 0; flex: 0 0 100%; height: 100%; position: relative; scroll-snap-align: start; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gallery-ui { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); }
.dot.on { background: var(--ink); }
.gallery-actions { display: flex; gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }

.pdp-name { font-family: var(--display); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; }
.pdp-price { font-size: 20px; margin: 12px 0 22px; }
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; }
.status-now { display: flex; align-items: center; justify-content: space-between; }
.status-label { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.status-detail { margin: 10px 0 0; }
.status-note { margin: 6px 0 0; color: var(--ink-2); font-style: italic; }
.status-card .muted.small { margin: 8px 0 0; }
.status-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 16px; }
.status-btn {
  height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg);
  font-size: 14px; font-weight: 600; color: var(--c);
}
.status-btn.on { background: var(--c); border-color: var(--c); color: #fff; }
.specs { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 110px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); font-size: 13px; }
.specs dd { margin: 0; }
.desc { border-bottom: 1px solid var(--line); padding: 14px 0; }
.desc summary { cursor: pointer; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; list-style: none; }
.desc summary::after { content: "+"; float: right; color: var(--muted); }
.desc[open] summary::after { content: "–"; }
.desc p { color: var(--ink-2); white-space: pre-line; }
.history-list { padding-top: 10px; }
.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }

/* Present mode: the image fills the screen for the client. */
body.presenting .topbar { display: none; }
.pdp.presenting .pdp-top, .pdp.presenting .pdp-info { display: none; }
.pdp.presenting .pdp-body { display: block; }
.pdp.presenting .gallery-wrap { position: fixed; inset: 0; z-index: 30; background: #0f0d0a; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.pdp.presenting .gallery { height: calc(100vh - 70px); border-radius: 0; background: #0f0d0a; }
.pdp.presenting .gallery-ui { padding: 12px 20px; }
.pdp.presenting .dot { background: #4a4540; }
.pdp.presenting .dot.on { background: #fff; }
.pdp.presenting #present::after { content: " (exit)"; }

/* ---------- sheet ---------- */
#sheet-root .sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 16, 10, 0.4); opacity: 0; transition: opacity 0.2s; }
#sheet-root .sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(560px, 100%);
  transform: translate(-50%, 100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}
#sheet-root.open .sheet-backdrop { opacity: 1; }
#sheet-root.open .sheet { transform: translate(-50%, 0); }
@media (min-width: 700px) {
  #sheet-root .sheet { bottom: auto; top: 50%; border-radius: 22px; transform: translate(-50%, -40%); opacity: 0; transition: transform 0.25s, opacity 0.2s; }
  #sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-head h3 { font-family: var(--display); font-size: 26px; }
.sheet .icon-btn { border: 0; background: transparent; }
.status-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.status-choice {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; text-align: left;
}
.status-choice .dot { width: 12px; height: 12px; background: var(--c); }
.status-choice.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 12px 14px; font-size: 16px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--ink-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field:only-child { grid-column: span 2; }
.sheet-error { color: var(--danger); margin: 4px 0 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 15px; font-weight: 500;
}
.btn.small { height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.4; }
.btn.on { background: var(--ink-2); color: var(--bg); }

/* ---------- back office ---------- */
.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tab { height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; font-size: 14px; }
.tab span { color: var(--muted); margin-left: 4px; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab.on span { color: #cfc6b8; }
.tab.alert:not(.on) { border-color: var(--danger); color: var(--danger); }
.bo-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.bo-tools .search { flex: 1 1 260px; height: 46px; padding-left: 16px; }
.bo-bulk { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 4px 4px 14px; }
.bo-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bo-row { display: grid; grid-template-columns: 44px 64px minmax(160px, 2fr) minmax(120px, 1fr) minmax(120px, 1.2fr) 110px 220px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bo-row:last-child { border-bottom: 0; }
.bo-header { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.bo-row > span, .bo-piece { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bo-row > span .badge { align-self: flex-start; }
.bo-thumb img { width: 64px; height: 84px; object-fit: cover; object-position: top; border-radius: 8px; }
.bo-actions { flex-direction: row !important; gap: 6px !important; justify-content: flex-end; }
.check { display: grid; place-items: center; height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.activity-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }

/* ---------- settings ---------- */
.settings { max-width: 480px; }
.info-block { max-width: 720px; color: var(--ink-2); }
.info-block .section-title { color: var(--ink); font-size: 22px; margin-top: 36px; }

/* ---------- color studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.canvas-wrap { position: relative; display: flex; align-items: center; justify-content: center; background: #ece5d8; border-radius: var(--radius); min-height: 420px; height: calc(100vh - var(--topbar) - 190px); overflow: hidden; }
#canvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }
#canvas.brushing { cursor: none; }
.brush-cursor { position: absolute; left: 0; top: 0; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.5); pointer-events: none; }
.seg.four { grid-template-columns: 1fr 1fr; gap: 3px; }
.toggle-row { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; margin: 12px 0 0; font-size: 14px; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--ink); grid-row: span 2; }
.toggle-row .small { grid-column: 2; }
.canvas-msg { position: absolute; inset: auto 16px 16px; text-align: center; background: rgba(255,255,255,0.9); padding: 10px 14px; border-radius: 12px; color: var(--ink-2); }
.thumbs { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; }
.thumb { flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; }
.thumb img { width: 56px; height: 76px; object-fit: cover; object-position: top; }
.thumb.on { border-color: var(--ink); }
.studio-panel { position: sticky; top: calc(var(--topbar) + 16px); display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.studio-panel section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.studio-panel h3 { font-family: var(--display); font-size: 21px; display: flex; align-items: center; gap: 10px; }
.studio-panel p { margin: 8px 0; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 13px var(--text); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 10px 0; }
.seg button { height: 40px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; }
.seg button.on { background: var(--ink); color: var(--bg); }
.slider { display: block; margin: 10px 0 0; }
.slider span { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.slider input { width: 100%; accent-color: var(--ink); height: 32px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.swatch { position: relative; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12); background: var(--s); padding: 0; }
.swatch span { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 9px; color: var(--muted); white-space: nowrap; margin-top: 2px; pointer-events: none; }
.swatches { row-gap: 22px; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 3px; }
.swatch.custom { background: conic-gradient(#e33, #ec3, #3c5, #3ce, #35e, #c3e, #e33); overflow: visible; display: block; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.studio-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- sign-in ---------- */
body.signed-out .topbar { display: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 0; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 36px 32px; }
.auth-brand { font-family: var(--display); font-size: 20px; letter-spacing: 0.18em; margin: 0 0 4px; }
.auth-card h1 { font-family: var(--display); font-size: 34px; margin: 18px 0 6px; }
.auth-card form { margin-top: 22px; }
.auth-help { text-align: center; margin-top: 14px; }

/* ---------- account + staff ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px 20px; max-width: none; }
.card-box .section-title { margin-top: 18px; font-size: 22px; }
.select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; font-size: 16px; }
.users-table .bo-row { grid-template-columns: minmax(140px, 1.4fr) 1fr 1fr 1fr 110px 90px; }
.bo-row.inactive { opacity: 0.55; }
@media (max-width: 1000px) {
  .users-table .bo-row { grid-template-columns: 1fr 1fr 1fr; }
  .users-table .bo-row > span { grid-column: auto !important; }
  .users-table .bo-actions { justify-content: flex-start; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px;
  transition: opacity 0.2s, transform 0.2s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error, .toast.warn { background: var(--danger); }

/* ---------- portrait iPad / narrow ---------- */
.brand-mark { white-space: nowrap; }
@media (max-width: 1000px) {
  .topbar { gap: 14px; }
  .brand-mark { font-size: 15px; letter-spacing: 0.12em; }
  .brand-sub { display: none; }
  .nav-link { padding: 10px 11px; letter-spacing: 0.06em; font-size: 12px; }
  .pdp-body, .studio { grid-template-columns: 1fr; }
  .gallery-wrap { position: relative; top: 0; }
  .studio-panel { position: static; }
  .gallery { height: 70vh; }
  .canvas-wrap { height: 62vh; }
  .bo-row { grid-template-columns: 40px 56px 1fr 1fr; }
  .bo-header { display: none; }
  .bo-row > span:nth-of-type(3), .bo-row > span:nth-of-type(4) { grid-column: 3 / -1; }
  .bo-actions { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .topbar { gap: 12px; }
  .brand-sub, .sync-label { display: none; }
  .tile.wide { grid-column: span 1; aspect-ratio: 3 / 4; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
