/* ==========================================================================
   Moth to a Flame — design system
   Tokens → base → layout → components → shells (site / palace / dashboards)
   Page-specific styles live next to their page as pages-*.css
   ========================================================================== */

:root {
  --bg: #0b0a09;
  --bg-2: #12100e;
  --bg-3: #1a1714;
  --bg-4: #231f1a;
  --gold: #c9a35c;
  --gold-2: #e6cf9a;
  --gold-3: #8f7340;
  --ink: #efe7d8;
  --ink-2: #b9ae9b;
  --ink-3: #81786a;
  --line: rgba(201, 163, 92, .2);
  --line-2: rgba(255, 255, 255, .07);
  --ok: #93b08e;
  --warn: #d9a860;
  --bad: #cf8271;
  --on-gold: #14110c;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --script: "Pinyon Script", cursive;
  --display: var(--serif);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 84px;
  --maxw: 1320px;
}

/* Storefront themes — applied with data-theme on any wrapper */
[data-theme="obsidian"] { --bg:#0b0a09; --bg-2:#12100e; --bg-3:#1a1714; --bg-4:#231f1a; --ink:#efe7d8; --ink-2:#b9ae9b; --ink-3:#81786a; --line-2:rgba(255,255,255,.07); --on-gold:#14110c; }
[data-theme="espresso"] { --bg:#1b120d; --bg-2:#231811; --bg-3:#2c1f16; --bg-4:#38281c; --ink:#f1e4d2; --ink-2:#c4b09a; --ink-3:#8f7b68; --line-2:rgba(255,255,255,.08); --on-gold:#1b120d; }
[data-theme="midnight"] { --bg:#0a0d14; --bg-2:#10141d; --bg-3:#171c28; --bg-4:#1f2634; --ink:#e8e9ee; --ink-2:#a9adba; --ink-3:#737888; --line-2:rgba(255,255,255,.08); --on-gold:#0a0d14; }
[data-theme="ivory"]    { --bg:#f6f0e6; --bg-2:#efe7da; --bg-3:#fbf7f0; --bg-4:#e6dccb; --ink:#2a241c; --ink-2:#5f5648; --ink-3:#8d8372; --line-2:rgba(42,36,28,.1); --on-gold:#fbf7f0; }
[data-theme="blush"]    { --bg:#f3dfdb; --bg-2:#ecd3ce; --bg-3:#f9ece9; --bg-4:#e3c5bf; --ink:#2e2222; --ink-2:#655050; --ink-3:#927a78; --line-2:rgba(46,34,34,.1); --on-gold:#f9ece9; }
[data-theme="sage"]     { --bg:#e3e6da; --bg-2:#d8dccd; --bg-3:#eef0e7; --bg-4:#cbd0bd; --ink:#242a20; --ink-2:#555d4e; --ink-3:#808876; --line-2:rgba(36,42,32,.1); --on-gold:#eef0e7; }
[data-theme] { background: var(--bg); color: var(--ink); }
[data-font="couture"] { --display: "Playfair Display", var(--serif); }
[data-font="modern"]  { --display: var(--sans); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.7;
  letter-spacing: .01em; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 1px solid var(--gold-2); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- typography ---------- */
.display { font-family: var(--display); font-weight: 300; font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: 1.02; letter-spacing: .02em; }
.h1 { font-family: var(--display); font-weight: 300; font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.08; letter-spacing: .02em; }
.h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: .02em; }
.h3 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.25; letter-spacing: .02em; }
.h4 { font-family: var(--display); font-weight: 500; font-size: 1.15rem; line-height: 1.3; }
.eyebrow { font-family: var(--sans); font-weight: 400; font-size: .7rem; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.script { font-family: var(--script); font-size: 1.9em; line-height: 1; color: var(--gold); letter-spacing: 0; text-transform: none; }
.lede { font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.6; color: var(--ink-2); font-weight: 400; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.gold { color: var(--gold); }
.small { font-size: .84rem; }
.tiny { font-size: .72rem; letter-spacing: .08em; }
.caps { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 400; }
.italic { font-style: italic; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 4vw, 56px); }
.container-narrow { max-width: 860px; }
.section { padding-block: clamp(64px, 9vw, 132px); }
.section-tight { padding-block: clamp(40px, 5vw, 72px); }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 16px); }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--gap, 28px); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 1000px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); --gap: 16px; } }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 64px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }

/* ---------- brand mark ---------- */
.moth-mark {
  display: inline-block; width: var(--size, 40px); aspect-ratio: 750 / 610; flex: none;
  background: var(--mark-color, var(--gold));
  -webkit-mask: url(../img/moth-mark.png) center / contain no-repeat;
          mask: url(../img/moth-mark.png) center / contain no-repeat;
}
.wordmark { font-family: var(--serif); font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); line-height: 1.05; }
.wordmark small { display: block; font-family: var(--sans); font-size: .42em; letter-spacing: .42em; font-weight: 400; margin-top: .5em; }
.ornament { display: flex; align-items: center; gap: 18px; color: var(--gold); justify-content: center; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: min(120px, 18vw); background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { transform: scaleX(-1); }
.rule { height: 1px; border: 0; background: var(--line); margin: 0; }
.rule-short { width: 64px; height: 1px; background: var(--gold); border: 0; margin: 24px 0; }
.center .rule-short { margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 30px; border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--sans); font-size: .72rem; font-weight: 400; letter-spacing: .28em; text-transform: uppercase;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), opacity .2s;
  white-space: nowrap; cursor: pointer; background: transparent;
}
.btn:hover { background: var(--gold); color: var(--on-gold); }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn-quiet { border-color: transparent; padding-inline: 8px; min-height: 36px; }
.btn-quiet:hover { background: transparent; color: var(--gold-2); }
.btn-danger { border-color: rgba(207,130,113,.5); color: var(--bad); }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #1a0d0a; }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: .66rem; letter-spacing: .22em; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.link { color: var(--gold); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .3s; }
.link:hover { border-color: var(--gold); }
.link-arrow { display: inline-flex; align-items: center; gap: 10px; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.link-arrow::after { content: ""; width: 28px; height: 1px; background: currentColor; transition: width .35s var(--ease); }
.link-arrow:hover::after { width: 48px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); position: relative; transition: color .3s; }
.icon-btn:hover { color: var(--gold); }
.icon-btn svg, .icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.count-dot { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: var(--on-gold); font-size: .62rem; font-weight: 500; line-height: 16px; text-align: center; letter-spacing: 0; }
.count-dot:empty, .count-dot[data-zero] { display: none; }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 18px; }
.label { display: block; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0; font: inherit; font-size: .95rem; transition: border-color .3s, background .3s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); background: rgba(201,163,92,.04); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.select option { background: var(--bg-2); color: var(--ink); }
.hint { font-size: .78rem; color: var(--ink-3); margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 12px; transition: .3s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: .3s var(--ease); }
.switch input:checked + span { border-color: var(--gold); background: rgba(201,163,92,.15); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--gold); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.qty button { width: 40px; height: 44px; font-size: 1.1rem; color: var(--ink-2); }
.qty button:hover { color: var(--gold); }
.qty span { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- surfaces ---------- */
.panel { background: var(--bg-2); border: 1px solid var(--line-2); padding: clamp(20px, 2.4vw, 32px); }
.panel-gold { border-color: var(--line); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); white-space: nowrap; font-weight: 400; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-plain::before { display: none; }
.badge-ok { color: var(--ok); border-color: rgba(147,176,142,.35); }
.badge-warn { color: var(--warn); border-color: rgba(217,168,96,.35); }
.badge-bad { color: var(--bad); border-color: rgba(207,130,113,.35); }
.badge-mute { color: var(--ink-3); border-color: var(--line-2); }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); border: 1px dashed var(--line); }
.empty .moth-mark { --size: 44px; opacity: .6; margin: 0 auto 16px; display: block; }
.preview-note { font-size: .74rem; color: var(--ink-3); border-left: 1px solid var(--gold-3); padding-left: 12px; line-height: 1.5; }

/* ---------- product card ---------- */
.product-card { display: block; position: relative; }
.product-card .art { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-3); }
.product-card .art > img, .product-card .art > svg { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.product-card:hover .art > img, .product-card:hover .art > svg { transform: scale(1.045); }
.product-card .wish { position: absolute; top: 10px; right: 10px; z-index: 2; color: #efe7d8; background: rgba(11,10,9,.35); backdrop-filter: blur(6px); }
.product-card .wish.is-on { color: var(--gold); }
.product-card .wish.is-on svg { fill: currentColor; }
.product-card .quick { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; opacity: 0; transform: translateY(8px); transition: .4s var(--ease); background: rgba(11,10,9,.82); backdrop-filter: blur(8px); color: #e6cf9a; border-color: rgba(201,163,92,.5); }
.product-card:hover .quick, .product-card:focus-within .quick { opacity: 1; transform: none; }
@media (hover: none) { .product-card .quick { display: none; } }
.product-card .meta { padding: 16px 2px 0; }
.product-card .maison { font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-3); }
.product-card .name { font-family: var(--display); font-size: 1.28rem; line-height: 1.25; margin-top: 4px; }
.product-card .notes { font-size: .8rem; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .price { margin-top: 8px; font-size: .9rem; letter-spacing: .06em; color: var(--gold); font-variant-numeric: tabular-nums; }
.product-card .price s { color: var(--ink-3); margin-right: 8px; }
.product-card .flag { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(11,10,9,.7); color: #e6cf9a; backdrop-filter: blur(6px); border-color: rgba(201,163,92,.4); }
.art-frame { position: relative; overflow: hidden; background: var(--bg-3); }
.art-frame > img, .art-frame > svg { width: 100%; height: 100%; object-fit: cover; }

/* ---------- shop (maison) card ---------- */
.maison-card { display: block; border: 1px solid var(--line-2); transition: border-color .4s, transform .6s var(--ease); background: var(--bg-2); }
.maison-card:hover { border-color: var(--line); transform: translateY(-4px); }
.maison-card .banner { aspect-ratio: 16 / 10; position: relative; overflow: hidden; display: grid; place-items: center; }
.maison-card .body { padding: 22px 24px 26px; }
.monogram { display: inline-grid; place-items: center; width: var(--size, 56px); height: var(--size, 56px); border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: var(--serif); font-size: calc(var(--size, 56px) * .4); letter-spacing: .04em; flex: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: rgba(201,163,92,.03); }
.table .right { text-align: right; }
.table-thumb { width: 44px; height: 54px; overflow: hidden; background: var(--bg-3); flex: none; }
.table-thumb img, .table-thumb svg { width: 100%; height: 100%; object-fit: cover; }

/* ---------- tabs / chips ---------- */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 14px 0; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .3s; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--gold); border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 16px; border: 1px solid var(--line-2); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); transition: .3s; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line); color: var(--ink); }
.chip.is-active { border-color: var(--gold); color: var(--gold); background: rgba(201,163,92,.06); }

/* ---------- KPIs & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.kpi { background: var(--bg-2); padding: 22px 24px; min-width: 0; }
.kpi .k-label { font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }
.kpi .k-value { font-family: var(--serif); font-size: 2.3rem; line-height: 1.1; margin-top: 8px; font-weight: 400; font-variant-numeric: tabular-nums; }
.kpi .k-delta { font-size: .76rem; margin-top: 6px; color: var(--ink-3); }
.k-delta.up { color: var(--ok); } .k-delta.down { color: var(--bad); }
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); font-size: 10px; fill: var(--ink-3); letter-spacing: .08em; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 180px) 1fr auto; gap: 14px; align-items: center; font-size: .86rem; padding: 7px 0; }
.bar-row .track { height: 6px; background: var(--line-2); }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold)); }

/* ---------- toast & modal ---------- */
.toasts { position: fixed; z-index: 400; left: 50%; bottom: 28px; transform: translateX(-50%); display: grid; gap: 10px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: #17140f; border: 1px solid rgba(201,163,92,.45); color: #efe7d8; padding: 14px 20px; font-size: .88rem; display: flex; gap: 12px; align-items: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: rise .5s var(--ease); pointer-events: auto; }
.toast .moth-mark { --size: 22px; --mark-color: #c9a35c; }
.toast a { color: #e6cf9a; margin-left: auto; font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }
.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(5,4,3,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .3s; overflow-y: auto; }
.modal { width: min(100%, var(--modal-w, 560px)); background: #12100e; color: #efe7d8; border: 1px solid rgba(201,163,92,.3); padding: clamp(24px, 4vw, 44px); position: relative; animation: rise .5s var(--ease); max-height: calc(100vh - 40px); overflow-y: auto;
  --bg:#0b0a09; --bg-2:#12100e; --bg-3:#1a1714; --ink:#efe7d8; --ink-2:#b9ae9b; --ink-3:#81786a; --line-2:rgba(255,255,255,.07); --on-gold:#14110c; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 28px; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-1deg); opacity: 1; } 30% { transform: scale(1.04, .97) rotate(1.2deg); opacity: .94; } 60% { transform: scale(.97, 1.04) rotate(-.6deg); } 80% { transform: scale(1.02, .99) rotate(.8deg); opacity: .97; } }
.flame-anim { transform-origin: 50% 100%; transform-box: fill-box; animation: flicker 3.2s ease-in-out infinite; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .flame-anim { animation: none; } html { scroll-behavior: auto; } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .moth-mark { animation: fade 1.2s ease-in-out infinite alternate; }

/* ==========================================================================
   Public shell — site + palace header / footer
   ========================================================================== */
.announce { background: var(--bg-2); border-bottom: 1px solid var(--line-2); text-align: center; font-size: .66rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); padding: 9px 16px; }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(11,10,9,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); color: #efe7d8; transition: background .4s; }
.site-header.is-over { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(11,10,9,.7), transparent); border-color: transparent; backdrop-filter: none; }
.site-header.is-over.is-scrolled { background: rgba(11,10,9,.9); backdrop-filter: blur(14px); border-color: var(--line-2); }
.site-header .bar { height: var(--header-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.site-nav { display: flex; gap: clamp(18px, 2.4vw, 38px); align-items: center; }
.site-nav a { font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: #cfc5b3; padding: 8px 0; position: relative; white-space: nowrap; transition: color .3s; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: #c9a35c; transition: right .4s var(--ease); }
.site-nav a:hover, .site-nav a.is-active { color: #e6cf9a; }
.site-nav a:hover::after, .site-nav a.is-active::after { right: 0; }
.site-header .tools { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.site-header .tools .icon-btn { color: #efe7d8; }
.site-header .tools .icon-btn:hover { color: #c9a35c; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brand .moth-mark { --size: 34px; --mark-color: #c9a35c; }
.brand .wordmark { font-size: .92rem; color: #c9a35c; }
.brand .wordmark small { font-size: .5rem; letter-spacing: .4em; margin-top: 3px; }
.brand-row { flex-direction: row; gap: 14px; text-align: left; }
.palace-pill { border: 1px solid rgba(201,163,92,.55); color: #c9a35c !important; padding: 9px 18px !important; }
.palace-pill::after { display: none; }
.palace-pill:hover { background: #c9a35c; color: #14110c !important; }
/* Navigation is a hamburger at every width: menu left, brand dead centre, tools right. */
.nav-toggle { display: inline-grid; margin-left: -10px; }
.site-header .site-nav { position: fixed; inset: var(--header-h) 0 0 0; height: calc(100vh - var(--header-h)); background: #0b0a09; flex-direction: column; justify-content: center; gap: 34px; transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s; }
.site-header .site-nav a { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: .12em; }
.site-header .site-nav a.palace-pill { font-family: var(--sans); font-size: .78rem; letter-spacing: .28em; margin-top: 10px; padding: 14px 28px !important; }
.site-header.nav-open .site-nav { transform: none; opacity: 1; visibility: visible; pointer-events: auto; }
.site-header.nav-open { background: #0b0a09 !important; backdrop-filter: none; }
@media (max-width: 980px) {
  :root { --header-h: 68px; }
  .brand .wordmark small { display: none; }
  .brand .moth-mark { --size: 26px; }
  .brand .wordmark { font-size: .76rem; }
  .tools .hide-sm { display: none; }
}
.site-footer { border-top: 1px solid var(--line-2); background: #090807; color: #b9ae9b; padding: 72px 0 28px; font-size: .9rem;
  --ink:#efe7d8; --ink-2:#b9ae9b; --ink-3:#81786a; --line-2:rgba(255,255,255,.07); --bg-2:#12100e; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.site-footer h4 { font-family: var(--sans); font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: #c9a35c; font-weight: 400; margin-bottom: 18px; }
.site-footer li + li { margin-top: 10px; }
.site-footer a:hover { color: #e6cf9a; }
.site-footer .legal { margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .72rem; letter-spacing: .12em; color: #81786a; }
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
main.page { min-height: 60vh; animation: fade .6s; }

/* ==========================================================================
   Dashboards — vendor Atelier and Keeper's Office
   ========================================================================== */
.dash { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.dash-side { background: #090807; border-right: 1px solid var(--line-2); padding: 28px 0 20px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-side .brand { padding: 0 24px 24px; border-bottom: 1px solid var(--line-2); align-items: flex-start; text-align: left; }
.dash-side .who { padding: 20px 24px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: center; }
.dash-side .who .monogram { --size: 40px; }
.dash-nav { padding: 16px 12px; flex: 1; }
.dash-nav a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); border-left: 1px solid transparent; transition: .3s; }
.dash-nav a:hover { color: var(--ink); background: rgba(255,255,255,.02); }
.dash-nav a.is-active { color: var(--gold); border-color: var(--gold); background: rgba(201,163,92,.06); }
.dash-nav .count { margin-left: auto; font-size: .64rem; background: var(--gold); color: var(--on-gold); padding: 0 6px; border-radius: 8px; letter-spacing: 0; font-weight: 500; }
.dash-nav .sep { height: 1px; background: var(--line-2); margin: 12px 14px; }
.dash-side .foot { padding: 12px; border-top: 1px solid var(--line-2); }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(20px, 3vw, 44px); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 50; background: rgba(11,10,9,.9); backdrop-filter: blur(12px); }
.dash-main { padding: clamp(20px, 3vw, 44px); max-width: 1400px; animation: fade .5s; }
.dash-main > * + * { margin-top: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; height: auto; padding: 14px 0 0; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .dash-side .brand { padding: 0 20px 12px; border: 0; }
  .dash-side .who, .dash-side .foot, .dash-nav .sep { display: none; }
  .dash-nav { display: flex; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
  .dash-nav a { border-left: 0; border-bottom: 1px solid transparent; white-space: nowrap; padding: 12px; }
  .dash-top { position: static; }
}
.feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--gold); }
.feed .dot svg { width: 15px; height: 15px; }
.feed time { font-size: .72rem; color: var(--ink-3); white-space: nowrap; }

/* ---------- conversation (front desk + Moth Agent) ---------- */
.chat-log { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 86%; padding: 12px 16px; font-size: .92rem; line-height: 1.55; animation: rise .4s var(--ease); white-space: pre-line; }
.msg-them { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--line-2); }
.msg-me { align-self: flex-end; background: rgba(201,163,92,.12); border: 1px solid var(--line); }
.msg .who { display: block; font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.msg-products { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; }
.msg-products a { flex: none; width: 104px; font-size: .74rem; line-height: 1.3; white-space: normal; }
.msg-products .art-frame { aspect-ratio: 4/5; margin-bottom: 6px; }
.chat-form { display: flex; gap: 0; border: 1px solid var(--line); margin-top: 12px; }
.chat-form input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font: inherit; font-size: .92rem; padding: 14px 16px; }
.chat-form input:focus { outline: none; }
.chat-form button { padding: 0 18px; color: var(--gold); font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; }
.suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggests button { border: 1px solid var(--line-2); padding: 6px 12px; font-size: .74rem; color: var(--ink-2); transition: .3s; }
.suggests button:hover { border-color: var(--gold); color: var(--gold); }
.desk-fab { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: flex; align-items: center; gap: 12px; background: #12100e; color: #e6cf9a; border: 1px solid rgba(201,163,92,.5); padding: 12px 20px 12px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.45); font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; transition: transform .4s var(--ease); }
.desk-fab:hover { transform: translateY(-3px); }
.desk-fab .moth-mark { --size: 26px; --mark-color: #c9a35c; }
.desk-panel { position: fixed; right: 22px; bottom: 22px; z-index: 160; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 44px)); display: flex; flex-direction: column; background: #12100e; color: #efe7d8; border: 1px solid rgba(201,163,92,.4); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .45s var(--ease);
  --bg:#0b0a09; --bg-2:#12100e; --bg-3:#1a1714; --ink:#efe7d8; --ink-2:#b9ae9b; --ink-3:#81786a; --line:rgba(201,163,92,.2); --line-2:rgba(255,255,255,.07); --gold:#c9a35c; --on-gold:#14110c; }
.desk-panel header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.desk-panel .chat-log { flex: 1; padding: 16px 18px; }
.desk-panel footer { padding: 0 18px 16px; }
@media (max-width: 520px) { .desk-panel { right: 12px; bottom: 12px; } .desk-fab span.txt { display: none; } .desk-fab { padding: 12px; border-radius: 50%; } }

/* ---------- preview switcher ---------- */
.preview-switch { position: fixed; left: 18px; bottom: 18px; z-index: 200; font-size: .68rem; letter-spacing: .14em; }
.preview-switch > button { background: #17140f; color: #b9ae9b; border: 1px solid rgba(255,255,255,.14); padding: 9px 14px; display: flex; gap: 8px; align-items: center; text-transform: uppercase; }
.preview-switch > button b { color: #c9a35c; font-weight: 400; }
.preview-switch .menu { position: absolute; bottom: calc(100% + 8px); left: 0; width: 290px; background: #12100e; border: 1px solid rgba(201,163,92,.35); padding: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: rise .3s var(--ease); }
.preview-switch .menu button { display: block; width: 100%; text-align: left; padding: 11px 12px; color: #efe7d8; letter-spacing: .04em; font-size: .86rem; }
.preview-switch .menu button small { display: block; color: #81786a; font-size: .72rem; }
.preview-switch .menu button:hover, .preview-switch .menu button.is-active { background: rgba(201,163,92,.1); color: #e6cf9a; }
.preview-switch .menu hr { border: 0; height: 1px; background: rgba(255,255,255,.08); margin: 6px 0; }
@media print { .preview-switch, .desk-fab { display: none; } }

/* ---------- scrollbars ---------- */
html { color-scheme: dark; scrollbar-color: #3a332a #0b0a09; }
* { scrollbar-width: thin; }

/* ---------- keep dashboard grids from being stretched by wide children ---------- */
.dash-main, .dash-main > *, .dash-grid > *, .dash-main .panel, .dash-main .grid > * { min-width: 0; max-width: 100%; }
.dash-main .panel-head > * { min-width: 0; }
.dash-main .table-wrap { max-width: 100%; }
