/* HarKey Billboard Intelligence — black + white + gold (#f5a623) */
:root {
  --black: #0d0d0d;
  --ink: #1a1a1a;
  --panel: #ffffff;
  --bg: #f4f5f7;
  --line: #e3e6ea;
  --muted: #6b7280;
  --gold: #f5a623;
  --gold-dk: #c9851a;
  --go: #1f8a4c; --go-bg: #d6f0df;
  --warn: #9a6b00; --warn-bg: #fdeecb;
  --no: #b4232a; --no-bg: #fbdce0;
  --muted-bg: #eceef1;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45;
}

/* Top bar */
.topbar {
  background: var(--black); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; height: 58px;
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: 1px; }
.wordmark .gold { color: var(--gold); }
.divider { color: #555; font-weight: 300; }
.product { font-weight: 600; font-size: 15px; color: #e8e8e8; }
.market-tag { color: #9aa0a6; font-size: 12px; font-weight: 500; letter-spacing: .3px; }
/* market selector (top bar) — the required per-market context */
.market-picker { display: inline-flex; align-items: center; gap: 7px; }
.market-picker-k { color: #9aa0a6; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
#market-select { background: #1a1a1a; color: #fff; border: 1px solid #3a3a3a; border-radius: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 9px; cursor: pointer; }
#market-select:hover { border-color: var(--gold); }
#market-select:focus { outline: none; border-color: var(--gold); }
/* Targets workbook mini-map */
#wb-map { height: 220px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 4px; }
/* dashboard scorecard tiles */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; border-top: 3px solid var(--gold); }
.nav-tile, .card.nav-card { cursor: pointer; transition: box-shadow .15s, transform .1s, border-color .15s; }
.nav-tile:hover, .card.nav-card:hover { border-color: var(--gold); box-shadow: 0 3px 12px rgba(0,0,0,.09); transform: translateY(-1px); }
.card.nav-card h3 { color: var(--gold-dk); }
.stat-val { font-size: 27px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-lab { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 5px; text-transform: uppercase; letter-spacing: .4px; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
/* development-pipeline deal pins on the market map */
.pipeline-pin { color: #6d28d9; font-size: 18px; line-height: 1; cursor: pointer;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 2px #fff; }
/* admin: Team-access button + assignment table */
.access-admin-btn { background: #1a1a1a; color: #fff; border: 1px solid #3a3a3a; border-radius: 6px;
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 9px; cursor: pointer; }
.access-admin-btn:hover { border-color: var(--gold); color: var(--gold); }
/* One column per section, inside a fixed-width modal — so the table scrolls
   sideways rather than spilling its checkboxes out over the page, which is what
   it did the first time a tenth section was added. The member column is pinned
   so you can still tell whose row you are ticking once it scrolls. */
.acc-scroll { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
.acc-table { border-collapse: collapse; min-width: 100%; }
.acc-table th { background: var(--black); color: #fff; font-size: 11px; font-weight: 600; padding: 8px 10px;
  text-align: center; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.acc-table th:first-child { text-align: left; position: sticky; left: 0; z-index: 2; background: var(--black); }
.acc-table td { border-top: 1px solid var(--line); padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.acc-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel);
  box-shadow: 1px 0 0 var(--line); }
.acc-table td.acc-c { text-align: center; }
.acc-table input { width: 16px; height: 16px; cursor: pointer; }
/* audit / activity modal */
.aud-people { display: flex; flex-direction: column; gap: 7px; }
.aud-person { font-size: 13px; }
.aud-person.on b { color: var(--go); }
.aud-table { width: 100%; border-collapse: collapse; }
.aud-table th { background: var(--black); color: #fff; font-size: 11px; font-weight: 600; padding: 7px 10px;
  text-align: left; text-transform: uppercase; letter-spacing: .3px; position: sticky; top: 0; }
.aud-table td { border-top: 1px solid var(--line); padding: 7px 10px; font-size: 12.5px; vertical-align: top; }
.aud-fail { color: var(--no); font-size: 11px; font-weight: 700; }
#aud-user { font-family: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; }

/* Tabs */
.tabs {
  display: flex; gap: 2px; background: var(--ink); padding: 0 14px;
  position: sticky; top: 58px; z-index: 29; overflow-x: auto;
}
.tab {
  background: none; border: none; color: #b8bcc2; font-family: inherit;
  font-size: 13px; font-weight: 600; padding: 12px 16px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; transition: color .15s;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--gold); }

/* Views */
main { max-width: 1640px; margin: 0 auto; padding: 26px 22px 60px; }
/* Opportunities + Map side-by-side */
.split-2col { display: grid; grid-template-columns: minmax(300px, 1fr) 10px minmax(300px, 1fr); gap: 0; align-items: start; }
.split-left, .split-right { min-width: 0; }
.split-left .table-wrap { max-height: 660px; overflow: auto; }
.split-right #map { height: 660px; margin: 0; }
.split-2col .map-controls { z-index: 600; }
/* Compact graded-opportunities list (fits the narrow left panel; full detail via ℹ) */
#opp-results table.graded-tbl { width: 100%; table-layout: auto; }
#opp-results table.graded-tbl th { font-size: 10px; padding: 6px 8px; text-transform: uppercase; letter-spacing: .3px; color: #cfd3d8; }
#opp-results table.graded-tbl td { padding: 7px 8px; font-size: 12px; vertical-align: middle; }
#opp-results .g-grade { white-space: nowrap; text-align: center; line-height: 1.9; }
#opp-results .g-jur { font-weight: 600; font-size: 12.5px; }
#opp-results .g-parcel .muted-note { font-size: 11px; line-height: 1.35; }
#opp-results .g-parcel { width: 99%; }
#opp-results .opp-actions { white-space: nowrap; text-align: right; }
#opp-results .opp-actions .btn-ghost { padding: 3px 7px; margin-left: 2px; }
/* draggable divider between the list and the map */
.split-gutter { align-self: stretch; min-height: 660px; cursor: col-resize;
  display: flex; align-items: center; justify-content: center; touch-action: none; }
.split-gutter > span { width: 4px; height: 46px; border-radius: 3px; background: var(--line);
  transition: background .15s, height .15s; }
.split-gutter:hover > span, body.col-resizing .split-gutter > span { background: var(--gold); height: 96px; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing #map, body.col-resizing .split-left .table-wrap { pointer-events: none; }
/* Comps tab: list + revenue map side-by-side (its own 2-col grid, no gutter) */
.comps-split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.comps-split .split-left, .comps-split .split-right { min-width: 0; }
.comps-split .table-wrap { max-height: 660px; overflow: auto; }
#comps-map { height: 660px; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.leaflet-container.placing, .leaflet-container.placing .leaflet-interactive { cursor: crosshair !important; }
/* Deal documents (file attachments), grouped by category */
.pl-file-group { margin-bottom: 11px; }
.pl-file-cat-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--gold-dk);
  border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 5px; }
.pl-file-cat-n { color: var(--muted); font-weight: 600; }
.pl-file { display: flex; align-items: center; gap: 6px 8px; font-size: 13px; flex-wrap: wrap; padding: 3px 0; }
.pl-file .m-link { font-weight: 600; flex: 0 1 auto; min-width: 0; word-break: break-word; }
.pl-file .muted-note { font-size: 11px; white-space: nowrap; }
.pl-file-cat { width: 130px; font-family: inherit; font-size: 12px; padding: 3px 7px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; margin-left: auto; }
.pl-file-del { color: var(--no); cursor: pointer; font-weight: 700; padding: 0 4px; line-height: 1; }
.pl-file-del:hover { color: #7d1a1f; }
.pl-file-add { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pl-file-add .pl-file-cat { margin-left: 0; }
/* Documents tab: project-wide files, category chips */
.doc-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.doc-quality { margin: 0 0 10px; padding: 9px 11px; border: 1px solid #f2cf83; border-radius: 8px;
  background: #fff8e8; color: #704d00; font-size: 12.5px; }
.doc-chip { cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 14px; }
.doc-chip:hover { border-color: var(--gold); }
.doc-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.doc-chip-n { opacity: .55; font-weight: 500; margin-left: 5px; }
.doc-list { display: flex; flex-direction: column; gap: 22px; }
.doc-sec-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--muted);
  padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.doc-sec-n { background: var(--muted-bg); color: var(--muted); border-radius: 999px;
  padding: 1px 8px; font-size: 11px; font-weight: 700; }
.doc-sec-body { display: flex; flex-direction: column; margin-top: 2px; }
.doc-item { display: grid; align-items: center; gap: 18px; padding: 10px 12px; border-radius: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 250px) 74px 96px 92px auto;
  border-bottom: 1px solid var(--line); transition: background .12s; }
.doc-item:last-child { border-bottom: 0; }
.doc-item:hover { background: var(--panel); box-shadow: 0 1px 3px rgba(16, 24, 40, .07); border-bottom-color: transparent; }
.doc-name { display: flex; align-items: center; gap: 12px; min-width: 0;
  text-decoration: none; color: var(--ink); font-weight: 600; }
.doc-ico { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--muted-bg); border-radius: 8px; font-size: 15px; }
.doc-name .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-name:hover .fn { color: var(--gold-dk); text-decoration: underline; }
.doc-deal { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; text-decoration: none; }
.doc-deal:hover { color: var(--gold-dk); text-decoration: underline; }
.doc-size, .doc-by, .doc-date { text-align: right; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-suggest { font: inherit; font-size: 10.5px; font-weight: 750; color: #805700; background: #fff8e8;
  border: 1px solid #e7c56f; border-radius: 6px; padding: 4px 7px; cursor: pointer; white-space: nowrap; }
.doc-suggest:hover { border-color: var(--gold-dk); background: #fff1c9; }
.doc-suggest:disabled { opacity: .6; cursor: default; }

/* Admin deal-folder mapping workbench */
.fmap-source { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.fmap-source-main > label { display: block; font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .45px; margin-bottom: 6px; }
.fmap-source-picker { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.fmap-source-picker > span { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .45px; }
#fmap-source-select { font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.fmap-root-row { display: flex; gap: 8px; align-items: center; }
#fmap-root { flex: 1; min-width: 260px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
#fmap-root[readonly] { background: var(--muted-bg); color: var(--muted); }
#fmap-root:focus, .fmap-folder-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,166,35,.13); }
.fmap-local-note { color: var(--muted); font-size: 12px; line-height: 1.55; padding-left: 18px;
  border-left: 1px solid var(--line); }
.fmap-local-note strong { color: var(--ink); }
.fmap-summary { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fmap-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fmap-stat b { display: block; color: var(--ink); font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fmap-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .35px; }
.fmap-stat.is-approved { border-top: 3px solid var(--go); }
.fmap-stat.is-strong { border-top: 3px solid #4da46c; }
.fmap-stat.is-review { border-top: 3px solid var(--gold); }
.fmap-stat.is-unmatched { border-top: 3px solid var(--muted); }
.fmap-controls #fmap-search { min-width: 260px; font-family: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 7px; }
.fmap-table { min-width: 980px; }
.fmap-table td { vertical-align: middle; }
.fmap-deal { display: flex; flex-direction: column; min-width: 210px; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fmap-deal:hover b { color: var(--gold-dk); text-decoration: underline; }
.fmap-deal span, .fmap-folder-meta, .fmap-warning { color: var(--muted); font-size: 11px; margin-top: 2px; }
.fmap-warning { color: var(--warn); font-weight: 700; }
/* Approved mappings are done and leave the worklist; this is the way back to
   them, and the count so it is obvious nothing was thrown away. */
.fmap-hidden { font-size: 11.5px; color: var(--muted); padding: 6px 2px 8px; }
.fmap-hidden button { background: none; border: 0; padding: 0; font: inherit;
  color: var(--gold-dk, #a5822c); font-weight: 700; cursor: pointer; text-decoration: underline; }
.fmap-folder-input { width: 100%; min-width: 270px; font-family: inherit; font-size: 12.5px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.fmap-actions { white-space: nowrap; }
.fmap-actions button { margin: 2px 0 2px 5px; padding: 5px 9px; font-size: 11.5px; }
.fmap-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 28px;
  color: var(--muted); text-align: center; line-height: 1.8; }
.deal-folder-links { margin: 0 0 12px; }
.deal-folder-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--gold) 9%, white);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 9px; }
.deal-folder-ico { font-size: 20px; }
.deal-folder-copy-main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.deal-folder-copy-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-folder-copy-main span { color: var(--muted); font-size: 11px; }
.deal-folder-source { display: inline-block; margin-right: 5px; padding: 1px 6px; border-radius: 999px;
  background: #e5f1fb; color: #1769aa !important; font-size: 9.5px !important; font-weight: 800;
  text-transform: uppercase; letter-spacing: .3px; }
.deal-onedrive-files { margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.deal-onedrive-files > .loading, .deal-onedrive-files > .hint { padding: 12px; }
.od-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px;
  background: var(--muted-bg); border-bottom: 1px solid var(--line); font-size: 11.5px; }
.od-head span { color: var(--muted); }
.od-items { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.od-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 8px 11px; border-top: 1px solid #f0f1f3; color: var(--ink); text-decoration: none; }
.od-item:first-child { border-top: 0; }
.od-item:hover { background: color-mix(in srgb, #1769aa 6%, white); }
.od-main { display: flex; flex-direction: column; min-width: 0; }
.od-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.od-main span, .od-open { color: var(--muted); font-size: 10.5px; }
.od-open { white-space: nowrap; }
@media (max-width: 820px) {
  .doc-item { grid-template-columns: 1fr auto auto; gap: 4px 14px; }
  .doc-deal { grid-column: 1; grid-row: 2; }
  .doc-suggest { grid-column: 2 / -1; grid-row: 2; justify-self: end; }
  .doc-by { display: none; }
  .fmap-source { grid-template-columns: 1fr; }
  .fmap-local-note { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .fmap-root-row { align-items: stretch; flex-direction: column; }
  #fmap-root { min-width: 0; width: 100%; }
  .fmap-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
/* Stale mode inside a pipeline's results */
.pl-stale-ctl { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
#dev-results td.num, #dev-results th.num, #acq-results td.num, #acq-results th.num { text-align: right; }
/* Login screen */
.login-overlay { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d0d0d, #242424); padding: 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 30px 32px 26px; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login-brand { text-align: center; margin-bottom: 4px; }
.login-brand .wordmark { font-weight: 800; font-size: 26px; letter-spacing: 1px; color: var(--black); }
.login-brand .gold { color: var(--gold); }
.login-prod { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.login-card h2 { text-align: center; margin: 16px 0 18px; font-size: 18px; color: var(--ink); }
.login-f { display: block; margin-bottom: 12px; }
.login-f > span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 4px; }
.login-f input { width: 100%; font-family: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.login-f input:focus { outline: none; border-color: var(--gold); }
.login-btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-msg { min-height: 18px; margin-top: 10px; font-size: 12.5px; text-align: center; color: var(--muted); }
.login-msg.err { color: var(--no); font-weight: 600; }
/* Users admin panel */
.usr-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.usr-add input { font-family: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; }
.usr-add input#usr-new-name { width: 170px; }
.usr-add input#usr-new-pass { width: 160px; }
/* Stale-deals threshold control */
.stale-thresh { font-size: 13px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.stale-thresh input { width: 64px; font-family: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; }
#stale-results td.num, #stale-results th.num { text-align: right; }
@media (max-width: 1100px) { .comps-split { grid-template-columns: 1fr; } #comps-map { height: 460px; } }
#comps-table td.num, #comps-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
#comps-table tr.clickable { cursor: pointer; }
#comps-table tr.clickable:hover td { background: rgba(13,148,136,0.07); }
/* Comps revenue legend on the map (self-contained; bottom-left) */
.comps-legend { background: #fff; padding: 7px 9px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.2);
  font-size: 11.5px; line-height: 1.7; color: var(--ink); }
.comps-legend .cl-h { font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 3px; }
.comps-legend .cl-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.comps-legend .cl-sw { display: inline-block; border-radius: 50%; border: 1px solid #333; flex: none; }
/* Add/edit comp form */
.comp-form .cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.comp-form .cf { display: flex; flex-direction: column; gap: 3px; }
.comp-form .cf > span { color: var(--muted); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; }
.comp-form .cf input, .comp-form .cf select, .comp-form .cf textarea {
  font-family: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; }
.comp-form .cf-wide { grid-column: 1 / -1; }
.comp-form .cf-note { color: var(--muted); font-size: 11.5px; margin-top: 7px; }
.comp-form .m-section { margin-top: 14px; }
/* clicked-parcel detail rendered into the left panel */
.parcel-panel { padding: 6px 4px 14px; }
.parcel-panel .panel-back { margin-bottom: 12px; }
.parcel-panel .pp-head h3 { margin: 2px 0 3px; font-size: 15px; line-height: 1.3; }
.parcel-panel .pp-sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.parcel-panel .pp-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pp-nogo-btn { color: #b4232a; border-color: #e6b8bb; }
.pp-nogo-btn:hover:not(:disabled) { background: #fbeaeb; }
.pp-nogo-btn:disabled { color: var(--muted); border-color: var(--line); cursor: default; }
.m-note.nogo-note { background: #fbeaeb; border-left-color: #b4232a; }
/* sub-tab row (Development → Pipeline | Targets) */
.subtabs { display: flex; gap: 4px; background: #23262b; padding: 0 16px;
  position: sticky; top: 96px; z-index: 28; overflow-x: auto; box-shadow: inset 0 -1px 0 #000; }
.subtab { background: none; border: none; color: #c4c8ce; font-family: inherit;
  font-size: 14px; font-weight: 600; padding: 9px 18px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; transition: color .15s; }
.subtab:hover { color: #fff; }
.subtab.active { color: #fff; border-bottom-color: var(--gold); }
/* Development pipeline */
.pl-filters { display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* bigger, readable category sub-filters (M&A / Organic / …) */
.pl-cat { cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; padding: 6px 14px; border-radius: 9px; }
.pl-cat.active { background: var(--ink); color: #fff; border-color: var(--ink); }
/* columns editor */
.col-name { flex: 1; font-size: 13px; font-weight: 600; }
#col-add-sel { flex: 1; font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.col-up, .col-dn, .col-rm { border: 1px solid var(--line); background: var(--panel); border-radius: 6px;
  cursor: pointer; font-size: 12px; padding: 5px 8px; line-height: 1; }
.col-rm { color: var(--no); border-color: #e6b8bb; }
.col-up:disabled, .col-dn:disabled { opacity: .35; cursor: default; }
/* owner filter + multi-select tag picker */
.pl-owner-wrap { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 12px; color: var(--muted); }
.pl-owner-sel { font-family: inherit; font-size: 13px; font-weight: 600; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.own-pick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 7px; min-width: 260px; background: #fff; }
.own-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.own-chip { background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 4px 2px 9px;
  border-radius: 11px; display: inline-flex; align-items: center; gap: 4px; }
.own-x { cursor: pointer; opacity: .75; padding: 0 3px; }
.own-x:hover { opacity: 1; color: var(--gold); }
/* .kv .v .own-in beats the generic `.kv .v input { min-width:260px; border }` rule */
.own-in, .kv .v .own-in { border: none; outline: none; background: transparent; font-family: inherit;
  font-size: 13px; min-width: 90px; flex: 1; padding: 2px; }
/* click-to-sort headers */
th.pl-sortable { cursor: pointer; user-select: none; }
th.pl-sortable:hover { color: var(--gold); }
#pl-search { min-width: 240px; font-family: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
.pl-sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--no); background: var(--no-bg); padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.pl-status-cell { color: #3a3a3a; max-width: 480px; }
.pl-upcount { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* deal modal: weekly change log + add form */
.pl-week { margin-bottom: 14px; }
.pl-week-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--gold-dk); border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 6px; }
.pl-upd { padding: 7px 0; border-bottom: 1px solid #f0f1f3; }
.pl-upd-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pl-upd-body { font-size: 13px; color: var(--ink); margin-top: 2px; white-space: pre-wrap; }
.pl-del { margin-left: auto; cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 4px; font-size: 15px; }
.pl-del:hover { color: var(--no); }
.pl-add { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.pl-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-add input, .pl-add textarea, .kv .v input, .kv .v select, .kv .v textarea, #nd-body {
  font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.pl-add textarea, #nd-body { width: 100%; }
.kv .v input, .kv .v select { min-width: 260px; }
.pl-danger { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.pl-del-deal { color: var(--no); border-color: #e6b8bb; }
/* weekly-review selector + inline update cells */
.pl-week-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.pl-week-sel { font-family: inherit; font-size: 13px; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--ink); max-width: 260px; }
.pl-wk-upd { font-size: 13px; margin: 3px 0; white-space: pre-wrap; line-height: 1.4; }
.pl-wk-upd b { color: var(--gold-dk); }
/* stage sections + inline stage dropdown */
tr.pl-stage-head td { background: #f2f3f5; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--gold-dk); padding: 7px 14px; position: sticky; }
.pl-stage-count { display: inline-block; margin-left: 8px; background: var(--ink); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; letter-spacing: 0; }
.pl-stage-sel { font-family: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--ink); max-width: 190px; }
.pl-prog { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--gold-dk);
  background: var(--warn-bg); padding: 1px 6px; border-radius: 8px; font-variant-numeric: tabular-nums; }
/* sub-project (parent/child) grouping */
.pl-tree-tog { display: inline-block; width: 15px; margin-right: 4px; color: var(--gold-dk);
  font-size: 11px; cursor: pointer; user-select: none; }
.pl-tree-tog:hover { color: var(--ink); }
.pl-tree-lead { display: inline-block; width: 15px; margin-right: 4px; color: var(--muted); }
.pl-childcount { display: inline-block; margin-left: 6px; background: var(--gold); color: var(--ink);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
tr.pl-child td.cell-strong { padding-left: 26px; font-weight: 500; }
tr.pl-child td { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.pl-lender { font-size: 11px; margin-left: 5px; vertical-align: middle; }
.pl-author-tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
  padding: 7px 12px; background: var(--muted-bg); border-radius: 8px; color: var(--ink); white-space: nowrap; }
.pl-upd-author { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.pl-upd-author:hover { color: var(--gold-dk); }
.pl-upd-author-edit { font: inherit; font-weight: 600; padding: 1px 4px; max-width: 160px;
  border: 1px solid var(--gold); border-radius: 4px; }
.pl-act { font-size: 12.5px; padding: 5px 0; border-top: 1px solid var(--line); }
.pl-act:first-child { border-top: none; }
.pl-act-who { font-weight: 600; }
.pl-act-what { color: var(--ink); }
/* deal contact block */
.dm-contact-list { display: flex; flex-direction: column; gap: 10px; }
.dm-contact-card { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: var(--muted-bg); }
.dm-contact-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.dm-contact-remove { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.dm-contact-remove:hover { color: var(--no); text-decoration: underline; }
.dm-contact-add { margin-top: 10px; }
.dm-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.dm-c-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.dm-c-field.dm-c-wide { grid-column: 1 / -1; }
.dm-c-field input { font: inherit; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--ink); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.dm-c-field input:focus { outline: none; border-color: var(--gold); }
/* Admin + Reports tabs — the controls that used to be buttons in the top bar */
.adm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: start; }
.adm-card { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); cursor: pointer; }
.adm-card:hover { border-color: var(--gold); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.adm-ic { font-size: 17px; }
.adm-t { font-size: 14px; font-weight: 800; }
.adm-s { font-size: 12px; color: var(--muted); line-height: 1.45; }
.adm-feats { grid-column: 1 / -1; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.adm-feats h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.adm-feat { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; padding: 6px 0; }
.rpt-scope { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* "Shared with" inside a deal — hands this one site to an outside consultant */
.dm-share { margin-top: 8px; }
.dm-share-list { list-style: none; margin: 0 0 10px; padding: 0; }
.dm-share-list li { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 6px 8px; border-bottom: 1px solid #f2f2f2; font-size: 13px; }
.dm-share-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line, #e6e6e6);
  border-radius: 8px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
.dm-share-tag.dm-share-ro { border-style: dashed; }
.dm-share-x { background: none; border: 0; color: #b3261e; cursor: pointer; font-size: 12px; padding: 0; }
.dm-share-x:hover { text-decoration: underline; }
.dm-share-x:disabled { opacity: .5; cursor: default; text-decoration: none; }
.dm-share-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dm-share-add select { padding: 6px; min-width: 170px; }
.dm-share-none { margin-bottom: 10px; }

/* Lender Summary tab */
.lender-group { margin-bottom: 26px; }
.lender-group h2 { font-size: 16px; margin: 0 0 8px; border-bottom: 2px solid var(--gold); padding-bottom: 5px; }
.lender-totals { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.lender-tot-chip { font-size: 13px; padding: 5px 11px; background: var(--muted-bg); border-radius: 8px; }
.lender-action-btn { float: right; margin: -4px 0 0 8px; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px; margin: 6px 0; }
.lender-figs { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lender-fig { font-size: 12px; white-space: nowrap; color: var(--muted); }
.lender-fig b { color: var(--ink); font-variant-numeric: tabular-nums; }
#lender-print-meta { display: none; }

/* Print/PDF mode keeps the lender summary's on-site visual structure while
   removing application chrome and fitting the tables cleanly on paper. */
body.lender-print-mode { background: #fff; color: var(--ink); }
body.lender-print-mode .topbar,
body.lender-print-mode .tabs,
body.lender-print-mode .subtabs,
body.lender-print-mode .foot,
body.lender-print-mode .modal-overlay { display: none !important; }
body.lender-print-mode main { max-width: none; margin: 0; padding: 0; }
body.lender-print-mode .view { display: none !important; animation: none !important; }
body.lender-print-mode #view-lender { display: block !important; }
body.lender-print-mode #view-lender .view-head::before {
  content: 'HARKEY  /  BILLBOARD INTELLIGENCE'; display: block; margin-bottom: 16px;
  color: var(--black); font-size: 13px; font-weight: 800; letter-spacing: 1px;
  border-bottom: 3px solid var(--gold); padding-bottom: 8px;
}
body.lender-print-mode #view-lender .view-head h1 { font-size: 22px; margin-bottom: 4px; }
body.lender-print-mode #view-lender .lede { max-width: none; margin-bottom: 14px; font-size: 11px; }
body.lender-print-mode .lender-action-btn { display: none !important; }
body.lender-print-mode #lender-print-meta {
  display: block; margin: -8px 0 18px; color: var(--muted); font-size: 10px;
}
body.lender-print-mode .lender-group { margin-bottom: 20px; }
body.lender-print-mode .lender-group h2 { break-after: avoid; page-break-after: avoid; }
body.lender-print-mode .lender-totals { break-inside: avoid; page-break-inside: avoid; gap: 5px; margin-bottom: 8px; }
body.lender-print-mode .lender-tot-chip { font-size: 9.5px; padding: 3px 7px; }
body.lender-print-mode table { break-inside: auto; page-break-inside: auto; }
body.lender-print-mode thead { display: table-header-group; }
body.lender-print-mode tr { break-inside: avoid; page-break-inside: avoid; }
body.lender-print-mode thead th { position: static; padding: 6px 8px; font-size: 8.5px; }
body.lender-print-mode tbody td { padding: 6px 8px; font-size: 9.5px; }
body.lender-print-mode .lender-figs { gap: 2px 7px; }
body.lender-print-mode .lender-fig { font-size: 9px; }
body.lender-print-mode tbody tr.clickable { cursor: default; }

@media print {
  @page { size: landscape; margin: 0.45in; }
  body.lender-print-mode * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
/* Long-term targets: state × market breakdown */
.lt-rollup { margin: 0 0 18px; }
.lt-rollup h3 { font-size: 14px; margin: 0 0 8px; }
.lt-rollup-tbl { width: auto; min-width: 340px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lt-rollup-tbl th { background: var(--muted-bg); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.lt-rollup-tbl td, .lt-rollup-tbl th { padding: 5px 12px; border-top: 1px solid var(--line); }
.lt-rollup-tbl .lt-subtotal td { background: color-mix(in srgb, var(--gold) 8%, transparent); font-weight: 600; }
tr.lt-state-head td { background: color-mix(in srgb, var(--gold) 16%, transparent); font-size: 13px; }
tr.lt-market-head td { background: var(--muted-bg); font-weight: 600; font-size: 12px; padding-left: 22px; color: var(--ink); }
/* location autocomplete (New-deal form) */
.geo-wrap { position: relative; display: inline-block; }
.geo-suggest { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 3px);
  z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,.16); max-height: 260px; overflow-y: auto; text-align: left; }
.geo-opt { padding: 8px 10px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-opt:first-child { border-top: none; }
.geo-opt:hover, .geo-opt.active { background: var(--muted-bg); }
.sp-parent { font-weight: 600; margin-right: 8px; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sp-add-row { display: flex; gap: 8px; align-items: center; }
.sp-add-row select { flex: 1; font-family: inherit; font-size: 13px; padding: 5px 7px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.sp-remove { cursor: pointer; margin-left: 2px; font-weight: 700; opacity: .8; }
.sp-remove:hover { opacity: 1; }
/* deal-detail fields editor — controlled form (fixed labels + dropdowns) */
.fld-editor { display: flex; flex-direction: column; gap: 8px; }
.fld-rows { display: flex; flex-direction: column; gap: 8px; }
.fld-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; }
.fld-k-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: right;
  overflow: hidden; text-overflow: ellipsis; }
.fld-row .fld-v, .fld-row .fld-k { font-family: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink);
  min-width: 0; width: 100%; }
.fld-row select.fld-v { cursor: pointer; }
.fld-row textarea.fld-v { resize: vertical; min-height: 34px; line-height: 1.4; }
.fld-row .fld-v:focus, .fld-row .fld-k:focus { outline: none; border-color: var(--gold); }
.fld-url { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fld-url .fld-v { flex: 1 1 auto; }
.fld-url-open { flex: 0 0 auto; white-space: nowrap; font-size: 12.5px; }
.fld-tags { min-height: 35px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 4px 7px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.fld-tags:focus-within { border-color: var(--gold); }
.fld-tag-list { display: contents; }
.fld-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 22%, var(--panel)); color: var(--ink); font-size: 12px; font-weight: 600; }
.fld-tag-x { border: 0; background: transparent; color: inherit; padding: 0; line-height: 1; cursor: pointer; font-size: 14px; }
.fld-tag-input { flex: 1 1 180px; min-width: 150px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; padding: 3px; color: var(--ink); }
.fld-rm { border: none; background: none; color: var(--muted); font-size: 18px;
  line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 5px; }
.fld-rm:hover { color: var(--ink); background: var(--warn-bg); }
.fld-add-sel { align-self: flex-start; font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--gold-dk); cursor: pointer; }
.fld-add-sel:focus { outline: none; border-color: var(--gold); }
/* development project-stage checklist (deal modal) */
.pl-checklist { display: flex; flex-direction: column; gap: 6px; }
.pl-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.pl-check input { width: 16px; height: 16px; cursor: pointer; }
/* per-deal project checklist (phases + checkable tasks) */
.pt-progress { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.pt-bar { flex: 1 1 auto; height: 7px; background: var(--muted-bg); border-radius: 999px; overflow: hidden; }
.pt-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .2s; }
.pt-progress-lab { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-phase { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; overflow: hidden; }
.pt-phase-h { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--muted-bg); padding: 8px 12px; }
.pt-phase-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.pt-phase-n { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-items { display: flex; flex-direction: column; }
.pt-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; font-size: 13px;
  border-top: 1px solid var(--line); cursor: pointer; }
.pt-item:first-child { border-top: none; }
.pt-item input { width: 15px; height: 15px; cursor: pointer; flex: 0 0 auto; }
.pt-item .pt-t { flex: 1 1 auto; }
.pt-item.done .pt-t { color: var(--muted); text-decoration: line-through; }
.pt-who { flex: 0 0 auto; font-family: inherit; font-size: 11px; font-weight: 700; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted);
  cursor: pointer; max-width: 130px; }
.pt-who:focus { outline: none; border-color: var(--gold); }
.pt-due { flex: 0 0 auto; font-family: inherit; font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.pt-due:focus { outline: none; border-color: var(--gold); }
/* Development Roadmap — go-live timeline grid */
.rm-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.rm-grid { min-width: 640px; }
.rm-row { display: grid; align-items: stretch; border-top: 1px solid var(--line); }
.rm-row:first-child { border-top: none; }
.rm-row.clickable { cursor: pointer; }
.rm-row.clickable:hover { background: var(--muted-bg); }
.rm-head { background: var(--black); color: #fff; }
.rm-name-h { padding: 9px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; align-self: center; }
.rm-m { padding: 8px 3px; font-size: 10.5px; font-weight: 700; text-align: center; color: #cfd3d8; border-left: 1px solid #333; white-space: nowrap; align-self: center; }
.rm-m.rm-now { color: var(--gold); }
.rm-name { padding: 9px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.rm-stage { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.rm-cell { border-left: 1px solid var(--line); min-height: 40px; display: flex; align-items: center; justify-content: center; }
.rm-cell.rm-now { background: rgba(245, 166, 35, .08); }
.rm-pill { background: var(--gold); color: var(--ink); font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; text-align: center; }
.rm-undated { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.rm-undated-h { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 3px; }
.rm-chip { font-family: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.rm-chip:hover { border-color: var(--gold); color: var(--gold-dk); }
.pt-rm { flex: 0 0 auto; border: none; background: none; color: var(--line); font-size: 16px;
  line-height: 1; cursor: pointer; padding: 0 4px; }
.pt-item:hover .pt-rm { color: var(--muted); }
.pt-rm:hover { color: var(--no); }
.pt-add-in { width: 100%; border: none; border-top: 1px dashed var(--line); background: none;
  font-family: inherit; font-size: 12.5px; color: var(--ink); padding: 7px 12px; }
.pt-add-in:focus { outline: none; background: var(--muted-bg); }
.pt-addphase { display: flex; gap: 7px; margin-top: 4px; }
.pt-addphase-in { flex: 1 1 auto; font-family: inherit; font-size: 13px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 7px; }
.pt-addphase-in:focus { outline: none; border-color: var(--gold); }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pt-head h4 { margin: 0; }
.pt-share { font-size: 12.5px; }
.pt-share-box { background: var(--muted-bg); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin: 8px 0 4px; }
.pt-share-note { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.pt-share-row { display: flex; gap: 7px; }
.pt-share-row input { flex: 1 1 auto; font-family: inherit; font-size: 12.5px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.pt-share-row input:focus { outline: none; border-color: var(--gold); }
/* stage editor */
.stg-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.stg-row { display: flex; align-items: center; gap: 6px; }
.stg-row .stg-up, .stg-row .stg-dn, .stg-row .stg-rm { border: 1px solid var(--line); background: var(--panel);
  border-radius: 6px; cursor: pointer; font-size: 12px; padding: 5px 8px; line-height: 1; }
.stg-row .stg-rm { color: var(--no); border-color: #e6b8bb; margin-left: auto; }
.stg-row .stg-up:disabled, .stg-row .stg-dn:disabled { opacity: .35; cursor: default; }
.stg-name { flex: 1; font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.stg-add-row { display: flex; gap: 8px; }
.stg-add-row input { flex: 1; font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 1100px) {
  /* !important so a saved/dragged inline width from a wide session can never
     leave the mobile layout stuck in a broken 2-column state. */
  .split-2col { grid-template-columns: 1fr !important; }
  .split-gutter { display: none; }
  .split-right #map { height: 460px; }
}
#opp-results tr.clickable { cursor: pointer; }
#opp-results tr.clickable:hover td { background: rgba(13,148,136,0.07); }
#opp-results tr.row-active td { background: rgba(245,166,35,0.10); }
#opp-results tr.row-active td:first-child { box-shadow: inset 3px 0 0 #f5a623; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.view-head h1 .badge-live {
  font-size: 11px; font-weight: 700; background: var(--gold); color: var(--black);
  padding: 3px 8px; border-radius: 10px; vertical-align: middle; margin-left: 8px;
}
.lede { color: var(--muted); max-width: 880px; margin: 0 0 16px; font-size: 13.5px; }
.lede strong { color: var(--ink); }
.sub { font-size: 16px; font-weight: 700; margin: 26px 0 10px; }
.muted-note { color: var(--muted); font-weight: 500; font-size: 13px; }

/* Legend */
.legend { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 11px;
  text-transform: uppercase; letter-spacing: .4px;
}
.band-open, .sig-go { background: var(--go-bg); color: var(--go); }
.band-conditional, .sig-warn { background: var(--warn-bg); color: var(--warn); }
.band-closed, .sig-no { background: var(--no-bg); color: var(--no); }
.sig-muted { background: var(--muted-bg); color: var(--muted); }

/* Tables */
.table-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--black); color: #fff; font-size: 11.5px; font-weight: 600;
  text-align: left; padding: 11px 14px; text-transform: uppercase; letter-spacing: .4px;
  position: sticky; top: 0;
}
tbody td { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: top; }
tbody tr.clickable { cursor: pointer; transition: background .12s; }
tbody tr.clickable:hover { background: #fbf7ee; }
td .pop { font-variant-numeric: tabular-nums; color: var(--muted); }
.cell-strong { font-weight: 700; }
.signal { font-size: 12px; }

/* Loading / hint */
.loading, .hint { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.err { color: var(--no); }

/* Cards (rights bundle) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 6px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  border-top: 3px solid var(--gold);
}
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.card .row { font-size: 12.5px; margin: 4px 0; }
.card .k { color: var(--muted); }
.card .ph { color: var(--go); font-weight: 600; }
.card .gm { color: var(--no); font-weight: 600; }

/* Upload / search card */
.upload-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px;
}
.upload-card input[type=text], .upload-card input[type=file] {
  font-family: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; min-width: 260px;
}
.btn-gold {
  background: var(--gold); color: var(--black); border: none; font-family: inherit;
  font-weight: 700; font-size: 13px; padding: 9px 18px; border-radius: 7px; cursor: pointer;
  transition: background .15s;
}
.btn-gold:hover { background: var(--gold-dk); }
.btn-gold:disabled { opacity: .55; cursor: default; }
.upload-status { font-size: 13px; color: var(--muted); }
.upload-status.ok { color: var(--go); font-weight: 600; }
.upload-status.bad { color: var(--no); font-weight: 600; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--panel); border-radius: 12px; max-width: 760px; width: 100%;
  padding: 0; position: relative; box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
#modal-body { padding: 24px 26px 26px; }
.m-head { border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 16px; }
.m-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.m-head .m-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; }
.m-section { margin-bottom: 16px; }
.m-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold-dk);
  margin: 0 0 8px; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.m-note { background: #fbf7ee; border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 4px;
  font-size: 12.5px; color: #4a4a4a; margin-top: 8px; }
.m-corridors { display: flex; flex-wrap: wrap; gap: 6px; }
.m-corr { background: var(--muted-bg); font-size: 11.5px; padding: 3px 9px; border-radius: 10px; }
.m-corr.named { background: var(--go-bg); color: var(--go); font-weight: 600; }
/* new-off-premise zoning gate (data/zoning.py) */
.zgate { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.zgate-row { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.zgate-k { flex: 0 0 104px; color: var(--gold-dk); font-weight: 700; text-transform: capitalize; }
.zgate-v { color: #3a3a3a; }
/* zoning-gate requirements as a checkmark list (city-detail modal) */
.zck-head { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; color: var(--gold-dk);
  text-transform: uppercase; letter-spacing: .4px; }
ul.zck { list-style: none; margin: 0; padding: 0; }
ul.zck li { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0;
  border-top: 1px solid var(--line); font-size: 12.5px; }
ul.zck li:first-child { border-top: none; }
.zck-mark { flex: 0 0 auto; color: var(--go); font-weight: 800; font-size: 14px; line-height: 1.35; }
.zck-body { color: #3a3a3a; line-height: 1.45; }
.zck-body b { color: var(--ink); }
.m-link { color: var(--gold-dk); font-weight: 600; text-decoration: none; }
.m-link:hover { text-decoration: underline; }

/* Footer */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .m-grid { grid-template-columns: 1fr; }
  .product { display: none; }
}

/* Map */
.map-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.map-controls input[type=text], .map-controls select {
  font-family: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
}
.map-controls input[type=text] { min-width: 200px; }
.btn-ghost {
  background: #fff; border: 1px solid var(--line); font-family: inherit; font-weight: 600;
  font-size: 13px; padding: 8px 14px; border-radius: 7px; cursor: pointer; transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--gold); }
.btn-ghost:disabled { opacity: .5; cursor: default; color: var(--muted); border-color: var(--line); }
.map-sep { width: 1px; height: 22px; background: var(--line); }
#map { height: 600px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; z-index: 0; background: #e8eaed; }
.map-legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; border: 1.5px solid #0d0d0d; }
.dot-go { background: var(--go); }
.dot-muted { background: #9aa0a6; }
.leaflet-popup-content { font-family: 'Inter', sans-serif; font-size: 12.5px; line-height: 1.4; }
.leaflet-popup-content b { color: var(--ink); }
.leaflet-container { font-family: 'Inter', sans-serif; }
.map-check { font-size: 12.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.map-check input { accent-color: var(--gold); margin: 0; }

/* ─────────── UI polish: consistent, neat controls ─────────── */
/* group each toolbar row into a tidy strip (the open search row stays borderless) */
.map-controls { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; row-gap: 8px; }
.map-controls.nl-row { background: none; border: none; padding: 0; }
/* one shared height so every button / input / dropdown lines up crisply */
.map-controls .btn-ghost, .map-controls .btn-gold, .map-controls .menu-btn,
.map-controls input[type=text], .map-controls select {
  height: 34px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0;
}
.map-controls input[type=file] { font-size: 12px; max-width: 200px; }
/* softer, more consistent buttons */
.btn-ghost { box-shadow: 0 1px 1px rgba(0,0,0,.02); }
.btn-ghost:hover { background: #fffdf6; }
.btn-gold { box-shadow: 0 1px 2px rgba(245,166,35,.28); }
.map-sep { height: 20px; opacity: .8; }
/* Leaflet layer control → match the app's rounded card look */
.leaflet-control-layers { border: 1px solid var(--line) !important; border-radius: 10px !important;
  box-shadow: 0 3px 12px rgba(13,13,13,.12) !important; }
.leaflet-control-layers-toggle { border-radius: 9px !important; }
.leaflet-control-layers-expanded { padding: 10px 12px !important; font-family: 'Inter', sans-serif; font-size: 13px; }
.leaflet-control-layers-list label { display: flex; align-items: center; gap: 6px; margin: 4px 0; cursor: pointer; }
.leaflet-control-layers-separator { margin: 8px -2px; border-top: 1px solid var(--line); }
.dot-conv { background: var(--gold); }
/* site-report popup */
.leaflet-popup-content { margin: 11px 13px; min-width: 215px; max-width: 260px; }
.sr-addr { font-weight: 700; color: var(--ink); }
.sr-meta { color: #6b7280; font-size: 11.5px; margin: 2px 0 0; }
.sr-verdict { margin-top: 7px; padding-top: 7px; border-top: 1px solid #e3e6ea; }
.sr-row { display: flex; justify-content: space-between; gap: 10px; margin: 2px 0; }
.sr-row .k { color: #6b7280; }
.sr-row .v { font-weight: 600; text-align: right; }
.sr-chip { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; text-transform: uppercase; }
.sr-link { color: var(--gold-dk); font-weight: 600; cursor: pointer; text-decoration: underline; }
.sr-link:hover { color: var(--gold); }
/* cluster bubbles -> brand gold */
.marker-cluster { background: rgba(245,166,35,.35); }
.marker-cluster div { background: rgba(245,166,35,.9); color: #0d0d0d; font-weight: 700; }
/* mark button in popups + gold-star markers */
.sr-mark { margin-top: 8px; width: 100%; background: var(--gold); color: var(--black); border: none;
  font-family: inherit; font-weight: 700; font-size: 12px; padding: 7px; border-radius: 6px; cursor: pointer; }
.sr-mark:hover { background: var(--gold-dk); }
.sr-mark.marked { background: var(--go-bg); color: var(--go); }
.mark-star { color: var(--gold); font-size: 20px; line-height: 20px; text-align: center;
  text-shadow: 0 0 3px #000, 0 0 2px #000; cursor: pointer; }
.mark-note-in { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 12px;
  padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; }
.mark-actions { display: flex; gap: 6px; margin-top: 6px; }
.mark-actions button { flex: 1; font-family: inherit; font-size: 11.5px; font-weight: 600;
  padding: 5px; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); background: #fff; }
.mark-actions .unmark { color: var(--no); border-color: #f0c0c4; }
/* measure tool */
.btn-ghost.on { background: var(--gold); color: var(--black); border-color: var(--gold); }
#map.measuring { cursor: crosshair; }
#map.adding { cursor: crosshair; }
.leaflet-div-icon.gap-pin { background: transparent; border: none; color: #1f8a4c; font-size: 18px;
  line-height: 22px; text-align: center; text-shadow: 0 0 3px #000, 0 0 2px #000; }
/* Mesa candidate sites — distinct from the gold ★ saved-board marker */
.leaflet-div-icon.cand-pin { background: transparent; border: none; color: #2b6cb0; font-size: 17px;
  line-height: 20px; text-align: center; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.leaflet-div-icon.cand-pin.combo { color: #7c3aed; }  /* combined-parcel candidates = purple */
.leaflet-div-icon.cty-pin { background: transparent; border: none; color: #0d9488; font-size: 16px;
  line-height: 20px; text-align: center; text-shadow: 0 0 3px #000, 0 0 2px #000; }  /* county island = teal ▲ */
/* inventory boards — ★ colored by operator (color set inline per-marker) */
.leaflet-div-icon.op-star { background: transparent; border: none; font-size: 16px;
  line-height: 18px; text-align: center; cursor: pointer; }
.leaflet-div-icon.op-star span { text-shadow: 0 0 3px #000, 0 0 2px #000, 0 0 1px #000; }
/* operator color legend (bottom-right) */
.op-legend { background: #fff; padding: 8px 11px; border-radius: 7px; box-shadow: 0 1px 7px rgba(0,0,0,.28);
  font-size: 11.5px; max-height: 250px; overflow-y: auto; min-width: 168px; }
.op-legend h5 { margin: 0 0 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold-dk); }
.op-legend .op-row { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
.op-legend .op-sw { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #0d0d0d; flex: none; }
.op-legend .op-name { color: var(--ink); }
.op-legend .op-n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 10px; }
/* toolbar dropdown menus (Tools ▾ / Export ▾) */
.map-controls { position: relative; z-index: 600; }
.menu { position: relative; display: inline-flex; }
.menu-btn::after { content: ''; }
.menu-panel { position: absolute; top: calc(100% + 5px); left: 0; z-index: 1000; display: none;
  flex-direction: column; gap: 7px; min-width: 210px; padding: 11px; background: #fff;
  border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.20); }
.menu-panel.open { display: flex; }
.menu-panel > button, .menu-panel > select { width: 100%; }
.menu-panel .map-check { font-size: 12.5px; }
.menu-sep { border-top: 1px solid var(--line); margin: 3px 0 1px; }
.menu-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.menu-btn.on { background: var(--gold); color: var(--black); border-color: var(--gold); }
/* graded opportunities — grade pills, checklist, NL bar */
.grade-pill { display: inline-block; min-width: 16px; text-align: center; font-weight: 800; font-size: 11px;
  padding: 1px 7px; border-radius: 10px; color: #fff; }
.grade-a { background: #1f8a4c; } .grade-b { background: #6aa84f; } .grade-c { background: #c9851a; }
.grade-d { background: #e8841a; } .grade-f { background: #b4232a; }
.ck-strip { display: inline-flex; gap: 2px; }
.ck { display: inline-block; width: 14px; text-align: center; font-weight: 700; font-size: 12px; cursor: default; }
.ck-pass { color: #1f8a4c; } .ck-fail { color: #b4232a; } .ck-review { color: #9a6b00; } .ck-na { color: var(--muted); }
.ck-row { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 12.5px; border-bottom: 1px solid #f0f1f3; }
.ck-row .ck { font-size: 14px; flex: none; }
.ck-label { font-weight: 600; flex: 0 0 180px; }
.ck-detail { color: #4a4a4a; }
.dq-note { border-left-color: var(--no) !important; background: var(--no-bg) !important; }
.nl-row #nl-q { flex: 1; min-width: 320px; font-size: 14px; padding: 10px 12px; }
.nl-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.nl-chip { font-family: inherit; font-size: 11.5px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; }
.nl-chip:hover { border-color: var(--gold); background: #fbf7ee; }
.opp-cb { accent-color: var(--gold); cursor: pointer; }
.wb-in { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 12.5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; }
.leaflet-div-icon.graded-pin { background: transparent; border: none; font-size: 16px; line-height: 18px;
  text-align: center; text-shadow: 0 0 3px #000, 0 0 2px #000; }
/* topbar user chip */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who-chip { color: var(--gold); font-size: 12px; font-weight: 700; }
/* promote-to-target button (secondary to the gold "add to my boards") */
.sr-mark.sr-target { margin-top: 6px; background: #1f3864; color: #fff; }
.sr-mark.sr-target:hover { background: #16284a; }
.sr-mark.sr-target.marked { background: var(--go-bg); color: var(--go); }
/* workbook (Targets) — review controls + comment thread */
.wb-select { font-family: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.wb-btn { margin-top: 8px; }
.wb-push { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.wb-push .k { color: var(--muted); font-size: 12.5px; }
.wb-comments { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 320px; overflow-y: auto; }
.wb-empty { color: var(--muted); font-size: 12.5px; padding: 8px 0; }
.wb-c { background: #fbf7ee; border-left: 3px solid var(--gold); border-radius: 4px; padding: 8px 10px; }
.wb-c-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.wb-c-who { font-weight: 700; font-size: 12.5px; color: var(--ink); }
.wb-c-ts { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.wb-c-b { font-size: 12.5px; color: #2a2a2a; white-space: pre-wrap; word-break: break-word; }
.wb-comment-box { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; min-height: 56px; }
.wb-comment-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.leaflet-div-icon.measure-vert { background: #fff; border: 2px solid #0d0d0d; border-radius: 50%; box-sizing: border-box; }
.leaflet-div-icon.measure-vert.snap { background: var(--gold); }
.leaflet-div-icon.measure-label { background: #0d0d0d; color: var(--gold); border: 1px solid var(--gold);
  font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
  width: auto !important; height: auto !important; }

/* Revenue workbooks — browser spreadsheet that keeps the uploaded XLSX as template */
.rev-shell { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 9px rgba(0,0,0,.05); }
.rev-toolbar { display: flex; align-items: stretch; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fafafa; }
.rev-workbook-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.rev-workbook-tab { min-width: 185px; text-align: left; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 8px; padding: 8px 11px; cursor: pointer; font-family: inherit; }
.rev-workbook-tab span { display: block; font-size: 12.5px; font-weight: 750; }
.rev-workbook-tab small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.rev-workbook-tab:hover { border-color: var(--gold); }
.rev-workbook-tab.active { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); background: #fffaf1; }
.rev-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rev-export { text-decoration: none; display: inline-flex; align-items: center; }
.rev-export.disabled { opacity: .45; pointer-events: none; }
#rev-status { min-height: 28px; padding: 7px 16px 0; }
.rev-sheet-tabs { display: flex; gap: 3px; padding: 8px 12px 0; overflow-x: auto; border-top: 1px solid #f3f3f3; }
.rev-view-modes { display: flex; align-items: center; gap: 10px; padding: 4px 16px 9px; min-height: 32px; }
.rev-mode-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); background: #f1f2f4; border-radius: 8px; }
.rev-view-mode { border: 0; background: transparent; color: var(--muted); padding: 6px 11px; border-radius: 5px;
  font: 700 11px/1.2 Inter, sans-serif; cursor: pointer; }
.rev-view-mode.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.rev-view-caption { color: var(--muted); font-size: 10.5px; }
.rev-sheet-tab { border: 1px solid var(--line); border-bottom: 0; background: #f2f3f5; color: #4b5563;
  border-radius: 6px 6px 0 0; padding: 7px 12px; white-space: nowrap; font-family: inherit;
  font-size: 11.5px; font-weight: 650; cursor: pointer; }
.rev-sheet-tab.active { background: #fff; color: var(--ink); border-color: #aeb4bd; position: relative; z-index: 2; }
.rev-grid-wrap { width: 100%; max-height: calc(100vh - 285px); min-height: 400px; overflow: auto;
  border-top: 1px solid #aeb4bd; background: #fff; }
.rev-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%;
  font-family: Calibri, Arial, sans-serif; font-size: 12px; color: #111; }
.rev-grid th, .rev-grid td { border-right: 1px solid #d9dde2; border-bottom: 1px solid #d9dde2; padding: 0;
  height: 24px; overflow: hidden; white-space: nowrap; vertical-align: middle; }
.rev-grid thead th { position: sticky; top: 0; z-index: 6; background: #e9ebee; color: #60656d;
  height: 23px; text-align: center; font: 600 10px/23px Inter, sans-serif; }
.rev-row-col { width: 42px; min-width: 42px; }
.rev-row-head, .rev-corner { position: sticky; left: 0; z-index: 5; width: 42px; min-width: 42px;
  background: #e9ebee; color: #60656d; text-align: center; font: 500 10px/23px Inter, sans-serif; }
.rev-corner { z-index: 8 !important; top: 0; }
.rev-td { position: relative; background: #fff; }
.rev-cell { display: block; width: 100%; height: 100%; min-height: 23px; border: 0; padding: 2px 5px;
  background: transparent; color: inherit; text-align: inherit; font: inherit; outline: none; }
.rev-cell:hover { box-shadow: inset 0 0 0 1px #9fb7d5; }
.rev-cell:focus { box-shadow: inset 0 0 0 2px #2b6cb0; background: #fff; position: relative; z-index: 3; }
.rev-cell:disabled { opacity: .6; }
.rev-cell-read { display: block; min-height: 23px; padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; }
.rev-formula { background-image: linear-gradient(135deg, rgba(120,128,138,.08) 25%, transparent 25%, transparent 50%, rgba(120,128,138,.08) 50%, rgba(120,128,138,.08) 75%, transparent 75%);
  background-size: 6px 6px; }
.rev-edited::after { content: ''; position: absolute; right: 0; top: 0; width: 0; height: 0;
  border-top: 7px solid #2b6cb0; border-left: 7px solid transparent; pointer-events: none; }
.rev-note { padding: 7px 14px 10px; color: var(--muted); font-size: 10.5px; border-top: 1px solid var(--line); }
.rev-empty { margin: 45px auto; max-width: 540px; text-align: center; padding: 28px; border: 1px dashed #bec3ca;
  border-radius: 10px; background: #fafafa; }
.rev-empty h3 { margin: 0 0 5px; }
.rev-empty p { color: var(--muted); margin: 0 0 16px; }
.rev-reforecast-panel { margin: 8px 16px 14px; padding: 14px 16px; border: 1px solid #dfc37d; border-radius: 9px;
  background: #fffaf0; }
.rev-snapshot-banner { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: -2px -3px 13px; padding: 11px 12px;
  border-radius: 7px; background: #171717; color: #fff; }
.rev-snapshot-banner > div:last-child { border-left: 1px solid #4a4a4a; padding-left: 12px; }
.rev-snapshot-banner span { display: block; color: #c8c8c8; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .45px; }
.rev-snapshot-banner strong { display: block; margin-top: 3px; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.rev-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rev-plan-head h3 { margin: 0 0 2px; font-size: 15px; }
.rev-plan-head p { margin: 0; color: var(--muted); font-size: 12px; }
.rev-plan-stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.rev-plan-stats > div { background: #fff; border: 1px solid #eadfc5; border-radius: 7px; padding: 9px 11px; }
.rev-plan-stats b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.rev-plan-stats span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .35px; }
.rev-plan-stats .neg b { color: var(--no); } .rev-plan-stats .pos b { color: var(--go); }
.rev-new { margin-top: 11px; font-size: 11px; }
.rev-new > strong { color: #725316; }
.rev-new > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rev-new-row { display: inline-block; background: #fff; border: 1px solid #dfc37d; border-radius: 14px; padding: 3px 8px; }

/* Friendly revenue view — clean controls mapped to the original workbook cells */
.rev-grid-wrap.rev-friendly-wrap { max-height: none; overflow: visible; background: #f5f5f3; }
.rev-friendly { padding: 20px; color: var(--ink); }
.rev-friendly-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.rev-friendly-title h2 { margin: 1px 0 0; font-size: 21px; line-height: 1.15; }
.rev-friendly-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.rev-friendly-title .eyebrow, .rev-editor-head .eyebrow { margin: 0 0 4px; color: #8a6413; font-size: 9px; font-weight: 850;
  letter-spacing: .85px; text-transform: uppercase; }
.rev-cell-source { background: #161616; color: var(--gold); border-radius: 15px; padding: 5px 9px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.rev-kpi-panel, .rev-friendly-dashboard, .rev-friendly-table-panel { background: #fff; border: 1px solid #deded9; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.045); padding: 18px; }
.rev-friendly-dashboard, .rev-friendly-table-panel { margin-top: 16px; }
.rev-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 9px; margin-top: 14px; }
.rev-kpi-card { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #e1e1dc;
  border-radius: 9px; padding: 11px 12px; background: #fafaf8; }
.rev-kpi-card.primary { color: #fff; background: #171717; border-color: #171717; }
.rev-kpi-card span { font-size: 10.5px; line-height: 1.3; color: var(--muted); }
.rev-kpi-card.primary span { color: #ddd; }
.rev-kpi-card strong { margin: 7px 0; font-size: clamp(17px, 2vw, 23px); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.rev-kpi-card small { color: #999; font-size: 8.5px; text-transform: uppercase; letter-spacing: .4px; }
.rev-summary-head { align-items: center; }
.rev-summary-kpis { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rev-summary-kpis > div { min-width: 170px; border-left: 3px solid var(--gold); background: #faf7ef; border-radius: 5px; padding: 9px 11px; }
.rev-summary-kpis span { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .35px; }
.rev-summary-kpis strong { display: block; margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; }
.rev-month-grid { display: grid; grid-template-columns: repeat(12, minmax(66px, 1fr)); gap: 6px; margin: 17px 0 23px; }
.rev-month-card { position: relative; overflow: hidden; min-height: 84px; border: 1px solid #ddd; border-radius: 8px; background: #fff;
  color: var(--ink); padding: 9px 7px 12px; text-align: left; cursor: pointer; font-family: inherit; }
.rev-month-card:hover { border-color: #b68a2f; }
.rev-month-card.active { border-color: #111; box-shadow: inset 0 0 0 1px #111; background: #fffaf0; }
.rev-month-card span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.rev-month-card strong { display: block; margin-top: 5px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.rev-month-card i { position: absolute; left: 0; right: 0; bottom: 0; display: block; background: var(--gold); opacity: .55; }
.rev-month-card.active i { opacity: 1; }
.rev-editor-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; border-top: 1px solid #e6e4de; padding-top: 16px; }
.rev-editor-head h2 { margin: 0; font-size: 20px; }
.rev-editor-head > span { color: var(--muted); font-size: 10px; }
.rev-section-grid { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr; gap: 10px; margin-top: 11px; }
.rev-friendly-section { border: 1px solid #dfdfdb; border-radius: 9px; padding: 12px; background: #fafaf8; }
.rev-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.rev-section-head h3 { margin: 0; font-size: 12px; }
.rev-section-head strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.rev-friendly-field { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(92px, 130px); align-items: center; gap: 8px;
  border-top: 1px solid #e8e7e2; padding: 7px 0; position: relative; }
.rev-friendly-field > span { color: #555; font-size: 10.5px; line-height: 1.25; }
.rev-friendly-input { width: 100%; box-sizing: border-box; border: 1px solid #cfd2d6; border-radius: 6px; background: #fff;
  color: var(--ink); padding: 6px 7px; font: 650 11px/1.2 Inter, sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.rev-friendly-input:hover { border-color: #8da8c6; }
.rev-friendly-input:focus { border-color: #2b6cb0; box-shadow: 0 0 0 2px rgba(43,108,176,.16); outline: none; }
.rev-friendly-input.edited { border-color: #6d96c3; background: #f4f8fd; }
.rev-friendly-value { display: block; min-width: 70px; color: #222; font-size: 11px; font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums; }
.rev-friendly-value.formula { color: #5b6470; }
.rev-friendly-value.muted { color: #aaa; }
.rev-valuation-head { margin-top: 20px; align-items: end; }
.rev-valuation-head > strong { font-size: 20px; }
.rev-valuation-grid { grid-template-columns: repeat(2, 1fr); }
.rev-valuation-card .rev-friendly-field { grid-template-columns: 1fr 125px; }
.rev-table-title { align-items: end; }
.rev-table-search { min-width: min(290px, 40%); }
.rev-table-search span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.rev-table-search input { width: 100%; box-sizing: border-box; border: 1px solid #cfd2d6; border-radius: 7px; padding: 8px 9px; font: 11px Inter, sans-serif; }
.rev-table-search input:focus { outline: none; border-color: #2b6cb0; box-shadow: 0 0 0 2px rgba(43,108,176,.12); }
.rev-column-groups { display: flex; gap: 5px; margin: 14px 0 9px; flex-wrap: wrap; }
.rev-column-group { border: 1px solid #d6d6d2; border-radius: 16px; background: #fff; color: #555; padding: 5px 9px;
  font: 700 9.5px/1 Inter, sans-serif; cursor: pointer; }
.rev-column-group.active { border-color: #171717; background: #171717; color: #fff; }
.rev-friendly-table-wrap { max-height: 610px; overflow: auto; border: 1px solid #dcdcd7; border-radius: 8px; }
.rev-friendly-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10.5px; }
.rev-friendly-table th { position: sticky; top: 0; z-index: 3; min-width: 108px; max-width: 210px; background: #222; color: #fff;
  padding: 8px; text-align: left; vertical-align: bottom; font-size: 9px; line-height: 1.2; white-space: normal; }
.rev-friendly-table td { position: relative; min-width: 108px; max-width: 230px; height: 34px; padding: 4px 6px;
  border-right: 1px solid #e5e5e2; border-bottom: 1px solid #e5e5e2; background: #fff; }
.rev-friendly-table td:first-child, .rev-friendly-table th:first-child { position: sticky; left: 0; z-index: 2; min-width: 120px; }
.rev-friendly-table th:first-child { z-index: 4; }
.rev-friendly-table tr:nth-child(even) td { background: #fafaf8; }
.rev-friendly-table .rev-friendly-input { min-width: 94px; border-color: transparent; background: transparent; text-align: left; font-size: 10.5px; }
.rev-friendly-table .rev-friendly-input:focus { border-color: #2b6cb0; background: #fff; }
.rev-friendly-table .rev-friendly-value { min-width: 94px; overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: nowrap; }
.rev-friendly-table .formula { background-color: #f3f4f5; }
.rev-friendly-table tr.rev-friendly-total td { background: #fff4d8; font-weight: 800; }
.rev-friendly-table tr.rev-friendly-section-row td { border-top: 2px solid #9e7b2c; background: #f8f3e7; font-weight: 800; }
.rev-sheet-kpis { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 7px; margin-top: 14px; }
.rev-sheet-kpis > div { border: 1px solid #e2dfd6; border-radius: 7px; background: #fffcf4; padding: 8px 9px; }
.rev-sheet-kpis span { display: block; min-height: 25px; color: var(--muted); font-size: 9px; line-height: 1.25; }
.rev-sheet-kpis strong { display: block; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rev-filter-empty { padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
@media (max-width: 1000px) {
  .rev-toolbar { flex-direction: column; }
  .rev-actions { justify-content: flex-start; }
  .rev-plan-stats { grid-template-columns: repeat(2, 1fr); }
  .rev-grid-wrap { max-height: calc(100vh - 340px); }
  .rev-grid-wrap.rev-friendly-wrap { max-height: none; }
  .rev-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .rev-month-grid { grid-template-columns: repeat(6, 1fr); }
  .rev-section-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .rev-friendly { padding: 10px; }
  .rev-view-modes, .rev-friendly-title, .rev-summary-head, .rev-editor-head { align-items: stretch; flex-direction: column; }
  .rev-view-caption { display: none; }
  .rev-kpi-grid, .rev-sheet-kpis, .rev-valuation-grid { grid-template-columns: 1fr; }
  .rev-month-grid { grid-template-columns: repeat(3, 1fr); }
  .rev-summary-kpis { justify-content: stretch; }
  .rev-summary-kpis > div, .rev-table-search { width: 100%; min-width: 0; max-width: none; }
}

/* Structured Revenue dashboard */
#view-revenue { max-width: 1800px; margin: 0 auto; }
.rd-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.rd-page-head h1 { margin: 2px 0 4px; font-size: 30px; line-height: 1.1; letter-spacing: -.75px; }
.rd-page-head .lede { max-width: 720px; margin: 0; }
.rd-eyebrow { margin: 0 0 3px; color: #96630a; font-size: 9px; font-weight: 850; letter-spacing: .9px; text-transform: uppercase; }
.rd-actions { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rd-date-field, .rd-group-field { display: flex; flex-direction: column; gap: 4px; }
.rd-date-field span, .rd-group-field span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .35px; text-transform: uppercase; }
.rd-date-field input, .rd-group-field select { min-height: 35px; border: 1px solid #cfd3d8; border-radius: 6px; background: #fff; padding: 7px 9px; color: var(--ink); font: 650 11px Inter, sans-serif; }
.rd-link-button { display: inline-flex; align-items: center; min-height: 35px; text-decoration: none; }
#rd-status { min-height: 22px; }
.rd-source-strip { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(250px, 1fr) auto; gap: 0; margin-bottom: 13px; border: 1px solid #dadddf; border-radius: 9px; background: #fff; overflow: hidden; }
.rd-source-strip > div { min-width: 0; padding: 10px 13px; border-right: 1px solid #e6e8ea; }
.rd-source-strip > div:last-child { border: 0; }
.rd-source-strip span { display: inline-block; margin-right: 7px; border-radius: 10px; padding: 2px 6px; font-size: 8px; font-weight: 850; letter-spacing: .35px; text-transform: uppercase; }
.rd-source-strip .rd-lock { color: #4b5563; background: #eceff2; }
.rd-source-strip .rd-live { color: #1f6746; background: #dff1e7; }
.rd-source-strip strong { display: inline; font-size: 11px; }
.rd-source-strip small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rd-source-links { display: flex; align-items: center; gap: 8px; }
.rd-source-links a { white-space: nowrap; color: #705114; font-size: 10px; font-weight: 750; }

.rd-kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 8px; }
.rd-kpi { position: relative; display: flex; min-height: 104px; flex-direction: column; justify-content: space-between; border: 1px solid #dedfdd; border-top: 3px solid #b8bcc1; border-radius: 8px; background: #fff; padding: 10px 11px; box-shadow: 0 2px 8px rgba(24, 24, 24, .035); }
.rd-kpi.primary { border-color: #171717; background: #171717; color: #fff; }
.rd-kpi.overridden { border-color: #c7942f; box-shadow: inset 0 0 0 1px #e8c77f; }
.rd-kpi.positive { border-top-color: #27744f; }
.rd-kpi.negative { border-top-color: #b5453c; }
.rd-kpi > span { min-height: 29px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.rd-kpi.primary > span { color: #d6d6d6; }
.rd-kpi strong { margin: 5px 0; font-size: clamp(15px, 1.55vw, 21px); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.rd-kpi.positive strong, .rd-table .positive, .rd-plan-table .positive,
.rd-market-row .positive, .rd-plan-summary .positive { color: #27744f !important; }
.rd-kpi.negative strong, .rd-table .negative, .rd-plan-table .negative,
.rd-market-row .negative, .rd-plan-summary .negative { color: #b5453c !important; }
.rd-kpi.primary strong { color: #fff !important; }
.rd-kpi small { color: #91959b; font-size: 8.5px; line-height: 1.25; }
.rd-kpi-edit { position: absolute; top: 7px; right: 7px; border: 1px solid #d2d5d8; border-radius: 11px; background: #fff; color: #6a7077; padding: 2px 7px; font: 750 7.5px Inter, sans-serif; cursor: pointer; text-transform: uppercase; }
.rd-kpi-edit:hover { border-color: #a97b21; color: #765313; }
.rd-kpi.primary .rd-kpi-edit { border-color: #555; background: #292929; color: #ddd; }
.rd-kpi-editor { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(240px, .55fr) auto; align-items: end; gap: 18px; margin: 10px 0; border: 1px solid #c99a3d; border-left: 4px solid #b47c14; border-radius: 8px; background: #fffcf4; padding: 13px 14px; }
.rd-kpi-editor[hidden] { display: none; }
.rd-kpi-editor h3 { margin: 0; font-size: 15px; }
.rd-kpi-editor p:not(.rd-eyebrow) { margin: 3px 0 0; max-width: 650px; color: var(--muted); font-size: 9px; }
.rd-kpi-editor > label { display: flex; flex-direction: column; gap: 3px; }
.rd-kpi-editor > label > span { color: var(--muted); font-size: 8.5px; font-weight: 750; text-transform: uppercase; }
.rd-kpi-editor > label > small { color: var(--muted); font-size: 8px; }
.rd-kpi-input { position: relative; }
.rd-kpi-input i { position: absolute; left: 9px; top: 8px; color: #6f7479; font-size: 10px; font-style: normal; }
.rd-kpi-input input { width: 100%; border: 1px solid #c8ccd0; border-radius: 6px; background: #fff; padding: 7px 8px 7px 20px; font: 750 11px Inter, sans-serif; text-align: right; }
.rd-kpi-input input:focus { border-color: #9c7528; outline: none; box-shadow: 0 0 0 2px rgba(156, 117, 40, .12); }
.rd-kpi-editor-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.rd-audit { margin: 10px 0; }
.rd-audit-card { border: 1px solid #dfd5b8; border-radius: 9px; background: #fffdf7; }
.rd-audit-card > summary { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; list-style: none; }
.rd-audit-card > summary::-webkit-details-marker { display: none; }
.rd-audit-card > summary strong { font-size: 11px; }
.rd-audit-card > summary > span:last-child { color: var(--muted); font-size: 10px; }
.rd-audit-mark { border-radius: 12px; padding: 3px 7px; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.rd-audit-mark.warn { color: #7a5308; background: #f8e7b9; }
.rd-audit-mark.clean { color: #1f6746; background: #dff1e7; }
.rd-audit-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #eee5ce; }
.rd-audit-grid > div { padding: 11px 12px; border-right: 1px solid #eee5ce; }
.rd-audit-grid > div:last-child { border: 0; }
.rd-audit-grid span { display: block; color: var(--muted); font-size: 8.5px; font-weight: 750; text-transform: uppercase; }
.rd-audit-grid strong { display: block; margin-top: 4px; font-size: 12px; }
.rd-audit-grid p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.rd-audit-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 0 12px 12px; }
.rd-audit-details details { border: 1px solid #e5dfcf; border-radius: 6px; background: #fff; padding: 7px 8px; }
.rd-audit-details summary { cursor: pointer; font-size: 9.5px; font-weight: 750; }
.rd-audit-details ul { max-height: 155px; overflow: auto; margin: 7px 0 0; padding-left: 17px; color: #555; font-size: 9px; }
.rd-audit-details p { margin: 6px 0 0; color: var(--muted); font-size: 9px; }

.rd-panel { border: 1px solid #dcdfdf; border-radius: 10px; background: #fff; box-shadow: 0 2px 9px rgba(20, 20, 20, .04); }
.rd-filter-panel { margin: 10px 0; padding: 13px; }
.rd-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.rd-panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.rd-panel-head p:not(.rd-eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; }
.rd-filters { display: grid; grid-template-columns: minmax(210px, 1.4fr) repeat(6, minmax(125px, 1fr)); gap: 7px; margin-top: 10px; }
.rd-filters label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.rd-filters label > span { color: var(--muted); font-size: 8.5px; font-weight: 750; letter-spacing: .25px; text-transform: uppercase; }
.rd-filters input, .rd-filters select { min-width: 0; width: 100%; border: 1px solid #d2d5d8; border-radius: 6px; background: #fff; padding: 7px 8px; color: #303236; font: 10px Inter, sans-serif; }
.rd-filters input:focus, .rd-filters select:focus { border-color: #9c7528; outline: none; box-shadow: 0 0 0 2px rgba(156, 117, 40, .12); }

.rd-plan-panel { margin: 10px 0; padding: 14px 14px 0; overflow: hidden; }
.rd-plan-head { align-items: flex-end; }
.rd-plan-tabs { display: inline-flex; border: 1px solid #cfd2d5; border-radius: 7px; background: #f0f1f2; padding: 3px; }
.rd-plan-tabs button { border: 0; border-radius: 5px; background: transparent; padding: 7px 11px; color: var(--muted); font: 750 9.5px Inter, sans-serif; cursor: pointer; }
.rd-plan-tabs button.active { background: #1d1e20; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.rd-plan-controls { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(220px, 1fr) 115px minmax(180px, .8fr) auto minmax(230px, 1fr); align-items: end; gap: 8px; margin-top: 12px; border: 1px solid #e0e1df; border-radius: 8px; background: #fafaf8; padding: 10px; }
.rd-plan-controls > label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.rd-plan-controls > label > span { color: var(--muted); font-size: 8.5px; font-weight: 750; letter-spacing: .3px; text-transform: uppercase; }
.rd-plan-controls select, .rd-plan-controls input { width: 100%; min-height: 34px; border: 1px solid #cfd2d5; border-radius: 6px; background: #fff; padding: 7px 8px; color: var(--ink); font: 10px Inter, sans-serif; }
.rd-percent-input { position: relative; }
.rd-percent-input input { padding-right: 26px; }
.rd-percent-input i { position: absolute; right: 9px; top: 9px; color: var(--muted); font-size: 10px; font-style: normal; }
.rd-plan-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 36px; border-left: 3px solid #b8892d; padding-left: 10px; }
.rd-plan-summary span { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.rd-plan-summary strong { grid-row: span 2; font-size: 17px; font-variant-numeric: tabular-nums; }
.rd-plan-summary em { color: var(--muted); font-size: 8.5px; font-style: normal; }
.rd-plan-table-wrap { width: calc(100% + 28px); max-height: 410px; overflow: auto; margin: 12px -14px 0; border-top: 1px solid #d5d7d8; }
.rd-plan-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: 9px; }
.rd-plan-table th { position: sticky; top: 0; z-index: 3; background: #34373a; color: #fff; padding: 8px; text-align: left; font-size: 8.5px; }
.rd-plan-table td { height: 38px; border-right: 1px solid #e3e5e6; border-bottom: 1px solid #e3e5e6; background: #fff; padding: 5px 8px; }
.rd-plan-table tr:nth-child(even) td { background: #fafafa; }
.rd-plan-table td strong { display: block; }
.rd-plan-table td span { display: block; max-width: 240px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.rd-plan-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rd-plan-input { position: relative; min-width: 115px; }
.rd-plan-input i { position: absolute; left: 8px; top: 7px; color: #73777c; font-size: 9px; font-style: normal; }
.rd-plan-input input { width: 100%; border: 1px solid #cfd3d6; border-radius: 5px; background: #fff; padding: 5px 6px 5px 18px; color: var(--ink); font: 700 9.5px Inter, sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.rd-plan-input input:focus { border-color: #9c7528; outline: none; box-shadow: 0 0 0 2px rgba(156, 117, 40, .12); }

.rd-chart-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .7fr); gap: 10px; margin: 10px 0; }
.rd-chart-grid .rd-panel { padding: 14px; }
.rd-chart-legend { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; }
.rd-chart-legend i { display: inline-block; width: 13px; height: 4px; margin-left: 5px; border-radius: 2px; }
.rd-chart-legend .budget, .rd-bars .budget { background: #d4d6d8; }
.rd-chart-legend .forecast, .rd-bars .forecast { background: #bf8b26; }
.rd-market-rows { margin-top: 13px; }
.rd-market-row { display: grid; grid-template-columns: minmax(95px, 160px) minmax(140px, 1fr) 85px; align-items: center; gap: 8px; min-height: 24px; }
.rd-market-row > span { overflow: hidden; color: #4c5055; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rd-market-row > strong { text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
.rd-bars { display: flex; flex-direction: column; gap: 2px; }
.rd-bars i { display: block; height: 5px; border-radius: 1px 3px 3px 1px; }
.rd-donut-row { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 190px; }
.rd-donut { display: grid; width: 128px; height: 128px; place-items: center; border-radius: 50%; }
.rd-donut > div { display: flex; width: 82px; height: 82px; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; background: #fff; }
.rd-donut strong { font-size: 23px; line-height: 1; }
.rd-donut span { margin-top: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.rd-donut-legend { min-width: 145px; }
.rd-donut-legend > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #eceeef; font-size: 9px; }
.rd-donut-legend i { width: 7px; height: 7px; border-radius: 50%; }
.rd-donut-legend .d0 { background: #27744f; }.rd-donut-legend .d1 { background: #c99a2e; }.rd-donut-legend .d2 { background: #b5453c; }
.rd-donut-legend strong { font-size: 11px; }
.rd-net-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #e4e6e7; }
.rd-net-strip span { padding: 9px 7px 0; color: var(--muted); font-size: 8.5px; }
.rd-net-strip strong { display: block; margin-top: 2px; color: var(--ink); font-size: 11px; }

.rd-table-panel { margin-top: 10px; padding: 14px 14px 0; overflow: hidden; }
.rd-table-controls { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rd-table-controls .rd-group-field:first-child select { min-width: 220px; }
.rd-table-wrap { width: calc(100% + 28px); max-height: 690px; overflow: auto; margin: 12px -14px 0; border-top: 1px solid #cfd2d4; }
.rd-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 9px; }
.rd-table th { position: sticky; top: 24px; z-index: 5; min-width: 105px; max-width: 170px; height: 37px; padding: 6px 7px; border-right: 1px solid #41454a; border-bottom: 1px solid #41454a; background: #292c30; color: #fff; text-align: left; line-height: 1.2; white-space: normal; }
.rd-table .rd-super-head th { top: 0; height: 24px; border-right: 1px solid #d7b971; border-bottom: 1px solid #d7b971; background: #8c671f; color: #fff; font-size: 8px; letter-spacing: .35px; text-align: center; text-transform: uppercase; }
.rd-table td { min-width: 105px; max-width: 190px; height: 38px; padding: 5px 7px; border-right: 1px solid #e3e5e6; border-bottom: 1px solid #e3e5e6; background: #fff; vertical-align: middle; }
.rd-table tbody tr:nth-child(even):not(.rd-group-row) td { background: #fafafa; }
.rd-table td strong { display: block; font-size: 9.5px; }
.rd-table td > span { display: block; overflow: hidden; margin-top: 1px; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.rd-table td em { display: inline-block; margin-top: 2px; border-radius: 8px; background: #f5d9d6; color: #8d3029; padding: 1px 5px; font-size: 7px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.rd-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-table .strong { font-weight: 800; }
.rd-table th.rd-sticky, .rd-table td.rd-sticky { position: sticky; left: 0; min-width: 145px; max-width: 205px; }
.rd-table th.rd-sticky { z-index: 7; }
.rd-table td.rd-sticky { z-index: 2; }
.rd-table .rd-group-row td { height: 31px; border-bottom-color: #d5c59e; background: #f7f1e3; font-weight: 750; }
.rd-table .rd-group-row td:first-child { position: static; }
.rd-table .rd-group-row td strong { display: inline; }
.rd-table .rd-group-row td span { display: inline; margin-left: 6px; }
.rd-table .rd-unmatched td { background: #fff8f7 !important; }
.rd-empty { padding: 24px !important; color: var(--muted); text-align: center !important; }
.rd-footnote { padding: 9px 2px; color: var(--muted); font-size: 9px; }

@media (max-width: 1250px) {
  .rd-kpis { grid-template-columns: repeat(3, 1fr); }
  .rd-filters { grid-template-columns: repeat(4, 1fr); }
  .rd-search { grid-column: span 2; }
  .rd-audit-grid, .rd-audit-details { grid-template-columns: repeat(2, 1fr); }
  .rd-plan-controls { grid-template-columns: 1fr 130px auto; }
  .rd-plan-summary { grid-column: 1 / -1; }
  .rd-kpi-editor { grid-template-columns: 1fr 260px; }
  .rd-kpi-editor-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 850px) {
  .rd-page-head { align-items: stretch; flex-direction: column; }
  .rd-actions { justify-content: flex-start; }
  .rd-source-strip { grid-template-columns: 1fr; }
  .rd-source-strip > div { border-right: 0; border-bottom: 1px solid #e6e8ea; }
  .rd-kpis { grid-template-columns: repeat(2, 1fr); }
  .rd-chart-grid { grid-template-columns: 1fr; }
  .rd-filters { grid-template-columns: repeat(2, 1fr); }
  .rd-plan-head { align-items: stretch; }
}
@media (max-width: 540px) {
  .rd-actions > *, .rd-date-field { width: 100%; }
  .rd-kpis, .rd-filters, .rd-audit-grid, .rd-audit-details { grid-template-columns: 1fr; }
  .rd-search { grid-column: auto; }
  .rd-panel-head { align-items: stretch; flex-direction: column; }
  .rd-market-row { grid-template-columns: 90px 1fr 70px; }
  .rd-plan-controls { grid-template-columns: 1fr; }
  .rd-plan-summary { grid-column: auto; }
  .rd-kpi-editor { grid-template-columns: 1fr; }
  .rd-kpi-editor-actions { grid-column: auto; }
}

/* Insurance policy register */
#view-insurance { max-width: 1800px; margin: 0 auto; }
.ins-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 8px; }
.ins-head h1 { margin: 2px 0 4px; font-size: 30px; line-height: 1.1; letter-spacing: -.75px; }
.ins-head .lede { max-width: 780px; margin: 0; }
.ins-eyebrow { margin: 0 0 3px; color: #96630a; font-size: 9px; font-weight: 850; letter-spacing: .9px; text-transform: uppercase; }
.ins-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#ins-status { min-height: 22px; }
.ins-kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ins-kpi { display: flex; min-height: 100px; flex-direction: column; justify-content: space-between; border: 1px solid #dedfdd; border-top: 3px solid #b8bcc1; border-radius: 8px; background: #fff; padding: 11px 12px; box-shadow: 0 2px 8px rgba(24,24,24,.035); }
.ins-kpi.primary { border-color: #171717; background: #171717; color: #fff; }
.ins-kpi.warn { border-top-color: #bd8420; }
.ins-kpi.danger { border-top-color: #b5453c; }
.ins-kpi > span { color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.ins-kpi.primary > span { color: #d6d6d6; }
.ins-kpi strong { margin: 6px 0; font-size: clamp(17px, 1.6vw, 23px); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.ins-kpi small { color: #91959b; font-size: 8.5px; line-height: 1.25; }
.ins-panel { overflow: hidden; border: 1px solid #dcdfdf; border-radius: 10px; background: #fff; box-shadow: 0 2px 9px rgba(20,20,20,.04); }
.ins-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px; }
.ins-panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.ins-panel-head p:not(.ins-eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; }
.ins-filters { display: grid; grid-template-columns: minmax(250px, 1.6fr) repeat(4, minmax(135px, 1fr)); gap: 8px; padding: 0 14px 14px; }
.ins-filters label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.ins-filters label > span { color: var(--muted); font-size: 8.5px; font-weight: 750; letter-spacing: .25px; text-transform: uppercase; }
.ins-filters input, .ins-filters select { min-width: 0; width: 100%; border: 1px solid #d2d5d8; border-radius: 6px; background: #fff; padding: 7px 8px; color: #303236; font: 10px Inter, sans-serif; }
.ins-filters input:focus, .ins-filters select:focus { border-color: #9c7528; outline: none; box-shadow: 0 0 0 2px rgba(156,117,40,.12); }
.ins-table-wrap { max-height: 680px; overflow: auto; border-top: 1px solid #cfd2d4; }
.ins-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 9px; }
.ins-table th { position: sticky; top: 0; z-index: 3; min-width: 115px; max-width: 190px; height: 38px; padding: 7px 8px; border-right: 1px solid #41454a; background: #292c30; color: #fff; text-align: left; line-height: 1.2; }
.ins-table th.num, .ins-table td.num { text-align: right; }
.ins-table td { min-width: 115px; max-width: 230px; height: 48px; padding: 7px 8px; border-right: 1px solid #e3e5e6; border-bottom: 1px solid #e3e5e6; background: #fff; vertical-align: middle; }
.ins-table tbody tr { cursor: pointer; }
.ins-table tbody tr:nth-child(even) td { background: #fafafa; }
.ins-table tbody tr:hover td { background: #fff9ed; }
.ins-table td strong { display: block; font-size: 9.5px; line-height: 1.35; }
.ins-table td > span:not(.ins-renewal):not(.ins-missing) { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ins-policy-cell { min-width: 180px !important; }
.ins-tags { display: flex; max-width: 220px; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.ins-tag { display: inline-block; border-radius: 9px; background: #eef0f2; color: #555d65; padding: 2px 6px; font-size: 7.5px; line-height: 1.25; }
.ins-empty { color: var(--muted); }
.ins-renewal { display: inline-block; margin-top: 4px; border-radius: 10px; padding: 2px 6px; font-size: 7.5px; font-weight: 800; }
.ins-renewal.good { background: #dff1e7; color: #1f6746; }
.ins-renewal.warn { background: #f8e7b9; color: #7a5308; }
.ins-renewal.danger { background: #f5d9d6; color: #8d3029; }
.ins-renewal.muted { background: #eceff2; color: #626a72; }
.ins-doc-cell a { color: #765313; font-weight: 750; text-decoration: none; }
.ins-doc-cell a:hover { text-decoration: underline; }
.ins-missing { display: inline-block; border-radius: 9px; background: #f5d9d6; color: #8d3029; padding: 2px 6px; font-size: 7.5px; font-weight: 800; }
.ins-edit { padding: 5px 9px !important; }
.ins-blank { display: flex; min-height: 180px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: var(--muted); }
.ins-blank strong { color: var(--ink); font-size: 13px; }
.ins-footnote { padding: 9px 2px; color: var(--muted); font-size: 9px; }
.ins-form { min-width: min(760px, 82vw); }
.ins-form section { margin: 0 0 16px; }
.ins-form section h4 { margin: 0 0 8px; border-bottom: 1px solid #e3e5e6; padding-bottom: 5px; color: #79591b; font-size: 9px; letter-spacing: .7px; text-transform: uppercase; }
.ins-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
.ins-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ins-form-grid label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.ins-form-grid label > span { color: var(--muted); font-size: 8.5px; font-weight: 750; text-transform: uppercase; }
.ins-form-grid label > span i { margin-left: 4px; color: #a1473f; font-size: 7px; font-style: normal; }
.ins-form-grid input, .ins-form-grid select, .ins-form-grid textarea { width: 100%; border: 1px solid #cfd2d5; border-radius: 6px; background: #fff; padding: 8px 9px; color: var(--ink); font: 10px Inter, sans-serif; }
.ins-form-grid textarea { min-height: 70px; resize: vertical; }
.ins-form-grid input:focus, .ins-form-grid select:focus, .ins-form-grid textarea:focus { border-color: #9c7528; outline: none; box-shadow: 0 0 0 2px rgba(156,117,40,.12); }
.ins-form-wide { grid-column: 1 / -1; }
.ins-form-actions { display: grid; grid-template-columns: 1fr minmax(100px, auto) auto auto; align-items: center; gap: 8px; border-top: 1px solid #dedfdf; padding-top: 13px; }
.ins-delete { border-color: #d7aaa6 !important; color: #9b3e36 !important; justify-self: start; }

@media (max-width: 1100px) {
  .ins-kpis { grid-template-columns: repeat(3, 1fr); }
  .ins-filters { grid-template-columns: repeat(3, 1fr); }
  .ins-search { grid-column: span 2; }
}
@media (max-width: 700px) {
  .ins-head { align-items: stretch; flex-direction: column; }
  .ins-kpis, .ins-filters, .ins-form-grid, .ins-form-grid-3 { grid-template-columns: 1fr; }
  .ins-search, .ins-form-wide { grid-column: auto; }
  .ins-panel-head { align-items: stretch; flex-direction: column; }
  .ins-form { min-width: 0; }
  .ins-form-actions { grid-template-columns: 1fr 1fr; }
}
