
:root {
  --color-bg: #f7f8f9;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-primary: #0f172a;
  --color-primary-hover: #1f2937;
  --color-primary-text: #ffffff;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-text: #ffffff;
  --color-ok: #15803d;
  --color-ok-bg: #ecfdf3;
  --color-ok-border: #d1fae5;
  --color-error: #b42318;
  --color-error-bg: #fef2f2;
  --color-error-border: #fee2e2;
  --color-warn: #b54708;
  --color-warn-bg: #fffbeb;
  --color-warn-border: #fef0c7;
  --color-neutral: #475467;
  --color-neutral-bg: #f9fafb;
  --color-neutral-border: #eaecf0;
  --tint-blue: #2563eb;
  --tint-blue-bg: #eff6ff;
  --tint-violet: #7c3aed;
  --tint-violet-bg: #f5f3ff;
  --tint-green: #059669;
  --tint-green-bg: #ecfdf5;
  --tint-orange: #ea580c;
  --tint-orange-bg: #fff7ed;
  --tint-neutral: #475467;
  --tint-neutral-bg: #f3f4f6;
  --radius-sm: 6px;
  --radius-button: 8px;
  --radius-tile: 10px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 24px 64px rgba(15, 23, 42, 0.22);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; line-height: 1.3; }
h2 { font-size: 16px; line-height: 1.4; }
h3 { font-size: 14px; }

/* ---- Top bar + tabs ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(to right, rgba(20, 20, 20, 0.25) 0%, rgba(20, 20, 20, 0.1) 45%, var(--color-surface) 92%),
    url('/banners/header-banner.jpg') center/cover no-repeat;
  padding: 22px var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.topbar-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 16px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); }

.brand-mark { width: 28px; height: 28px; flex-shrink: 0; object-fit: contain; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3) 0 var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-weight: 500;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 28px;
  padding: 0 var(--space-8);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 0 10px;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  font-size: 13.5px;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-primary); }
.tab .icon { width: 16px; height: 16px; }

/* ---- Page scaffold ---- */

.content { max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-8) var(--space-8); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.page-sub { margin: 4px 0 0; color: var(--color-text-muted); font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---- Tiles ---- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }

.tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4) var(--space-5);
}
.tile-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: 13px; font-weight: 500; color: var(--color-text); }
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.tile-icon .icon { width: 15px; height: 15px; }
.tile-icon img { width: 20px; height: 20px; }
.tile-icon-blue { color: var(--tint-blue); background: var(--tint-blue-bg); }
.tile-icon-violet { color: var(--tint-violet); background: var(--tint-violet-bg); }
.tile-icon-green { color: var(--tint-green); background: var(--tint-green-bg); }
.tile-icon-orange { color: var(--tint-orange); background: var(--tint-orange-bg); }
.tile-icon-neutral { color: var(--tint-neutral); background: var(--tint-neutral-bg); }
.tile-icon-mint { background: var(--spot-mint-bg); }
.tile-value { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { margin-top: 2px; font-size: 12.5px; color: var(--color-text-muted); }

/* ---- Cards ---- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.card-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.card-sub { margin: 2px 0 0; color: var(--color-text-muted); font-size: 12.5px; }
.card-body { padding: var(--space-4) var(--space-5); }

/* ---- Tables ---- */

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
th, td { text-align: left; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
thead th { background: var(--color-neutral-bg); color: var(--color-text-muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-neutral-bg); }
th:last-child, td:last-child { text-align: right; width: 1%; white-space: nowrap; }
td a { font-weight: 500; }
td a:hover { text-decoration: underline; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.row-actions form { display: inline; }

.mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--color-text-muted); }

/* ---- Key/value grid ---- */

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4) var(--space-6); margin: 0; }
.kv dt { font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; }
.kv dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

/* ---- Empty state ---- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-8) var(--space-5);
  margin: var(--space-4) var(--space-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-tile);
  background: var(--color-neutral-bg);
  color: var(--color-text-muted);
  text-align: center;
}
.empty-state .icon { width: 22px; height: 22px; margin-bottom: var(--space-1); }
.empty-state svg:not(.icon) { margin-bottom: var(--space-2); }
.empty-title { font-weight: 600; color: var(--color-text); }
.empty-sub { font-size: 12.5px; }

/* ---- Bar chart ---- */

.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar { width: 100%; height: var(--h); min-height: 2px; background: var(--tint-blue); border-radius: 3px 3px 0 0; transition: background 0.12s ease; }
.bar:hover { background: #1d4ed8; }
.bar-label { font-size: 11px; color: var(--color-text-muted); line-height: 1; }

/* ---- Insight widgets (donut / radial gauge / heatmap) ---- */

.insight-card { display: flex; flex-direction: column; min-width: 0; }
.insight-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.donut-chart { display: flex; align-items: center; gap: var(--space-4); }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); flex: 1; min-width: 0; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; }
.donut-legend-item strong { margin-left: auto; color: var(--color-text); font-weight: 600; }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.radial-gauge { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.radial-gauge-label { font-size: 12.5px; color: var(--color-text-muted); text-align: center; }
.heatmap-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.heatmap-cell { aspect-ratio: 1; border-radius: 4px; }
.connection-status-list { display: flex; flex-direction: column; gap: var(--space-2); max-height: 140px; overflow-y: auto; }
.connection-status-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 12.5px; min-width: 0; }
.connection-status-row .mono { color: var(--color-text-muted); flex-shrink: 0; }
.connection-status-row .badge { min-width: 0; }

/* ---- Traffic simulator ---- */

.sim-strategy-picker { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.sim-strategy-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
}
.sim-strategy-btn.active { border-color: var(--spot-mint); color: var(--color-text); background: var(--spot-mint-bg); }

/* Radial layout: skills arranged in a circle with the "Leads" cursor at the
   center. aspect-ratio:1 keeps percentage-based left/top offsets circular
   (not elliptical); nodes and spokes are positioned via inline left/top/
   rotate styles computed server-side with Math.cos/sin. */
.sim-radial { position: relative; width: 100%; max-width: 560px; margin: var(--space-5) auto 0; aspect-ratio: 1; }
.sim-spokes { position: absolute; inset: 0; }
.sim-spoke { position: absolute; left: 50%; top: 50%; height: 2px; background: var(--color-border); transform-origin: left center; z-index: 0; }
.sim-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  border: 2px solid var(--spot-mint);
  border-radius: 999px;
  width: 84px;
  height: 84px;
  justify-content: center;
  box-shadow: 0 0 0 6px var(--spot-mint-bg);
  z-index: 2;
}
.sim-center img { width: 28px; height: 28px; }
.sim-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 168px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  background: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 1;
}
.sim-node.pulse { border-color: var(--spot-mint); box-shadow: 0 0 0 4px var(--spot-mint-bg); }
.sim-node-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-node-avail { font-size: 11.5px; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.sim-node-weight { font-size: 11px; color: var(--color-text-muted); margin-bottom: 4px; }
.sim-node-avail-edit { display: flex; align-items: center; gap: 4px; margin-bottom: var(--space-2); font-size: 12px; color: var(--color-text-muted); }
.sim-avail-input {
  width: 44px;
  padding: 2px 4px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  text-align: center;
  background: var(--color-surface);
  color: var(--color-text);
}
.sim-node-count { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--space-2); }
.sim-node-fallback { border-style: dashed; }
.sim-bar-track { height: 8px; border-radius: 4px; background: var(--color-neutral-bg); overflow: hidden; }
.sim-bar-fill { height: 100%; background: var(--spot-mint); border-radius: 4px; transition: width 0.2s ease; }
.sim-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--spot-mint); box-shadow: 0 0 0 3px var(--spot-mint-bg); transition: left 0.6s ease, top 0.6s ease; pointer-events: none; z-index: 5; }
#simulate-live-toggle.active-live { border-color: var(--color-danger); color: var(--color-danger); }
@media (max-width: 640px) {
  .sim-radial { max-width: 100%; }
  .sim-node { width: 132px; padding: var(--space-2); }
}
.sim-log {
  margin-top: var(--space-4);
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sim-log-line { font-size: 12px; font-family: var(--font-mono, monospace); color: var(--color-text-muted); }

/* ---- Live traffic feed ---- */

.live-tally { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.live-tally-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.live-tally-count { font-weight: 700; font-size: 15px; color: var(--color-text); }
.live-feed {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}
.live-row { font-size: 12.5px; font-family: var(--font-mono, monospace); color: var(--color-text-muted); }
.live-row:first-child { color: var(--color-text); font-weight: 500; }
.pager { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }

/* ---- Bitly ---- */

.link-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.mini-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-2); }
.mini-table h3 { margin: 0 0 var(--space-2); }
.mini-table table { font-size: 13px; }
.mini-table td { padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table td:last-child { text-align: right; font-weight: 500; }
@media (max-width: 640px) { .mini-tables { grid-template-columns: 1fr; } }

/* ---- Forms ---- */

input, select {
  font-family: var(--font-body);
  font-size: 14px;
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  margin: 0;
}
input:focus, select:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }

label { display: block; font-size: 12.5px; font-weight: 500; color: var(--color-text-muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.field-row .field { margin-bottom: 0; }
.field-check { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); font-size: 14px; color: var(--color-text); font-weight: 400; }
.field:last-child, .field-row:last-child, .field-check:last-child { margin-bottom: 0; }

.combobox { position: relative; }
.combobox-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 224px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-modal);
  padding: var(--space-1);
}
.combobox-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
}
.combobox-option:hover, .combobox-option.is-active { background: var(--color-neutral-bg); }
.combobox-empty { padding: var(--space-2) var(--space-3); font-size: 13px; color: var(--color-text-muted); }

/* ---- Spot illustrations ----
   A friendly-illustration language layered on top of this (light, neutral)
   theme: bold black outlines, one flat mint accent, simple dot-eye faces --
   used for the strategy cards and empty states. --spot-ink/--spot-mint are
   the two colors every spot illustration draws from, so they stay consistent
   as more get added. */
:root {
  --spot-ink: #141414;
  --spot-mint: #3ecf8e;
  --spot-mint-bg: #eafbf3;
}
.strategy-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.strategy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: var(--space-3);
  border-radius: 16px;
  background: #fbf8f2;
  border: 3px solid var(--spot-ink);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.strategy-card:hover { transform: translateY(-2px); }
.strategy-card input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.strategy-card-icon { line-height: 0; }
.strategy-card-title { font-weight: 700; font-size: 14.5px; color: var(--spot-ink); }
.strategy-card-desc { font-size: 12px; line-height: 1.45; color: var(--color-text-muted); }
.strategy-card:has(input:checked) { background: var(--spot-mint-bg); box-shadow: 0 0 0 2px var(--spot-ink) inset; }
.strategy-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--spot-mint);
  border: 2px solid var(--spot-ink);
  color: var(--spot-ink);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 640px) { .strategy-cards { grid-template-columns: 1fr; } }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn .icon { width: 15px; height: 15px; }
.btn-lg { height: 40px; padding: 0 var(--space-4); font-size: 14px; }
.btn-block { width: 100%; }

.btn:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, .modal-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary { background: var(--color-primary); color: var(--color-primary-text); border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-danger { background: var(--color-danger); color: var(--color-danger-text); border-color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-hover); }
.btn-ghost { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.btn-ghost:hover { background: var(--color-neutral-bg); border-color: var(--color-border-strong); }

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
}
.btn-icon:hover { background: var(--color-error-bg); color: var(--color-danger); border-color: var(--color-error-border); }

.icon { width: 18px; height: 18px; vertical-align: -0.15em; }

/* ---- Badges + avatars ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 18px;
  border: 1px solid transparent;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-ok { color: var(--color-ok); background: var(--color-ok-bg); border-color: var(--color-ok-border); }
.badge-error { color: var(--color-error); background: var(--color-error-bg); border-color: var(--color-error-border); }
.badge-warn { color: var(--color-warn); background: var(--color-warn-bg); border-color: var(--color-warn-border); }
.badge-neutral { color: var(--color-neutral); background: var(--color-neutral-bg); border-color: var(--color-neutral-border); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.cell-user { display: inline-flex; align-items: center; gap: var(--space-2); }

/* ---- Alerts ---- */

.alert { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-button); border: 1px solid; font-size: 13px; margin-bottom: var(--space-4); }
.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error { color: var(--color-error); background: var(--color-error-bg); border-color: var(--color-error-border); }
.alert-ok { color: var(--color-ok); background: var(--color-ok-bg); border-color: var(--color-ok-border); }
.alert-neutral { color: var(--color-text); background: var(--color-surface); border-color: var(--color-border); }
.flash-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 13px;
}
.flash-banner .icon { width: 16px; height: 16px; color: var(--color-ok); }

/* ---- Login ---- */

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--color-bg); padding: var(--space-6); }
.login-card { width: 100%; max-width: 400px; }
.login-card .card-body { padding: var(--space-8); }
.login-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 15px; margin-bottom: var(--space-6); }
.login-card h1 { font-size: 20px; }
.login-card .page-sub { margin-bottom: var(--space-6); }
.login-card .btn { margin-top: var(--space-2); }

/* ---- Public notice (what a lead sees at / or on a dead link) ---- */

.public-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  background: radial-gradient(circle at 50% 38%, var(--spot-mint-bg) 0, var(--color-bg) 420px);
}
.public-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-card);
}
.public-art {
  display: grid;
  place-items: center;
  width: 152px;
  height: 152px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  background: var(--spot-mint-bg);
  border: 1px dashed var(--spot-mint);
}
.public-art img { display: block; animation: public-float 4s ease-in-out infinite; }
.public-card h1 { margin: 0 0 var(--space-2); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--color-text); text-wrap: balance; }
.public-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--color-text-muted); text-wrap: pretty; }
.public-action { margin-top: var(--space-6); text-decoration: none; }
@keyframes public-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .public-art img { animation: none; } }

/* ---- Modals ---- */

dialog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  color: var(--color-text);
  text-align: left;
  white-space: normal;
}
dialog.modal-wide { width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head .page-sub { margin-top: 2px; }
.modal-close {
  display: inline-flex;
  padding: 6px;
  margin: -6px -6px 0 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-muted);
}
.modal-close:hover { background: var(--color-neutral-bg); color: var(--color-text); }
.modal-body { padding: var(--space-5) var(--space-6); }
.modal-body p { margin: 0; }
.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-6);
}
.modal-actions-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
tr[data-href] { cursor: pointer; }
