/* Arcadia Sellers — demo / design mockup. Flat, editorial, black-and-white with one signal colour. */
:root, [data-theme="paper"] {
  --bg: #f4f2ec;
  --surface: #fbfaf6;
  --ink: #111110;
  --ink-2: #3a3a37;
  --muted: #6d6c66;
  --rule: #111110;
  --rule-soft: #d8d5cb;
  --signal: #2433ff;
  --ok: #17703a;
  --warn: #9a6a00;
  --bad: #b3261e;
  --fee: #9b988d;
  --cogs: #c9c6bb;
  --invert-bg: #111110;
  --invert-ink: #f4f2ec;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0e0d;
  --surface: #161615;
  --ink: #edebe4;
  --ink-2: #c4c2bb;
  --muted: #8f8d85;
  --rule: #edebe4;
  --rule-soft: #2c2c2a;
  --signal: #8a93ff;
  --ok: #5cc887;
  --warn: #e0b54a;
  --bad: #ff7b72;
  --fee: #6b6962;
  --cogs: #3f3e3a;
  --invert-bg: #edebe4;
  --invert-ink: #0e0e0d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 "Archivo", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
h1 { font-size: clamp(30px, 4.4vw, 52px); }
h2 { font-size: 17px; letter-spacing: -.01em; }
h3 { font-size: 15px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
main:focus { outline: none; }

/* Demo strip */
.demo-strip {
  background: var(--invert-bg); color: var(--invert-ink);
  font-size: 12.5px; padding: 7px 24px;
}
.demo-strip .mono { font-weight: 700; margin-right: 10px; padding: 1px 6px; border: 1px solid currentColor; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; border-bottom: 2px solid var(--rule); background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 17px;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-slash { color: var(--signal); margin: 0 2px; }
.topbar-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.label { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.tenant-pick { display: flex; align-items: center; gap: 8px; }
select {
  font: 500 14px "Archivo", sans-serif; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 0; padding: 7px 28px 7px 10px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.seg { display: inline-flex; border: 1px solid var(--rule); }
.seg-btn {
  font: 600 13px "Archivo", sans-serif; padding: 7px 12px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--rule); }
.seg-btn.is-on { background: var(--ink); color: var(--bg); }
.icon-btn {
  height: 34px; padding: 0 10px; border: 1px solid var(--rule); background: transparent; color: var(--ink);
  font: 500 12px "JetBrains Mono", monospace; text-transform: uppercase; cursor: pointer; border-radius: 0;
}

/* Buttons */
.btn {
  font: 700 13px "Archivo", sans-serif; letter-spacing: .01em; text-transform: uppercase;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 2px;
  padding: 10px 16px; cursor: pointer;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn:disabled { opacity: .35; cursor: not-allowed; background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.link { text-decoration: none; font-size: 12px; }
.link:hover { color: var(--signal); }

/* Layout */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); flex: 1; }
.sidenav { border-right: 1px solid var(--rule); padding: 20px 0; position: sticky; top: 62px; align-self: start; height: calc(100vh - 62px); }
.sidenav a {
  display: flex; gap: 12px; align-items: baseline; padding: 10px 24px; text-decoration: none;
  font-weight: 600; font-size: 15px; border-left: 3px solid transparent;
}
.sidenav a .num { font-size: 11px; color: var(--muted); }
.sidenav a:hover { background: var(--surface); }
.sidenav a[aria-current="page"] { border-left-color: var(--signal); background: var(--surface); }
.sidenav a[aria-current="page"] .num { color: var(--signal); }
body.role-client .agency-only { display: none; }
main { padding: 32px 40px 64px; min-width: 0; }
.view-head { margin-bottom: 28px; max-width: 760px; }
.kicker { font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lede { font-size: 17px; color: var(--ink-2); margin: 12px 0 0; max-width: 60ch; }

/* Cards / KPIs */
.card { border: 1px solid var(--rule); background: var(--surface); padding: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .mono { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); margin-bottom: 20px; }
.kpi { padding: 16px 20px; border-right: 1px solid var(--rule); background: var(--surface); }
.kpi:last-child { border-right: 0; }
.kpi .k { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; margin-top: 2px; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font: 500 11px "JetBrains Mono", monospace; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule); padding: 8px 10px; white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--bg); }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }

/* Status tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font: 500 11px "JetBrains Mono", monospace; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid currentColor; white-space: nowrap;
}
.tag::before { content: ""; width: 6px; height: 6px; background: currentColor; }
.tag.ok { color: var(--ok); } .tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); } .tag.neutral { color: var(--ink-2); }
.tag.plain::before { display: none; }

/* Alerts */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { border-top: 1px solid var(--rule-soft); padding: 12px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.alerts li:first-child { border-top: 0; padding-top: 0; }
.alerts .what { font-weight: 600; }
.alerts .who { grid-column: 2; font-size: 13px; color: var(--muted); }

/* Connection banner */
.conn-banner { border: 2px solid var(--bad); padding: 14px 18px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.conn-banner strong { display: block; }
.conn-banner.warn { border-color: var(--warn); }

/* Bars */
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; align-items: end; height: 220px; border-bottom: 1px solid var(--rule); padding-top: 8px; }
.bar { display: flex; flex-direction: column-reverse; height: 100%; position: relative; }
.bar .seg-p { background: var(--ink); }
.bar .seg-f { background: var(--fee); }
.bar .seg-c { background: var(--cogs); }
.bar .wk { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font: 500 10px "JetBrains Mono", monospace; color: var(--muted); }
.bar:hover .seg-p { background: var(--signal); }
.legend { display: flex; gap: 14px; align-items: center; font-size: 11px; margin-top: 30px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.sw-ink { background: var(--ink); } .sw-fee { background: var(--fee); } .sw-cogs { background: var(--cogs); }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.mini-list li:first-child { border-top: 0; padding-top: 0; }

/* Products */
.adapter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); margin-bottom: 20px; }
.adapter {
  text-align: left; background: var(--surface); color: var(--ink); border: 0; border-right: 1px solid var(--rule);
  padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit;
}
.adapter:last-child { border-right: 0; }
.adapter .mono { font-size: 11px; color: var(--signal); }
.adapter strong { font-size: 16px; }
.adapter span:last-child { font-size: 13px; color: var(--ink-2); }
.adapter:hover { background: var(--ink); color: var(--bg); }
.adapter:hover span:last-child { color: var(--bg); }

/* SEO */
.seo-list { display: grid; gap: 16px; }
.seo-item { border: 1px solid var(--rule); background: var(--surface); padding: 18px 20px; }
.seo-item.dirty { border-left: 4px solid var(--signal); }
.seo-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.field-label { display: flex; justify-content: space-between; font: 500 11px "JetBrains Mono", monospace; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field-label .count.over { color: var(--bad); font-weight: 700; }
.input {
  width: 100%; font: 500 15px "Archivo", sans-serif; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 0; padding: 10px 12px;
}
.input:focus { outline: none; border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.suggest { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.suggest .mono { font-size: 11px; color: var(--signal); }
.suggest button { font: 600 12px "Archivo", sans-serif; background: none; border: 0; border-bottom: 1px solid currentColor; padding: 0; color: var(--ink); cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--rule); background: var(--bg); padding: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 13px "Archivo", sans-serif; border: 1px solid var(--ink); padding: 3px 4px 3px 8px; }
.chip.bad { border-color: var(--bad); color: var(--bad); }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.tag-input { border: 0; background: transparent; font: 500 13px "Archivo", sans-serif; color: var(--ink); flex: 1; min-width: 120px; padding: 3px; }
.tag-input:focus { outline: none; }
.issues { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.issues li { padding-left: 16px; position: relative; }
.issues li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; }
.issues li.error { color: var(--bad); } .issues li.error::before { background: var(--bad); }
.issues li.warning { color: var(--warn); } .issues li.warning::before { background: var(--warn); }
.savebar {
  position: sticky; bottom: 0; margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--bg); border-top: 2px solid var(--rule); padding: 14px 0;
}
.savebar .mono { font-size: 12px; }

/* Guide */
.guide { max-width: 720px; }
.guide h2 { font-size: 24px; margin: 36px 0 10px; padding-top: 16px; border-top: 1px solid var(--rule); }
.guide h2:first-child { margin-top: 0; }
.guide p, .guide li { font-size: 16px; color: var(--ink-2); }
.guide ol { padding-left: 22px; }
.guide li { margin-bottom: 6px; }
.guide .callout { border: 1px solid var(--rule); border-left: 4px solid var(--signal); background: var(--surface); padding: 14px 18px; margin: 16px 0; }
.guide code { font-family: "JetBrains Mono", monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--rule-soft); padding: 1px 5px; }

/* Footer / toast */
.footer { border-top: 2px solid var(--rule); padding: 18px 24px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.footer p { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--invert-bg); color: var(--invert-ink); padding: 12px 16px; font-size: 14px; max-width: calc(100% - 32px);
}

/* Responsive */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpis, .adapter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .adapter:nth-child(2) { border-right: 0; }
  .adapter:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; position: static; }
  .demo-strip { padding: 7px 16px; }
  .shell { grid-template-columns: 1fr; }
  .sidenav {
    position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 0;
    display: flex; overflow-x: auto; scrollbar-width: none;
  }
  .sidenav a { border-left: 0; border-bottom: 3px solid transparent; padding: 12px 14px; white-space: nowrap; font-size: 14px; }
  .sidenav a[aria-current="page"] { border-bottom-color: var(--signal); }
  main { padding: 24px 16px 48px; }
  .kpi .v { font-size: 24px; }
  .card { padding: 16px; }
  .footer { padding: 16px; }
  .conn-banner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .seg-btn, .adapter, .sidenav a { transition: background-color .12s, color .12s, border-color .12s; }
}

.input + .field-label, .suggest + .field-label { margin-top: 16px; }
