/* Hot Follow-ups — SoCon brand (same palette and type as the webinar landing page).
   Phone first: sticky app bar, one-glance summary card, bottom tab bar, bottom-sheet lead drawer. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #F7F5FC;
  --surface: #FFFFFF;
  --tint: #F5F3FF;
  --tint-2: #EDE4FE;
  --tint-3: #DDD1FB;
  --ink: #111827;
  --ink-soft: #4B5563;
  --ink-faint: #8A8F98;
  --line: #E6E1F2;
  --primary: #6D28D9;
  --primary-deep: #5B21B6;
  --night: #1E1233;
  --orange: #F97316;
  --orange-deep: #C2410C;
  --orange-soft: #FFEDD5;
  --green: #16A34A;
  --green-soft: #DCFCE7;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  --amber: #B45309;
  --amber-soft: #FEF3C7;

  /* priority colours: P0 hottest → P4 */
  --p0: #6D28D9;
  --p1: #DC2626;
  --p2: #EA580C;
  --p3: #CA8A04;
  --p4: #64748B;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(30, 18, 51, .06), 0 6px 16px -8px rgba(30, 18, 51, .14);
  --shadow-lg: 0 18px 40px -12px rgba(30, 18, 51, .35);
  --heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--heading); letter-spacing: -.02em; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ buttons */
.btn-cta,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}

.btn-cta {
  color: #fff;
  background: linear-gradient(180deg, var(--orange), #EA580C);
  box-shadow: 0 10px 24px -8px rgba(234, 88, 12, .55), inset 0 -3px 0 rgba(0, 0, 0, .12);
}

.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:disabled { background: var(--tint-3); cursor: default; }
.btn-secondary { color: var(--primary-deep); background: var(--tint-2); }
.btn-secondary:disabled { opacity: .45; cursor: default; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  text-decoration: none;
  flex: none;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.call { background: var(--green); border-color: var(--green); color: #fff; }
.icon-btn.wa { color: var(--green); border-color: #BBF7D0; background: #F0FDF4; }
.icon-btn.ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; }

/* ------------------------------------------------------------------ brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 18px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), var(--primary));
  color: #fff;
  font-size: 16px;
}

/* ------------------------------------------------------------------ sign-in / pick-your-name */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(120% 80% at 50% 0%, #3B1F66 0%, var(--night) 60%);
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 12px;
}

.gate-card .brand { color: var(--primary-deep); font-size: 15px; }
.gate-card h1 { font-size: 26px; font-weight: 800; }
.gate-card p { color: var(--ink-soft); font-size: 14px; }

.gate-card input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--tint);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 20px;
  letter-spacing: .3em;
  text-align: center;
}

.form-error { color: var(--red); font-size: 14px; min-height: 20px; text-align: center; }

.name-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }

.name-list button {
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-weight: 700;
}

.name-list button:hover { border-color: var(--primary); background: var(--tint); }

/* ------------------------------------------------------------------ app bar */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--night), #2A1747);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 6px 20px -12px rgba(30, 18, 51, .8);
}

.appbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px 12px; display: grid; gap: 10px; }
.appbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.updated { font-size: 12px; color: rgba(255, 255, 255, .6); }

.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.picker {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding-left: 12px;
  min-width: 0;
}

.picker-icon { font-size: 14px; }

.picker select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 28px 9px 8px;
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.picker select option { color: var(--ink); }

.picker::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, .7);
  border-bottom: 2px solid rgba(255, 255, 255, .7);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 4px;
}

.mode-switch button {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .72);
  border-radius: 11px;
  padding: 9px 8px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 14px;
}

.mode-switch button.on { background: #fff; color: var(--primary-deep); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }

/* ------------------------------------------------------------------ page content */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px calc(var(--tabbar-h) + 90px + var(--safe-bottom));
  display: grid;
  gap: 12px;
}

.alert { background: var(--red-soft); color: #991B1B; border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; }

/* reminder round banner */
.round-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.round-text { font-size: 14px; color: var(--ink-soft); }

.round-text .eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary-deep);
  background: var(--tint-2);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 6px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--tint);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.segmented button {
  border: 0;
  background: none;
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
}

.segmented button.on { background: var(--surface); color: var(--primary-deep); box-shadow: 0 1px 4px rgba(30, 18, 51, .15); }

/* ------------------------------------------------------------------ summary card */
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, var(--tint) 0%, #fff 70%);
  padding: 16px;
  text-align: left;
}

.summary-hero b { display: block; font-family: var(--heading); font-size: 34px; font-weight: 800; line-height: 1; color: var(--primary-deep); }
.summary-hero span { display: block; font-weight: 700; margin-top: 4px; }
.summary-hero small { display: block; color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }

.ring {
  --pct: 0;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--tint-2) 0);
}

.ring i {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 13px;
}

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }

.stat {
  border: 0;
  background: var(--surface);
  padding: 12px 6px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--heading); font-size: 20px; font-weight: 800; line-height: 1.1; }
.stat span { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.25; }
.stat.alert b { color: var(--red); }
.stat.on, .summary-hero.on { box-shadow: inset 0 -3px 0 var(--primary); }

/* ------------------------------------------------------------------ tab bar (bottom on phones) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  height: calc(var(--tabbar-h) + var(--safe-bottom));
}

.tab {
  flex: 1;
  border: 0;
  background: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-faint);
  border-radius: 12px;
  position: relative;
}

.tab-icon { font-size: 18px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tab.on { color: var(--primary-deep); background: var(--tint); }
.tab.on .tab-icon { filter: none; opacity: 1; }

.tab i {
  position: absolute;
  top: 2px;
  left: calc(50% + 8px);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
}

.tab i:empty { display: none; }

/* ------------------------------------------------------------------ search + chips */
#queueTools { display: grid; gap: 10px; }

.search input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238A8F98' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m17 17-4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px 50%;
}

.search input:focus { border-color: var(--primary); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chips button {
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.chips button.on { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ------------------------------------------------------------------ lead cards */
.lead-list { display: grid; gap: 8px; }

.sechead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 2px 0;
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary-deep);
}

.sechead:first-child { margin-top: 0; }
.sechead small { background: var(--tint-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }

.lead {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--p4);
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.lead:active { transform: scale(.995); }
.lead.P0 { border-left-color: var(--p0); }
.lead.P1 { border-left-color: var(--p1); }
.lead.P2 { border-left-color: var(--p2); }
.lead.P3 { border-left-color: var(--p3); }
.lead.P5, .lead.P6 { border-left-color: var(--line); }
.lead.dim { opacity: .66; box-shadow: none; }

.lead-main { flex: 1; min-width: 0; display: grid; gap: 4px; }

.name {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--ink-soft); }
.meta b { color: var(--ink); font-weight: 700; }

.lead-actions { display: flex; gap: 8px; }

.empty {
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ tags + priority pills */
.tags, .top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }

.pri {
  font-family: var(--heading);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
  background: var(--p4);
}

.pri.P0 { background: var(--p0); }
.pri.P1 { background: var(--p1); }
.pri.P2 { background: var(--p2); }
.pri.P3 { background: var(--p3); }
.pri.P5, .pri.P6 { background: var(--tint-2); color: var(--ink-soft); }

.tag {
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--tint);
  color: var(--ink-soft);
}

.tag.closing { background: var(--tint-2); color: var(--primary-deep); }
.tag.callback { background: var(--tint-2); color: var(--primary); }
.tag.overdue { background: var(--red); color: #fff; }
.tag.today { background: var(--orange); color: #fff; }
.tag.yes { background: var(--green-soft); color: #166534; }
.tag.no { background: var(--red-soft); color: #991B1B; }
.tag.maybe { background: var(--amber-soft); color: var(--amber); }
.tag.ok { background: none; color: var(--green); padding-left: 2px; }

/* ------------------------------------------------------------------ start calling */
.start {
  position: fixed;
  z-index: 16;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  max-width: 480px;
  margin: 0 auto;
  font-size: 16px;
  padding: 15px 18px;
  border-radius: 14px;
}

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

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
th { font-size: 11px; color: var(--ink-faint); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--tint); }
th:first-child { background: var(--tint); }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--tint); }
tbody tr:last-child td { border-bottom: 0; }
td.red { color: var(--red); font-weight: 800; }
.muted { font-size: 13px; color: var(--ink-faint); }

/* ------------------------------------------------------------------ lead sheet */
.shade { position: fixed; inset: 0; z-index: 30; background: rgba(30, 18, 51, .55); }

.sheet {
  position: fixed;
  z-index: 31;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92vh;
  height: 92dvh;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sheet-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; }
.grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--tint-3); margin: 0 auto 10px; }
.sheet-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-title h2 { font-size: 21px; font-weight: 800; margin-top: 6px; }
.sheet-sub { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }

.sheet-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-top: 12px; }

.sheet-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.sheet-actions a svg { width: 18px; height: 18px; }
.sheet-actions a.call { background: var(--green); border-color: var(--green); color: #fff; }
.sheet-actions a.wa { color: #166534; border-color: #BBF7D0; background: #F0FDF4; }

.sheet-body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; display: grid; gap: 12px; align-content: start; }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.block h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary-deep); margin-bottom: 10px; }

.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.outcomes button {
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  font-weight: 700;
  font-size: 14px;
}

.outcomes button.on { border-color: var(--primary); background: var(--primary); color: #fff; }

.callback { display: grid; gap: 8px; margin-top: 10px; padding: 10px; background: var(--tint); border-radius: var(--radius-sm); }
.choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.choice-label { width: 38px; font-size: 12px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; }

.choice-row button {
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
}

.choice-row button.on { border-color: var(--primary); color: var(--primary-deep); background: var(--tint-2); }
.choice-row input { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px 8px; }

textarea {
  width: 100%;
  min-height: 72px;
  margin-top: 10px;
  background: var(--tint);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
}

textarea:focus { border-color: var(--primary); outline: none; background: #fff; }

.save-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.save-row .btn-primary { flex: none; }
.saved { color: var(--green); font-weight: 700; font-size: 14px; }
.hint { color: var(--ink-soft); font-size: 14px; }

.tips { display: grid; gap: 8px; padding: 0; }
.tips li { list-style: none; position: relative; padding-left: 22px; font-size: 14px; }
.tips li::before { content: "💡"; position: absolute; left: 0; top: 0; font-size: 13px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--tint); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fact span { display: block; font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.fact b { font-size: 14px; word-break: break-word; }

.wa-list { display: grid; gap: 8px; }

.wa-list a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
}

.wa-list a b { display: block; font-size: 12px; color: #166534; margin-bottom: 2px; }

.notes { display: grid; gap: 8px; }
.note { background: var(--tint); border-radius: 10px; padding: 9px 11px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.note span { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }

.sheet-foot {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ larger screens */
@media (min-width: 720px) {
  .appbar-inner { grid-template-columns: auto 1fr auto; align-items: center; }
  .appbar-row { order: 0; }
  .pickers { order: 1; max-width: 480px; justify-self: end; width: 100%; }
  .mode-switch { order: 2; min-width: 300px; }

  .content { padding-bottom: 110px; }

  /* tab bar becomes a row of pills under the summary */
  .tabbar {
    position: static;
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    justify-content: flex-start;
    gap: 6px;
  }

  .tab { flex: none; display: flex; gap: 6px; padding: 8px 14px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
  .tab i { position: static; }
  .tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
  .tab.on i { background: #fff; color: var(--primary-deep); }

  .summary { display: grid; grid-template-columns: 1.1fr 2fr; }
  .summary-grid { border-top: 0; border-left: 1px solid var(--line); }

  .start { bottom: 24px; }

  .sheet {
    left: auto;
    top: 0;
    width: 480px;
    height: 100vh;
    border-radius: 0;
  }

  .grabber { display: none; }
}

/* refresh icon spins while loading */
@keyframes spin { to { transform: rotate(360deg); } }
#refresh.spinning svg { animation: spin .8s linear infinite; }

/* ------------------------------------------------------------------ fixes: grid overflow, name row, team cards */
.content { grid-template-columns: minmax(0, 1fr); }
.brand #title, .updated { white-space: nowrap; }
.name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }

.team-card {
  display: grid;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.team-card:hover { border-color: var(--primary); }
.team-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.team-name { font-family: var(--heading); font-weight: 800; font-size: 16px; }
.team-headline { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.team-headline b { font-family: var(--heading); font-size: 18px; color: var(--primary-deep); }
.team-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metric { background: var(--tint); border-radius: 10px; padding: 8px; text-align: center; }
.metric b { display: block; font-family: var(--heading); font-weight: 800; font-size: 17px; }
.metric span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.metric.warn { background: var(--red-soft); }
.metric.warn b { color: var(--red); }
.team-note { margin-top: 10px; }

/* compact phones: keep the first leads above the fold */
@media (max-width: 719px) {
  .round-card { padding: 12px; gap: 10px; }
  .round-text { font-size: 13.5px; }
  .segmented button { padding: 6px; }
  .summary-hero { padding: 12px 14px; }
  .summary-hero b { font-size: 28px; }
  .ring { width: 54px; height: 54px; }
  .ring i { width: 42px; height: 42px; font-size: 12px; }
  .stat { padding: 9px 4px; }
  .stat b { font-size: 18px; }
}

/* BDAs can't change whose leads they see: show their name without the dropdown arrow */
.picker:has(select:disabled)::after { display: none; }
.picker select:disabled { opacity: 1; cursor: default; }

/* ------------------------------------------------------------------ filters: counts, priority, status */
.chips button em { font-style: normal; font-weight: 800; font-size: 11.5px; opacity: .7; margin-left: 2px; }
.chips button.on em { opacity: .9; }

.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips.compact { gap: 5px; }
.chips.compact button { padding: 4px 9px; font-size: 12.5px; font-weight: 700; }

.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-faint);
}

.status-filter select { border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink); padding: 5px 0; max-width: 190px; }
.status-filter:has(select:not([value=""])) { border-color: var(--line); }

.link-btn { border: 0; background: none; color: var(--primary); font-weight: 700; font-size: 13px; text-decoration: underline; padding: 4px; }

/* ------------------------------------------------------------------ collapsible filter panel */
.search-row { display: flex; gap: 8px; }
.search-row .search { flex: 1; min-width: 0; }

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.filter-toggle.on { border-color: var(--primary); color: var(--primary-deep); background: var(--tint); }
.filter-toggle i { font-style: normal; font-size: 11px; font-weight: 800; background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 7px; }
.filter-toggle i:empty { display: none; }

.filter-summary { font-size: 13px; color: var(--ink-soft); }
.filter-summary b { color: var(--primary-deep); }

.filter-panel { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.filter-group { display: grid; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.filter-panel .status-filter { justify-self: start; }
.filter-panel .link-btn { justify-self: start; }
