/* Cold Call CRM - one stylesheet for every page.
   Colours live in the tokens below; change them here and the whole app follows. */

:root {
  --bg: #060b1c;
  --bg-glow-1: rgba(47, 123, 255, 0.22);
  --bg-glow-2: rgba(41, 199, 193, 0.08);
  --sidebar: #070d22;
  --panel: rgba(16, 27, 60, 0.72);
  --panel-solid: #0f1a3a;
  --panel-raised: #15224a;
  --border: rgba(110, 140, 220, 0.16);
  --border-strong: rgba(110, 140, 220, 0.3);
  --text: #e8eeff;
  --text-soft: #b7c2e3;
  --muted: #7f8bb3;
  --accent: #2f7bff;
  --accent-bright: #4d9bff;
  --accent-soft: rgba(47, 123, 255, 0.16);
  --green: #2fd67b;
  --green-soft: rgba(47, 214, 123, 0.14);
  --amber: #f3b53f;
  --amber-soft: rgba(243, 181, 63, 0.16);
  --red: #ff5f78;
  --red-soft: rgba(255, 95, 120, 0.15);
  --purple: #9d80ff;
  --purple-soft: rgba(157, 128, 255, 0.16);
  --blue: #4d9bff;
  --blue-soft: rgba(77, 155, 255, 0.16);
  --teal: #2bc9c2;
  --teal-soft: rgba(43, 201, 194, 0.15);
  --grey: #8a95b8;
  --grey-soft: rgba(138, 149, 184, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --sidebar-w: 232px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 75% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

[hidden] { display: none !important; }

a { color: var(--accent-bright); }

svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor;
      stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- practice banner ---------- */
.practice-banner {
  position: sticky; top: 0; z-index: 50;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.85rem; font-weight: 600;
  color: #1b1300;
  background: repeating-linear-gradient(135deg, #f3b53f 0 18px, #f7c560 18px 36px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.narrow-only { display: none; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1.1rem 0.85rem;
  background: linear-gradient(180deg, var(--sidebar), rgba(7, 13, 34, 0.92));
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.has-banner .sidebar { top: 2.1rem; height: calc(100vh - 2.1rem); }

.brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 0.4rem 1rem; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  box-shadow: 0 6px 18px rgba(47, 123, 255, 0.4);
}
.brand-mark svg { width: 1.1rem; height: 1.1rem; fill: #fff; stroke: none; }
.brand-name { font-weight: 800; letter-spacing: -0.01em; font-size: 1.02rem; }

.nav-label {
  padding: 0.4rem 0.6rem; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(47, 123, 255, 0.35), rgba(47, 123, 255, 0.12));
  box-shadow: inset 2px 0 0 var(--accent-bright);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 1rem; }

.today-card {
  padding: 0.85rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
}
.today-top { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem; }
.ring { width: 2.6rem; height: 2.6rem; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-track { stroke: rgba(255, 255, 255, 0.08); }
.ring-fill { stroke: var(--accent-bright); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25;
             transition: stroke-dashoffset 0.6s ease, stroke 0.3s; }
.ring-fill.done { stroke: var(--green); }
.today-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.today-dials b { font-size: 1.35rem; font-weight: 800; }
.today-dials span { font-size: 0.75rem; color: var(--muted); }
.today-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-soft); padding: 0.1rem 0; }

.foot-tools { display: flex; flex-direction: column; gap: 0.5rem; }
.text-size { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); padding: 0 0.3rem; }
.text-size span:first-child { margin-right: auto; }
.text-size button {
  width: 1.7rem; height: 1.7rem; border-radius: 7px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); font: inherit; font-size: 1rem; cursor: pointer;
}
.text-size button:hover { background: rgba(255, 255, 255, 0.06); }
#text-size-value { min-width: 2.8rem; text-align: center; color: var(--text-soft); }

.main { min-width: 0; padding: 1.6rem 2rem 3rem; outline: none; }
/* during a call the docked call panel (Dialer) covers the bottom: every page can still scroll clear of it */
body.dl-docked .main:not(:has(.dialer-page)) { padding-bottom: calc(var(--call-panel-h, 0px) + 1rem); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { margin: 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; backdrop-filter: blur(6px);
}
.card h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.card p { color: var(--text-soft); margin: 0.4rem 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.stat {
  position: relative; overflow: hidden;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
}
.stat-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-top: 0.2rem; }
.stat-sub { font-size: 0.78rem; color: var(--muted); }
.stat.hero { background: linear-gradient(135deg, #2f7bff, #1e5be0 60%, #1a4fc7); border-color: rgba(120, 170, 255, 0.5);
             box-shadow: 0 12px 30px rgba(47, 123, 255, 0.35); }
.stat.hero .stat-label, .stat.hero .stat-sub { color: rgba(255, 255, 255, 0.8); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.55rem 0.95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--panel-raised); color: var(--text);
  font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #1b2b5c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent-bright); color: #fff; box-shadow: 0 6px 18px rgba(47, 123, 255, 0.35); }
.btn-primary:hover { background: var(--accent-bright); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-danger { background: var(--red-soft); border-color: rgba(255, 95, 120, 0.4); color: #ffd3da; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: rgba(5, 10, 28, 0.6); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 1px;
}
label { font-size: 0.82rem; font-weight: 600; color: var(--text-soft); }

/* ---------- tables (wide ones scroll inside their own box) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left; white-space: nowrap; padding: 0.7rem 0.9rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); background: rgba(8, 14, 36, 0.6);
}
td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* ---------- pills & badges (colour names match settings.toml) ---------- */
.pill { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border-radius: 999px;
        font-size: 0.75rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.c-amber  { color: var(--amber);  background: var(--amber-soft);  border-color: rgba(243, 181, 63, 0.35); }
.c-red    { color: var(--red);    background: var(--red-soft);    border-color: rgba(255, 95, 120, 0.35); }
.c-purple { color: var(--purple); background: var(--purple-soft); border-color: rgba(157, 128, 255, 0.35); }
.c-blue   { color: var(--blue);   background: var(--blue-soft);   border-color: rgba(77, 155, 255, 0.35); }
.c-green  { color: var(--green);  background: var(--green-soft);  border-color: rgba(47, 214, 123, 0.35); }
.c-teal   { color: var(--teal);   background: var(--teal-soft);   border-color: rgba(43, 201, 194, 0.35); }
.c-grey   { color: var(--grey);   background: var(--grey-soft);   border-color: rgba(138, 149, 184, 0.3); }

/* ---------- "coming in a later step" ---------- */
.coming { max-width: 640px; }
.coming .step { display: inline-block; margin-bottom: 0.6rem; }
.coming ul { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--text-soft); }
.coming li { margin: 0.25rem 0; }

/* ---------- login ---------- */
.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.login-card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.6rem; border-radius: var(--radius); background: var(--panel-solid);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.login-card .brand { padding-bottom: 0.6rem; }
.login-card .btn { margin-top: 0.4rem; }
.login-error { margin: 0; color: var(--red); font-size: 0.85rem; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; max-width: calc(100vw - 2rem); }
.toast {
  padding: 0.7rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600;
  background: var(--panel-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
.toast.error { border-color: rgba(255, 95, 120, 0.6); color: #ffd3da; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- phone & small screens: sidebar becomes a top bar ---------- */
@media (max-width: 860px) {
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .shell { display: block; }
  .sidebar, .has-banner .sidebar {
    position: sticky; top: 0; z-index: 40; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem;
    padding: 0.6rem 1rem; border-right: none; border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .has-banner .sidebar { top: 2.1rem; }
  .brand { padding: 0; }
  .brand-name { font-size: 0.95rem; }
  .nav-label { display: none; }
  .nav { order: 3; flex-direction: row; width: 100%; overflow-x: auto; gap: 0.25rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0.45rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
  .nav a.active { box-shadow: inset 0 -2px 0 var(--accent-bright); }
  .sidebar-foot { order: 2; margin: 0 0 0 auto; padding: 0; flex-direction: row; align-items: center; gap: 0.4rem; }
  .today-card { padding: 0.25rem 0.6rem; display: flex; align-items: center; gap: 0.6rem; }
  .today-top { margin: 0; gap: 0.4rem; }
  .ring { width: 1.6rem; height: 1.6rem; }
  .today-label, .today-row { display: none; }
  .today-dials b { font-size: 1rem; }
  .foot-tools { flex-direction: row; align-items: center; }
  .text-size span:first-child, #text-size-value { display: none; }
  #backup-btn { padding: 0.4rem; font-size: 0; gap: 0; }
  #backup-btn svg { font-size: 1rem; }
  .main { padding: 1.1rem 1rem 2.5rem; }
  .page-head h1 { font-size: 1.35rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .stat-value { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Leads page
   ===================================================================== */
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* headline cards are buttons: click one to filter the table */
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
              transition: border-color 0.15s, transform 0.05s; }
button.stat:hover { border-color: var(--border-strong); }
button.stat:active { transform: translateY(1px); }
button.stat { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.2rem 0.6rem; }
.hero-spark { flex: 1 1 6rem; min-width: 0; max-width: 8rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.hero-spark small { font-size: 0.7rem; color: rgba(255, 255, 255, 0.8); text-align: right; }
.spark { width: 100%; height: 2.1rem; }
.spark polyline { fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: 0.9; }
.total-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; margin: 0.55rem 0 0.45rem;
             background: rgba(255, 255, 255, 0.06); }
.total-legend { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; font-size: 0.72rem; color: var(--muted); }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.3rem; }
.seg-ready { background: var(--accent-bright); }
.seg-skipped { background: var(--amber); }
.seg-dropped { background: var(--red); }
.seg-pending { background: var(--grey); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; }
.toolbar select { padding: 0.5rem 0.65rem; font-size: 0.85rem; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search svg { position: absolute; left: 0.7rem; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-left: 2.2rem; font-size: 0.88rem; }
.toolbar-count { margin-left: auto; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* table */
.leads-table { min-width: 860px; }
.leads-table td { padding: 0.6rem 0.9rem; }
.cell-business { min-width: 280px; }
.biz-line { display: flex; align-items: center; gap: 0.35rem; }
.lead-name { padding: 0; border: none; background: none; color: var(--text); font: inherit; font-weight: 700;
             font-size: 0.9rem; cursor: pointer; text-align: left; }
.lead-name:hover { color: var(--accent-bright); text-decoration: underline; }
.icon-link { display: inline-flex; color: var(--muted); }
.icon-link:hover { color: var(--accent-bright); }
.icon-link svg { width: 0.95rem; height: 0.95rem; }
.biz-sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.1rem; }
.biz-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.biz-tags .pill { font-size: 0.68rem; padding: 0.1rem 0.5rem; }
tr.status-skipped .lead-name, tr.status-dropped .lead-name { color: var(--text-soft); font-weight: 600; }
.phone-copy { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.3rem; margin: -0.2rem -0.3rem;
              border: none; border-radius: 6px; background: none; color: var(--accent-bright); font: inherit;
              font-family: var(--mono); font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.phone-copy:hover { background: var(--accent-soft); }
.phone-copy svg { width: 0.85rem; height: 0.85rem; color: var(--muted); }
.score { display: flex; align-items: center; gap: 0.55rem; }
.score b { min-width: 1.6rem; font-variant-numeric: tabular-nums; }
.score .bar { width: 4rem; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.score .bar i { display: block; height: 100%; border-radius: inherit; background: var(--grey); }
.g-A .bar i, .big-score.g-A b { background: var(--green); }
.g-B .bar i { background: var(--blue); }
.g-C .bar i { background: var(--amber); }
.grade { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 7px;
         font-size: 0.78rem; font-weight: 800; border: 1px solid transparent; }
.grade-A { color: var(--green); background: var(--green-soft); border-color: rgba(47, 214, 123, 0.4); }
.grade-B { color: var(--blue); background: var(--blue-soft); border-color: rgba(77, 155, 255, 0.4); }
.grade-C { color: var(--amber); background: var(--amber-soft); border-color: rgba(243, 181, 63, 0.4); }
.grade-none { color: var(--muted); background: var(--grey-soft); }
.outcome-select { padding: 0.3rem 1.6rem 0.3rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
                  cursor: pointer; appearance: none; -webkit-appearance: none; min-width: 8.5rem;
                  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                                    linear-gradient(135deg, currentColor 50%, transparent 50%);
                  background-position: right 0.75rem center, right 0.45rem center;
                  background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
.outcome-select option { color: var(--text); background: var(--panel-solid); }
.cell-when { white-space: nowrap; font-size: 0.8rem; }
.cell-when small { display: block; color: var(--muted); font-size: 0.72rem; }
td.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.table-foot { display: flex; justify-content: center; padding: 0.9rem 0; }

/* toasts with a button */
.toast { display: flex; align-items: center; gap: 0.8rem; }
.toast-action { flex: none; padding: 0.25rem 0.6rem; border-radius: 6px; border: 1px solid var(--border-strong);
                background: transparent; color: var(--accent-bright); font: inherit; font-weight: 700; cursor: pointer; }
.toast-action:hover { background: var(--accent-soft); }

/* ---------- lead panel ---------- */
.drawer-shell { position: fixed; inset: 0; z-index: 90; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 18, 0.55); backdrop-filter: blur(2px); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); overflow-y: auto;
          background: var(--panel-solid); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow);
          animation: drawer-in 0.2s ease; outline: none; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
body.drawer-open { overflow: hidden; }
.drawer-loading { padding: 2rem 1.4rem; }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between;
               gap: 0.8rem; padding: 1.1rem 1.3rem 0.9rem; background: var(--panel-solid); border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.drawer-head p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.drawer-close { padding: 0.4rem; }
.drawer-body { padding: 0.4rem 1.3rem 2rem; }
.drawer-body section { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.drawer-body section:last-child { border-bottom: none; }
.drawer-body h3 { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em;
                  text-transform: uppercase; color: var(--muted); }
.drawer-score { display: flex; align-items: center; gap: 1rem; }
.drawer-score .grade { margin-right: 0.3rem; }
.big-score { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%;
             border: 3px solid var(--grey); flex: none; }
.big-score.g-A { border-color: var(--green); }
.big-score.g-B { border-color: var(--blue); }
.big-score.g-C { border-color: var(--amber); }
.big-score b { font-size: 1.5rem; line-height: 1; background: none !important; }
.big-score small { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: -0.6rem; }
.drawer-reason { margin: 0.45rem 0 0; color: var(--text-soft); font-size: 0.85rem; }
.drawer-tags { margin-top: 0.45rem; }
.phone-big { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0.75rem 0.9rem;
             border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: rgba(5, 10, 28, 0.5);
             color: var(--text); font-family: var(--mono); font-size: 1.05rem; cursor: pointer; }
.phone-big:hover { border-color: var(--accent-bright); }
.phone-big svg { color: var(--muted); }
.look-links { display: grid; gap: 0.45rem; }
.look-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.8rem; border-radius: var(--radius-sm);
             border: 1px solid var(--border); background: var(--panel); color: var(--text); text-decoration: none; }
.look-link:hover { border-color: var(--accent-bright); background: var(--accent-soft); }
.look-link > span:nth-child(2) { flex: 1; min-width: 0; }
.look-link b { display: block; font-size: 0.9rem; }
.look-link small { display: block; color: var(--muted); font-size: 0.76rem; overflow-wrap: anywhere; }
.look-link > svg { color: var(--muted); width: 1rem; height: 1rem; }
.look-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px;
             background: var(--accent-soft); color: var(--accent-bright); flex: none; }
.look-none { margin: 0.6rem 0 0; font-size: 0.84rem; color: var(--green); }
.score-notes, .facts, .history { list-style: none; margin: 0; padding: 0; }
.score-notes li, .facts li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0;
                             font-size: 0.86rem; border-bottom: 1px dashed var(--border); }
.score-notes li:last-child, .facts li:last-child { border-bottom: none; }
.score-notes b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-notes b.pos { color: var(--green); }
.score-notes b.neg { color: var(--red); }
.score-notes li.total { font-weight: 800; border-top: 1px solid var(--border-strong); border-bottom: none; margin-top: 0.2rem; }
.facts span { color: var(--muted); }
.facts b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.8rem; }
.pill-btn { padding: 0.4rem 0.75rem; border-radius: 999px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.pill-btn:hover { filter: brightness(1.2); }
.pill-btn:disabled { opacity: 0.5; cursor: wait; }
.history li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); }
.history li:last-child { border-bottom: none; }
.history .pill { flex: none; }
.hist-when { flex: 1; font-size: 0.82rem; }
.hist-when small { display: block; color: var(--muted); font-size: 0.74rem; }
.hist-when em { display: block; color: var(--text-soft); font-size: 0.8rem; margin-top: 0.15rem; }
.history li.ignored .pill, .history li.ignored .hist-when { opacity: 0.45; text-decoration: line-through; }

@media (max-width: 860px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .toolbar select { flex: 1 1 calc(50% - 0.25rem); }
  .toolbar-count { margin-left: 0; width: 100%; }
  .hero-spark { max-width: none; flex-basis: 100%; align-items: flex-start; }
  .hero-spark .spark { display: none; }
  .drawer { width: 100%; border-left: none; }
}

/* Phones: keep the business name in view while the rest of the row scrolls sideways,
   and make the top bar solid and shorter. */
@media (max-width: 600px) {
  .leads-table { min-width: 720px; }
  .leads-table th:first-child, .leads-table td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--panel-solid);
    min-width: 9.5rem; max-width: 11rem; box-shadow: 1px 0 0 var(--border);
  }
  .cell-business .biz-sub { white-space: normal; }
  .sidebar, .has-banner .sidebar { background: var(--sidebar); }
  .brand-name, .today-dials span { display: none; }
}

/* a lead that no longer matches your filters fades out */
.leads-table tr.leaving { opacity: 0; transition: opacity 0.3s ease; }

.link-btn { display: block; padding: 0; border: none; background: none; color: var(--muted); font: inherit;
            font-size: 0.72rem; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--accent-bright); text-decoration: underline; }
.look-none.muted { color: var(--muted); }

/* =====================================================================
   Scraper page
   ===================================================================== */
.scrape-form { margin-bottom: 1rem; }
.field-label { display: block; margin: 0.9rem 0 0.35rem; }
.field-label small { font-weight: 400; color: var(--muted); margin-left: 0.3rem; }
.scrape-form textarea { width: 100%; resize: vertical; }
.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.45rem; }
.chip-group-label { width: 100%; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chip { padding: 0.32rem 0.65rem; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel-raised);
        color: var(--text-soft); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.chip b { color: var(--muted); font-weight: 700; margin-left: 0.2rem; }
.chip:hover { border-color: var(--accent-bright); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-bright); color: #fff; }
.chip.on b { color: var(--accent-bright); }
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
.form-grid select, .form-grid input { width: 100%; }
.inline { display: flex; gap: 0.5rem; }
.inline input { flex: 1; min-width: 0; }
.hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin-top: 1rem; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 500; }
.form-row label.check { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.check .num { width: 5rem; padding: 0.35rem 0.5rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1.1rem; }
.section-title { font-size: 1.05rem; margin: 1.6rem 0 0.7rem; }
.section-title small { font-size: 0.78rem; font-weight: 400; color: var(--muted); margin-left: 0.4rem; }
.active-run { margin-bottom: 1rem; border-color: rgba(77, 155, 255, 0.45); }
.active-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 0.8rem 0 0.6rem; }
.progress i { display: block; height: 100%; background: var(--accent-bright); transition: width 0.4s ease; }
.active-nums { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.85rem; color: var(--text-soft); }
.runs-table { min-width: 720px; }
.runs-table .sub { display: block; color: var(--muted); font-size: 0.76rem; }
.runs-table .actions { text-align: right; white-space: nowrap; }
.error-text { color: var(--red) !important; }
#waiting-card { margin-bottom: 1rem; }
@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

.practice-note { margin-bottom: 1rem; border-color: rgba(243, 181, 63, 0.5); background: var(--amber-soft); color: var(--text); font-size: 0.88rem; }
.practice-link { opacity: 0.75; cursor: default; }
.practice-link:hover { border-color: var(--border); background: var(--panel); }

.address-line { display: inline-flex; align-items: flex-start; gap: 0.4rem; margin-top: 0.45rem; padding: 0.25rem 0.4rem;
                margin-left: -0.4rem; border: none; border-radius: 6px; background: none; color: var(--text-soft);
                font: inherit; font-size: 0.85rem; text-align: left; cursor: pointer; }
.address-line:hover { background: var(--accent-soft); color: var(--text); }
.address-line svg { width: 0.95rem; height: 0.95rem; margin-top: 0.15rem; color: var(--muted); }
.address-none { display: flex; align-items: center; gap: 0.4rem; margin: 0.45rem 0 0 !important; font-size: 0.82rem; }
.address-none svg { width: 0.95rem; height: 0.95rem; }

.quote-note { display: block; font-size: 0.78rem; color: var(--text-soft); }

/* Phones: every page visible at once - two rows of icon buttons instead of a hidden scroll */
@media (max-width: 860px) {
  .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.3rem; overflow: visible; }
  .nav a { flex-direction: column; justify-content: center; gap: 0.15rem; padding: 0.4rem 0.2rem;
           font-size: 0.72rem; text-align: center; white-space: nowrap; }
  .nav a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a svg { width: 1.15rem; height: 1.15rem; }
  .nav a.active { box-shadow: inset 0 0 0 1px var(--accent-bright); }
}
@media (max-width: 360px) {
  .nav a { font-size: 0.66rem; }
}

@media (max-width: 860px) { #help-link { padding: 0.4rem; font-size: 0; gap: 0; } #help-link svg { font-size: 1rem; } }
