:root {
  --bg: #f5efe6; --surface: #fffdf9; --surface-2: #f3ece2; --ink: #1f1a15; --ink-2: #6a5e51; --line: #e7ddcf;
  --gold: #87672c; --gold-2: #c9a45c; --gold-soft: #f4ead8; --gold-grad: linear-gradient(135deg, #e9d29c 0%, #c9a45c 45%, #9c7a3c 100%);
  --ok: #2f7a4f; --ok-soft: #e3f1e8; --warn: #9a5418; --warn-soft: #f8eadb; --danger: #a3332b;
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "Jost", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(31,26,21,.06), 0 4px 14px rgba(31,26,21,.06);
  --bar: #a8701a; --bar-on: #87581a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d0b; --surface: #171411; --surface-2: #211c17; --ink: #f3ece2; --ink-2: #b6a998; --line: #2f2822;
    --gold: #dcbb79; --gold-soft: #2a2219; --ok: #7fcf9f; --ok-soft: #1c2a21; --warn: #f0b27a; --warn-soft: #2d2117; --danger: #f08a80;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); color-scheme: dark; --bar: #bd8023; --bar-on: #d99a3a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d0b; --surface: #171411; --surface-2: #211c17; --ink: #f3ece2; --ink-2: #b6a998; --line: #2f2822;
  --gold: #dcbb79; --gold-soft: #2a2219; --ok: #7fcf9f; --ok-soft: #1c2a21; --warn: #f0b27a; --warn-soft: #2d2117; --danger: #f08a80;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3); color-scheme: dark; --bar: #bd8023; --bar-on: #d99a3a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
a { color: var(--gold); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-grad); display: grid; place-items: center; color: #1a1408; font: 600 15px var(--serif); }
.brand b { font: 500 23px/1 var(--serif); }
.brand small { display: block; font: 500 10px var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); margin-top: 3px; }
.top nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.who { font-size: 13px; color: var(--ink-2); }

main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
h1 { font: 400 38px/1.05 var(--serif); margin: 0; }
.eyebrow { font: 500 11px var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 500 13px var(--sans); letter-spacing: .06em; text-decoration: none; color: var(--ink); }
.btn:hover:not(:disabled) { border-color: var(--gold-2); }
.btn.gold { background: var(--gold-grad); border: 0; color: #1a1408; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 12.5px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.search { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); width: 220px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.prod { text-align: left; padding: 10px 10px 14px; display: grid; gap: 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.prod:hover { border-color: var(--gold-2); }
.prod .ph { position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #ece6dc 25%, transparent 25%), linear-gradient(-45deg, #ece6dc 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #ece6dc 75%), linear-gradient(-45deg, transparent 75%, #ece6dc 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.prod img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; }
.prod .nm { font: 500 20px/1.1 var(--serif); padding: 0 4px; }
.prod .meta { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 12.5px; color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.badge.published { background: var(--ok-soft); color: var(--ok); }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; font: 400 26px var(--serif); color: var(--ink); margin-bottom: 6px; }

.login { max-width: 400px; margin: 9vh auto; padding: 32px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .lbl { font-size: 13px; font-weight: 500; }
.field input, .field select { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.field input:focus, .field select:focus { border-color: var(--gold-2); outline: none; }
.help { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.err { color: var(--danger); font-size: 13.5px; min-height: 1.2em; margin: 0; }

.editor { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stage { padding: 16px; display: grid; gap: 12px; position: sticky; top: 84px; }
.canvas-wrap { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.drop { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; border: 2px dashed var(--line); border-radius: 14px; color: var(--ink-2); }
.drop.over { border-color: var(--gold-2); background: var(--gold-soft); }
.drop b { display: block; font: 400 24px var(--serif); color: var(--ink); }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,253,249,.82); font-weight: 500; gap: 10px; align-content: center; justify-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--gold-2); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; min-height: 34px; padding: 0 14px; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn[aria-pressed="true"] { border-color: var(--gold-2); background: var(--gold-soft); }
#wrap3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.readout { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.form { padding: 22px; display: grid; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sect { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.sect h3 { margin: 0; font: 500 11.5px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-2); }
.issues { margin: 0; padding: 12px 14px 12px 32px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; font-size: 13.5px; }
.ready { margin: 0; padding: 12px 14px; background: var(--ok-soft); color: var(--ok); border-radius: 12px; font-size: 13.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.snippet { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font: 12.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { padding: 16px 18px; display: grid; gap: 2px; }
.tile .lbl { color: var(--ink-2); font-size: 12.5px; }
.tile b { font: 400 34px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.tile small { color: var(--ink-2); font-size: 12px; }
.chartcard { padding: 18px 20px; margin-bottom: 16px; display: grid; gap: 12px; }
.chead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chead h2 { margin: 0; font: 400 24px var(--serif); }
.chartcard > * { min-width: 0; }
.chart { position: relative; min-height: 220px; overflow: hidden; }
.chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--ink-2); stroke-opacity: .5; stroke-width: 1; }
.chart .ax { fill: var(--ink-2); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--bar); }
.chart .bar.on { fill: var(--bar-on); }
.chart .hit { fill: transparent; }
.tip { position: absolute; pointer-events: none; padding: 7px 11px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 12px; display: grid; white-space: nowrap; box-shadow: var(--shadow); }
.tip[hidden] { display: none; }
.tip b { font-weight: 600; font-size: 13px; }
.tablewrap { overflow-x: auto; }
.tablewrap[hidden] { display: none; }
.tbl { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
#dayTable .tbl { min-width: 0; }
.tbl th { text-align: left; font: 500 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
.tbl td:first-child { min-width: 150px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { color: var(--ink); text-underline-offset: 3px; }
.inbar { display: inline-block; width: 64px; height: 6px; margin-right: 10px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.inbar i { display: block; height: 100%; border-radius: 3px; background: var(--bar); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--surface); font-weight: 500; transition: .25s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); color: #fff; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .stage { position: static; } }
@media (max-width: 520px) { main { padding: 20px 14px 50px; } .top { padding: 12px 14px; } .row2 { grid-template-columns: 1fr; } .search { width: 100%; }
  .who, .brand small { display: none; } .top nav { flex-wrap: wrap; justify-content: flex-end; gap: 6px; } .top nav .btn { white-space: nowrap; } }

/* ---- shared by the dashboard, account pages and platform console ---- */
.banner { padding: 10px 24px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.banner.imp { background: #6b1f1a; color: #fff; }
.banner .btn { min-height: 30px; }
.switch { min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-size: 13px; max-width: 200px; }
.top nav a.btn[aria-current="page"] { border-color: var(--gold-2); background: var(--gold-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.steps li .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li b { display: block; font-weight: 500; }
.steps li span.help { display: block; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; font: 600 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); }
.status.live, .status.active, .status.trial { background: var(--ok-soft); color: var(--ok); }
.status.pending { background: var(--warn-soft); color: var(--warn); }
.status.suspended, .status.closed { background: #f6dcd9; color: var(--danger); }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--bar); border-radius: 5px; }
.meter.hot i { background: var(--danger); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.pad { padding: 22px; display: grid; gap: 14px; }
.pad h2 { margin: 0; font: 400 26px var(--serif); }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { flex: 1; min-width: 180px; }
.swatch { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: none; }
.logo-box { width: 72px; height: 72px; border-radius: 16px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.preview-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 16px; background: #0f0d0b; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.auth { max-width: 440px; margin: 7vh auto; padding: 32px; display: grid; gap: 16px; }
.auth .alt { font-size: 13.5px; color: var(--ink-2); text-align: center; margin: 0; }
.ok-box { padding: 12px 14px; background: var(--ok-soft); color: var(--ok); border-radius: 12px; font-size: 14px; margin: 0; }
.field input, .field select { width: 100%; min-width: 0; }
.row2 > *, .cols > * { min-width: 0; }
