/* finder.css — round 39 (owned by the finder agent). Loaded after app.css/game.css/hud.css, so rules here override them.
 *
 * The Lead Finder (tools/finder.js): a search panel (where, radius, venue types,
 * saved searches), then the results table beside the tactical plot. Desktop: table
 * and plot side by side, the plot sticky. Under 1100px the plot sits above the
 * table; under 720px each table row becomes a card. Blue and white, glass over the
 * world, like the Vault and the Map.
 */

.lf { gap: var(--s-4); }
.lf .lf__textbtn { font: inherit; font-size: var(--t-xs); font-weight: 600; color: var(--scan); background: none; border: 0; padding: 6px 4px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.lf .lf__textbtn:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lf :is(.lf__textbtn, .lf__near, .lf__chip, .lf__refine, .lf__savedrun, .lf__savedx, .lf__link, .lf__inpipe, .lf__tel):focus-visible { outline: 2px solid var(--scan); outline-offset: 2px; }
.lf__dim { color: var(--fg-faint); }

/* ---- Search panel ---- */
.lf__search { display: grid; gap: var(--s-4); }
.lf__searchhead { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: baseline; justify-content: space-between; }
.lf__target { font-size: var(--t-xs); color: var(--fg-dim); }
.lf__row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: var(--s-3); align-items: stretch; }
.lf__go { min-height: 58px; padding-inline: 32px; align-self: stretch; }
.lf__go.is-stale { box-shadow: 0 0 0 2px rgba(var(--scan-rgb), 0.55), 0 0 26px -6px rgba(var(--scan-rgb), 0.8); }
.lf__place-row { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.lf__place-row .input { flex: 1 1 auto; min-width: 0; }
.lf__place.is-near .input { color: var(--scan); font-weight: 600; }
.lf__near { flex: none; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: var(--t-xs); font-weight: 600; color: var(--fg-dim); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--r-pill); padding: 5px 11px; cursor: pointer; white-space: nowrap; transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast); }
.lf__near:hover { color: #fff; border-color: rgba(var(--scan-rgb), 0.5); }
.lf__near[disabled] { opacity: 0.6; cursor: progress; }
.lf__near-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.lf__near.is-on { color: #fff; background: rgba(var(--scan-rgb), 0.18); border-color: rgba(var(--scan-rgb), 0.6); }
.lf__near.is-on .lf__near-dot { background: var(--scan); border-color: var(--scan); box-shadow: 0 0 10px var(--scan); }

.lf__types { display: grid; gap: var(--s-2); }
.lf__typeshead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.lf__typeslabel { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); }
.lf__fitkey { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--t-2xs); color: var(--fg-faint); }
.lf__fitkey .lf__fitdot:not(:first-child) { margin-left: 6px; }
.lf__typetools { margin-left: auto; display: flex; gap: 2px; }
.lf__chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* .lf__chip: the one chip look lives in arsenal.css. */
.lf__chip-n { font-family: var(--font-mono); font-size: 0.66rem; color: var(--fg-faint); padding-left: 2px; }
.lf__chip.is-on .lf__chip-n { color: #cfe6ff; }
.lf__fitdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lf__fitdot--3 { background: var(--scan); box-shadow: 0 0 8px rgba(var(--scan-rgb), 0.8); }
.lf__fitdot--2 { background: transparent; box-shadow: inset 0 0 0 1.5px var(--scan); }
.lf__fitdot--1 { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-faint); }
.lf__status { margin: 0; min-height: 1.4em; font-size: var(--t-sm); color: var(--fg-dim); }

.lf__saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lf__saved-label { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); margin-right: 4px; }
.lf__savedchip { display: inline-flex; align-items: center; max-width: 100%; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.lf__savedrun { font: inherit; font-size: var(--t-xs); font-weight: 600; color: var(--fg); background: none; border: 0; padding: 6px 4px 6px 12px; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; border-radius: var(--r-pill); }
.lf__savedrun:hover { color: var(--scan); }
.lf__savedx { font: inherit; font-size: 1rem; line-height: 1; color: var(--fg-faint); background: none; border: 0; padding: 6px 10px 6px 6px; cursor: pointer; border-radius: var(--r-pill); }
.lf__savedx:hover { color: #fff; }

/* ---- Split: table + plot ---- */
.lf__split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 33%); gap: var(--s-4); align-items: start; }
.lf__mapcol { position: sticky; top: var(--s-4); min-width: 0; }
.lf__plot.tac { height: clamp(380px, 62vh, 620px); }
.lf__plot.is-idle { opacity: 0.55; }
.lf__results { display: grid; gap: var(--s-3); min-width: 0; padding: var(--s-4); }
@media (max-width: 1100px) {
  .lf__split { grid-template-columns: minmax(0, 1fr); }
  .lf__mapcol { position: static; order: -1; }
  .lf__plot.tac { height: 320px; }
}

.lf__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.lf__summary { font-size: var(--t-sm); color: var(--fg-dim); min-width: 0; }
.lf__summary strong { color: var(--fg); }
.lf__toolacts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.lf__save { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.lf__savename { min-width: min(260px, 100%); font-size: var(--t-sm); padding: 6px 10px; min-height: 36px; }
.lf__savedok { font-size: var(--t-xs); color: var(--scan); }
.lf__refinebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.lf__refines { display: flex; flex-wrap: wrap; gap: 6px; }
.lf .lf__refine { min-height: 32px; padding: 0.3rem 0.75rem; font-size: var(--t-xs); border: 1px solid rgba(255, 255, 255, 0.08); }
.lf__refine.is-on { color: #fff; background: rgba(var(--scan-rgb), 0.16); border-color: rgba(var(--scan-rgb), 0.55); }
.lf__sort { width: auto; min-height: 36px; padding: 4px 30px 4px 12px; font-size: var(--t-xs); }
.lf__note { margin: 0; font-size: var(--t-xs); color: var(--warn); }

.lf__bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); min-height: 44px; padding: 4px var(--s-3); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.1); font-size: var(--t-xs); color: var(--fg-dim); }
.lf__bulk.is-on { position: sticky; top: 0; z-index: 3; background: rgba(10, 22, 48, 0.94); border: 1px solid rgba(var(--scan-rgb), 0.5); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px); }
.lf__bulkcount { color: #fff; font-size: var(--t-sm); }
.lf__bulkadd { margin-left: auto; }

/* ---- Table ---- */
.lf__tablewrap { min-width: 0; border-radius: var(--r-md); border: 1px solid rgba(255, 255, 255, 0.07); overflow: hidden; }
.lf__table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: var(--t-sm); }
.lf__th { text-align: left; font-family: var(--font-mono); font-weight: 400; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); padding: 10px 10px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.lf__th--check, .lf__td--check { width: 40px; padding-left: 14px; padding-right: 0; }
.lf__th--dist, .lf__td--dist { text-align: right; white-space: nowrap; }
.lf__th--act { width: 1%; }
.lf__td { padding: 12px 10px; vertical-align: top; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.lf__tr:last-child .lf__td { border-bottom: 0; }
.lf__tr { cursor: pointer; transition: background var(--dur-fast); }
.lf__tr:hover { background: rgba(255, 255, 255, 0.03); }
.lf__tr.is-picked { background: rgba(var(--scan-rgb), 0.07); }
.lf__tr.is-focus { background: rgba(var(--scan-rgb), 0.12); box-shadow: inset 3px 0 0 var(--scan); }
.lf__tr.is-inpipe .lf__name strong { color: var(--fg-dim); }
.lf__check { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--scan); cursor: pointer; }
.lf__check:disabled { opacity: 0.35; cursor: default; }
.lf__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.lf__name strong { font-weight: 650; color: #fff; overflow-wrap: anywhere; }
.lf__brand { font-size: var(--t-2xs); color: var(--fg-faint); }
.lf__where { margin-top: 2px; font-size: var(--t-xs); color: var(--fg-dim); overflow-wrap: anywhere; }
.lf__tel { color: var(--fg-dim); text-decoration: none; white-space: nowrap; }
.lf__tel:hover { color: #fff; text-decoration: underline; }
.lf__links { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; }
.lf__link { font-size: var(--t-2xs); font-weight: 600; color: var(--scan); text-decoration: none; white-space: nowrap; }
.lf__link::after { content: " ↗"; font-weight: 400; opacity: 0.7; }
.lf__link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lf__td--type { min-width: 120px; }
.lf__type { display: block; font-size: var(--t-xs); color: var(--fg); white-space: nowrap; }
.lf__fit { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--t-2xs); color: var(--fg-faint); white-space: nowrap; }
.lf__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.lf__bars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, 0.16); }
.lf__bars i:nth-child(1) { height: 4px; } .lf__bars i:nth-child(2) { height: 7px; } .lf__bars i:nth-child(3) { height: 10px; }
.lf__bars--1 i:nth-child(-n+1), .lf__bars--2 i:nth-child(-n+2), .lf__bars--3 i { background: var(--scan); }
.lf__td--hours { min-width: 110px; max-width: 200px; }
.lf__hours { display: grid; gap: 3px; }
.lf__open { font-size: var(--t-2xs); font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.lf__open.is-open { color: var(--ok); }
.lf__open.is-closed { color: var(--fg-faint); }
.lf__open.is-unknown { color: var(--fg-faint); font-weight: 500; }
.lf__hourstext { font-size: var(--t-2xs); color: var(--fg-faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lf__td--dist { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-dim); }
.lf__td--act { white-space: nowrap; text-align: right; }
.lf__td--act > * { vertical-align: middle; }
.lf__add { min-width: 64px; }
.lf__inpipe { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; font-size: var(--t-xs); font-weight: 600; color: var(--scan); text-decoration: none; padding: 0 6px; border-radius: var(--r-sm); }
.lf__inpipe:hover { color: #fff; text-decoration: underline; }
.lf__score { display: block; margin: 2px 0 0 auto; }

/* ---- Empty, error, loading ---- */
.lf__empty { display: grid; gap: var(--s-2); justify-items: start; padding: var(--s-5) var(--s-4); }
.lf__empty p { margin: 0; color: var(--fg-dim); font-size: var(--t-sm); max-width: 62ch; }
.lf__emptytitle { font-family: var(--font-display, inherit); font-size: var(--t-lg); color: #fff; }
.lf__emptysteps { margin: var(--s-2) 0 0; padding-left: 1.4em; display: grid; gap: 4px; font-size: var(--t-sm); color: var(--fg-dim); }
.lf__emptysteps li::marker { color: var(--scan); font-family: var(--font-mono); }
.lf__empty--error .lf__emptytitle { color: #fff; }
.lf__empty--error { border-left: 2px solid var(--warn); }
.lf__empty--inline { padding: var(--s-4); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.03); }
.lf__skeleton { display: grid; gap: 1px; border-radius: var(--r-md); overflow: hidden; }
.lf__skrow { display: grid; grid-template-columns: 1fr 120px 60px; gap: var(--s-4); padding: 16px 14px; background: rgba(255, 255, 255, 0.025); }
.lf__skrow i { height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(var(--scan-rgb), 0.16), rgba(255, 255, 255, 0.05)); background-size: 200% 100%; animation: lf-shimmer 1.3s linear infinite; }
@keyframes lf-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .lf__skrow i { animation: none; } }

.lf__foot { display: grid; gap: var(--s-3); justify-items: start; }
.lf__credit { margin: 0; font-size: var(--t-2xs); color: var(--fg-faint); max-width: 90ch; line-height: 1.5; }

/* ---- Phone and narrow panels ---- */
@media (max-width: 720px) {
  .lf__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lf__place { grid-column: 1 / -1; }
  .lf__go { min-height: 58px; padding-inline: 18px; }
  .lf__typetools { margin-left: 0; width: 100%; }
  .lf__results { padding: var(--s-3); }
  .lf__plot.tac { height: 280px; }
  .lf__bulkadd { margin-left: 0; width: 100%; }
  .lf__sort { width: 100%; }
  .lf__table, .lf__table tbody { display: block; }
  .lf__table thead { display: none; }
  .lf__tablewrap { border: 0; overflow: visible; }
  .lf__tr { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "check venue dist" "check type act" "check hours act"; gap: 4px 10px; padding: 14px 12px; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--r-md); margin-bottom: var(--s-2); }
  .lf__td { padding: 0; border: 0; min-width: 0; max-width: none; }
  .lf__td--check { grid-area: check; width: auto; padding: 0; }
  .lf__td--venue { grid-area: venue; }
  .lf__td--dist { grid-area: dist; }
  .lf__td--type { grid-area: type; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .lf__td--type .lf__fit { margin-top: 0; }
  .lf__td--hours { grid-area: hours; }
  .lf__td--act { grid-area: act; align-self: end; }
  .lf__tr.is-focus { box-shadow: inset 3px 0 0 var(--scan), 0 0 0 1px rgba(var(--scan-rgb), 0.4); }
}

/* ---- Round 40 fixer: the plot before the first search (M13) ----
 * Not an empty box with an "N" in it: the rings stay dimmed under a short invitation
 * (lib/tactical.js marks the host .is-empty until a search lands), and the
 * corner and legend wait until there is something to label. */
.tac__empty { position: absolute; inset: 0; z-index: 3; display: none; place-content: center; justify-items: center; gap: var(--s-2); padding: var(--s-5); text-align: center; pointer-events: none; }
.tac.is-empty .tac__empty { display: grid; }
.tac.is-empty .tac__canvas { opacity: 0.55; }
.tac.is-empty .tac__corner, .tac.is-empty .tac__legend { display: none; }
.tac__empty > * { pointer-events: auto; }
.tac__empty b, .lf__plotempty b { font-size: var(--t-lg); line-height: 1.2; color: var(--fg); text-wrap: balance; }
.tac__empty span, .lf__plotempty > span:not(.lf__plotping) { max-width: 30ch; font-size: var(--t-sm); line-height: 1.5; color: var(--fg-dim); text-wrap: balance; }
.lf__plotempty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); background: radial-gradient(circle at 50% 30%, rgba(20, 103, 239, 0.22), rgba(6, 14, 34, 0.86) 70%); border: 1px solid rgba(144, 195, 255, 0.18); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8); }
.lf__plotempty .btn { margin-top: var(--s-1); }
.lf__plotping { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--neon, #38a5ff); box-shadow: 0 0 14px var(--neon, #38a5ff); }
.lf__plotping::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(56, 165, 255, 0.7); }
@media (prefers-reduced-motion: no-preference) { .lf__plotping::after { animation: lf-ping 2.4s var(--ease-out) 3; } }
@keyframes lf-ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.lf__plot.is-idle.is-empty { opacity: 1; }   /* the canvas dims itself; the invitation stays at full strength */
@media (max-width: 1100px) {
  /* On one column the how-to reads first until there is something to plot. */
  .lf__mapcol:has(.tac.is-empty) { order: 0; }
  .lf__plot.tac.is-empty { height: 260px; }
}
/* While the search locates its area (before the sweep starts), the invitation steps aside for a status line. */
.is-busy .lf__plotempty > b, .is-busy .lf__plotempty > span:not(.lf__plotping), .is-busy .lf__plotempty > .btn { display: none; }
.is-busy .lf__plotempty::after { content: "Locating your search area…"; font-size: var(--t-sm); color: var(--fg-dim); }
