/* ============================================================
   Leads Machine — Grove Innovations theme
   Palette + type from the Grove design system (groveinnovations.com):
   navy #031a25–#14495f · brand greens #58d050/#1f9e4a · Manrope + Inter
   ============================================================ */

:root {
  --navy-950: #031a25;
  --navy-900: #04222e;
  --navy-800: #072a3a;
  --navy-700: #0e3a4e;
  --navy-600: #14495f;

  --green-600: #15803d;
  --green-500: #1f9e4a;
  --green-400: #58d050;
  --green-300: #7fe07a;

  --ink: #0f2733;
  --slate: #48636f;
  --bg: #ffffff;
  --bg-soft: #f4f8f5;
  --line: #dfe8e3;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(4, 34, 46, 0.07), 0 1px 2px rgba(4, 34, 46, 0.05);
  --shadow-md: 0 10px 30px -8px rgba(4, 34, 46, 0.16);
  --shadow-lg: 0 24px 60px -16px rgba(4, 34, 46, 0.28);

  --font-display: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* , *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-500); }

/* ---------- Build banner ---------- */
.buildbanner {
  background: var(--navy-900); color: #fff; text-align: center;
  padding: 8px 14px; font-size: 13px; font-family: var(--font-display); font-weight: 600;
}
.buildbanner .dot { color: var(--green-300); margin-right: 6px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand h1 {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: 0.005em; color: var(--navy-900); line-height: 1.15;
  text-transform: uppercase;
}
.brand h1 .w2 { color: var(--green-400); }
.brand .hmark { width: 29px; height: 29px; flex-shrink: 0; color: var(--green-400); margin-top: -1px; }
.brand .tag { margin: 1px 0 0; font-size: 12.5px; color: var(--slate); }
.brand .tag a { font-weight: 600; }
.asof {
  font-size: 12.5px; color: var(--navy-700); white-space: nowrap;
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; font-weight: 500;
}

/* ---------- Layout ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 22px 26px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  min-width: 0;
}

.panel-head { flex-basis: 100%; margin-bottom: 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head .eyebrow {
  font-family: var(--font-display); font-weight: 800; font-size: 11.5px;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--green-600);
}
.panel-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 16.5px;
  letter-spacing: -0.01em; color: var(--navy-900);
}
.panel-head .hint { font-size: 12.5px; color: var(--slate); margin-left: auto; }

/* ---------- Controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; }
.filters { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.ctl label {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate);
}
.ctl.off label { opacity: 0.45; }
.ctl.off select, .ctl.off .seg, .ctl.off input { opacity: 0.45; pointer-events: none; }

select, input[type="number"] {
  height: 38px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-family: var(--font-body); font-size: 13.5px; color: var(--ink);
  min-width: 150px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:hover:not(:disabled), input[type="number"]:hover:not(:disabled) { border-color: #c8d6cf; }
select:focus, input[type="number"]:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3.5px rgba(88, 208, 80, 0.18);
}
select:disabled, input:disabled { background: var(--bg-soft); color: #9aa9a2; }

/* segmented controls */
.seg {
  display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px;
  overflow: hidden; background: #fff; height: 38px;
}
.seg button {
  border: 0; background: transparent; padding: 0 15px; font-family: var(--font-body);
  font-size: 13px; font-weight: 600; color: var(--slate); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button:hover:not(.active) { background: var(--bg-soft); color: var(--navy-700); }
.seg button.active { background: var(--green-500); color: #fff; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }

/* run button */
.run {
  height: 42px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--green-500); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: 0.01em;
  cursor: pointer; box-shadow: 0 6px 18px -6px rgba(31, 158, 74, 0.55);
  transition: all 0.18s ease;
}
.run:hover { background: var(--green-600); transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(31, 158, 74, 0.6); }
.run:active { transform: translateY(0); }

/* name / address search row */
.nsrow { display: flex; gap: 8px; align-items: stretch; }
.nsrow input {
  flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-family: var(--font-body); font-size: 13.5px; color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nsrow input:hover { border-color: #c8d6cf; }
.nsrow input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3.5px rgba(88, 208, 80, 0.18); }
.nsrow button {
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--navy-900); color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 13.5px; letter-spacing: 0.01em; cursor: pointer;
  transition: background 0.15s ease;
}
.nsrow button:hover { background: var(--navy-700); }
.nsrow button:disabled { opacity: 0.6; cursor: default; }

/* featured lead-list control */
#leadlistCtl {
  background: rgba(88, 208, 80, 0.10);
  border: 1px solid rgba(88, 208, 80, 0.38);
  border-radius: var(--radius-sm);
  padding: 8px 10px 10px;
}
#leadlistCtl label { color: var(--green-600); }
#leadlistCtl select { border-color: rgba(88, 208, 80, 0.5); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; padding: 16px 22px; }
.stat { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border-left: 3px solid var(--line); }
.stat .n { font-family: var(--font-display); font-size: 25px; font-weight: 800; color: var(--navy-900); letter-spacing: -0.02em; }
.stat .l { font-size: 11px; color: var(--slate); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.stat.highlight { border-left-color: var(--green-500); }
.stat.highlight .n { color: var(--green-600); }
.stat.highlight2 { border-left-color: var(--navy-600); }
.stat.highlight2 .n { color: var(--navy-600); }

/* ---------- Results ---------- */
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 17px;
  letter-spacing: -0.01em; color: var(--navy-900);
}
.note { margin: 8px 0 0; font-size: 12.5px; color: var(--slate); }
.extras { margin-top: 6px; font-size: 12.5px; color: var(--navy-700); }

.ghost {
  height: 36px; padding: 0 18px; border: 1.5px solid var(--navy-700); border-radius: 999px;
  background: transparent; color: var(--navy-800);
  font-family: var(--font-display); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all 0.18s ease;
}
.ghost:hover:not(:disabled) { background: var(--navy-800); color: #fff; }
.ghost:disabled { opacity: 0.4; cursor: default; }

.tablewrap { overflow-x: auto; overflow-y: auto; max-height: 560px; max-width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-soft); color: var(--navy-700);
  font-family: var(--font-display); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1.5px solid var(--line);
}
tbody tr:nth-child(even) { background: #fbfdfc; }
tbody tr:hover { background: rgba(88, 208, 80, 0.07); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.own { font-weight: 600; color: var(--navy-900); }
.sub { color: var(--slate); font-weight: 400; font-size: 12px; }
.empty { padding: 34px; text-align: center; color: var(--slate); }

/* ---------- Flag chips (+ hover tooltips) ---------- */
.chip {
  display: inline-block; position: relative; cursor: help;
  font-size: 10px; font-weight: 800; font-family: var(--font-display);
  padding: 2px 7px; border-radius: 999px; margin-right: 4px; margin-bottom: 2px;
  background: var(--navy-800); color: var(--green-300);
  letter-spacing: 0.04em;
}
.chip.v, .chip[data-tip^="Vacant"] { background: #92400e; color: #fff; }
.chip.puv { background: var(--navy-700); color: var(--green-300); }
.chip.prb { background: #6d28d9; color: #fff; }   /* probate / estate */
.chip.reo { background: #0f766e; color: #fff; }   /* bank-owned / REO */
.chip.tl  { background: #b45309; color: #fff; }   /* tired landlord */
.chip.y25 { background: #1e40af; color: #fff; }   /* 25+ years owned */

.chip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--navy-950); color: #fff;
  padding: 7px 11px; border-radius: 8px;
  font-family: var(--font-body); font-size: 12px; font-weight: 400;
  line-height: 1.4; white-space: normal; width: max-content; max-width: 340px;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 40;
  box-shadow: var(--shadow-md); transition: opacity 0.12s ease;
}
.chip::before {
  content: ""; position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--navy-950);
  opacity: 0; visibility: hidden; z-index: 40;
}
.chip:hover::after, .chip:hover::before { opacity: 1; visibility: visible; }

/* ---------- Footer ---------- */
footer { background: var(--navy-950); color: rgba(255, 255, 255, 0.72); margin-top: 30px; }
.foot-grid {
  max-width: 1320px; margin: 0 auto; padding: 52px 26px 40px;
  display: grid; grid-template-columns: 1.1fr 1.5fr 1.5fr 1.1fr; gap: 38px;
}
.foot-grid > * { min-width: 0; }
.foot-brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.foot-brand .mark { width: 36px; height: 36px; }
.foot-brand strong { font-family: var(--font-display); font-weight: 800; color: #fff; font-size: 16px; }
.foot-brand p { margin: 0; font-size: 13.5px; }
.foot-col h4 {
  margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-300);
}
.foot-col p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; }
.foot-col p strong { color: #fff; font-weight: 600; }
.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 1320px; margin: 0 auto; padding: 18px 26px;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: rgba(255, 255, 255, 0.5);
}

/* ---------- selection mode + export list bar ---------- */
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#selbtn.on { background: var(--green-500); border-color: var(--green-500); color: #fff; }
#selbtn.on:hover { background: var(--green-600); border-color: var(--green-600); }

th.selcol, td.selcol { display: none; width: 36px; text-align: center; }
table.selmode th.selcol, table.selmode td.selcol { display: table-cell; }
td.selcol input {
  width: 16px; height: 16px; accent-color: var(--green-500);
  cursor: pointer; display: block; margin: 3px auto 0;
}

.expbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--navy-900); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 22px; flex-wrap: wrap;
  box-shadow: 0 -10px 30px -12px rgba(4, 34, 46, 0.45);
}
.expinfo { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.expinfo strong {
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  color: #fff; letter-spacing: 0.02em;
}
.expinfo #expCount { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--green-300); }
.expbar .exphint { font-size: 12.5px; color: rgba(255, 255, 255, 0.65); }
.expactions { display: flex; gap: 10px; flex-wrap: wrap; }
.btnbar-primary {
  height: 38px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--green-400); color: var(--navy-900);
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px; cursor: pointer;
  transition: background 0.15s ease;
}
.btnbar-primary:hover:not(:disabled) { background: var(--green-300); }
.btnbar-primary:disabled { opacity: 0.45; cursor: default; }
.btnbar-ghost {
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35); background: transparent; color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: background 0.15s ease;
}
.btnbar-ghost:hover { background: rgba(255, 255, 255, 0.12); }
body.has-expbar { padding-bottom: 76px; }

/* ---------- AI pick band + motivation score ---------- */
.pickband {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(88, 208, 80, 0.16), rgba(31, 158, 74, 0.09));
  border: 1px solid rgba(31, 158, 74, 0.35);
}
.pickband.on {
  background: linear-gradient(135deg, rgba(88, 208, 80, 0.30), rgba(31, 158, 74, 0.18));
  border-color: var(--green-500);
}
.pick-star { font-size: 22px; line-height: 1; }
.pick-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.pick-txt strong { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; color: var(--navy-900); }
.pick-txt span { font-size: 12.5px; color: var(--slate); }
.pick-btn {
  height: 38px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--green-500); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px; cursor: pointer;
  transition: background 0.15s ease;
}
.pick-btn:hover { background: var(--green-600); }
.sc {
  display: inline-block; min-width: 30px; text-align: center;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 800; font-size: 11.5px; font-family: var(--font-display);
}
.sc-hi { background: var(--green-500); color: #fff; }
.sc-mid { background: rgba(31, 158, 74, 0.16); color: var(--green-600); }
.sc-lo { background: var(--bg-soft); color: var(--slate); border: 1px solid var(--line); }

/* ---------- Tabs (Property search / Foreclosures) ---------- */
.tabbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px;
  color: var(--slate); cursor: pointer;
  transition: all 0.18s ease;
}
.tab:hover:not(.active) { border-color: #c8d6cf; color: var(--navy-700); }
.tab.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; box-shadow: var(--shadow-sm); }
.tab .tabnew {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--green-400); color: var(--navy-900);
  padding: 2px 7px; border-radius: 999px; font-weight: 800;
}
.tabpage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---------- Foreclosures tab ---------- */
#fclStats { padding: 4px 0 10px; }
#fclDetail { scroll-margin-top: 84px; }
.fcl-state { height: 36px; margin-left: 10px; font-weight: 600; }
.fcl-co { cursor: pointer; }
.fcl-co.on { background: rgba(88, 208, 80, 0.14) !important; }
.fcl-co.on td { border-bottom-color: rgba(88, 208, 80, 0.45); }
/* FCL-ENRICH deep-link landing (2026-09-22): the exact parcel row, highlighted */
tr.pinhl { background: rgba(88, 208, 80, 0.16) !important; box-shadow: inset 3px 0 0 var(--green-500); }
tr.pinhl td { border-bottom-color: rgba(88, 208, 80, 0.5) !important; }
.ty {
  display: inline-block; font-size: 10.5px; font-weight: 800; font-family: var(--font-display);
  padding: 2px 8px; border-radius: 999px; margin: 1px 4px 1px 0; letter-spacing: 0.03em;
  background: var(--navy-800); color: var(--green-300);
}
.ty-lis   { background: #6d28d9; color: #fff; }   /* lis pendens — earliest distress */
.ty-taxdq { background: #b45309; color: #fff; }   /* tax-delinquent / tax sale */
.ty-lien  { background: #4b5563; color: #fff; }
.ty-x     { background: var(--bg-soft); color: var(--slate); border: 1px solid var(--line); }
.st { font-weight: 600; }
.st-ok { color: var(--green-600); }
.st-warn { color: #b45309; }
.lk { color: var(--navy-600); font-weight: 600; text-decoration: none; white-space: nowrap; }
.lk:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  main { padding: 14px 14px 6px; }
  .card { padding: 16px; }
  .ctl { min-width: 0; flex: 1 1 46%; }
  .ctl select, .ctl input { min-width: 0; width: 100%; }
  .run { width: 100%; }
  .foot-grid { grid-template-columns: 1fr; padding: 40px 16px 30px; }
  .foot-bottom { padding: 16px; }
  /* mobile: the as-of pill must wrap instead of pushing the page wide */
  .asof { white-space: normal; max-width: 100%; overflow-wrap: anywhere; border-radius: 12px; line-height: 1.35; text-align: left; }
  .topbar { width: 100%; }
  html, body { max-width: 100%; }
}
