/* Mercurius: commerce carried by the god of it. Marble ground, gilt and quicksilver accents,
   inscriptional capitals for headlines, a humanist italic for prose, a terminal mono for data. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --marble: #f1ede6;
  --marble-2: #e8e3da;
  --marble-3: #dcd6ca;
  --paper: rgba(255, 253, 249, 0.72);
  --ink: #1c1b18;
  --ink-2: #4a4741;
  --muted: #7c776c;
  --line: rgba(28, 27, 24, 0.14);
  --line-strong: rgba(28, 27, 24, 0.34);
  --gilt: #a1782c;
  --gilt-2: #c9a24f;
  --gilt-dim: rgba(161, 120, 44, 0.12);
  --silver: #66788c;
  --silver-dim: rgba(102, 120, 140, 0.14);
  --pompeii: #a8412f;
  --pompeii-dim: rgba(168, 65, 47, 0.12);
  --ok: #3e7a5b;
  --warn: #b0801f;
  --bad: #a8412f;
  --basalt: #1f1e1b;
  --basalt-2: #2a2926;
  --basalt-ink: #ece7dc;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 0;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1280px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--marble) url("marble.svg") center top / 1600px 1600px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 85% -5%, rgba(201,162,79,0.16), transparent 60%),
              radial-gradient(700px 500px at -5% 100%, rgba(102,120,140,0.14), transparent 60%);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gilt); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; display: block; }
::selection { background: var(--gilt); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

/* Type */
h1, h2, .display { font-family: var(--display); font-weight: 500; letter-spacing: 0.01em; line-height: 1.04; margin: 0; }
h1 { font-size: clamp(34px, 5.8vw, 74px); }
h2 { font-size: clamp(28px, 4.2vw, 52px); }
h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; margin: 0; letter-spacing: 0; }
h1 em, h2 em, h3 em, .it { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--gilt); letter-spacing: 0; }
h1 em, h2 em { font-size: 1.12em; }
p { margin: 0 0 1em; }
.lede { font-family: var(--serif); font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
.eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); line-height: 1.8; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gilt); display: inline-block; vertical-align: middle; margin-right: 12px; }
.eyebrow .dot { margin: 0 6px; vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; color: var(--muted); }
.dim { color: var(--muted); }
.acid { color: var(--gilt); }
.ember { color: var(--pompeii); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--marble) 88%, transparent);
  backdrop-filter: blur(10px);
}
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px; background: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; letter-spacing: 0.3em; font-size: 13px; }
.brand .moon { width: 28px; height: 18px; background: none; box-shadow: none; border-radius: 0; position: relative; }
.brand .moon::before { content: ""; position: absolute; left: 9px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gilt); box-shadow: 0 0 0 2px var(--marble), 0 0 0 3px var(--gilt); }
.brand .moon::after { content: ""; position: absolute; inset: 6px 0 auto 0; height: 5px; border-top: 2px solid var(--gilt); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; font-family: var(--display); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; }
.nav ul a.active { color: var(--gilt); }
@media (max-width: 720px) { .nav { flex-wrap: wrap; } .nav ul { order: 3; width: 100%; gap: 16px; overflow-x: auto; padding-top: 10px; } }

/* Buttons: engraved plates */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font-family: var(--display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500;
  transition: background .15s, color .15s, transform .1s, border-color .15s, box-shadow .15s;
  white-space: nowrap; box-shadow: inset 0 0 0 0 transparent;
}
.btn:hover { background: var(--ink); color: var(--marble); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--marble); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 2px var(--gilt-2); }
.btn.primary:hover { background: var(--gilt); border-color: var(--gilt); color: #fff; box-shadow: inset 0 0 0 1px var(--gilt), inset 0 0 0 2px #fff3d6; }
.btn.ghost { border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: 10px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.ok { border-color: var(--ok); color: var(--ok); }
.btn.ok:hover { background: var(--ok); color: #fff; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .count { background: var(--gilt); color: #fff; padding: 0 7px; border-radius: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0; }
.btn.primary .count { background: var(--gilt-2); color: var(--ink); }

/* Cards: marble slabs with gilt corner keys */
.card {
  position: relative; border: 1px solid var(--line-strong); background: var(--paper);
  padding: 22px; border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 12px 30px -24px rgba(28,27,24,.5);
}
.card::before, .card::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--gilt); pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card.flat::before, .card.flat::after { display: none; }
.card h3 { margin-bottom: 8px; }
.card .label { font-family: var(--display); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gilt); margin-bottom: 10px; }
.card.basalt { background: var(--basalt); color: var(--basalt-ink); border-color: var(--basalt); }
.card.basalt .small, .card.basalt .dim { color: #a19b8f; }

/* Tags and pills */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--ink-2); background: rgba(255,255,255,.5);
}
.tag.acid { border-color: var(--gilt); color: var(--gilt); background: var(--gilt-dim); }
.tag.ember { border-color: var(--pompeii); color: var(--pompeii); background: var(--pompeii-dim); }
.tag.ok { border-color: var(--ok); color: var(--ok); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.tag.bad { border-color: var(--bad); color: var(--bad); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* Ticker: an inscription band */
.ticker { border-block: 1px solid var(--line-strong); overflow: hidden; white-space: nowrap; background: var(--basalt); color: var(--basalt-ink); position: relative; z-index: 1; }
.ticker-track { display: inline-flex; gap: 48px; padding: 10px 0; animation: ticker 60s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { font-size: 12px; color: #b9b3a6; }
.ticker-item b { color: var(--gilt-2); font-weight: 500; font-family: var(--display); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Log feed */
.feed { display: flex; flex-direction: column; gap: 0; max-height: 420px; overflow: auto; scrollbar-width: thin; }
.feed-item { display: grid; grid-template-columns: 56px 84px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12px; align-items: baseline; }
.feed-item:first-child { animation: slidein .35s ease-out; }
.feed-item .t { color: var(--muted); }
.feed-item .k { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: 9.5px; }
.feed-item .m { color: var(--ink-2); }
.feed-item .m b { color: var(--ink); font-weight: 500; }
.basalt .feed-item { border-color: rgba(236,231,220,.14); }
.basalt .feed-item .m { color: #c9c3b6; } .basalt .feed-item .m b { color: var(--basalt-ink); } .basalt .feed-item .t { color: #8d877b; }
.k-price { color: var(--gilt); } .k-stock { color: var(--pompeii); } .k-fraud { color: var(--bad); }
.k-fulfil { color: var(--ok); } .k-approval { color: var(--warn); } .k-system { color: var(--muted); } .k-sale { color: var(--ink); } .k-support { color: var(--silver); }
.basalt .k-price { color: var(--gilt-2); } .basalt .k-sale { color: var(--basalt-ink); } .basalt .k-fulfil { color: #7cc59c; } .basalt .k-stock { color: #e0785f; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .feed-item { grid-template-columns: 52px 1fr; } .feed-item .k { grid-column: 2; } .feed-item .m { grid-column: 1 / -1; } }

/* Layout helpers */
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }
.section { padding-block: clamp(56px, 8vw, 120px); border-top: 1px solid var(--line-strong); position: relative; }
.section::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 110px) clamp(40px, 6vw, 80px); display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { margin: 18px 0 22px; }
.hero-panel { position: relative; }
.hero-panel .card { padding: 0; overflow: hidden; }
.panel-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid rgba(236,231,220,.16); font-family: var(--display); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #a19b8f; }
.panel-body { padding: 8px 16px 16px; }

/* Big numbers */
.stat { padding: 20px 0; border-top: 1px solid var(--line-strong); }
.stat .v { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.6vw, 60px); line-height: 1; color: var(--ink); }
.stat .v small { font-size: .45em; color: var(--muted); font-family: var(--mono); margin-left: 6px; }
.stat .l { font-family: var(--display); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* Steps: numbered in Roman */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line-strong); background: var(--paper); }
.steps > div { padding: 26px; border-right: 1px solid var(--line); position: relative; }
.steps > div:last-child { border-right: 0; }
.steps .n { font-family: var(--display); font-size: 40px; color: var(--gilt); line-height: 1; margin-bottom: 16px; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } .steps > div:nth-child(2) { border-right: 0; } .steps > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .steps > div { border-right: 0; border-bottom: 1px solid var(--line); } .steps > div:last-child { border-bottom: 0; } }

/* Pricing tiers */
.tier { display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
.tier .price { font-family: var(--display); font-size: 46px; line-height: 1; }
.tier .price small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tier ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 12px; color: var(--ink-2); }
.tier ul li::before { content: "· "; color: var(--gilt); font-weight: 600; }
.tier.featured { border-color: var(--gilt); background: linear-gradient(180deg, var(--gilt-dim), var(--paper)); }

/* Footer */
.footer { border-top: 1px solid var(--line-strong); padding: 40px 0 60px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* Store */
.store-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 40px 0 24px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,.5); font-family: var(--display); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.chip.on, .chip:hover { border-color: var(--gilt); color: var(--gilt); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; background: transparent; border: 1px solid var(--line-strong); border-right: 0; border-bottom: 0; }
.product { background: var(--paper); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: background .2s; }
.product:hover { background: rgba(255,253,249,.95); }
.product .art { aspect-ratio: 1; border: 1px solid var(--line); background: var(--marble-2); overflow: hidden; }
.product .art svg { width: 100%; height: 100%; }
.product .name { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.1; }
.product .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.product .price { font-size: 18px; font-weight: 500; }
.product .price s { color: var(--muted); font-size: 12px; margin-right: 6px; font-weight: 400; }
.product .delta { font-size: 11px; }
.product .why { font-size: 11px; color: var(--muted); border: 0; background: transparent; padding: 0; text-decoration: underline dotted; cursor: help; text-align: left; font-style: italic; font-family: var(--serif); font-size: 14px; }
.product .stock { font-size: 11px; color: var(--muted); }
.product .stock.low { color: var(--warn); }
.product .stock.out { color: var(--bad); }
.product .actions { display: flex; gap: 8px; margin-top: auto; }
.product .actions .btn { flex: 1; justify-content: center; }
.flash { animation: flash .8s ease-out; }
@keyframes flash { 0% { background: var(--gilt-dim); } 100% { background: transparent; } }

.why-pop { position: absolute; z-index: 20; left: 18px; right: 18px; bottom: 90px; background: var(--basalt); color: #c9c3b6; border: 1px solid var(--gilt); padding: 12px; font-size: 12px; box-shadow: 0 20px 40px rgba(28,27,24,.35); }
.why-pop b { color: var(--gilt-2); font-weight: 500; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--marble); border-left: 1px solid var(--line-strong); z-index: 50; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); box-shadow: -20px 0 60px rgba(28,27,24,.2); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line-strong); font-family: var(--display); letter-spacing: .18em; text-transform: uppercase; font-size: 11px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 20px; }
.drawer-foot { border-top: 1px solid var(--line-strong); padding: 16px 20px; display: grid; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cart-line .art { width: 56px; height: 56px; border: 1px solid var(--line); }
.cart-line .art svg { width: 100%; height: 100%; }
.qty { display: inline-flex; border: 1px solid var(--line-strong); background: rgba(255,255,255,.5); }
.qty button { background: transparent; border: 0; width: 26px; height: 26px; }
.qty span { width: 28px; text-align: center; line-height: 26px; font-size: 12px; }
.scrim { position: fixed; inset: 0; background: rgba(28,27,24,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(28,27,24,.45); }
.modal.open { display: flex; }
.modal .box { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--marble); border: 1px solid var(--line-strong); padding: 24px; position: relative; box-shadow: 0 30px 80px rgba(28,27,24,.35); }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-family: var(--display); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { background: rgba(255,255,255,.7); border: 1px solid var(--line-strong); padding: 10px 12px; border-radius: var(--radius); outline: none; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--gilt); }

/* Receipt: wax-sealed docket */
.receipt { background: #fbf8f1; color: #1c1b18; padding: 24px; font-size: 12px; position: relative; border: 1px solid var(--line-strong);
  -webkit-mask: linear-gradient(#000 0 0) padding-box, radial-gradient(circle at 8px 100%, transparent 6px, #000 6.5px) bottom / 16px 12px repeat-x; }
.receipt h3 { font-family: var(--display); font-size: 22px; margin-bottom: 4px; letter-spacing: .06em; }
.receipt .line { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted rgba(0,0,0,.25); }
.receipt .total { font-weight: 600; font-size: 14px; border-top: 2px solid #1c1b18; margin-top: 6px; padding-top: 6px; }
.receipt .stamp { position: absolute; right: 20px; top: 20px; border: 2px solid var(--pompeii); color: var(--pompeii); padding: 4px 8px; transform: rotate(-8deg); font-family: var(--display); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: 10px; }

/* Order stepper */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 12px 0; }
.stepper div { height: 4px; background: var(--line); position: relative; }
.stepper div.done { background: var(--gilt); }
.stepper div.now { background: var(--gilt); animation: pulse 1.2s infinite; }
.stepper-labels { display: grid; grid-template-columns: repeat(5, 1fr); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stepper-labels .now { color: var(--gilt); }
.order { padding: 16px 0; border-bottom: 1px dashed var(--line); }

/* Support widget */
.support { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 45; }
.support .btn { border-radius: 999px; box-shadow: 0 10px 30px rgba(28,27,24,.25); }
.support-box { position: fixed; right: 20px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: min(360px, calc(100vw - 40px)); height: 420px; background: var(--marble); border: 1px solid var(--line-strong); display: none; flex-direction: column; z-index: 46; box-shadow: 0 30px 60px rgba(28,27,24,.3); }
.support-box.open { display: flex; }
.support-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.msg { padding: 8px 10px; max-width: 85%; border: 1px solid var(--line); }
.msg.bot { align-self: flex-start; background: rgba(255,255,255,.7); }
.msg.me { align-self: flex-end; background: var(--gilt-dim); border-color: var(--gilt); }
.support-in { display: flex; border-top: 1px solid var(--line-strong); }
.support-in input { flex: 1; background: transparent; border: 0; padding: 12px; outline: none; }
.support-in button { background: var(--ink); color: var(--marble); border: 0; padding: 0 14px; font-family: var(--display); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }

/* Console */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line-strong); margin-block: 24px; background: var(--paper); }
.kpi { padding: 18px 20px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font-family: var(--display); font-weight: 500; font-size: 36px; line-height: 1; }
.kpi .l { font-family: var(--display); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.kpi .d { font-size: 11px; margin-top: 4px; }
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(3) { border-right: 0; } .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); } .kpi:nth-child(2n) { border-right: 0 !important; } }
.console-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.console-grid > * { min-width: 0; }
@media (max-width: 960px) { .console-grid { grid-template-columns: 1fr; } }
.policy { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.policy .pl { font-size: 12px; }
.policy .pl small { display: block; color: var(--muted); font-size: 11px; }
.policy .pv { font-size: 12px; color: var(--gilt); min-width: 52px; text-align: right; }
.policy input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--gilt); }
.switch { width: 38px; height: 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.6); position: relative; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch.on { border-color: var(--gilt); background: var(--gilt-dim); }
.switch.on::after { transform: translateX(18px); background: var(--gilt); }
.approval { padding: 14px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 8px; }
.approval .t { font-size: 13px; }
.approval .t b { color: var(--warn); font-weight: 500; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-family: var(--display); font-weight: 500; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line-strong); }
.tbl td { padding: 9px 6px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }
.bar { height: 6px; background: var(--line); position: relative; min-width: 80px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--gilt); }
.bar.low i { background: var(--warn); } .bar.out i { background: var(--bad); }
.filters button { background: transparent; border: 0; padding: 4px 8px; font-family: var(--display); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid transparent; }
.filters button.on { color: var(--gilt); border-color: var(--gilt); }
.report { border: 1px solid var(--gilt); background: linear-gradient(180deg, var(--gilt-dim), var(--paper)); padding: 18px; display: none; }
.report.show { display: block; }
.report h3 { color: var(--gilt); font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: .06em; }
.report ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--marble); padding: 10px 16px; font-size: 12px; opacity: 0; transition: .2s; z-index: 70; pointer-events: none; letter-spacing: .04em; border: 1px solid var(--gilt-2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mono-block { background: var(--basalt); color: #c9c3b6; border: 1px solid var(--basalt); padding: 12px; font-size: 11px; overflow: auto; max-height: 240px; white-space: pre; }

/* Margin page: invoices, profit table, ads feed */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); }
.compare > div { background: var(--paper); padding: 22px; }
.compare .big { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4vw, 50px); line-height: 1; }
.compare .big small { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 8px; }
@media (max-width: 600px) { .compare { grid-template-columns: 1fr; } }
.invoice { border: 1px solid var(--line-strong); padding: 14px 16px; display: grid; gap: 8px; background: rgba(255,253,249,.8); }
.invoice.done { border-color: var(--ok); }
.invoice .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.invoice .head b { font-weight: 500; }
.invoice .lines { display: none; }
.invoice.done .lines { display: block; }
.invoice .scan { height: 3px; background: var(--line); overflow: hidden; position: relative; }
.invoice .scan i { position: absolute; inset: 0; width: 30%; background: var(--gilt); animation: scan 1s linear infinite; }
@keyframes scan { from { left: -30%; } to { left: 100%; } }
.conf { display: inline-block; min-width: 34px; text-align: right; }
.conf.hi { color: var(--ok); } .conf.mid { color: var(--warn); } .conf.lo { color: var(--bad); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: transparent; border: 0; padding: 8px 12px; font-family: var(--display); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--gilt); border-color: var(--gilt); }
.tabpane { display: none; } .tabpane.on { display: block; }
.mono-block.tall { max-height: 360px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .vs { grid-template-columns: 1fr; } }
.vs .card.win { border-color: var(--gilt); background: linear-gradient(180deg, var(--gilt-dim), var(--paper)); }
.vs .v { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 46px); line-height: 1; }
.vs .v.neg { color: var(--bad); }
.hbar { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; font-size: 11px; padding: 4px 0; }
.hbar .track { height: 8px; background: var(--line); position: relative; }
.hbar .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--silver); }
.hbar .track i.profit { background: var(--gilt); }
.hbar .track i.neg { background: var(--bad); }
.hbar .n { text-align: right; }
.stale { color: var(--warn); }
textarea.paste { width: 100%; min-height: 110px; background: rgba(255,255,255,.7); border: 1px solid var(--line-strong); padding: 10px; font-size: 12px; resize: vertical; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
