:root {
  --bg: #080b0e;
  --panel: #0d1116;
  --panel-2: #12171d;
  --panel-3: #171d25;
  --border: #252b33;
  --border-strong: #323a45;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --brand: #c9003b;
  --brand-hot: #d0003f;
  --brand-deep: #6f001f;
  --brand-tint: rgba(201, 0, 59, 0.14);
  --pass: #34d399;
  --fail: #fb7185;
  --warn: #fbbf24;
  --info: #60a5fa;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --font-ui: "Barlow", "Avenir Next", system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Barlow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Legacy aliases used across templates */
  --ink: var(--text);
  --paper: var(--bg);
  --card: var(--panel);
  --line: var(--border);
  --accent: var(--brand);
  --accent-dark: var(--brand-hot);
  --sans: var(--font-display);
  --ui: var(--font-ui);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.app-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}
a { color: #fca5a5; }
a:hover { color: #fff; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0a0e13 0%, #080b0e 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 14px 16px;
  z-index: 20;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  min-width: 0;
}
.sidebar-account .avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 11px;
}
.sidebar-account .user-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-account .user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account .user-meta small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sidebar-account .chev {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 11px;
  margin-left: 2px;
}
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 6px 10px;
  border: 0;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: auto;
  padding-right: 2px;
  padding-top: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: rgba(111, 0, 31, 0.35);
  border-color: transparent;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.sidebar-foot {
  margin-top: 10px;
  padding: 14px 8px 6px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.sidebar-kc {
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.55;
  filter: grayscale(1) brightness(0.85);
}
.sidebar-tag { display: grid; gap: 3px; justify-items: center; }
.sidebar-tag strong {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.sidebar-tag span {
  font-size: 9px;
  color: #4b5563;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Top bar ---------- */
.shell-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 0 20px;
  background: rgba(8, 11, 14, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex: 0 0 auto;
}
.topbar-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
  min-width: 0;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
}
.topbar-search svg { width: 15px; height: 15px; color: var(--muted-2); flex: 0 0 auto; }
.topbar-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  font: inherit;
  font-size: 13px;
}
.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.user-meta { display: grid; line-height: 1.15; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--muted-2); font-size: 11px; }
.chev { color: var(--muted-2); font-size: 11px; }

/* ---------- Main wrap ---------- */
.wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 22px 48px;
}
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.lede { color: var(--muted); max-width: 62ch; line-height: 1.45; margin: 0 0 12px; font-size: 14px; }
.txt-white { color: #fff; }
.txt-brand { color: var(--brand-hot); }
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.footer-note {
  margin-top: 40px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.banner {
  background: rgba(201, 0, 59, 0.08);
  border: 1px solid rgba(201, 0, 59, 0.35);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
}
.banner a { color: #fda4af; }
.banner.error { background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.35); }
.banner.pass { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.35); }

.card, .panel-card, .settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1rem;
}
.panel-head a {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.panel-head a:hover { color: var(--brand-hot); }
.empty-state { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

form.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="email"], input[type="file"], select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 1px solid rgba(201, 0, 59, 0.55);
  border-color: rgba(201, 0, 59, 0.55);
}
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.checks label { font-weight: 500; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

button, .btn {
  appearance: none;
  border: 0;
  background: var(--text);
  color: #0b0e12;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.brand, .btn.brand {
  background: var(--brand);
  color: #fff;
}
button.brand:hover, .btn.brand:hover { background: var(--brand-hot); }
button.danger { background: var(--fail); color: #1a0508; }
button:disabled, .btn.disabled { opacity: 0.45; pointer-events: none; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table.dense td, .table.dense th { padding: 9px 8px; }
.table a { color: var(--text); text-decoration: none; }
.table a:hover { color: #fda4af; }
.score { font-family: var(--mono); font-weight: 700; }
.tier-A { color: #fda4af; }
.tier-B { color: #fb7185; }
.tier-C { color: var(--warn); }
.tier-LOW { color: var(--muted); }

.pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.pass { background: rgba(52, 211, 153, 0.12); color: var(--pass); border-color: rgba(52, 211, 153, 0.35); }
.pill.fail { background: rgba(251, 113, 133, 0.12); color: var(--fail); border-color: rgba(251, 113, 133, 0.35); }
.pill.warn { background: rgba(251, 191, 36, 0.12); color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.pill.conf-confirmed,
.pill.conf-high { background: rgba(52, 211, 153, 0.12); color: var(--pass); border-color: rgba(52, 211, 153, 0.35); }
.pill.conf-probable,
.pill.conf-medium_high,
.pill.conf-medium { background: rgba(96, 165, 250, 0.12); color: var(--info); border-color: rgba(96, 165, 250, 0.35); }
.pill.conf-weak_guess,
.pill.conf-none,
.pill.conf-unconfirmed,
.pill.conf-medium_low,
.pill.conf-low { background: rgba(251, 191, 36, 0.12); color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.pill.conf-rejected { background: rgba(251, 113, 133, 0.12); color: var(--fail); border-color: rgba(251, 113, 133, 0.35); }
.pill.need {
  background: var(--panel-3);
  color: var(--text);
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 4px 4px 0;
}
.muted { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.hint { font-weight: 500; color: var(--muted); font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filters a {
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel);
}
.filters a:hover, .filters a.active {
  color: var(--text);
  border-color: rgba(201, 0, 59, 0.55);
  background: var(--brand-tint);
}

.contact-panel { border-color: rgba(201, 0, 59, 0.35); }
.contact-facts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.contact-facts li { font-size: 16px; line-height: 1.4; }
.contact-kind {
  display: inline-block;
  min-width: 9.5rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-empty { font-size: 1.15rem; margin: 0 0 8px; }
.contact-source { color: var(--muted); font-size: 13px; font-weight: 500; }
.contact-source::before { content: " — "; }

.progress { height: 10px; background: var(--panel-3); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress > span, .progress-bar { display: block; height: 100%; background: var(--brand); transition: width 0.3s ease; }
.log { list-style: none; padding: 0; margin: 18px 0 0; }
.log li { font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }

.census {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 16px 0 0;
}
.census div {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.census dt { font-size: 12px; color: var(--muted); }
.census dd { margin: 4px 0 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

.combo { position: relative; }
.combo-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow: auto;
}
.combo-list[hidden] { display: none; }
.combo-option {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
}
.combo-option small { color: var(--muted); font-weight: 400; }
.combo-option[aria-selected="true"], .combo-option:hover { background: var(--brand-tint); }
.scanned-list { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 13px; }
.scanned-list li { margin: 4px 0; }
.town-suggest { display: grid; gap: 8px; }
.town-chip {
  display: grid;
  justify-items: start;
  gap: 2px;
  font-size: 13px;
  padding: 10px 14px;
  text-align: left;
  border-radius: var(--radius-sm);
}
.town-chip small { color: var(--muted); font-weight: 500; }
.contact-box summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.contact-box summary:hover { color: #fda4af; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; }
.check { padding: 10px 0; border-bottom: 1px solid var(--border); }
.check h3 { margin: 0 0 4px; font-size: 14px; }
.check p { margin: 0; color: var(--muted); font-size: 13px; }
.table tr.score-detail td { border-bottom: 1px solid var(--border); padding-top: 0; }
details.score-break { margin: 0 0 10px; }
details.score-break summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.score-services { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.score-services li { margin: 4px 0; }
details.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
pre.mail {
  white-space: pre-wrap;
  background: #05070a;
  color: var(--text);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}

/* Status pills */
.status-pill {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
  display: inline-block;
}
.status-healthy { background: rgba(52, 211, 153, 0.12); color: var(--pass); border-color: rgba(52, 211, 153, 0.35); }
.status-low-inventory { background: rgba(201, 0, 59, 0.14); color: #fda4af; border-color: rgba(201, 0, 59, 0.4); }
.status-replenishing { background: rgba(96, 165, 250, 0.12); color: var(--info); border-color: rgba(96, 165, 250, 0.35); }
.status-paused { background: var(--panel-3); color: var(--muted); }
.status-no-eligible-areas,
.status-api-error { background: rgba(251, 113, 133, 0.12); color: var(--fail); border-color: rgba(251, 113, 133, 0.35); }
.status-run-queued, .status-run-discovering, .status-run-crawling,
.status-run-auditing, .status-run-scoring, .status-run-enriching,
.status-run-rescoring { background: rgba(96, 165, 250, 0.12); color: var(--info); border-color: rgba(96, 165, 250, 0.35); }
.status-run-complete { background: rgba(52, 211, 153, 0.12); color: var(--pass); border-color: rgba(52, 211, 153, 0.35); }
.status-run-failed, .status-run-cancelled { background: rgba(251, 113, 133, 0.12); color: var(--fail); border-color: rgba(251, 113, 133, 0.35); }

/* ---------- Dashboard ---------- */
.dash-page-head {
  margin: 0 0 10px;
}
.dash-page-head h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.2;
}
.dash-page-head p {
  margin: 2px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.metric-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.metric-card:hover {
  border-color: rgba(201, 0, 59, 0.45);
  background: var(--panel-2);
  transform: translateY(-1px);
  color: inherit;
}
.metric-ico {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(201, 0, 59, 0.12);
  border: 1px solid rgba(201, 0, 59, 0.35);
  color: #fda4af;
}
.metric-ico svg { width: 22px; height: 22px; }
.metric-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.metric-label {
  margin: 5px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.metric-hint { margin: 3px 0 0; color: var(--muted-2); font-size: 11px; }
.metric-chev { color: var(--muted-2); font-size: 22px; line-height: 1; }

.inventory-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.inv-chip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 12px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 40px;
}
.inv-kicker {
  width: auto;
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.inv-chip strong {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}
.inv-chip .status-pill { flex: 0 0 auto; }
.inv-meta {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.action-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.scan-action-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.scan-action-media {
  position: absolute;
  inset: 0 0 0 42%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.38) contrast(1.05) saturate(0.85);
}
.scan-action-lead .scan-action-media {
  background-image: url("/static/assets/construction/lead-crane.jpg");
}
.scan-action-co .scan-action-media {
  background-image: url("/static/assets/construction/co-building.jpg");
}
.scan-action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, rgba(13, 17, 22, 0.98) 0%, rgba(13, 17, 22, 0.92) 42%, rgba(13, 17, 22, 0.35) 62%, rgba(13, 17, 22, 0.55) 100%);
  pointer-events: none;
}
.scan-action-lead::after,
.scan-action-co::after {
  content: "";
  position: absolute;
  top: -10%;
  right: -4%;
  width: 46%;
  height: 120%;
  z-index: 2;
  background: linear-gradient(160deg, transparent 18%, rgba(201, 0, 59, 0.22) 48%, transparent 78%);
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.scan-action-body {
  position: relative;
  z-index: 3;
  padding: 18px 18px 16px;
  display: grid;
  gap: 8px;
  align-content: start;
  max-width: none;
  grid-column: 1;
}
.scan-action-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(201, 0, 59, 0.14);
  border: 1px solid rgba(201, 0, 59, 0.4);
  color: #fda4af;
}
.scan-action-ico svg { width: 18px; height: 18px; }
.scan-action-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.scan-action-lede { margin: 0; color: var(--text); font-weight: 500; font-size: 14px; }
.scan-action-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.scan-action-motto {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  margin: 0 !important;
  font-size: 10px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 164, 175, 0.9) !important;
  text-align: right;
  line-height: 1.55 !important;
  max-width: 11rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.scan-action-card .btn { margin-top: 4px; width: fit-content; }

.dash-bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.activity-feed li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
}
.act-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 6px;
  background: var(--muted-2);
}
.tone-pass { background: var(--pass); }
.tone-fail { background: var(--fail); }
.tone-warn { background: var(--warn); }
.tone-info { background: var(--info); }
.tone-muted { background: var(--muted-2); }
.activity-feed strong { font-size: 13px; }
.activity-feed .ts { font-size: 11px; }

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.page-header h1 { margin-bottom: 4px; }
.settings-grid { display: grid; gap: 16px; }
.settings-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.05rem;
}
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 8px 0 14px;
}
.toggle-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--muted);
}

.sidebar-account-wrap { position: relative; }
.sidebar-account {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.sidebar-account:hover { background: var(--panel-2); }
.account-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 2px;
}
.account-menu[hidden] { display: none !important; }
.account-menu a,
.account-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.account-menu a:hover,
.account-menu-btn:hover { background: var(--panel-2); color: #fff; }
.account-menu form { margin: 0; }

.stack-form { display: grid; gap: 12px; }
.stack-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.stack-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}
.stack-form input[readonly] {
  color: var(--muted);
  cursor: not-allowed;
}
.account-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.account-facts p {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 9px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.account-facts span {
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.account-facts strong { font-size: 13px; }
.muted-line { color: var(--muted-2); font-size: 12px; margin: 0; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}
.btn.ghost:hover { border-color: var(--border-strong); color: #fff; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top, rgba(201, 0, 59, 0.12), transparent 55%),
    var(--bg);
  font-family: var(--font-ui);
  color: var(--text);
  margin: 0;
}
.auth-card {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
}
.auth-logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 18px;
}
.auth-card h1 {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 4px;
}
.auth-lede {
  text-align: center;
  color: var(--muted-2);
  margin: 0 0 18px;
  font-size: 13px;
}
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.auth-form .btn { width: 100%; margin-top: 4px; }

@media (max-width: 1180px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  body.app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
  .action-panels, .inventory-strip, .row, .split { grid-template-columns: 1fr; }
  .scan-action-card { grid-template-columns: 1fr; min-height: 200px; }
  .scan-action-media { inset: 0; opacity: 0.55; }
  .scan-action-motto { display: none; }
  .inv-chip { flex-wrap: wrap; }
  .inv-meta { margin-left: 0; }
  .topbar { grid-template-columns: 1fr; height: auto; padding: 12px 16px; gap: 10px; }
  .topbar-actions { justify-self: stretch; width: 100%; }
  .topbar-search { width: 100%; max-width: none; flex: 1 1 auto; }
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr !important; }
  .wrap { padding: 16px 14px 56px; }
}
