/* White and crisp, in the NTP logo's navy and orange. Light only, on purpose. */
:root {
  color-scheme: light;
  --bg: #ffffff; --soft: #f5f6f8; --card: #ffffff; --ink: #111110; --muted: #5c5c57; --line: #dcdfe4;
  --navy: #132d50; --orange: #f27f31; --accent: #2a78d6; --bad: #d03b3b;
  --yes: #16794a; --yes-bg: #e6f5ec; --no: #9a5200; --no-bg: #fdf1dc;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 16px/1.45 -apple-system, "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 26px; padding-bottom: 64px; }
h1 { font-size: 26px; font-weight: 700; color: var(--navy); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; color: var(--navy); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* header */
.bar { background: var(--bg); border-bottom: 1px solid var(--line); border-top: 4px solid var(--navy); }
.barrow { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy);
         font-weight: 700; font-size: 17px; }
.brand img { height: 38px; width: auto; display: block; }
nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
nav a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600;
        border-bottom: 3px solid transparent; }
nav a:hover { color: var(--navy); }
nav a.on { color: var(--navy); border-bottom-color: var(--orange); }
.who { display: flex; gap: 14px; align-items: center; margin: 0; font-size: 14px; }
.who a { color: var(--ink); font-weight: 600; text-decoration: none; }
.link { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0;
        text-decoration: underline; }

.flash { background: var(--soft); border: 1px solid var(--line); border-left: 4px solid var(--orange);
         padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
/* On the long Assign list the message and the assign bar stay in view wherever you've scrolled. */
main:has(#assign-form) .flash { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
                                z-index: 10; margin: 0; max-width: calc(100% - 32px); background: var(--bg);
                                box-shadow: 0 6px 24px rgba(19, 45, 80, .18); }
#assign-form .toolbar { position: sticky; top: 8px; z-index: 4; box-shadow: 0 4px 14px rgba(19, 45, 80, .08); }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }
.headrow { display: flex; justify-content: space-between; align-items: center; gap: 12px;
           flex-wrap: wrap; margin-bottom: 16px; }
.daynav { display: flex; gap: 8px; align-items: center; }

/* panels and forms */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
         padding: 18px; margin-bottom: 16px; }
label { display: grid; gap: 6px; font-weight: 600; }
label.check { display: flex; align-items: center; gap: 7px; font-weight: 400; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
                border-radius: 12px; padding: 10px 12px; min-width: 0; }
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
                            border-color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--navy); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
main > h1 { margin-bottom: 16px; }
.toolbar input[name=password] { flex: 1 1 280px; }
select.reassign { padding: 6px 8px; border-radius: 10px; color: var(--muted); max-width: 150px; }
select.reassign.taken { color: var(--navy); font-weight: 700; border-color: var(--navy); }
.rowtools { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
#people td { vertical-align: middle; }
#people .state { align-self: center; min-width: 2em; font-weight: 600; }
#people input { padding: 6px 10px; border-radius: 10px; }
.btn.remove { color: var(--bad); }
.btn.remove:hover { border-color: var(--bad); }
#f-group { max-width: 220px; }
#f-text { flex: 1 1 160px; }
form.inline { display: flex; gap: 6px; margin: 0; }
.carry { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.btn { border: 1.5px solid var(--line); background: var(--bg); color: var(--navy); padding: 10px 18px;
       border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--navy); }
.btn.small { padding: 5px 12px; font-size: 14px; border-radius: 10px; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #0d2140; }
.btn.yes.on { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
.btn.no.on { background: var(--no-bg); border-color: var(--no); color: var(--no); }
.btn.bad.on { background: #fde8e8; border-color: #a32626; color: #a32626; }
.btn.pick.on { background: var(--navy); border-color: var(--navy); color: #fff; }
/* what came of an answered call */
.outcomes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px;
            padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.outcomes[hidden], .callback-on[hidden] { display: none; }
.callback-on { padding: 5px 8px; border-radius: 10px; font-size: 14px; }
.card.bad_number { border-left-color: #a32626; }
.lasttime { margin-top: 6px; }
td .actions { margin-top: 0; flex-wrap: nowrap; }
td .actions .btn { padding: 5px 11px; font-size: 14px; border-radius: 10px; white-space: nowrap; }
td .outcomes { margin-top: 8px; padding: 8px 10px; }

/* sign in */
.signin { max-width: 420px; margin: 0 auto; padding-top: 28px; }
.signin .logo { display: block; width: 240px; max-width: 70%; height: auto; margin: 0 auto 26px; }
.signin p { color: var(--muted); margin: 6px 0 18px; }
.signin .panel { display: grid; gap: 16px; padding: 20px; }
.signin input { width: 100%; font-size: 18px; padding: 12px 14px; }
.signin .btn { width: 100%; font-size: 18px; padding: 14px; }

/* Today: one closed row per rep, click to open their calls */
.hint { margin: -6px 0 12px; }
details.rep { padding: 0; margin-bottom: 10px; overflow: hidden; }
details.rep summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer;
                      list-style: none; user-select: none; }
details.rep summary::-webkit-details-marker { display: none; }
details.rep summary::before { content: ""; width: 9px; height: 9px; flex: none; margin-right: 2px;
                              border-right: 2.5px solid var(--orange); border-bottom: 2.5px solid var(--orange);
                              transform: rotate(-45deg); transition: transform .15s; }
details.rep[open] summary::before { transform: rotate(45deg); }
details.rep summary:hover { background: var(--soft); }
details.rep summary h2 { flex: 1; }
details.rep[open] summary { border-bottom: 1px solid var(--line); }
details.rep table { margin: 0; }
details.rep th:first-child, details.rep td:first-child { padding-left: 18px; }

/* Assign: one row per state, click to open its accounts */
/* fixed columns, so they don't shift as states open and close */
#accounts { table-layout: fixed; }
#accounts thead th:nth-child(1) { width: 52px; }
#accounts thead th:nth-child(3) { width: 160px; }
#accounts thead th:nth-child(4) { width: 205px; }
#accounts thead th:nth-child(5) { width: 165px; }
#accounts td { overflow-wrap: anywhere; }
#accounts tbody tr:last-child td { border-bottom: 1px solid var(--line); }
#accounts tr[hidden], #accounts tbody[hidden] { display: none !important; }
#accounts tbody.closed tr[data-text], #accounts tbody.closed tr.city-head,
#accounts tr.city-closed { display: none; }
#accounts.searching tbody.closed tr[data-text], #accounts.searching tbody.closed tr.city-head,
#accounts.searching tr.city-closed { display: table-row; }
/* a big city inside a state: one step in from the state's own row */
.city-head { cursor: pointer; user-select: none; }
.city-head th { text-transform: none; letter-spacing: 0; background: var(--bg); padding-left: 34px; }
.city-head td { background: var(--bg); vertical-align: middle; }
.city-head:hover td, .city-head:hover th { background: var(--soft); }
.city-toggle { border: 0; background: none; padding: 0; font: inherit; font-size: 16px; font-weight: 700;
               color: var(--navy); cursor: pointer; }
.city-toggle::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 12px 2px 2px;
                       border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
                       transform: rotate(45deg); transition: transform .15s; }
.city-head.closed .city-toggle::before { transform: rotate(-45deg); }
#accounts.searching .city-head.closed .city-toggle::before { transform: rotate(45deg); }
.city-count { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 12px; }
#accounts tr[data-city] td:nth-child(2) { padding-left: 54px; }
.state-head { cursor: pointer; user-select: none; }
.state-head td, .state-head th { background: var(--bg); padding-top: 13px; padding-bottom: 13px; vertical-align: middle; }
.state-head:hover td, .state-head:hover th { background: var(--soft); }
.state-head th { text-transform: none; letter-spacing: 0; font-size: 16px; }
.state-toggle { border: 0; background: none; padding: 0; font: inherit; font-size: 17px; font-weight: 700;
                color: var(--navy); cursor: pointer; }
.state-toggle::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 14px 2px 2px;
                        border-right: 2.5px solid var(--orange); border-bottom: 2.5px solid var(--orange);
                        transform: rotate(45deg); transition: transform .15s; }
tbody.closed .state-toggle::before { transform: rotate(-45deg); }
#accounts.searching tbody.closed .state-toggle::before { transform: rotate(45deg); }
.state-count { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 12px; }
tbody.state:not(.closed) .state-head td, tbody.state:not(.closed) .state-head th,
#accounts.searching .state-head td, #accounts.searching .state-head th { background: var(--soft); }

/* tables */
table { width: 100%; border-collapse: collapse; }
table.panel { padding: 0; display: table; overflow: hidden; border-spacing: 0; border-collapse: separate; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
     color: var(--muted); font-weight: 700; background: var(--soft); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--soft); }
tr.off td { color: var(--muted); }
td .note { width: 100%; padding: 6px 10px; border-radius: 10px; }
td .btn.small + .btn.small { margin-left: 4px; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.yes { background: var(--yes-bg); color: var(--yes); }
.pill.no { background: var(--no-bg); color: var(--no); }
/* how long since an account last ordered */
.pill.fresh { background: var(--yes-bg); color: var(--yes); }
.pill.warm { background: var(--no-bg); color: var(--no); }
.pill.cold { background: #fde8e8; color: #a32626; }
.pill.never { background: var(--soft); color: var(--muted); }
.pill.prospect { background: #e4eefb; color: #1d5fb8; }
/* the Leads page */
.card.lead { border-left-color: #1d5fb8; }
.card.lead .top { align-items: center; }
.leadgrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 10px; }
.leadphone { font-size: 18px; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.leadbar { position: sticky; top: 8px; z-index: 4; box-shadow: 0 4px 14px rgba(19, 45, 80, .08); }
#lead-filters input[type=search] { flex: 1 1 200px; }
a.tab { text-decoration: none; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 18px; }
@media (max-width: 800px) { .leadgrid { grid-template-columns: 1fr; gap: 10px; } }
.pill.owner { background: var(--navy); color: #fff; margin-left: 12px; }
#own-accounts h2 { margin-bottom: 4px; }
#own-accounts .toolbar { margin: 12px 0; }
#own-accounts input[name=account] { flex: 1 1 260px; }
#own-accounts td { vertical-align: middle; }
#territories td { vertical-align: middle; }
#territories tbody tr:last-child td { border-bottom: 1px solid var(--line); }
#territories .towns-toggle { margin-left: 12px; font-weight: 600; }
#territories tbody.closed .town-row { display: none; }
#territories .town-row td { background: var(--soft); }
#territories .town-row td:first-child { padding-left: 40px; }
#territories .town-row.carved td:first-child { font-weight: 700; color: var(--navy); }
.small-pill { margin-left: 6px; padding: 0 8px; font-size: 12px; }
#territories select { padding: 6px 8px; border-radius: 10px; }
#territories tr.unowned td:first-child { border-left: 4px solid var(--orange); }
#territories { margin-bottom: 14px; }
.acct { font-weight: 650; }
.facts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.people { margin-top: 5px; }
.people ul { margin: 0; padding: 0; list-style: none; }
.reach { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.mapside .actions { gap: 6px; }
.mapside .actions .btn { padding: 7px 11px; font-size: 14px; }
.mapside .note { flex-basis: 100%; }
.mapside h3.callhead { margin-top: 16px; }
.buys { margin-top: 5px; }
.buys ul { margin: 0; padding: 0; list-style: none; }
.buys li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.why-note { margin-top: 5px; color: var(--navy); }

/* a rep's call cards */
.progress { color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs { display: flex; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.tab { border: 1.5px solid var(--line); background: var(--bg); color: var(--navy); padding: 7px 15px;
       border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--navy);
        border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; }
.card.answered { border-left-color: var(--yes); }
.card.no_answer { border-left-color: var(--orange); }
.top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.num { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.name { font-weight: 700; font-size: 18px; color: var(--navy); }
.who-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-top: 4px; }
.phone { font-size: 22px; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.why { margin-top: 6px; }
.opener { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--orange);
          background: var(--soft); border-radius: 0 10px 10px 0; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.note { flex: 1 1 220px; }

@media (max-width: 720px) {
  .brand span { display: none; }
  #accounts thead th:nth-child(5), #accounts tr[data-text] td:nth-child(5) { display: none; }
  table.panel { display: block; overflow-x: auto; }
}

/* ---- the account map ---- */
main.wrap.wide { max-width: 1560px; }
.maplayout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.mapbox { position: relative; padding: 0; overflow: hidden; margin-bottom: 0; min-height: 520px; }
#map-drawn svg { display: block; width: 100%; height: auto; background: var(--bg); cursor: grab; touch-action: none; }
#map-drawn svg:active { cursor: grabbing; }
#map-drawn path { vector-effect: non-scaling-stroke; }
.state { fill: #eef1f5; cursor: pointer; outline: none; }
.state.has { fill: #e2e8f0; }
.state:hover, .state:focus-visible { fill: #cfdaea; }
.state.on { fill: #d5e1f1; }
.state-lines { fill: none; stroke: #ffffff; stroke-width: 1.2; pointer-events: none; }
.nation-line { fill: none; stroke: #9aa7b8; stroke-width: 1; pointer-events: none; }
.county-lines { fill: none; stroke: #8d9bb0; stroke-width: .7; pointer-events: none; opacity: 0; transition: opacity .25s; }
.show-counties .county-lines { opacity: 1; }
.dot { stroke: #ffffff; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.dot.ordered { fill: #16a34a; }
.dot.lead { fill: #111827; stroke: #ffffff; }
.ourdot { fill: var(--orange); stroke: var(--navy); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.dot:hover, .dot.on { stroke: var(--navy); stroke-width: 2; }
.labels { pointer-events: none; }
.labels text { paint-order: stroke; stroke: #ffffff; stroke-width: 3px; stroke-linejoin: round; }
.state-name text { fill: var(--navy); font-weight: 700; }
.city-name text { fill: var(--ink); }
.city-name circle { fill: var(--muted); stroke: #ffffff; stroke-width: 1; }
.county-name text { fill: #7b8696; font-style: italic; letter-spacing: .03em; }
.mapctl { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; }
.mapctl .btn { padding: 6px 12px; min-width: 40px; background: var(--bg); box-shadow: 0 2px 8px rgba(19, 45, 80, .12); }
.maptip { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
          max-width: 230px; padding: 8px 11px; background: var(--bg); border: 1px solid var(--line);
          border-radius: 10px; box-shadow: 0 6px 20px rgba(19, 45, 80, .18); font-size: 13px; pointer-events: none; }
.maptip[hidden] { display: none; }
.maploading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); }
.maplegend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.key.ordered { background: #16a34a; }
.key.lead { background: #111827; }
.key.ours { background: var(--orange); border: 2px solid var(--navy); }
.key.prospect { background: #2a78d6; }
.key.newlead { background: #aab2bf; border: 1.5px solid #5d6673; margin-right: 0; }
.leadswitch { color: var(--ink); font-weight: 600; }
.dot.prospect { fill: #2a78d6; }
.leaddot { fill: #aab2bf; stroke: #5d6673; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.leaddot:hover { stroke: var(--navy); stroke-width: 2; }
.mapside { max-height: calc(100vh - 190px); overflow-y: auto; margin-bottom: 0; }
.mapside h2 { margin: 10px 0 2px; }
.mapside h3 { font-size: 14px; color: var(--navy); margin: 18px 0 6px; }
.mapside .phone { display: block; margin: 6px 0; }
.mapfind { width: 100%; margin: 6px 0 10px; }
.maplist { display: grid; }
.maprow { display: grid; gap: 2px; justify-items: start; text-align: left; font: inherit; color: var(--ink);
          background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 4px; cursor: pointer; }
.maprow:hover { background: var(--soft); }
.maprow-name { font-weight: 650; }
.mapreps { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.mapmissing { margin-top: 16px; font-size: 14px; }
.mapmissing summary { cursor: pointer; color: var(--navy); font-weight: 600; }
@media (max-width: 900px) {
  .maplayout { grid-template-columns: 1fr; }
  .mapside { max-height: none; }
}

/* ---- the map's two views ---- */
.maptools { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.viewpicks { margin: 0; }
#map-street { height: calc(100vh - 210px); min-height: 520px; background: var(--soft); }
#map-street[hidden], #map-drawn[hidden], .maploading[hidden], .streetnote[hidden] { display: none; }
.mapctl { z-index: 800; }                      /* above Leaflet's own layers */
.maploading { z-index: 900; background: var(--bg); }
.streetnote { position: absolute; z-index: 850; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0;
              padding: 8px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
              box-shadow: 0 6px 20px rgba(19, 45, 80, .18); font-size: 14px; }
.tipbody { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.leaflet-container { font: inherit; }
.leaflet-tooltip.streettip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
                             color: var(--ink); box-shadow: 0 6px 20px rgba(19, 45, 80, .18); }
.mapside a.btn { display: inline-block; margin-top: 4px; }

/* a lead's pictures: one from its own website, one from above */
.pill.shop { background: #e3efff; color: #1d5fb8; }
.leadpics { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.leadpics figure { margin: 0; }
.leadpics figcaption { font-size: 12px; color: var(--muted, #6b7480); margin-top: 3px; }
.leadpic { display: block; width: 240px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid #dfe5ee; background: #f1f4f8; }
.leadabout { margin-top: 10px; display: grid; gap: 3px; max-width: 900px; }
.mapside .leadpics { gap: 8px; }
.mapside .leadpic { width: 100%; height: auto; max-height: 220px; }
.mapside .leadpics figure { flex: 1 1 100%; }
@media (max-width: 800px) { .leadpic { width: 100%; height: auto; max-height: 220px; } .leadpics figure { flex: 1 1 100%; } }

.overdue { color: #9a3412; font-weight: 600; margin-top: 4px; }
.panel.promised { margin-bottom: 18px; }

/* the map: customers coloured by how late their next order is, filters, full screen */
.dot.ordered.late { fill: #f59e0b; }
.dot.ordered.verylate { fill: #dc2626; }
.key.late { background: #f59e0b; }
.key.verylate { background: #dc2626; }
.mapfilters { margin-bottom: 12px; }
.mapfilters .grow { flex: 1; }
.maplegend { flex-wrap: wrap; row-gap: 4px; }
body.mapfull { overflow: hidden; }
body.mapfull .maplayout { position: fixed; inset: 0; z-index: 50; background: #fff; padding: 10px; gap: 10px;
  grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; }
body.mapfull .mapbox, body.mapfull #map-street, body.mapfull #map-drawn { height: 100%; }
body.mapfull #map-drawn svg { height: 100%; }
body.mapfull .mapside { overflow: auto; margin: 0; }
body.mapfull #map-filters { position: fixed; z-index: 60; left: 120px; top: 18px; right: 390px; margin: 0;
  box-shadow: 0 4px 14px rgba(19, 45, 80, .18); }
@media (max-width: 900px) {
  body.mapfull .maplayout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 40%; }
  body.mapfull #map-filters { right: 12px; }
}

/* the key above the map: one chip per colour, with how many there are */
.maplegend { gap: 8px; }
.maplegend .chip { display: inline-flex; align-items: center; gap: 2px; padding: 5px 12px 5px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.maplegend .chip b { margin-left: 6px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.maplegend .key { width: 13px; height: 13px; margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(17, 24, 39, .12); }
.maplegend .key.ours { box-shadow: none; }
.maplegend .leadswitch { cursor: pointer; background: var(--soft); }
.maplegend .leadswitch input { margin-right: 6px; }

.dot.ordered.extreme { fill: #7f1d1d; }
.key.extreme { background: #7f1d1d; }

/* Leads: browse by state, then city */
.leadbrowse { margin-bottom: 12px; }
.browsehead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.chips .chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.chips .chip:hover { border-color: var(--navy); }
.chips .chip b { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* leads on the map, coloured by kind of business */
.leadkey { margin: 0 0 10px; align-items: center; }
.leadkey[hidden] { display: none; }
.key.k-repair { background: #64748b; } .key.k-dealer { background: #7c3aed; } .key.k-parts { background: #0891b2; }
.key.k-stop { background: #b45309; } .key.k-other { background: #db2777; }

/* Leads as an ordered list: a heading per city, one row per lead, opening into the full card */
.leadcity { margin: 22px 0 8px; font-size: 17px; display: flex; gap: 10px; align-items: baseline; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.leadcity .muted { font-size: 13px; font-weight: 600; }
details.card.lead { padding: 0; margin-bottom: 6px; border-left-width: 6px; }
details.card.lead > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.card.lead > summary::-webkit-details-marker { display: none; }
details.card.lead > summary:hover { background: var(--soft); }
details.card.lead[open] > summary { border-bottom: 1px solid var(--line); }
details.card.lead > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.card.lead > .actions { margin-bottom: 14px; }
details.card.lead .name { font-weight: 700; }
.rowphone { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.pill.kind { background: #eef1f5; color: var(--ink); }
/* the same colours as the lead dots on the map */
details.card.lead.k-repair, details.card.lead.k-collision, details.card.lead.k-tire, details.card.lead.k-wash { border-left-color: #64748b; }
details.card.lead.k-dealer { border-left-color: #7c3aed; }
details.card.lead.k-parts { border-left-color: #0891b2; }
details.card.lead.k-stop { border-left-color: #b45309; }
details.card.lead.k-chrome { border-left-color: #db2777; }
details.card.lead.k-service { border-left-color: #cbd5e1; }

/* a lead's picture has no frame until the picture itself has loaded */
.leadpics { margin-top: 0; }
.leadpics figure { display: none; margin-top: 10px; }
.leadpics figure.ready { display: block; }
.leadpic { background: none; }

/* the key to the colour stripe on each lead */
.leadkeybox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 10px; }
.leadkeybox .maplegend { margin: 0; }

/* the key is a row of switches: a group that is switched off is greyed out */
.maplegend button.chip { cursor: pointer; font-family: inherit; }
.maplegend button.chip:hover { border-color: var(--navy); }
.maplegend button.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line); }
.maplegend button.chip.off { opacity: .4; }
.maplegend button.chip.off .key { filter: grayscale(1); }
