/* ── Theme tokens ── */
:root {
  --bg: #f4f6f8;
  --bg-subtle: #eaecef;
  --surface: rgba(255,255,255,0.82);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255,255,255,0.95);
  --ink: #1a1d21;
  --ink-secondary: #4b5563;
  --muted: #6b7280;
  --line: rgba(0,0,0,0.08);
  --brand: #f59e0b;
  --brand-dim: rgba(245,158,11,0.14);
  --brand-text: #c2410c;
  --accent: #f59e0b;
  --good: #10b981;
  --good-bg: rgba(16,185,129,0.1);
  --warn: #f59e0b;
  --warn-bg: rgba(245,158,11,0.1);
  --bad: #ef4444;
  --bad-bg: rgba(239,68,68,0.1);
  --new-color: #8b5cf6;
  --new-bg: rgba(139,92,246,0.1);
  --neutral-bg: rgba(107,114,128,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --glass-blur: blur(12px);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-subtle: #1a1d27;
  --surface: rgba(30,33,43,0.75);
  --surface-solid: #1e212b;
  --surface-hover: rgba(40,44,56,0.9);
  --ink: #e5e7eb;
  --ink-secondary: #9ca3af;
  --muted: #6b7280;
  --line: rgba(255,255,255,0.07);
  --brand: #f59e0b;
  --brand-dim: rgba(245,158,11,0.16);
  --brand-text: #fbbf24;
  --good: #34d399;
  --good-bg: rgba(52,211,153,0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251,191,36,0.12);
  --bad: #f87171;
  --bad-bg: rgba(248,113,113,0.12);
  --new-color: #a78bfa;
  --new-bg: rgba(167,139,250,0.12);
  --neutral-bg: rgba(107,114,128,0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.3);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  color: var(--ink);
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

/* ── Layout ── */
.shell {
  width: min(1480px, 100vw - 40px);
  margin: 0 auto;
  padding: 20px 0 48px;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar-brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

[data-theme="dark"] .brand-icon {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.eyebrow {
  color: var(--brand-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1 { font-size: 22px; font-weight: 800; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 700; }

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Theme toggle ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: var(--brand-dim);
}

/* ── Inputs ── */
input, select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  outline: none;
  font-size: 13px;
  transition: all var(--transition);
}

input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

select { padding-right: 28px; cursor: pointer; }

/* ── Buttons ── */
button {
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition);
}

button:hover { filter: brightness(1.1); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { cursor: wait; opacity: 0.5; transform: none; filter: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}

.nav-link:hover {
  border-color: var(--brand);
  color: var(--brand-text);
  background: var(--brand-dim);
  transform: translateY(-1px);
}

.last-scrape {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: auto;
  padding-right: 4px;
}

/* ── Summary strip compact ── */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  font-size: 12px;
  color: var(--muted);
}

.summary-strip strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── Panel breakdown ── */
.panel-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.panel-breakdown b {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 600;
}

/* ── API settings ── */
.scrape-progress {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 16px 0, var(--brand-dim), transparent 34%),
    var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.scrape-progress[hidden] {
  display: none;
}

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.progress-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

#progressMeta {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-text);
  background: var(--brand-dim);
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-subtle);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #f97316, #fbbf24);
  transition: width 0.35s ease;
}

.scrape-progress.is-error .progress-fill {
  background: linear-gradient(90deg, var(--warn), var(--bad));
}

.progress-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.api-settings {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition);
}

.api-settings summary {
  padding: 12px 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}
.api-settings summary::-webkit-details-marker { display: none; }

.summary-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.api-status-summary {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  margin-left: 12px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto auto;
  gap: 10px;
  padding: 0 16px 16px;
  align-items: end;
}

.api-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.api-grid button { align-self: end; white-space: nowrap; }

/* ── Legend ── */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  font-size: 12px;
  color: var(--muted);
}

.legend-title {
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ── Controls ── */
.controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin: 16px 0 12px;
  align-items: center;
}

.controls input { width: 100%; }
.controls select { width: 100%; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.toggle:hover { border-color: var(--brand); }
.toggle input { width: 14px; height: 14px; min-height: auto; cursor: pointer; }

#scrapeButton, #refreshButton {
  min-width: 110px;
}

/* ── Platform & Type cards ── */
.platforms, .types { margin: 0 0 12px; }

.platform-cards, .type-cards { display: grid; gap: 8px; }
.platform-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.type-cards { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.platform-card, .type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  height: auto;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition: all var(--transition);
}

.platform-card { padding: 10px 12px; }
.type-card { padding: 8px 10px; }

.platform-card:hover, .type-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.platform-card.active, .type-card.active {
  border-color: var(--brand);
  background: var(--brand-dim);
}

.platform-card span, .type-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.platform-card strong { font-size: 16px; font-weight: 800; }
.type-card strong { font-size: 14px; font-weight: 800; }
.platform-card small, .type-card small { color: var(--muted); font-size: 11px; }

.platform-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

/* ── Table ── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

table { width: 100%; min-width: 1120px; border-collapse: collapse; }

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-left: 3px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
  transform: none;
}

.sort-btn:hover {
  color: var(--brand-text);
  background: var(--brand-dim);
  filter: none;
  transform: none;
}

.sort-btn.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--brand-dim); }
tbody tr:last-child td { border-bottom: 0; }

/* ── Info dots (tooltip) ── */
.info-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  margin-left: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-text);
  background: var(--brand-dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: none;
  cursor: help;
}

.info-dot::after {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 80;
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  content: attr(data-tip);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  white-space: normal;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.info-dot::before {
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  z-index: 81;
  width: 8px; height: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(225deg);
  transition: opacity 0.15s ease;
}

.info-dot:hover::after, .info-dot:hover::before { opacity: 1; }
.info-dot:hover::after { transform: translateX(-50%) translateY(0); }

.info-dot.tip-right::after { left: auto; right: -8px; transform: translateY(-4px); }
.info-dot.tip-right::before { left: auto; right: -1px; transform: rotate(225deg); }
.info-dot.tip-right:hover::after { transform: translateY(0); }

/* ── Service cells ── */
.service-name { max-width: 520px; line-height: 1.4; }

.pick-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-right: 6px;
  vertical-align: 1px;
}

.pick-list b {
  display: inline-flex;
  align-items: center;
  height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  color: var(--brand-text);
  background: var(--brand-dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.service-id { font-weight: 700; }
.service-id a { color: var(--brand-text); text-decoration: none; }
.service-id a:hover { text-decoration: underline; }

.score { color: var(--brand-text); font-weight: 800; }

.score-reason {
  position: relative;
  cursor: help;
}

.score-reason::after {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  width: 280px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  content: attr(data-tip);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
  white-space: normal;
}

.score-reason:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--neutral-bg);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-badge.up {
  color: var(--good);
  background: var(--good-bg);
}

.trend-badge.down {
  color: var(--bad);
  background: var(--bad-bg);
}

.trend-badge.flat {
  color: var(--muted);
  background: var(--neutral-bg);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
  background: var(--neutral-bg);
}

.badge.hot { color: var(--good); background: var(--good-bg); }
.badge.stable { color: var(--brand-text); background: var(--brand-dim); }
.badge.risky { color: var(--bad); background: var(--bad-bg); }
.badge.new { color: var(--new-color); background: var(--new-bg); }
.badge.no-recent { color: var(--muted); background: var(--neutral-bg); }

.status-reason {
  position: relative;
  cursor: help;
}

.status-reason::after {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 90;
  width: 260px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  content: attr(data-tip);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
  white-space: normal;
}

.status-reason:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty { color: var(--muted); text-align: center; padding: 32px 16px !important; }

/* ── Runs ── */
.runs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  color: var(--muted);
}

.runs h2 {
  color: var(--ink-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.runs p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-docs-link {
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  font-size: 12px;
}

.runs-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 720px;
}

.run-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 11px;
  transition: all var(--transition);
}

.run-item:hover { border-color: var(--brand); }
.run-item strong { color: var(--ink); }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.pagination button {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.pagination button:not(:disabled):hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pagination span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Responsive ── */
.docs-shell {
  max-width: 1180px;
}

.sales-shell {
  max-width: 1280px;
}

.docs-topbar {
  margin-bottom: 16px;
}

.docs-hero {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 10% 0, var(--brand-dim), transparent 28%),
    var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.docs-hero h2 {
  max-width: 760px;
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.docs-hero p {
  max-width: 820px;
  color: var(--ink-secondary);
  font-size: 14px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.doc-card h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.doc-card p {
  margin-bottom: 10px;
  color: var(--ink-secondary);
  font-size: 13px;
}

.doc-card ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
  color: var(--ink-secondary);
  font-size: 13px;
}

.doc-card strong {
  color: var(--ink);
  font-weight: 800;
}

.sales-hero {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0, var(--brand-dim), transparent 30%),
    var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.sales-hero h2 {
  margin: 4px 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

.sales-hero p {
  color: var(--ink-secondary);
  font-size: 13px;
}

.sales-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.sales-stats article,
.sales-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.sales-stats article {
  padding: 14px;
}

.sales-stats span,
.sales-card h2 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sales-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.sales-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-bottom: 14px;
}

.sales-card {
  padding: 14px;
}

.sales-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sales-list-item {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.sales-list-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sales-list-item strong {
  color: var(--brand-text);
  font-size: 18px;
  font-weight: 900;
}

.sales-list-item small,
.sales-empty {
  color: var(--muted);
  font-size: 12px;
}

.sales-table table {
  min-width: 1100px;
}

@media (max-width: 980px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .runs { align-items: stretch; flex-direction: column; }
  .footer-docs-link { margin-left: 0; }
  .runs-list { justify-content: flex-start; max-width: none; }
  .actions { flex-direction: column; align-items: stretch; }
  .controls { grid-template-columns: 1fr; align-items: stretch; }
  .api-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .sales-stats, .sales-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: calc(100vw - 20px); padding-top: 16px; }
  h1 { font-size: 20px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
}
