:root {
  color-scheme: light;
  --ink: #12151a;
  --muted: #5b6472;
  --line: #e5e7ec;
  --paper: #f6f7f9;
  --card: #ffffff;
  --accent: #1f4b8f;
  --danger: #9b1c1c;
  --ok: #146c43;
  --warn: #8a5a00;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.7rem; margin: 0 0 0.35rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
p { margin: 0 0 0.8rem; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }
.card code { overflow-wrap: anywhere; word-break: break-word; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.nav {
  background: #101317;
  color: #d7dde6;
  padding: 22px 14px 32px;
}
.nav a { color: #d7dde6; text-decoration: none; display: block; padding: 7px 10px; border-radius: 6px; }
.nav a.sub { padding-left: 22px; font-size: 14px; color: #a8b0bc; }
.nav a:hover, .nav a.active { background: #1c222b; color: #fff; }
.nav .mark { font-weight: 700; letter-spacing: -0.02em; font-size: 20px; margin: 0 10px 8px; color: #fff; }
.nav .org { font-size: 12px; color: #8b93a1; margin: 0 10px 18px; }
.nav .group { margin: 16px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #79818f; }
.nav form { margin: 0; padding: 0; border: 0; background: none; }
.nav .signout { margin: 8px 0 0; }
.nav .signout button {
  width: 100%;
  background: transparent;
  color: #d7dde6;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 400;
}
.nav .signout button:hover { background: #1c222b; color: #fff; }
.main { padding: 28px 36px 72px; max-width: 1120px; }
.public-main { max-width: 840px; margin: 0 auto; padding: 8vh 24px 8vh; }
.public-main.wide { max-width: 1100px; }

.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 24px; }
.market-card { margin: 0; }
.market-card h2 { font-size: 1.05rem; margin: 10px 0 4px; }
.market-card p { margin: 0 0 8px; }
.market-card-shot { display: block; text-decoration: none; }
.market-cats { color: var(--muted); font-size: 13px; }
.market-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.market-filters a {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}
.market-filters a:hover, .market-filters a.active { border-color: var(--accent); color: var(--accent); }
.market-site { display: grid; gap: 16px; margin: 0 0 24px; }
.market-site + .card table { margin: 12px 0 0; }
.public-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.public-footer a { color: inherit; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.page-head .lede { margin-bottom: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.crumb { font-size: 13px; margin: 0 0 6px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 16px;
}
.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.03em; }
.stat span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cdd2db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 90px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

.btn, button, input[type=submit] {
  display: inline-block;
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  font: 600 14px/1.2 inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn.secondary { background: #eef0f4; color: var(--ink); }
.btn.google {
  display: block;
  width: 100%;
  text-align: center;
  background: #fff;
  color: var(--ink);
  border: 1px solid #cdd2db;
  margin: 0 0 8px;
}
.auth-split {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 14px;
}
.auth-split:before, .auth-split:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:hover { text-decoration: none; opacity: 0.92; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.stack-form { display: grid; gap: 10px; }
.stack-form .actions { margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
td.right { text-align: right; }
table.plain td { vertical-align: top; }

.flash { background: #e8f6ee; color: var(--ok); padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.errors { background: #fdecec; color: var(--danger); padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #eef0f4; color: #333; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.active, .badge.paid, .badge.approved, .badge.verified, .badge.clean { background: #e8f6ee; color: var(--ok); }
.badge.pending_approval, .badge.pending_review, .badge.pending_payment, .badge.pending, .badge.flagged, .badge.draft { background: #fff4d6; color: var(--warn); }
.badge.rejected, .badge.suspended, .badge.refunded, .badge.archived, .badge.paused { background: #fdecec; color: var(--danger); }
.lede { color: var(--muted); }
.snippet { background: #101317; color: #e9ecf1; padding: 12px; border-radius: 8px; overflow: auto; white-space: pre-wrap; margin: 0 0 16px; }
.auth { max-width: 420px; margin: 12vh auto; padding: 0 20px; }
.cf-turnstile { margin: 14px 0 4px; }
.danger-zone { border-color: #f0d4d4; }
.previews { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; }
.previews figure { margin: 0; }
.previews img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #f4f5f7; }
.previews figcaption { color: var(--muted); font-size: 12px; margin-top: 6px; }
.empty { color: var(--muted); padding: 18px 0; }

.example-banners { display: grid; gap: 16px; margin-top: 12px; width: 100%; }
.example-banner {
  margin: 0;
  max-width: 100%;
  padding: 12px;
  background: #f3f4f7;
  border-radius: 8px;
  overflow: hidden;
}
.example-banner img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  background: #111827;
}
.example-banner figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.js-size-error { color: var(--danger); }
.card h3 { font-size: 1rem; margin: 18px 0 8px; }
.js-size-block[hidden],
.js-size-block-extra[hidden],
.js-offer-style[hidden] { display: none !important; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 38px; padding: 2px; }
.align-picks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(320px, 34%);
  gap: 16px;
  align-items: start;
}
.size-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.size-pick {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px 10px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
}
.size-pick:has(input:checked) {
  border-color: var(--accent);
  background: #f3f6fb;
}
.size-pick input { width: auto; margin: 0; }
.size-pick-swatch {
  width: 56px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #eef0f4;
  border-radius: 4px;
}
.size-pick-swatch::after {
  content: "";
  display: block;
  background: #8b93a1;
  width: min(48px, calc(var(--w) * 1px / 18));
  height: min(28px, calc(var(--h) * 1px / 18));
  min-width: 10px;
  min-height: 4px;
  border-radius: 1px;
}
.size-pick-meta { display: grid; line-height: 1.25; font-size: 13px; color: var(--muted); }
.size-pick-meta strong { color: var(--ink); font-size: 13px; }
.site-shot { position: sticky; top: 16px; }
.site-shot-frame {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
  border-radius: 8px;
  background: #e8ebf0;
  border: 1px solid var(--line);
}
.site-shot-frame-wide { max-width: 640px; }
.site-shot-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
td.thumb { width: 72px; }
td.thumb img {
  display: block;
  width: 64px;
  height: 40px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  background: #eef0f4;
}

.report-filters { grid-template-columns: 1fr 1fr 1.4fr; }
.report-split { align-items: start; grid-template-columns: 1fr 1fr; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.report-chart { width: 100%; height: auto; display: block; }
.report-chart .grid { stroke: #e6e9ef; stroke-width: 1; }
.report-chart .axis { fill: #62635f; font-size: 12px; text-anchor: end; }
.report-chart .axis.x { text-anchor: middle; }
.report-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.report-chart .line.served { stroke: #94a3b8; }
.report-chart .line.viewable { stroke: #1d4ed8; }
.report-chart .line.clicked { stroke: #0f766e; }
.chart-legend { display: flex; gap: 16px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.chart-legend .served { background: #94a3b8; }
.chart-legend .viewable { background: #1d4ed8; }
.chart-legend .clicked { background: #0f766e; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 88px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.bars-label { color: var(--ink); }
.bars-track { display: block; height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.bars-track span { display: block; height: 100%; background: #1d4ed8; border-radius: 99px; }
.bars-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.print-report { max-width: 960px; margin: 0 auto; padding: 28px 24px 64px; background: #fff; }
.print-head { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.print-head h1 { margin: 4px 0; font-size: 1.6rem; }
.print-head p { margin: 0; color: var(--muted); }
.print-actions { display: flex; gap: 8px; align-items: flex-start; }

@media print {
  .no-print { display: none !important; }
  .print-report { max-width: none; padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 16px; }
  .nav .group, .nav .org { width: 100%; margin: 8px 0 0; }
  .row, .kv, .split, .report-filters { grid-template-columns: 1fr; }
  .site-shot { position: static; }
  .main { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
}

/* Publisher control room */
:root {
  --ink: #121318;
  --muted: #62635f;
  --line: #d8d2c7;
  --paper: #f4f0e7;
  --paper-bright: #fffdf7;
  --card: #fffdf7;
  --accent: #5b50d6;
  --accent-dark: #4037b5;
  --coral: #ff5c35;
  --lime: #d8f85a;
  --danger: #961f1f;
  --ok: #365f00;
  --warn: #77540b;
  --shadow: 0 12px 30px rgba(40, 34, 24, .055);
}

html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 82% -10%, rgba(91, 80, 214, .09), transparent 31rem),
    var(--paper);
}
body.nav-lock { overflow: hidden; }
button, input, select, textarea { color: inherit; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--lime);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.workspace { min-width: 0; }
.nav {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  color: #e5e2da;
  background:
    radial-gradient(circle at 0 0, rgba(91, 80, 214, .2), transparent 17rem),
    #121318;
  border-right: 1px solid #2f3037;
}
.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 18px;
}
.brand {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
  color: #fff !important;
  text-decoration: none !important;
  background: none !important;
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #0b0c0f;
  border-radius: 50% 50% 50% 10px;
  color: var(--ink);
  background: var(--coral);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--lime);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.2; }
.brand small { margin-top: 2px; color: #b7bac3; font-size: 12px; font-weight: 600; line-height: 1.35; }
.nav-close { display: none; }
.org-card {
  margin: 0 0 18px;
  padding: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #30323b;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.org-avatar, .user-chip {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 12px;
  font-weight: 900;
}
.org-card strong, .org-card small { display: block; min-width: 0; }
.org-card strong {
  max-width: 166px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-card small { color: #b7bac3; font-size: 12px; line-height: 1.35; }
.nav-links { display: grid; gap: 3px; }
.nav-links > a {
  min-height: 39px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 9px;
  color: #ced0d8;
  font-size: 13px;
  font-weight: 650;
}
.nav-links > a:hover {
  color: #fff;
  background: #22242c;
  text-decoration: none;
}
.nav-links > a.active {
  color: var(--ink);
  background: var(--lime);
  box-shadow: inset 3px 0 0 var(--coral);
}
.nav-icon {
  color: #aeb1bb;
  font: 800 12px/1 ui-monospace, Consolas, monospace;
}
.nav-links > a.active .nav-icon { color: #555d24; }
.nav .group {
  margin: 18px 10px 5px;
  color: #aeb1bb;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .13em;
}
.nav-more {
  margin-top: 15px;
  border-top: 1px solid #2c2e36;
  border-bottom: 1px solid #2c2e36;
}
.nav-more summary {
  min-height: 42px;
  padding: 10px;
  color: #9ea2ad;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.nav-more > div { padding: 0 0 8px 15px; }
.nav-more a {
  padding: 6px 10px;
  color: #afb2bc;
  font-size: 12px;
}
.nav-more a:hover, .nav-more a.active { color: #fff; background: #22242c; text-decoration: none; }
.nav-links .staff-link { color: #fff; background: rgba(91,80,214,.18); }
.nav-foot {
  margin-top: auto;
  padding-top: 22px;
  display: grid;
  gap: 4px;
}
.nav-foot > a, .nav-foot .signout button {
  min-height: 40px;
  padding: 9px 10px;
  color: #aeb1bb;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: 600 12px/1.3 inherit;
  text-align: left;
  text-decoration: none;
}
.nav-foot > a:hover, .nav-foot .signout button:hover { color: #fff; background: #22242c; text-decoration: none; }
.nav-scrim { display: none; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  padding: 0 clamp(18px, 3vw, 42px);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid rgba(18,19,24,.12);
  background: rgba(244,240,231,.9);
  backdrop-filter: blur(12px);
}
.nav-toggle { display: none; }
.topbar-context, .topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-context { color: var(--muted); font-size: 12px; font-weight: 700; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d9700;
  box-shadow: 0 0 0 4px rgba(109,151,0,.14);
}
.topbar-link {
  min-height: 38px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.topbar-link:hover { color: #fff; background: var(--accent-dark); text-decoration: none; }

.main {
  width: 100%;
  max-width: 1440px;
  padding: clamp(26px, 3.4vw, 48px) clamp(18px, 3vw, 42px) 90px;
}
h1 { font-size: clamp(1.9rem, 3vw, 2.55rem); font-weight: 850; letter-spacing: -.045em; }
h2 { font-size: 1.08rem; font-weight: 800; }
.lede { max-width: 760px; color: var(--muted); }
.page-head { margin-bottom: 28px; align-items: center; }
.page-actions { align-items: center; }
.crumb { font-weight: 700; }
.crumb a { color: var(--accent-dark); }
.card {
  border-color: rgba(18,19,24,.14);
  border-radius: 15px;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}
.card-accent { border-left: 4px solid var(--accent); }
.grid.stats { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.stats .card { min-height: 126px; padding: 20px; }
.stat { font-size: 1.85rem; font-weight: 850; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.4; }

input, select, textarea {
  min-height: 44px;
  border-color: #c9c2b5;
  border-radius: 9px;
  background: #fffefa;
}
textarea { min-height: 108px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid rgba(91,80,214,.16); }
fieldset { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 7px; font-weight: 800; }
.check { min-height: 30px; }
.check input { min-height: 18px; accent-color: var(--accent); }
.btn, button, input[type=submit] {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 9px;
  background: var(--accent);
  font-weight: 750;
}
.btn.secondary { border: 1px solid #d5d0c7; background: #f0ece3; }
.btn.danger { background: var(--danger); }
.btn:hover, button:hover { opacity: 1; filter: brightness(.96); }

.main > table, .card > table {
  display: block;
  width: 100%;
  overflow-x: auto;
}
.main > table > thead, .main > table > tbody,
.card > table > thead, .card > table > tbody { min-width: 680px; }
th, td { padding: 13px 10px; }
th { color: #53544f; font-size: 12px; font-weight: 850; letter-spacing: .06em; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(91,80,214,.035); }
.badge {
  min-height: 24px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}
.badge.active, .badge.paid, .badge.approved, .badge.verified, .badge.clean { background: #e7f9a1; color: #315600; }
.badge.pending_approval, .badge.pending_review, .badge.pending_payment, .badge.pending, .badge.flagged, .badge.draft { background: #fff0c9; color: #6f4a00; }
.badge.rejected, .badge.suspended, .badge.refunded, .badge.archived, .badge.paused { background: #ffd8d0; color: #881818; }
.flash, .errors {
  margin: 0 0 22px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(18,19,24,.16);
  border-radius: 12px;
}
.flash { color: #2f5000; background: #e7f9a1; }
.errors { color: #741818; background: #ffd8d0; }
.flash strong, .errors strong { color: var(--ink); }
.errors ul { margin: 0; padding-left: 20px; }
.snippet { border: 1px solid #2f3138; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.danger-zone { border-color: rgba(150,31,31,.35); background: #fff8f5; }
.empty { color: var(--muted); }
.size-pick { border-color: #d3cdc2; background: #fffefa; }
.size-pick:has(input:checked) { border-color: var(--accent); background: #f1efff; box-shadow: inset 0 0 0 1px var(--accent); }
.bars-track { background: #e8e2d8; }
.bars-track span { background: var(--accent); }
.report-chart .line.viewable { stroke: var(--accent); }
.report-chart .line.clicked { stroke: #487600; }

@media (max-width: 1040px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .nav { padding-inline: 10px; }
}

@media (max-width: 800px) {
  .shell { display: block; }
  .workspace { min-height: 100vh; }
  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 310px);
    height: 100dvh;
    padding: 18px 14px;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 18px 0 45px rgba(0,0,0,.25);
  }
  .nav-is-open .nav {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }
  .nav-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #383a43;
    color: #fff;
    background: #22242c;
    font-size: 22px;
  }
  .nav .group, .nav .org { width: auto; margin: 18px 10px 5px; }
  .nav-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    border: 0;
    border-radius: 0;
    background: rgba(18,19,24,.5);
    transition: opacity .2s ease, visibility .2s ease;
  }
  .nav-is-open .nav-scrim { visibility: visible; opacity: 1; }
  .topbar { min-height: 60px; padding: 0 16px; }
  .nav-toggle {
    min-height: 38px;
    padding: 8px 11px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--ink);
    background: var(--paper-bright);
    border: 1px solid var(--line);
  }
  .topbar-context { display: none; }
  .topbar-link { min-height: 36px; padding: 8px 12px; }
  .user-chip { width: 32px; height: 32px; }
  .main { padding: 25px 16px 60px; }
  .page-head { align-items: flex-start; }
  .row, .kv, .split, .report-filters, .report-split { grid-template-columns: 1fr; }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.stats .card { min-height: 112px; }
  .site-shot { position: static; }
}

@media (max-width: 520px) {
  .topbar-actions .user-chip { display: none; }
  .topbar-link { font-size: 12px; }
  .grid.stats { grid-template-columns: 1fr; }
  .grid.stats .card { min-height: 0; }
  .page-actions { width: 100%; }
  .page-actions > *, .page-actions form, .page-actions .btn { width: 100%; }
  .page-actions button { width: 100%; }
  .flash, .errors { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.setup-steps {
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  border: 1px solid rgba(18,19,24,.14);
  border-radius: 14px;
  background: rgba(255,253,247,.72);
  overflow: hidden;
}
.setup-steps li {
  position: relative;
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: #62635f;
  border-right: 1px solid var(--line);
  font-size: 13px;
}
.setup-steps li:last-child { border-right: 0; }
.setup-steps span {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #c8c3ba;
  border-radius: 50%;
  background: var(--paper);
  font: 850 11px/1 ui-monospace, Consolas, monospace;
}
.setup-steps .active { color: var(--ink); background: var(--lime); }
.setup-steps .active span { border-color: var(--ink); background: var(--ink); color: #fff; }
.guided-form { display: grid; gap: 18px; }
.guided-form > .card { margin: 0; }
.form-section {
  padding: clamp(22px, 3vw, 32px);
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
}
.form-section-number {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50% 50% 50% 10px;
  color: #fff;
  background: var(--accent);
  font: 850 11px/1 ui-monospace, Consolas, monospace;
}
.form-section-body { max-width: 980px; }
.section-head { margin-bottom: 20px; }
.section-head h2 { margin-bottom: 7px; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.section-head p:not(.eyebrow) { max-width: 720px; color: var(--muted); }
.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.optional { color: var(--muted); font-size: 12px; font-weight: 600; }
.choice-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice-cards-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-cards label {
  min-height: 92px;
  margin: 0;
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border: 1px solid #d1cbc0;
  border-radius: 11px;
  background: #fffefa;
  cursor: pointer;
}
.choice-cards label:has(input:checked) {
  border-color: var(--accent);
  background: #f1efff;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-cards input { width: 18px; min-height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.choice-cards strong, .choice-cards small { display: block; }
.choice-cards strong { color: var(--ink); font-size: 13px; }
.choice-cards small { margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 550; line-height: 1.45; }
.switch-row {
  min-height: 72px;
  margin: 10px 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border: 1px solid #d3cdc2;
  border-radius: 11px;
  background: #fffefa;
}
.switch-row > span > strong, .switch-row > span > small { display: block; }
.switch-row > span > small { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 550; line-height: 1.45; }
.switch-row > input {
  position: relative;
  width: 44px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid #aaa59c;
  border-radius: 999px;
  background: #d9d5cc;
  cursor: pointer;
}
.switch-row > input::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.switch-row > input:checked { border-color: var(--accent); background: var(--accent); }
.switch-row > input:checked::after { transform: translateX(20px); }
.publish-row { border-color: #a5be4a; background: #f4facd; }
.inline-notice { margin-top: 16px; padding: 15px 17px; border-left: 4px solid var(--coral); border-radius: 4px 10px 10px 4px; background: #fff0dc; }
.inline-notice p { margin: 4px 0 0; color: #664f3c; font-size: 13px; }
.form-submit-bar {
  position: sticky;
  z-index: 10;
  bottom: 14px;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 15px 35px rgba(18,19,24,.22);
}
.form-submit-bar > div > strong, .form-submit-bar > div > span { display: block; }
.form-submit-bar > div > strong { font-size: 13px; }
.form-submit-bar > div > span { margin-top: 2px; color: #c4c6cd; font-size: 12px; line-height: 1.4; }
.form-submit-bar .actions { margin: 0; flex: 0 0 auto; }
.form-submit-bar .btn.secondary { border-color: #4b4d55; color: #fff; background: #292b32; }
.form-submit-bar button { color: var(--ink); background: var(--lime); }
.install-card {
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--lime);
}
.install-state {
  min-height: 40px;
  padding: 9px 12px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: #704d09;
  border-radius: 999px;
  background: #fff0c9;
  font-size: 12px;
  font-weight: 800;
}
.install-state.is-ready { color: #315600; background: #e7f9a1; }

@media (max-width: 800px) {
  .setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-steps li:nth-child(2) { border-right: 0; }
  .setup-steps li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-section { grid-template-columns: 1fr; }
  .form-section-number { width: 38px; height: 38px; }
  .choice-cards, .choice-cards-three { grid-template-columns: 1fr; }
  .form-submit-bar { position: static; align-items: flex-start; flex-direction: column; }
  .form-submit-bar .actions { width: 100%; }
  .form-submit-bar .actions > * { flex: 1; text-align: center; }
}

@media (max-width: 480px) {
  .setup-steps { grid-template-columns: 1fr; }
  .setup-steps li { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-steps li:last-child { border-bottom: 0; }
  .form-section { padding: 20px 17px; }
  .switch-row { align-items: flex-start; }
}

/* Dashboard */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.dashboard-head { margin-bottom: 18px; }
.dashboard-head h1 { margin-bottom: 7px; }
.service-strip {
  min-height: 46px;
  margin: 0 0 22px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #45463f;
  border: 1px solid #c8d77f;
  border-radius: 11px;
  background: #eff9bd;
  font-size: 13px;
  font-weight: 750;
}
.service-strip span:first-child { margin-right: auto; color: #315600; }
.service-strip i {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #5d9400;
  box-shadow: 0 0 0 4px rgba(93,148,0,.13);
}
.service-alert {
  margin: 0 0 22px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #d1a3a3;
  border-radius: 12px;
  background: #fff2ed;
}
.service-alert-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-weight: 900;
}
.service-alert h2 { margin: 0 0 3px; font-size: 15px; }
.service-alert p { margin: 0; color: #72534d; font-size: 12px; }
.service-alert .btn { white-space: nowrap; }
.billing-lock-banner {
  margin: 0 0 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #d99a73;
  border-left: 6px solid var(--coral);
  border-radius: 13px;
  background: #fff0dc;
  box-shadow: 6px 6px 0 rgba(18, 19, 24, .12);
}
.billing-lock-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 10px;
  color: #fff;
  background: var(--coral);
  font-size: 20px;
  font-weight: 900;
}
.billing-lock-banner .eyebrow { margin-bottom: 4px; color: #7b341c; }
.billing-lock-banner h2 { margin: 0 0 6px; font-size: 18px; }
.billing-lock-banner p { max-width: 900px; margin: 0; color: #593c2e; font-size: 14px; line-height: 1.5; }
.billing-lock-banner .billing-lock-detail { margin-top: 7px; color: #6e3f2c; }
.billing-lock-banner .btn { min-width: 155px; color: #fff; text-align: center; white-space: nowrap; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.section-head.compact { margin-bottom: 14px; align-items: center; }
.section-head.compact h2 { margin: 0; font-size: 18px; }
.text-link {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.setup-card {
  margin-bottom: 28px;
  border-color: var(--ink);
  box-shadow: 7px 7px 0 rgba(18,19,24,.92);
}
.setup-card .section-head { margin-bottom: 13px; }
.setup-card .section-head p { margin: 0; font-size: 12px; }
.setup-percent {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50% 50% 50% 10px;
  color: var(--ink);
  background: var(--lime);
  font: 900 13px/1 ui-monospace, Consolas, monospace;
}
.progress-track {
  height: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3ded4;
}
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.dashboard-checklist {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
  border-top: 1px solid var(--line);
}
.dashboard-checklist li {
  min-height: 64px;
  padding: 10px 2px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.dashboard-checklist li:last-child { border-bottom: 0; padding-bottom: 0; }
.check-state {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #aaa49a;
  border-radius: 50%;
  color: #77736c;
  background: #f2eee5;
  font: 850 10px/1 ui-monospace, Consolas, monospace;
}
.dashboard-checklist .is-done .check-state { color: #315600; border-color: #a3bd45; background: var(--lime); }
.dashboard-checklist strong, .dashboard-checklist small { display: block; }
.dashboard-checklist strong { font-size: 14px; line-height: 1.35; }
.dashboard-checklist small { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.dashboard-checklist a { padding: 8px; color: var(--accent-dark); font-size: 13px; font-weight: 850; text-decoration: none; }
.dashboard-checklist .is-done { background: rgba(216,248,90,.1); }
.metric-grid {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  min-height: 145px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}
.metric-card-lime { border-color: #aabc58; background: var(--lime); box-shadow: 5px 5px 0 var(--ink); }
.metric-card .metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin: 16px 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1;
  letter-spacing: -.04em;
}
.metric-card small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.metric-card-lime .metric-label, .metric-card-lime small { color: #3d450d; }
.dashboard-grid {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  gap: 16px;
  align-items: stretch;
}
.dashboard-grid > .card { min-width: 0; margin: 0; }
.dashboard-grid-lower { grid-template-columns: minmax(0, 1.75fr) minmax(260px, .75fr); }
.chart-total {
  color: var(--ink);
  font: 900 18px/1 ui-monospace, Consolas, monospace;
  text-align: right;
}
.chart-total small { display: block; margin-top: 4px; color: var(--muted); font: 650 12px/1.3 inherit; text-transform: uppercase; }
.mini-chart {
  height: 232px;
  margin-bottom: 24px;
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(14, minmax(11px, 1fr));
  gap: clamp(3px, .75vw, 9px);
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, rgba(18,19,24,.055) 50px);
}
.mini-chart-day {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.mini-chart-day i {
  width: 100%;
  max-width: 24px;
  min-height: 4px;
  display: block;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  transition: opacity .15s ease;
}
.mini-chart-day:hover i { opacity: .74; }
.mini-chart-day small { position: absolute; top: calc(100% + 7px); color: var(--muted); font-size: 12px; line-height: 1.2; }
.mini-chart-value {
  position: absolute;
  bottom: calc(var(--bar-height, 0%) + 4px);
  display: none;
  color: var(--muted);
  font-size: 12px;
}
.chart-empty { margin: 28px 0 0; color: var(--muted); font-size: 13px; }
.attention-count {
  min-width: 29px;
  height: 29px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: #fff;
  background: var(--coral);
  font: 900 11px/1 ui-monospace, Consolas, monospace;
}
.attention-list {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
}
.attention-list li {
  min-height: 64px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.attention-list li:last-child { border-bottom: 0; }
.attention-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font: 900 10px/1 ui-monospace, Consolas, monospace;
}
.attention-number.tone-amber { color: #553801; background: #ffd979; }
.attention-number.tone-coral { background: var(--coral); }
.attention-list strong, .attention-list small { display: block; }
.attention-list strong { font-size: 13px; line-height: 1.35; }
.attention-list small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.attention-list a, .row-arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}
.all-clear {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}
.all-clear > span {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #315600;
  background: var(--lime);
  font-weight: 900;
}
.all-clear strong, .all-clear small { display: block; }
.all-clear small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.responsive-table { overflow-x: auto; }
.table-primary { display: block; color: var(--ink); font-weight: 800; text-decoration: none; }
.table-primary:hover { color: var(--accent-dark); }
td > small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.inventory-stats { margin: 2px 0 16px; display: grid; }
.inventory-stats > div {
  min-height: 42px;
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.inventory-stats dt { color: var(--muted); font-size: 13px; }
.inventory-stats dd { margin: 0; font: 900 13px/1 ui-monospace, Consolas, monospace; }
.inventory-stats .has-warning dd { color: var(--warn); }
.inventory-stats .has-danger dd { color: var(--danger); }
.full-button { width: 100%; text-align: center; }
.activity-card { margin-top: 16px; }
.activity-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 30px;
  list-style: none;
}
.activity-list li {
  min-height: 56px;
  padding: 9px 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #ebe8ff; }
.activity-list strong, .activity-list small { display: block; }
.activity-list strong { font-size: 13px; line-height: 1.35; }
.activity-list small, .activity-list time { color: #53544f; font-size: 13px; line-height: 1.45; }
.activity-list time { white-space: nowrap; }
.invoice-note {
  margin-top: 16px;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid #d6c28c;
  border-radius: 11px;
  background: #fff5d8;
  font-size: 13px;
}
.invoice-note strong, .invoice-note span { display: block; }
.invoice-note span { margin-top: 3px; color: var(--muted); }
.invoice-note a { flex: 0 0 auto; color: var(--ink); font-weight: 850; text-decoration: none; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .dashboard-grid-lower { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .dashboard-head .page-actions { width: 100%; }
  .dashboard-head .page-actions > * { flex: 1; text-align: center; }
  .service-strip { align-items: flex-start; flex-direction: column; gap: 7px; }
  .service-strip span:first-child { margin-right: 0; }
  .service-alert { grid-template-columns: auto minmax(0, 1fr); }
  .service-alert .btn { grid-column: 1 / -1; text-align: center; }
  .billing-lock-banner { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .billing-lock-banner .btn { grid-column: 1 / -1; width: 100%; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 126px; }
  .dashboard-checklist li { grid-template-columns: auto minmax(0, 1fr); }
  .dashboard-checklist a { grid-column: 2; padding-left: 0; }
  .mini-chart { height: 190px; margin-bottom: 0; gap: 3px; }
  .mini-chart-day small { display: none; }
  .activity-list { grid-template-columns: 1fr; }
  .invoice-note { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 440px) {
  .setup-card .section-head { flex-direction: row; }
  .setup-percent { width: 48px; height: 48px; }
  .delivery-card, .attention-card { padding: 18px 15px; }
}

/* Staff operations */
.staff-tabs {
  margin: 0 0 20px;
  padding: 5px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,253,247,.72);
  scrollbar-width: thin;
}
.staff-tabs .btn {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  white-space: nowrap;
}
.staff-tabs .btn.secondary { color: var(--muted); background: transparent; border-color: transparent; }
.staff-tabs .btn.secondary:hover { color: var(--ink); background: #ece7dc; opacity: 1; }
.card details {
  border-radius: 9px;
}
.card details > summary {
  min-height: 36px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.card details[open] > summary { margin-bottom: 10px; color: #fff; border-color: var(--accent); background: var(--accent); }
.card td details form {
  min-width: min(360px, 72vw);
  margin: 8px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.card pre {
  max-width: min(680px, 72vw);
  max-height: 320px;
  padding: 12px;
  overflow: auto;
  border-radius: 8px;
  color: #f3f1e9;
  background: #17181e;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}

/* Getting paid */
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.payment-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 34px;
  overflow: hidden;
  padding: 24px;
  border-color: rgba(91, 80, 214, .36);
  background: linear-gradient(135deg, #fffdf7 0%, #f1efff 72%, #e8e3ff 100%);
}
.payment-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border: 34px solid rgba(91, 80, 214, .08);
  border-radius: 50%;
  pointer-events: none;
}
.payment-intro > * { position: relative; z-index: 1; }
.payment-intro h2 { margin-bottom: 7px; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.payment-intro-copy p:last-child { max-width: 720px; margin-bottom: 0; color: var(--muted); }
.payment-flow {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  white-space: nowrap;
}
.payment-flow span {
  padding: 8px 10px;
  border: 1px solid rgba(18, 19, 24, .14);
  border-radius: 999px;
  background: rgba(255, 253, 247, .88);
  font-size: 12px;
  font-weight: 850;
}
.payment-flow i { color: var(--accent); font-style: normal; font-weight: 900; }
.payment-intro-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 13px;
  border-top: 1px solid rgba(91, 80, 214, .18);
  color: var(--muted);
  font-size: 13px;
}
.payment-intro-note strong { color: var(--ink); }

.payment-provider-card { padding: 0; overflow: hidden; }
.payment-provider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-bright);
}
.payment-provider-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.payment-provider-title h2 { margin: 0; font-size: 1.35rem; }
.payment-provider-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(18, 19, 24, .22);
  border-radius: 11px;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 3px 3px 0 rgba(18, 19, 24, .13);
}
.payment-provider-mark.paypal { background: #075ca8; }
.payment-provider-mark.stripe { background: #635bff; }
.payment-provider-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr);
}
.payment-provider-guide,
.payment-provider-form { min-width: 0; padding: 24px; }
.payment-provider-guide {
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(244, 240, 231, .64), rgba(241, 239, 255, .72));
}
.payment-provider-guide h3,
.payment-provider-form h3 { margin: 0 0 6px; font-size: 1.05rem; }
.provider-summary { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.payment-setup-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: payment-step;
}
.payment-setup-steps > li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  padding: 0 0 18px;
  counter-increment: payment-step;
}
.payment-setup-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: #cbc4e5;
}
.payment-setup-steps > li::before {
  content: counter(payment-step);
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 12px;
  font-weight: 950;
}
.payment-setup-steps strong { display: block; margin: 3px 0 3px; }
.payment-setup-steps p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.setup-external-link { min-height: 36px; padding: 8px 11px; font-size: 12px; }
.payment-setup-steps .alternate-environment { margin-top: 8px; }
.permission-list {
  margin: 10px 0;
  padding: 4px 10px;
  border: 1px solid rgba(18, 19, 24, .12);
  border-radius: 9px;
  background: rgba(255, 253, 247, .78);
  list-style: none;
}
.permission-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(18, 19, 24, .09);
  color: var(--muted);
  font-size: 12px;
}
.permission-list li:last-child { border-bottom: 0; }
.permission-list b { color: var(--ink); }
.provider-account-link,
.provider-doc-link { margin: 10px 0 0; font-size: 13px; }
.provider-doc-link a { font-weight: 800; }
.payment-provider-form label { margin-top: 15px; }
.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.label-optional {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.callback-help { margin: 16px 0 2px; }
.payment-provider-form .callback-help > summary { display: flex; width: 100%; justify-content: space-between; }
.payment-provider-form .callback-help > summary::after { content: "+"; margin-left: 12px; }
.payment-provider-form .callback-help[open] > summary::after { content: "−"; }
.callback-help p,
.callback-help ul { color: var(--muted); font-size: 12px; }
.callback-help ul { margin: 8px 0 10px; padding-left: 20px; }
.callback-help li { margin: 4px 0; }
.provider-security-note {
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid #d8cf9e;
  border-radius: 9px;
  color: #5e501b;
  background: #fff8d8;
  font-size: 12px;
}
.payment-provider-form .actions { margin-top: 18px; }

@media (max-width: 1050px) {
  .payment-intro { grid-template-columns: 1fr; }
  .payment-flow { justify-self: start; }
  .payment-provider-grid { grid-template-columns: 1fr; }
  .payment-provider-guide { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .payment-intro,
  .payment-provider-guide,
  .payment-provider-form { padding: 18px 16px; }
  .payment-provider-head { padding: 17px 16px; }
  .payment-flow { flex-wrap: wrap; white-space: normal; }
  .payment-flow i { transform: rotate(90deg); }
  .payment-provider-form .actions button { width: 100%; }
}
