/* LawnSpotter app styles. Dark theme; brand colors come from lawnspotter's website. */
:root {
  /* brand */
  --brand-950: #0B2014;
  --brand-900: #13361F;
  --brand-700: #3F7A35;
  --brand-600: #4A8C3F;
  --brand-lime: #ACD25C;
  --brand-tint: rgba(172, 210, 92, .14);   /* selected rows, pressed choices */

  /* surfaces (deep green-black, lifting toward the front) */
  --bg: #0E1411;
  --panel: #151C18;
  --panel-2: #1C2521;
  --line: #243029;
  --line-strong: #33413A;
  --line-hover: #46564D;
  --hover: #1B2420;
  --text: #EEF1EF;
  --text-2: #C6CEC9;
  --text-3: #98A39C;


  /* score */
  --s-high: #5DB84A;
  --s-mid: #A6CC5B;
  --s-low: #3B6E41; /* below 70: still green, deep and muted */

  --amber: #F2C76A;
  --amber-bg: rgba(242, 199, 106, .1);
  --amber-line: rgba(242, 199, 106, .3);
  --ok: #9BD37E;
  --ok-bg: rgba(155, 211, 126, .1);
  --ok-line: rgba(155, 211, 126, .35);
  --bad: #F08A7D;
  --bad-bg: rgba(240, 138, 125, .1);
  --bad-line: rgba(240, 138, 125, .35);
  --danger: #E4655B;
  --danger-bg: rgba(228, 101, 91, .14);
  --chip-bg: rgba(255, 255, 255, .04);
  --map-bg: #1A201D;
  --marker-outline: rgba(255, 255, 255, .7);
  --focus: 0 0 0 3px rgba(172, 210, 92, .3);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* shapes: soft corners on panels, pills on controls */
  --r: 14px;
  --r-sm: 10px;
  --r-pill: 999px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

/* Light theme (the sun/moon toggle in the top bar; theme.js keeps the choice). */
:root[data-theme="light"] {
  --brand-tint: #F0F5E7;
  --bg: #F5F4EF;
  --panel: #FFFFFF;
  --panel-2: #FAFAF7;
  --line: #E4E2DA;
  --line-strong: #CFCCC0;
  --line-hover: #BDB9AB;
  --hover: #F7F6F1;
  --text: #1A2420;
  --text-2: #4D5852;
  --text-3: #7D867F;
  --s-high: #3F7A35;
  --s-mid: #93BD4F;
  --s-low: #C3DDB0; /* below 70: still green, soft sage */
  --amber: #7A5A12;
  --amber-bg: #FFF9E8;
  --amber-line: #EAD9A8;
  --ok: #2F6B2A;
  --ok-bg: #F3F8EF;
  --ok-line: #CFE0C6;
  --bad: #A13D22;
  --bad-bg: #FCF3F0;
  --bad-line: #EDCFC4;
  --danger: #B3261E;
  --danger-bg: #FCEBEA;
  --chip-bg: #F4F3EE;
  --map-bg: #EDEBE3;
  --marker-outline: #fff;
  --focus: 0 0 0 3px rgba(63, 122, 53, .25);
  --shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
:root[data-theme="light"] body { color-scheme: light; }
:root[data-theme="light"] a { color: var(--brand-700); }
:root[data-theme="light"] .btn-link, :root[data-theme="light"] .leg button, :root[data-theme="light"] .stop-side a { color: var(--brand-700); }
:root[data-theme="light"] .input:focus, :root[data-theme="light"] .route-name:focus { border-color: var(--brand-700); }
:root[data-theme="light"] .input, :root[data-theme="light"] select.input, :root[data-theme="light"] .seg, :root[data-theme="light"] .stepper, :root[data-theme="light"] .status-grid button { background-color: var(--panel); }
:root[data-theme="light"] .status-grid button[aria-pressed="true"] { border-color: var(--brand-700); color: var(--brand-900); }
:root[data-theme="light"] .lead-row.is-active { box-shadow: inset 3px 0 0 var(--brand-700); }
:root[data-theme="light"] .signal::before { background: var(--brand-700); }
:root[data-theme="light"] .info:hover, :root[data-theme="light"] .info:focus { border-color: var(--brand-700); color: var(--brand-700); }
:root[data-theme="light"] .score.low { color: #22401E; }
:root[data-theme="light"] .toast { background: var(--brand-950); color: #fff; }
:root[data-theme="light"] .pin-stop, :root[data-theme="light"] .stop-num { background: var(--brand-900); }
:root[data-theme="light"] .pin-stop.is-active { background: var(--brand-700); color: #fff; }
:root[data-theme="light"] .pin-handle { border-color: var(--brand-700); }
:root[data-theme="light"] .base-tiles { filter: sepia(.12) saturate(1.05); }
:root[data-theme="light"] .street-tiles { filter: grayscale(.6) sepia(.12) brightness(1.05) contrast(.94); }
:root[data-theme="light"] .legend, :root[data-theme="light"] .busy { background: rgba(255,255,255,.95); }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.85) !important; }
:root[data-theme="light"] .leaflet-control-scale-line { background: rgba(255,255,255,.8) !important; }
:root[data-theme="light"] .leaflet-tooltip { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
:root[data-theme="light"] .tooltip { border-color: var(--brand-950); }
:root[data-theme="light"] .crew-progress .bar span { background: var(--brand-700); }

/* the sun / moon switch */
.theme-toggle {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22); background: transparent; color: rgba(255,255,255,.85); cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle.on-page { border-color: var(--line-strong); color: var(--text-2); }
.theme-toggle.on-page:hover { background: var(--hover); color: var(--text); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.43;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brand-lime); }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--panel-2);
  font-size: 13.5px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: var(--line-hover); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-dark { background: transparent; border-color: rgba(255,255,255,.22); color: rgba(255,255,255,.9); }
.btn-dark:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.btn-sm { height: 28px; padding: 0 12px; font-size: 13px; }
.btn-upgrade { background: transparent; border-color: var(--brand-lime); color: var(--brand-lime); font-weight: 600; }
.btn-upgrade:hover { background: rgba(172,210,92,.14); border-color: var(--brand-lime); color: #fff; }
.account-upgrade { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-upgrade .note { margin: 0; }
@media (max-width: 760px) { #upgradeLink { display: none !important; } .account-upgrade { flex-direction: column; align-items: stretch; } }
.btn-lg { height: 42px; font-size: 14px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 500; color: var(--brand-lime); }
.btn-link:hover { text-decoration: underline; }
.btn-danger { color: var(--danger); }
.btn svg { width: 15px; height: 15px; flex: none; }

.input {
  height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--bg);
  font: inherit; font-size: 14px; color: var(--text);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--brand-lime); box-shadow: var(--focus); }
.input-sm { height: 30px; font-size: 13px; padding: 0 10px; }
select.input { padding-right: 28px; appearance: none; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237F8B84' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center; }
select.input option { background: var(--panel-2); color: var(--text); }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }

.seg { display: flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--bg); }
.seg button {
  flex: 1; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--brand-700); color: #fff; font-weight: 500; }
.seg button:focus-visible { outline: none; box-shadow: var(--focus); }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-lime); cursor: pointer; }

.stepper { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--bg); }
.stepper button { width: 32px; height: 30px; border: 0; background: var(--panel-2); color: var(--text-2); font-size: 16px; }
.stepper button:hover { background: var(--hover); color: var(--text); }
.stepper input {
  width: 56px; height: 30px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--text);
  text-align: center; font: inherit; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--brand-tint); }

/* ---------- sign in ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(320px, 40%) 1fr; background: var(--bg); }
.login-side {
  display: flex; flex-direction: column; padding: 40px 48px;
  background: var(--brand-900); color: rgba(255,255,255,.85);
}
.login-side .logo { width: 240px; height: auto; }
.login-tagline { margin-top: auto; max-width: 340px; font-size: 20px; line-height: 1.4; font-weight: 500; color: #fff; }
.login-legal { margin-top: 32px; font-size: 12.5px; color: rgba(255,255,255,.55); }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; }
.login-form h1 { font-size: 22px; font-weight: 600; margin-bottom: 24px; letter-spacing: -0.01em; }
.login-form .input { margin-bottom: 16px; }
.login-form .btn { margin-top: 4px; }
.form-error { margin: -4px 0 12px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.form-intro { margin: -12px 0 20px; font-size: 14px; color: var(--text-2); }
.form-intro + .form-intro { margin-top: -8px; }
.form-intro.muted { font-size: 13px; color: var(--text-3); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
.label-row .btn-link { font-size: 12.5px; }
.form-back { align-self: center; margin-top: 16px; }
.login-form > .btn + .btn-link { margin-top: 16px; }

/* ---------- app shell ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  flex: none; height: 52px; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: var(--brand-950); color: #fff; border-bottom: 1px solid rgba(172,210,92,.18);
}
.topbar .logo { height: 28px; width: auto; flex: none; }
.logo-pic { display: contents; } /* phones get the round badge instead of the full wordmark */
.market { flex: none; display: flex; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.15); }
.market label { font-size: 12px; color: rgba(255,255,255,.6); }
.market select {
  width: 210px; text-overflow: ellipsis;
  height: 30px; padding: 0 30px 0 12px; border-radius: var(--r-pill); appearance: none;
  border: 1px solid rgba(255,255,255,.2); color: #fff; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-opacity='.7' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.market select:focus { outline: none; border-color: var(--brand-lime); }
.market option { color: var(--text); background: var(--panel-2); font-weight: 400; }
/* State headings between the markets (the list is grouped by state). Without an explicit color
   they inherit the select's white text on the list's white background and look like empty boxes. */
.market optgroup { color: var(--brand-lime); background: var(--brand-950); font-weight: 700; font-style: normal; }
:root[data-theme="light"] .market optgroup { color: var(--brand-900); background: #E8EFE0; }
.tabs { display: flex; flex: none; align-self: stretch; gap: 4px; }
.tabs button {
  position: relative; padding: 0 9px; border: 0; background: none; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.65);
}
.tabs button:hover { color: #fff; }
.tabs button[aria-current="page"] { color: #fff; }
.tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand-lime); }
.tab-count { margin-left: 4px; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255,255,255,.14); font-size: 11.5px; }
.tab-count:empty { display: none; }
.topbar-right { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar-right > * { flex: none; }
/* Long company names are cut with an ellipsis so the section tabs never wrap. */
.topbar-right > .user { flex: 0 1 auto; min-width: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user { font-size: 13px; color: rgba(255,255,255,.7); }
.demo-badge { padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid rgba(242,199,106,.5); color: var(--amber); font-size: 12px; font-weight: 500; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr) 380px; }

/* ---------- filters column ---------- */
.filters { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.filters-toggle { display: none; }
.filters-body { flex: 1; overflow-y: auto; overflow-x: hidden; }
.group { padding: 16px; border-bottom: 1px solid var(--line); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; }
.group-title { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row, .row + .check, .check + .row { margin-top: 12px; }
.row > label, .row-label { font-size: 13px; color: var(--text-2); }
.row .input { min-width: 140px; }
.row-stack { flex-direction: column; align-items: stretch; gap: 6px; }
.note { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.weather { margin-top: 14px; }
.weather-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.weather-src { font-size: 11px; font-weight: 400; color: var(--text-3); }
.weather-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.weather-days li { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--chip-bg); font-size: 12px; line-height: 1.3; cursor: default; }
.weather-days .wd { color: var(--text-3); }
.weather-days .wt { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.weather-days .wr { color: var(--text-3); font-variant-numeric: tabular-nums; }
.weather-days li.wet { border-color: var(--line-strong); }
.weather-days li.wet .wr { color: var(--text); font-weight: 600; }
.note .btn-link { font-size: 12.5px; }
.filters-foot { flex: none; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }

.radius { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; margin-top: 10px; }
.radius input[type="range"] { width: 100%; accent-color: var(--brand-lime); }
.input-unit { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.input-unit .input { width: 62px; min-width: 0; text-align: right; }

.checklist { display: flex; flex-direction: column; }
.type-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.type-row .type-label { flex: 1; }
.type-shape { display: inline-grid; place-items: center; width: 16px; flex: none; }
.type-shape .shape { fill: var(--text-2); }
.tag .shape { fill: currentColor; opacity: .75; margin-right: 4px; vertical-align: -1px; }
.legend-note { color: var(--text-3); }
.type-row .type-count { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- map ---------- */
.map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-container { font-family: var(--font); background: var(--map-bg); }
.base-tiles { filter: saturate(.85) brightness(.92); }
.street-tiles { filter: invert(.93) hue-rotate(180deg) saturate(.45) brightness(.82) contrast(.92); } /* close zoom: turn the street map dark */
#map.is-satellite .street-tiles { filter: none; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; border-radius: var(--r-pill) !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-bar a { background: var(--panel-2) !important; color: var(--text) !important; border-bottom: 1px solid var(--line) !important; }
.leaflet-bar a:hover { background: var(--hover) !important; }
.leaflet-bar a:last-child { border-bottom: 0 !important; }
.leaflet-control-attribution { background: rgba(21,28,24,.85) !important; color: var(--text-3) !important; border-radius: var(--r-sm) 0 0 0; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-control-scale-line { background: rgba(21,28,24,.8) !important; color: var(--text-2) !important; border-color: var(--line-strong) !important; }
.leaflet-tooltip { background: var(--panel-2) !important; color: var(--text) !important; border: 1px solid var(--line-strong) !important; border-radius: var(--r-sm) !important; box-shadow: var(--shadow); }
.leaflet-tooltip-top::before { border-top-color: var(--line-strong) !important; }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--line-strong) !important; }
.leaflet-tooltip-left::before { border-left-color: var(--line-strong) !important; }
.leaflet-tooltip-right::before { border-right-color: var(--line-strong) !important; }
.basemap {
  position: absolute; top: 10px; right: 52px; z-index: 500; display: flex; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--panel-2); box-shadow: var(--shadow);
}
.basemap button { height: 26px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.basemap button:hover { color: var(--text); }
.basemap button[aria-pressed="true"] { background: var(--brand-700); color: #fff; }
#map.is-satellite .leaflet-control-scale-line { background: rgba(21,28,24,.8); }
.legend {
  position: absolute; left: 10px; bottom: 26px; z-index: 500;
  display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(21,28,24,.92); border: 1px solid var(--line-strong); font-size: 12px; color: var(--text-2);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-title { font-weight: 600; color: var(--text); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sw.s-high { background: var(--s-high); }
.sw.s-mid { background: var(--s-mid); }
.sw.s-low { background: var(--s-low); }
.map-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 600;
  display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 16px; border-radius: var(--r-pill);
  background: var(--brand-950); border: 1px solid rgba(172,210,92,.3); color: #fff; font-size: 13px; box-shadow: var(--shadow);
}
.map-banner button { height: 26px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid rgba(255,255,255,.25); background: none; color: #fff; font-size: 12.5px; }
.map-banner button:hover { background: rgba(255,255,255,.1); }
.app.picking #map { cursor: crosshair; touch-action: none; }
.busy {
  position: absolute; top: 10px; right: 56px; z-index: 600; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill); background: rgba(28,37,33,.96); border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--text-2);
}
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand-lime); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pin-stop {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-700); color: #fff; font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.pin-stop.is-done { background: #5E6A63; }
.pin-stop.is-active { background: var(--brand-lime); color: var(--brand-950); transform: scale(1.2); }
.pin-start { width: 16px; height: 16px; border-radius: 50%; background: #4C8DFF; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(76,141,255,.3); }
.pin-handle { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-lime); box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: move; }
.leaflet-tooltip.lead-tip { padding: 4px 10px; font-size: 12.5px; }
.leaflet-tooltip.lead-tip b { font-weight: 600; }

/* ---------- results column ---------- */
.results { position: relative; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.pane-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.pane-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pane-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.pane-body { flex: 1; overflow-y: auto; }
.pane-foot { flex: none; padding: 10px 16px; }
.pane-foot:has(> [hidden]:only-child) { display: none; }
.sort { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 0; border: 0; background: none; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.back:hover { color: var(--text); }

.lead-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.search-row { flex: none; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.search-row .input { width: 100%; border-radius: var(--r-pill); }
.note-box { width: 100%; min-height: 72px; padding: 8px 12px; resize: vertical; font: inherit; font-size: 13.5px; }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.lead-row {
  display: grid; grid-template-columns: 38px 1fr auto auto; gap: 2px 10px; align-items: start;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.lead-row .heart { grid-row: span 2; margin-top: -3px; }

/* the heart that saves a lead */
.heart {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer;
}
.heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.heart:hover { background: var(--hover); color: #FF6FA0; }
.heart:focus-visible { outline: none; box-shadow: var(--focus); }
.heart[aria-pressed="true"] { color: #FF4F8B; }
.heart[aria-pressed="true"] svg { fill: #FF4F8B; }
.detail-actions .heart { width: 32px; height: 32px; margin-left: auto; border: 1px solid var(--line-strong); }
.lead-row:hover { background: var(--hover); }
.lead-row.is-active { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand-lime); }
.lead-row .score { grid-row: span 2; }
.lead-addr { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-value { font-size: 13px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lead-meta { grid-column: 2 / 4; font-size: 12.5px; color: var(--text-2); }
.lead-row .tags { grid-column: 2 / 5; }
.status-text { color: var(--text-2); font-weight: 500; }

/* Scores use Archivo: its plain, even digits read cleanly at pill size (Plex's looked off). */
.score {
  display: inline-grid; place-items: center; width: 38px; height: 24px; border-radius: var(--r-pill);
  font-family: "Archivo", var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums; line-height: 1; color: #fff; background: var(--s-high);
}
.score.mid { background: var(--s-mid); color: #1B2A10; }
.score.low { background: var(--s-low); color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag {
  padding: 0 9px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--chip-bg);
  font-size: 11.5px; font-weight: 500; line-height: 19px; color: var(--text-2); white-space: nowrap;
}
/* Every tag is the same neutral pill. The small shape in front of it is the lead type's map
   marker shape, so types stay easy to tell apart without a color per type. */
.tag .shape { fill: var(--text-3); opacity: 1; }

/* characteristic filter chips under Sort */
.chips-row { flex: none; padding: 8px 16px 10px; border-bottom: 1px solid var(--line); }
.chips-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.chips-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.chips-head .btn-link { font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  height: 24px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: transparent;
  font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--line-hover); color: var(--text); }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }
/* A chosen filter chip: the one brand accent, the same for every chip. */
.chip[aria-pressed="true"] { font-weight: 600; color: var(--text); background: var(--brand-tint); border-color: var(--brand-lime); }
:root[data-theme="light"] .chip[aria-pressed="true"] { color: var(--brand-900); border-color: var(--brand-700); }

.pane-link { margin-top: 2px; font-size: 12.5px; }
.chip-count { margin-left: 3px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.new-types { margin: -4px 0 14px; }
.new-types .chip { height: 30px; padding: 0 12px; font-size: 12.5px; }
.chip-due:not([aria-pressed="true"]) { border-color: var(--amber-line); color: var(--amber); }

/* ---------- follow-up ---------- */
.fu-badge { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-size: 11.5px; font-weight: 500; line-height: 17px; color: var(--text-2); white-space: nowrap; }
.fu-badge.is-due { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); }
.tab-due { background: var(--amber); color: #1A1405; }
.tab-due:empty { display: none; }
.followup-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.followup-ctl input[type="date"] { width: 150px; color-scheme: inherit; }
.fu-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.history { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.history:empty { display: none; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.history li b { font-weight: 600; color: var(--text); }
.history li span { color: var(--text-3); text-align: right; }

.empty { padding: 40px 24px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty b { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.empty .btn { margin-top: 12px; }

/* ---------- lead detail ---------- */
.detail-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.detail-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.detail-sub { font-size: 13px; color: var(--text-3); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.detail-actions .score { width: auto; padding: 0 10px; }
.section { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.section-title { margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.signal { display: flex; gap: 10px; padding: 6px 0; }
.signal::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--brand-lime); }
.signal b { display: block; font-size: 13.5px; font-weight: 600; }
.signal span { display: block; font-size: 12.5px; color: var(--text-3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.pitch { font-size: 13.5px; color: var(--text-2); }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.status-grid button {
  height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--bg);
  font-size: 13px; color: var(--text-2); text-align: left;
}
.status-grid button:hover { background: var(--hover); color: var(--text); }
.status-grid button[aria-pressed="true"] { border-color: var(--brand-lime); background: var(--brand-tint); color: var(--brand-lime); font-weight: 600; }
.status-when { margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* ---------- route ---------- */
.route-name {
  width: 100%; margin: 0 0 2px -6px; padding: 2px 6px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text); background: transparent;
}
.route-name:hover { border-color: var(--line); }
.route-name:focus { outline: none; border-color: var(--brand-lime); background: var(--bg); box-shadow: var(--focus); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.stats div { padding: 10px 16px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--text-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1000; min-width: 190px; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow);
}
.menu a, .menu button {
  display: block; width: 100%; padding: 7px 12px; border: 0; border-radius: var(--r-sm); background: none;
  font-size: 13px; color: var(--text); text-align: left; text-decoration: none;
}
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu-note { padding: 6px 12px 4px; font-size: 11.5px; color: var(--text-3); }
.route-note { padding: 8px 16px; font-size: 12.5px; color: var(--amber); background: var(--amber-bg); border-bottom: 1px solid var(--amber-line); }

.stop-list { list-style: none; margin: 0; padding: 0 0 12px; }
.leg { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 29px; font-size: 12px; color: var(--text-3); }
.leg::before { content: ""; width: 1px; height: 14px; margin-right: 9px; background: var(--line-strong); }
.leg button { margin-left: auto; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 500; color: var(--brand-lime); }
.leg button:hover { text-decoration: underline; }
.steps { list-style: none; margin: 0 16px 6px 44px; padding: 6px 0; border-left: 1px solid var(--line-strong); }
.steps li { display: flex; gap: 10px; padding: 4px 0 4px 12px; font-size: 12.5px; color: var(--text-2); }
.steps li span { margin-left: auto; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 2px 10px; align-items: start;
  margin: 0 8px; padding: 9px 8px; border-radius: var(--r-sm); cursor: pointer;
}
.stop:hover { background: var(--hover); }
.stop.is-active { background: var(--brand-tint); }
.stop-num {
  grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-700); color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.stop.is-done .stop-num { background: #5E6A63; }
.stop.is-done .lead-addr { color: var(--text-3); }
.stop-side { grid-row: span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stop-side .input { height: 26px; font-size: 12px; padding: 0 22px 0 8px; background-position: right 7px center; }
.stop-side a { font-size: 12px; font-weight: 500; color: var(--brand-lime); text-decoration: none; }
.stop-side a:hover { text-decoration: underline; }
.stop .lead-meta, .stop .tags { grid-column: 2; }

.saved-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.saved-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.saved-row:hover { background: var(--hover); }
.saved-row div { flex: 1; min-width: 0; }
.saved-row b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-row span { font-size: 12.5px; color: var(--text-3); }

/* ---------- info tooltip ---------- */
.label-info { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.info {
  position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: 10.5px; font-weight: 600; color: var(--text-3); cursor: help; outline: none;
}
.info:hover, .info:focus { border-color: var(--brand-lime); color: var(--brand-lime); }
.has-tip { position: relative; }
.tooltip {
  position: absolute; left: 0; right: 0; top: 24px; z-index: 1200; padding: 10px 12px;
  border-radius: var(--r-sm); background: var(--brand-950); border: 1px solid var(--line-strong); color: rgba(255,255,255,.85);
  font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: left; cursor: default;
  box-shadow: var(--shadow); visibility: hidden; opacity: 0; transition: opacity .12s;
}
.tooltip b { display: block; margin-top: 8px; color: #fff; font-weight: 600; }
.tooltip b:first-child { margin-top: 0; }
.label-info:hover + .tooltip, .label-info:focus-within + .tooltip { visibility: visible; opacity: 1; }

/* ---------- full-width pages (New leads, Settings, How scoring works) ---------- */
.page { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg); }
.page-inner { max-width: 1200px; margin: 0 auto; padding: 24px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin-top: 2px; font-size: 13.5px; color: var(--text-3); }
.page-actions { display: flex; align-items: center; gap: 8px; }
.card-flat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th {
  padding: 9px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .heart-cell { width: 44px; text-align: right; }
.grid .heart-cell .heart { display: inline-grid; }
.grid .sub { display: block; font-size: 12.5px; color: var(--text-3); }
.grid .actions { text-align: right; white-space: nowrap; }
.grid .empty-cell { padding: 40px 16px; text-align: center; color: var(--text-3); }
.grid .empty-cell b { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; }

/* Results */
.chips-links { display: flex; gap: 14px; }
.results-summary { display: grid; grid-template-columns: repeat(4, 1fr); }
.results-summary > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.results-summary > div:last-child { border-right: 0; }
.results-summary .k { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.results-summary .v { display: block; margin-top: 2px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.results-summary .r { display: block; font-size: 12.5px; color: var(--text-3); }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.results-weeks { margin-top: 16px; }
.card-title { padding: 13px 16px 11px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.card-note { padding: 10px 16px 12px; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--line); }
.grid td.num .sub { display: inline-block; min-width: 52px; margin-left: 6px; font-size: 12px; }
.grid .nowrap { white-space: nowrap; }
.grid .bar-cell { width: 45%; vertical-align: middle; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--s-high); }
@media (max-width: 860px) {
  .results-summary { grid-template-columns: 1fr 1fr; }
  .results-summary > div:nth-child(2) { border-right: 0; }
  .results-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .results-grid { grid-template-columns: 1fr; }
  .grid .bar-cell { width: 30%; }
}
@media (max-width: 600px) {
  .results-summary > div { padding: 12px 14px; }
  .results-summary .v { font-size: 20px; }
  #resultsBody .grid th, #resultsBody .grid td { padding: 9px 10px; }
  #resultsBody .grid th { white-space: normal; }
  .grid td.num .sub { display: block; min-width: 0; margin-left: 0; }
  .grid .bar-cell { display: none; }
}

.doc { max-width: 820px; }
.doc h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.doc h2 { margin: 32px 0 10px; font-size: 16px; font-weight: 600; }
.doc p, .doc li { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.doc .lede { margin-top: 8px; font-size: 15px; }
.doc-list { margin: 8px 0 0; padding-left: 20px; }
.doc-list li + li { margin-top: 6px; }
.doc-list b { color: var(--text); }
.doc-table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.doc-table td:first-child { white-space: nowrap; font-weight: 500; }
.doc-table .score { width: auto; padding: 0 10px; }

/* ---------- account ---------- */
.user-btn { padding: 4px 10px; border: 0; border-radius: var(--r-pill); background: none; font: inherit; font-size: 13px; color: rgba(255,255,255,.75); cursor: pointer; }
.user-btn:hover, .user-btn[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); }
.account { max-width: 720px; }
.account-section { padding: 16px 18px; }
.account-section + .account-section { margin-top: 16px; }
.account-section h2 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.account-kv dd { text-align: left; }
.account-kv { grid-template-columns: 140px 1fr; }
.account-form { max-width: 360px; }
.team-list { list-style: none; margin: 0 0 12px; padding: 0; }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.team-list li div { flex: 1; min-width: 0; }
.team-list li b { display: block; font-weight: 600; }
.team-list li span { font-size: 12.5px; color: var(--text-3); }
.team-list li .territory-line { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-choices { display: grid; gap: 10px; margin-top: 14px; }
.export-choice { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.export-choice:hover { background: var(--hover); border-color: var(--line-hover); }
.export-choice:focus-visible { outline: none; box-shadow: var(--focus); }
.export-choice b { display: block; font-weight: 600; font-size: 14px; }
.export-choice span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
@media (max-width: 600px) {
  .team-list li { flex-wrap: wrap; }
  .team-list li div { flex-basis: 100%; }
  .team-list li .territory-line { white-space: normal; }
}
.team-invite { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.team-invite .input { width: 100%; }
@media (max-width: 600px) { .team-invite { grid-template-columns: 1fr; } }

/* ---------- settings ---------- */
.settings-list { display: grid; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; padding-top: 2px; }
.setting-label { flex: 1; min-width: 0; cursor: default; }
label.setting-label { cursor: pointer; }
.setting-label b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.setting-label span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--text-3); }
.setting-seg { flex: none; }
.setting-seg button { min-width: 84px; }
.setting-input { flex: none; width: 240px; }
.setting-num { width: 96px; text-align: right; }
.settings-saved { min-height: 18px; margin: 6px 0 0; text-align: right; color: var(--ok); }
/* An on/off switch built on a checkbox. */
input.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 22px; margin: 0; border-radius: var(--r-pill); background: var(--line-hover); cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
input.switch:checked { background: var(--brand-700); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:focus-visible { outline: none; box-shadow: var(--focus); }
.settings-links { display: grid; }
.link-row {
  display: block; width: 100%; padding: 11px 28px 11px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; position: relative;
  text-decoration: none; color: inherit; /* the playbook row is a link; it looks like the button rows */
}
.fu-links { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text-3); }
.link-row:first-child { border-top: 0; padding-top: 2px; }
.link-row::after { content: "›"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--text-3); }
.link-row b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.link-row span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--text-3); }
.link-row:hover b { color: var(--brand-lime); }
:root[data-theme="light"] .link-row:hover b { color: var(--brand-700); }
.back-link { display: inline-block; margin-bottom: 14px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 500; color: var(--brand-lime); }
:root[data-theme="light"] .back-link { color: var(--brand-700); }
.back-link:hover { text-decoration: underline; }
.membership-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.membership-status p { font-size: 13.5px; color: var(--text-2); }
.membership-status p b { color: var(--text); }
.membership-status .btn { flex: none; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.btn-danger-solid:disabled { opacity: .6; }
@media (max-width: 600px) {
  .setting-row { flex-wrap: wrap; }
  .setting-input { width: 100%; }
  .setting-num { width: 96px; }
  .membership-status { flex-direction: column; align-items: stretch; }
}

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); }
.lang-switch button { height: 22px; padding: 0 9px; border: 0; border-radius: var(--r-pill); background: transparent; font-size: 12px; font-weight: 600; color: var(--text-3); }
.lang-switch button[aria-pressed="true"] { background: var(--brand-700); color: #fff; }
.lang-dark.lang-switch { border-color: rgba(255,255,255,.22); }
.lang-dark.lang-switch button { color: rgba(255,255,255,.65); }
.lang-dark.lang-switch button[aria-pressed="true"] { background: rgba(255,255,255,.16); color: #fff; }
.login-main { position: relative; }
.login-lang { position: absolute; top: 20px; right: 24px; }
.login-theme { position: absolute; top: 18px; right: 104px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.modal-card { width: 100%; max-width: 480px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 600; }
.icon-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; font-size: 22px; line-height: 1; color: var(--text-3); }
.icon-close:hover { background: var(--hover); color: var(--text); }
#modalBody { padding: 16px 18px 18px; }
.modal-text { font-size: 13.5px; color: var(--text-2); }
.link-box { display: flex; gap: 8px; margin: 14px 0; }
.link-box .input { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); background: var(--bg); }
.modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modal-actions .spacer { flex: 1; }
.btn-danger { color: var(--danger); }
.form-grid-1 { display: grid; gap: 12px; }
.form-grid-1 label { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-grid-1 .input { width: 100%; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2000;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--brand-lime); color: var(--brand-950); font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
}

/* ---------- medium screens: one side column ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .filters { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--line); max-height: 52vh; }
  .results { grid-column: 1; grid-row: 2; border-left: 0; border-right: 1px solid var(--line); }
  .map-wrap { grid-column: 2; grid-row: 1 / 3; }
}

/* ---------- top bar on narrower screens ----------
   Under 1320px the section tabs use short names and the account name is hidden (it stays
   reachable from the Account page). Under 1180px the tabs move to a second row. */
@media (max-width: 1320px) {
  .topbar-right > .user { display: none; }
  .tabs [data-tab="new"], .tabs [data-tab="routes"], .tabs [data-tab="saved"] { font-size: 0; }
  .tabs [data-tab="saved"]::before { content: "Saved"; font-size: 13.5px; }
  html[lang="es"] .tabs [data-tab="saved"]::before { content: "Guardados"; }
  .tabs [data-tab="new"]::before { content: "New"; font-size: 13.5px; }
  .tabs [data-tab="routes"]::before { content: "Routes"; font-size: 13.5px; }
  html[lang="es"] .tabs [data-tab="new"]::before { content: "Nuevos"; }
  html[lang="es"] .tabs [data-tab="routes"]::before { content: "Rutas"; }
  .tabs .tab-count { font-size: 11px; }
}
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 8px; }
  .topbar-right { padding-bottom: 0; }
  .tabs { order: 9; flex: 0 0 calc(100% + 32px); height: 40px; margin: 8px -16px 0; padding: 0 8px; border-top: 1px solid rgba(255,255,255,.12); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

/* ---------- phones ---------- */
.phone-only { display: none !important; }
@media (max-width: 760px) {
  .phone-only { display: revert !important; }
  /* Two rows: logo, market and sign out on top; the section tabs underneath. */
  .topbar { flex-wrap: wrap; height: auto; gap: 0; padding: 0; }
  .topbar .logo { height: 32px; margin-left: 12px; }
  .market { flex: 1; min-width: 0; padding: 9px 10px; border-left: 0; }
  .market label { display: none; }
  .market select { width: 100%; }
  .topbar-right { margin: 0 10px 0 0; gap: 8px; }
  .topbar-right .lang-switch, #adminLink, .demo-badge, .user { display: none; }
  .tabs { order: 9; flex-basis: 100%; height: 40px; margin: 0; padding: 0 4px; border-top: 1px solid rgba(255,255,255,.12); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 1 0 auto; padding: 0 8px; font-size: 13px; white-space: nowrap; }
  .tabs button[aria-current="page"]::after { left: 6px; right: 6px; }
  .tabs [data-tab="saved"]::before, .tabs [data-tab="new"]::before, .tabs [data-tab="routes"]::before { font-size: 13px; }
  .app { height: auto; min-height: 100%; }
  .layout { display: flex; flex-direction: column; }
  .map-wrap { height: 46vh; flex: none; order: -1; }
  .filters { max-height: none; border-right: 0; }
  .filters-toggle {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
    padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--text);
    font-size: 14px; font-weight: 600; text-align: left;
  }
  .filters-toggle::after { content: "+"; font-size: 18px; font-weight: 400; color: var(--text-3); }
  .filters.open .filters-toggle::after { content: "\2212"; }
  .filters:not(.open) .filters-body { display: none; }
  .results { border: 0; border-top: 1px solid var(--line); }
  .pane { position: static; }
  .lead-list, .pane-body { overflow: visible; }
  /* Legend top-left, map style under the zoom buttons, so nothing overlaps the scale bar. */
  .legend { top: 8px; bottom: auto; left: 8px; font-size: 11px; gap: 8px; padding: 5px 10px; }
  .legend .legend-note { display: none; }
  .basemap { top: 84px; right: 10px; }
  .basemap button { height: 26px; padding: 0 10px; font-size: 12px; }
  .leaflet-control-attribution { font-size: 9px; }
  .page-inner { padding: 16px 16px 40px; }
  .account-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .account-kv dt { margin-top: 8px; font-size: 12px; }
  .account-kv dt:first-child { margin-top: 0; }
  .account-kv dd { min-width: 0; overflow-wrap: anywhere; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-side { padding: 20px 24px; }
  .login-side .logo { width: 190px; }
  .login-tagline, .login-legal { display: none; }
  .login-main { place-items: start center; padding-top: 40px; }
}

/* ---------- print: route sheet with directions (always on white) ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #111; font-size: 11.5pt; }
  .topbar, .filters, .map-wrap, .toolbar, .back, .toast, .stop-side a, .leg button, .route-note { display: none !important; }
  .app, .layout, .results, .pane { display: block; position: static; height: auto; overflow: visible; border: 0; background: #fff; }
  #listPane, #leadPane, #savedPane { display: none !important; }
  .route-name { border: 0; font-size: 16pt; color: #111; }
  .stats div { padding: 6px 0; }
  .stats b, .lead-addr, .steps li { color: #111; }
  .stop { break-inside: avoid; margin: 0; padding: 6px 0; }
  .steps { display: block !important; margin-left: 34px; }
  .stop-side .input { border: 1px solid #999; background: #fff; color: #111; }
  .tag { border: 1px solid #ccc; background: #fff; color: #333; }
}
