/* GenMarket Monitor — flat design, no gradients/shadows. */

:root {
  --navy: #1A3A5C;
  --navy-dark: #102740;
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #1F2937;
  --muted: #6B7280;
  --blue: #2563EB;
  --amber: #D97706;
  --green: #059669;
  --red: #DC2626;
  --pink: #DB2777;
  --purple: #7C3AED;
  --gray: #9CA3AF;
  --gold: #C6A15B;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Elton's ruling 2026-09-29: no company logo in the app — the title alone, centred
   (symmetric padding so the centring is true). */
.ronn-topbar { background: linear-gradient(180deg, #bccaee, #9fb5e2); border-top: 4px solid #0d1f9c; padding: 0 24px; position: sticky; top: 0; z-index: 101; box-shadow: 0 2px 4px rgba(0,0,0,0.06); }
.ronn-topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 88px; }
.ronn-product { order: 1; flex: 1; text-align: center; font-family: 'Saira Condensed', Arial, sans-serif; font-weight: 800; letter-spacing: .04em; font-size: 40px; text-transform: uppercase; line-height: 1; color: #0a0c12; }
.ronn-product b { color: #0d1f9c; }
.ronn-product small { display: block; font-family: Arial, sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: .2em; color: #6a7180; margin-top: 6px; }
@media (max-width: 560px) {
  .ronn-topbar-inner { min-height: 64px; }
  .ronn-product { font-size: 30px; }
}
/* D6 — read-only signed-in identity, replacing the old Admin: OFF/ON toggle
   (.admin-btn, removed 2026-08-11 with the shared-PIN elevation flow). */
.ronn-topbar .whoami {
  position: absolute; top: 10px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #0a0c12;
}
.ronn-topbar .whoami:empty { display: none; }
.ronn-topbar .whoami .whoami-name { font-weight: 700; }
.ronn-topbar .whoami .whoami-tier {
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(13, 31, 156, 0.4);
  padding: 3px 8px; border-radius: 10px; font-weight: 600;
}
.ronn-topbar .whoami .whoami-signout {
  background: none; border: 1px solid rgba(13, 31, 156, 0.4); color: #0a0c12;
  padding: 4px 9px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600;
}
.ronn-topbar .whoami .whoami-signout:hover { background: rgba(255, 255, 255, 0.7); }

nav.tabs {
  background: #fff;
  border-top: 1px solid #dfe2ea;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0;
  padding: 0 20px;
}
nav.tabs button {
  background: none; border: none; padding: 14px 18px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent;
}
nav.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); }
nav.tabs button:hover:not(.active) { color: var(--text); }

/* Level-2 sub-tab bar (2026-05-29). Shares nav.tabs base (flex row + mobile
   horizontal-scroll); lighter background, smaller buttons, sits below the main
   bar. Admin-only sub-tabs reuse the existing .admin-only hide rules below. */
nav.tabs.sub-tabs { background: #f8fafc; border-top: none; }
nav.tabs.sub-tabs button { padding: 9px 16px; font-size: 12px; border-bottom-width: 2px; }
nav.tabs.sub-tabs:empty { display: none; }

/* Dashboard placeholder (Phase 4) */
.dashboard-placeholder { text-align: center; padding: 80px 20px; color: var(--muted); }
.dashboard-placeholder .dash-icon { font-size: 48px; line-height: 1; }
.dashboard-placeholder h2 { margin: 12px 0 4px; color: var(--text); font-size: 20px; }
.dashboard-placeholder p { font-size: 14px; }

main { padding: 18px 20px 40px 20px; max-width: 1280px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Stats bar ---------- */
/* .stats / .stat retained for Targets + Recipients tabs which still use the
   tile layout. The Listings tab now uses .stats-bar-compact (C9, below). */
.stats {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 14px;
}
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; text-align: center;
}
.stat .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat .value { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 4px; }
.stat .sublabel { font-size: 10px; color: var(--muted); margin-top: 2px; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* C9 compact stats bar — single line, navy background, dot separators */
.stats-bar-compact {
  background: var(--navy);
  color: #FFFFFF;
  padding: 6px 14px;
  max-height: 32px;
  line-height: 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.stats-bar-compact .metric { color: #FFFFFF; white-space: nowrap; }
.stats-bar-compact .metric strong { font-weight: 700; margin-right: 4px; }
.stats-bar-compact .sep { color: #B7C7DA; padding: 0 6px; }

/* Item 2 (2026-06-28) — compact stale indicator chip in the stats bar.
   Replaces the old full-width amber banner; subtle amber on the navy bar,
   clickable → stale-review view. (The enterStaleReview handler was deleted
   2026-08-28 as unreachable — the chip that called it was removed 2026-07-03,
   and this rule now styles an element nothing wires a click to.) */
.stats-bar-compact .metric.stale-chip {
  cursor: pointer;
  color: #FFE08A;
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 10px;
  padding: 0 8px;
  line-height: 16px;
}
.stats-bar-compact .metric.stale-chip strong { color: #FFD24D; }
.stats-bar-compact .metric.stale-chip:hover { background: rgba(245, 158, 11, 0.18); }
.stats-bar-compact .metric.stale-chip:focus-visible { outline: 2px solid #FFD24D; outline-offset: 1px; }

/* C9 stale alert banner — top of Listings tab when stale rows exist */
.stale-banner {
  background: #FFF3CD;
  border-bottom: 2px solid #F59E0B;
  color: #92400E;
  padding: 10px 16px;
  margin-bottom: 12px;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.stale-banner .msg { flex: 1; }
.stale-banner .msg strong { font-weight: 700; }
.stale-banner button { background: #92400E; color: #FFFFFF; border: none; padding: 5px 12px; border-radius: 3px; font-size: 12px; font-weight: 600; cursor: pointer; }
.stale-banner button.dismiss { background: transparent; color: #92400E; font-size: 18px; padding: 0 6px; line-height: 1; }
.stale-banner button.review-disabled { background: #D6C3A8; color: #7A6A4F; cursor: not-allowed; }
.stale-banner button:hover { opacity: 0.85; }
.stale-banner button.review-disabled:hover { opacity: 1; }

/* C9 stale badges on listing cards (extends .badge from below) */
.badge.b-stale-warning   { background: #FEF3C7; color: #78350F; }
.badge.b-stale-hold      { background: #FED7AA; color: #9A3412; }
.badge.b-stale-confirmed { background: #FEE2E2; color: #991B1B; }
.badge.b-stale-reviewed  { background: #E5E7EB; color: #1F2937; }

/* Cross-Marketplace Product-ID match (Sources tab soft-dedup queue) */
.badge.b-cross-marketplace { background: #CCFBF1; color: #115E59; }

/* W-1 dupes judge verdict badges (DeDupe pair/cluster cards) */
.badge.b-judge-same { background: #D1FAE5; color: #064E3B; }
.badge.b-judge-diff { background: #DBEAFE; color: #1E3A8A; }
.badge.b-judge-weak { background: #E5E7EB; color: #1F2937; }

/* C12 spec-sheet badges + key-specs panel (visible to all users) */
.spec-sheet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0 0; }
.badge.b-spec-s3      { background: #D1FAE5; color: #064E3B; }
.badge.b-spec-oem     { background: #DBEAFE; color: #1E3A8A; }
.badge.b-spec-request { background: #E5E7EB; color: #374151; }
/* Model Rating Bands (2026-05-25) — admin-only power-band warning, amber. */
.power-band-flag { margin: 6px 0 0 0; padding: 4px 10px; border-radius: 4px; background: #FEF3C7; color: #78350F; border: 1px solid #FCD34D; font-size: 12px; font-weight: 600; line-height: 1.4; }
.spec-btn { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px; border: 1px solid #d0d5dd; background: #fff; color: #1A3A5C; text-decoration: none; cursor: pointer; line-height: 1.6; }
.spec-btn:hover { background: #f3f5f8; }
.key-specs { margin: 6px 0 0 0; }
.key-specs-toggle { background: none; border: none; color: #1A3A5C; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.key-specs-toggle .ks-caret { font-size: 10px; }
.key-specs-panel { margin-top: 6px; padding: 8px 12px; background: #f7f9fb; border: 1px solid #e5e9ef; border-radius: 6px; font-size: 12px; max-width: 460px; }
.key-specs-panel .ks-row { padding: 2px 0; }
.key-specs-panel .ks-k { color: #6a7180; display: inline-block; min-width: 90px; }
.key-specs-panel .ks-v { color: #0a0c12; font-weight: 600; }

/* C9 admin stale action row on cards */
.stale-action-row {
  background: #FFFBEB;
  border-top: 1px solid #FBBF24;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 0 0 4px 4px;
  font-size: 12px;
  color: #78350F;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stale-action-row .label { flex: 1; min-width: 200px; font-weight: 600; }
.stale-action-row button { background: #FFFFFF; color: #92400E; border: 1px solid #F59E0B; padding: 4px 10px; border-radius: 3px; font-size: 11px; font-weight: 600; cursor: pointer; }
.stale-action-row button.danger { background: #FEE2E2; border-color: #DC2626; color: #991B1B; }
.stale-action-row button:hover { opacity: 0.85; }

/* C9 collapsible filter bar */
.filters-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.filters-toolbar .search-wrap { flex: 1; min-width: 200px; }
.filters-toolbar .search-wrap input[type="search"] {
  width: 100%;
  height: 38px !important;
  padding: 0 12px !important;
  font-size: 14px;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  outline: none;
}
.filters-toolbar .search-wrap input[type="search"]:focus {
  border-color: #93A8C4;
  box-shadow: 0 0 0 3px rgba(59, 96, 140, 0.12);
  outline: none;
}
.filters-toolbar .btn-filters-toggle {
  background: #FFFFFF; color: var(--navy); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.filters-toolbar .btn-filters-toggle:hover { background: #F3F4F6; }
.btn-report-missing {
  height: 38px;
  padding: 0 14px;
  box-sizing: border-box;
}
.filters-collapsible { display: none; }
.filters-collapsible.expanded { display: block; }

/* ---------- Filter bar ---------- */
.filters {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px; margin-bottom: 14px;
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filters-row > select {
  flex: 1 1 200px;
  max-width: 240px;
  min-width: 160px;
}

.filters-row .power-filter {
  flex: 0 1 auto;
}

.filters-row .actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.range-sep { font-size: 11px; color: var(--muted); padding: 0 2px; }
.filters input, .filters select {
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px;
  font-size: 13px; background: #fff; color: var(--text); width: 100%;
}
.filters .actions { display: flex; gap: 6px; }
button.btn {
  background: var(--navy); color: #fff; border: none; padding: 8px 14px;
  border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer;
}
button.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.btn.danger { background: var(--red); }
button.btn.amber { background: var(--amber); }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 800px) { .filters { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; display: flex; flex-direction: column;
}
.card.locked { border-left: 3px solid var(--amber); border-top-left-radius: 0; border-bottom-left-radius: 0; }

.card-head { display: flex; justify-content: space-between; gap: 12px; }
.card-head .title { font-weight: 700; font-size: 15px; }
.card-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head .price { text-align: right; white-space: nowrap; }
.card-head .price .pu { font-weight: 700; font-size: 15px; }
.card-head .price .cost { font-size: 11px; color: var(--muted); }
.card-head .price .ext { font-size: 11px; color: var(--muted); }

/* Pricing benchmark display */
.price-no-ask { color: var(--text-secondary, #6b7280); font-style: italic; }

.card-head .price .price-ref { white-space: normal; max-width: 300px; margin-left: auto; }
.card-head .price .price-ref-row { justify-content: flex-end; }

/* R14 v1 (2026-10-12): what the price covers; the unknown wording neutral grey (R-14-6a). */
.price-covers { font-size: 11px; color: var(--text, #111827); margin-top: 4px; }
.price-covers-unknown { color: var(--text-secondary, #6b7280); font-style: italic; }

/* Price benchmark S1 (2026-10-13, R9): "Typical asking price". above = amber;
   within / below = neutral; verify = the verify badge colours; never green. */
.price-ref { margin-top: 5px; }
.price-ref-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.price-ref-pill { font-size: 10px; font-weight: 600; padding: 1px 7px;
  border-radius: 20px; white-space: nowrap; }
.price-ref-pill.pr-within,
.price-ref-pill.pr-below  { background: #F0F4F8; color: #4A5568; }
.price-ref-pill.pr-above  { background: #FDF3E1; color: #8A5A00; }
.price-ref-pill.pr-verify { background: #FFF4E5; color: #9A4A00; border: 1px solid #F0B46A; }
.price-ref-pill.pr-none   { background: #F3F4F6; color: #6B7280; font-weight: 500; }
.price-ref-age { font-size: 10px; color: var(--text-secondary, #6b7280); }
.price-ref-range, .price-ref-quote { font-size: 10px; color: var(--text-secondary, #6b7280); margin-top: 2px; }
.rollup-n { font-size: 10px; color: var(--text-secondary, #6b7280); }

.badges { margin-top: 8px; line-height: 1.7; }
.badge {
  display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0;
  font-size: 11px; font-weight: 600; border-radius: 4px;
  background: #E5E7EB; color: var(--text);
}
.badge.b-type-natural-gas-turbine    { background: #FEF3C7; color: #78350F; }
.badge.b-type-combined-cycle--hrsg   { background: #FCE7F3; color: #831843; }
.badge.b-type-reciprocating-generator{ background: #D1FAE5; color: #064E3B; }
.badge.b-type-hybrid-ng-h2           { background: #EDE9FE; color: #4C1D95; }
.badge.b-type-steam-turbine          { background: #DBEAFE; color: #1E3A8A; }
.badge.b-type-hydrogen-generator     { background: #DBEAFE; color: #1E3A8A; }
.badge.b-type-diesel-generator       { background: #D1FAE5; color: #064E3B; }
.badge.b-cycle-sc  { background: #D1FAE5; color: #064E3B; }
.badge.b-cycle-cc  { background: #FCE7F3; color: #831843; }
.badge.b-cycle-chp { background: #E5E7EB; color: #1F2937; }
.badge.b-cond-new         { background: #D1FAE5; color: #064E3B; }
.badge.b-cond-surplus     { background: #FEF3C7; color: #78350F; }
.badge.b-cond-used        { background: #E5E7EB; color: #1F2937; }
.badge.b-cond-refurbished { background: #DBEAFE; color: #1E3A8A; }
.badge.b-avail-immediate  { background: #D1FAE5; color: #064E3B; }
.badge.b-status-new                { background: #DBEAFE; color: #1E3A8A; }
.badge.b-status-possible-duplicate { background: #FEF3C7; color: #78350F; }
.badge.b-locked                    { background: #FEF3C7; color: #78350F; }
.badge.b-pinned                    { background: #E0E7FF; color: #3730A3; }
/* Administration ▸ Users account status (AUTH-2A) */
.badge.b-user-active               { background: #D1FAE5; color: #064E3B; }
.badge.b-user-inactive             { background: #E5E7EB; color: #1F2937; }
.badge.b-user-pending              { background: #FEF3C7; color: #78350F; }
/* Communications ▸ Contacts (CRM Phase A). The Shared badge states a
   VISIBILITY fact, not a status — a supply contact is readable by every
   signed-in person — so it deliberately borrows the same green as the other
   "open / available" badges rather than inventing a colour. */
.badge.b-contact-shared            { background: #D1FAE5; color: #064E3B; }
.badge.b-contact-buyer             { background: #DBEAFE; color: #1E3A8A; }
.muted-sm                          { color: var(--muted); font-size: 12px; }
.cd-row    { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid #EEF1F4; }
.cd-row:last-child { border-bottom: 0; }
.cd-label  { flex: 0 0 92px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.cd-value  { flex: 1; font-size: 14px; word-break: break-word; }
.badge.b-draft-pending             { background: #FEF3C7; color: #78350F; }
.badge.b-draft-approved            { background: #BBF7D0; color: #14532D; }
.badge.b-draft-edited              { background: #DBEAFE; color: #1E3A8A; }
.badge.b-draft-sent                { background: #D1FAE5; color: #064E3B; }
.badge.b-draft-dismissed           { background: #E5E7EB; color: #6B7280; }
.badge.b-fob              { background: #EDE9FE; color: #4C1D95; }
.badge.b-exw              { background: #E5E7EB; color: #1F2937; }
.badge.b-stype-oem        { background: #DBEAFE; color: #1E3A8A; }
.badge.b-stype-broker     { background: #EDE9FE; color: #4C1D95; }
.badge.b-stype-dealer     { background: #CCFBF1; color: #115E59; }
.badge.b-stype-marketplace{ background: #FEF3C7; color: #78350F; }
.badge.b-stype-owner-operator { background: #D1FAE5; color: #064E3B; }
.badge.b-stype-auction    { background: #FEE2E2; color: #991B1B; }
.badge.b-stype-government { background: #E5E7EB; color: #1F2937; }
.badge.b-stype-unknown    { background: #F3F4F6; color: #6B7280; }

/* Equipment category badges — small chips on listing cards.
   Distinct from type so a turbine listing reads "Natural Gas Turbine" + "Gas turbine"
   side-by-side without confusion. */
.badge.b-cat-gas-turbine          { background: #FEF3C7; color: #78350F; }
.badge.b-cat-steam-turbine        { background: #DBEAFE; color: #1E3A8A; }
.badge.b-cat-reciprocating-engine { background: #D1FAE5; color: #064E3B; }
.badge.b-cat-generator-only       { background: #CCFBF1; color: #115E59; }
.badge.b-cat-hrsg                 { background: #FCE7F3; color: #831843; }
.badge.b-cat-complete-plant       { background: #EDE9FE; color: #4C1D95; }
.badge.b-cat-hybrid-system        { background: #E0F2FE; color: #075985; }
.badge.b-cat-other                { background: #F3F4F6; color: #6B7280; }

/* Mounting — only Containerized is surfaced as a badge. */
.badge.b-mounting-containerized   { background: #E0E7FF; color: #3730A3; }

/* Market type — Primary dark green for new OEM, Secondary gray for used,
   Demo/Test blue for factory demo / low-hour units. */
.badge.b-market-primary    { background: #064E3B; color: #FFFFFF; }
.badge.b-market-secondary  { background: #E5E7EB; color: #1F2937; }
.badge.b-market-demo       { background: #DBEAFE; color: #1E3A8A; }

/* Unit type (Fix 8) — complete_unit green, component blue, unknown gray. */
.badge.b-utype-complete-unit { background: #D1FAE5; color: #064E3B; }
.badge.b-utype-component     { background: #DBEAFE; color: #1E3A8A; }
.badge.b-utype-unknown       { background: #F3F4F6; color: #6B7280; }

.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 14px; margin-top: 10px; }
.spec { font-size: 12px; }
.spec .k { color: var(--muted); }
.spec .v { font-weight: 600; }

.foot { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
.foot a, .foot span { color: var(--text); }
.notes { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 8px; }

/* Accuracy score badge — circular, top-right of card-head.
   Number lives INSIDE the colored circle (white, bold). Label lives OUTSIDE
   below the circle in body text — keeps the label readable on every fill color. */
.score-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-left: 12px; flex-shrink: 0;
}
.score-badge {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; line-height: 1;
}
.score-label {
  font-size: 11px; font-weight: 500; color: var(--text);
  margin-top: 4px; text-align: center; max-width: 80px;
}
.score-badge.tier-high       { background: #064E3B; }
.score-badge.tier-good       { background: #059669; }
.score-badge.tier-verify     { background: #D97706; }
.score-badge.tier-incomplete { background: #EA580C; }
.score-badge.tier-low        { background: #DC2626; }

/* Days on market + price arrow chips on the badges row */
/* D3 — negotiation leverage pill, warm ramp by score (3→5). Replaces the
   retired b-days-old "seller may be motivated" chip. */
.badge.b-leverage-3 { background: #FEF3C7; color: #78350F; }
.badge.b-leverage-4 { background: #FDE68A; color: #78350F; }
.badge.b-leverage-5 { background: #F59E0B; color: #FFFFFF; }
.badge.b-price-down { background: #D1FAE5; color: #064E3B; }
/* Ready to sell (2026-09-28): blank or non-50/60 frequency — confirm before quoting. */
.badge.b-verify-hz { background: #FEF3C7; color: #92400E; border: 1px solid #F59E0B; }
.badge.b-price-up   { background: #FEE2E2; color: #991B1B; }
.badge.b-price-flat { background: #E5E7EB; color: #6B7280; }

.card-actions { display: flex; gap: 6px; margin-top: 10px; }
.card-actions button { padding: 5px 10px; font-size: 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); background: #fff; }
.card-actions .lock { color: var(--amber); }
.card-actions .delete { color: var(--red); }

/* ---------- Forms (Add Listing) ---------- */
.form { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px; max-width: 980px; }
.form h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); margin: 18px 0 10px 0; }
.form h2:first-child { margin-top: 0; }
.form .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.form label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.form input, .form select, .form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; font-size: 13px; background: #fff;
}
.form textarea { min-height: 70px; resize: vertical; }
.form .field.required label::after { content: " *"; color: var(--red); }
/* Session C 3 — Signer section on Proposal Creation */
.pb-signer { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); }
.pb-signer > .field:first-child { grid-column: 1 / -1; }
.pb-signer-modes { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 4px; }
.pb-signer-modes label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; white-space: nowrap; }
/* signer-radio-label-wrap (2026-09-30): `.form input { width:100% }` above made
   each radio as wide as its label, squeezing the text to one word per line. */
.form .pb-signer-modes input[type="radio"] { width: auto; flex: 0 0 auto; margin: 0; padding: 0; }
/* Session E (2026-09-30) — Import from document panel (kill switch:
   GM_CONFIG.importEnabled). Imported inputs stay tinted until the rep edits them. */
.pb-import { background: #F5F8FF; border: 1px solid #C7D2FE; }
.pb-import-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.form .pb-import textarea { min-height: 64px; font-size: 12px; }
.pb-import-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pb-import-result { font-size: 12px; font-weight: 600; color: var(--text, #111827); }
.pb-import-low { font-size: 12px; color: #92400E; background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 4px; padding: 6px 10px; margin-top: 6px; line-height: 1.4; }
.form input.pb-imported, .form select.pb-imported { background: #EEF2FF; border-color: #A5B4FC; }
.form input.pb-imported-low, .form select.pb-imported-low { background: #FFFBEB; border-color: #FCD34D; }
.ppdf-prov-imported { background: #EEF2FF; color: #3730A3; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; border: 1px solid #C7D2FE; }
.pb-unit-imported-badge { flex-shrink: 0; }
.pb-inline-error { grid-column: 1 / -1; color: #991B1B; font-size: 12px; font-weight: 600; }
.form .form-actions { margin-top: 14px; display: flex; gap: 8px; }
.form .field.readonly input { background: #F3F4F6; color: var(--muted); }
.form .conv-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
/* Deal attribution fields (Deal Source + GMM Contribution Notes) */
.form .field-group { margin-bottom: 8px; }
.field-group > label .required { color: var(--red); font-weight: 600; }
.field-group > label .optional { color: var(--muted); font-weight: 400; font-size: 10px; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 700px) { .form .row { grid-template-columns: 1fr; } }

/* ---------- Upload ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 40px; text-align: center;
  background: #fff; color: var(--muted); cursor: pointer;
}
.dropzone.dragover { border-color: var(--blue); background: #EFF6FF; color: var(--text); }
.preview { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-top: 14px; }
.preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview th, .preview td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.preview th { background: #F9FAFB; font-weight: 600; }

/* ---------- Reports ---------- */
.report-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
.report-cols, .report-side {
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px;
}
.report-cols h3, .report-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); margin: 0 0 10px 0; }
.col-list { max-height: 400px; overflow: auto; }
.col-list label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.col-order { list-style: none; padding: 0; margin: 0 0 10px 0; }
.col-order li {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 4px; margin-bottom: 4px; font-size: 12px;
}
.col-order li button { padding: 2px 6px; font-size: 11px; border: 1px solid var(--border); background: #fff; border-radius: 3px; cursor: pointer; }
.report-filters .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.report-filters label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
.report-filters input, .report-filters select { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; font-size: 12px; }
.report-actions { display: flex; gap: 8px; margin-top: 12px; }
.report-output { margin-top: 14px; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: auto; max-height: 60vh; }
.report-output table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-output th, .report-output td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; white-space: nowrap; }
.report-output th { background: #F9FAFB; position: sticky; top: 0; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } }

/* ---------- Reports launcher (PART A/B rebuild) ---------- */
.report-intro {
  background: #EBF4FC; color: #33506B; border: 1px solid #CFE0F0;
  border-radius: 6px; padding: 9px 12px; font-size: 12px; line-height: 1.5; margin: 0 0 12px 0;
}
/* Compact two-step build instructions — kept tight (each step on its own line,
   minimal leading) so the block stays small. */
.report-intro-steps { display: block; line-height: 1.35; }
.report-intro-steps .ri-step { display: block; margin-top: 3px; }
.report-intro-steps .ri-step b { color: var(--navy, #1A3A5C); }
/* Collapsible analytics rollup (OEM / Region breakdown). */
.report-rollup .rollup-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 10px; cursor: pointer; background: #F9FAFB;
  border-bottom: 1px solid var(--border);
}
.report-rollup .rollup-meta { font-weight: 400; color: var(--muted); font-size: 12px; }
.report-rollup .rollup-actions { display: flex; align-items: center; gap: 8px; }
/* Print + collapse toggle are both .btn secondary (same prominent size). Give
   the toggle a stable min-width so it doesn't jump as the label flips between
   "▾ Collapse" and "▸ Expand". */
.report-rollup .rollup-toggle { min-width: 104px; text-align: center; }
.report-rollup .rollup-body { padding: 0; }
/* Sum-check footer row (renderReportRollup <tfoot>). */
.rollup-total td { border-top: 2px solid var(--border); font-weight: 600; }
.rollup-check.ok   { color: var(--green); font-weight: 600; }
.rollup-check.warn { color: var(--amber); font-weight: 700; }
.rollup-subnote    { color: var(--muted); font-weight: 400; }
.rollup-legend     { padding: 8px 12px; font-size: 11px; color: var(--muted); font-style: italic; }
.rollup-units      { cursor: help; border-bottom: 1px dotted var(--muted); }
.report-setup { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; background: #fff; }
.report-setup-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; }
#reportSetupToggle {
  background: #fff; border: 1px solid var(--border); border-radius: 5px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--navy); cursor: pointer;
}
.report-setup-summary { font-size: 12px; color: var(--muted); }
.report-setup-body { padding: 0 12px 12px 12px; }
.report-grid { display: grid; grid-template-columns: 55fr 45fr; gap: 16px; align-items: start; }
.report-panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); margin: 0 0 10px 0; }
.col-merged { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.col-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #EEF2F6; font-size: 13px; }
.col-row:last-child { border-bottom: 0; }
.col-row-label { flex: 1; }
.col-row button { padding: 2px 6px; font-size: 11px; border: 1px solid var(--border); background: #fff; border-radius: 3px; cursor: pointer; }
.col-row button:disabled { opacity: 0.35; cursor: default; }
.col-row.col-off { opacity: 0.55; background: #FAFBFC; }
.col-row.col-off .col-row-label { color: var(--muted); }
.report-launcher { margin: 4px 0 14px 0; }
.report-launch-section { margin-bottom: 14px; }
.report-launch-section > h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); margin: 0 0 8px 0; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.report-card {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s;
}
.report-card:hover { border-color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.report-card[disabled] { opacity: 0.5; cursor: not-allowed; }
.report-card .rc-icon { font-size: 20px; line-height: 1; }
.report-card .rc-body { flex: 1; display: flex; flex-direction: column; }
.report-card .rc-title { font-weight: 700; font-size: 13px; color: var(--navy); }
.report-card .rc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.report-card .rc-caption { font-size: 10px; color: #9AA5B1; margin-top: 3px; font-style: italic; }
.report-card .rc-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: #EBF4FC; color: #1A3A5C; align-self: flex-start; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }

/* ---------- Trends ---------- */
.trend-summary {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 18px; margin-bottom: 14px; font-size: 14px; line-height: 1.6; color: var(--text);
}
.trend-summary.loading { color: var(--muted); font-style: italic; }
.trend-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.trend-card {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 14px;
}
.trend-card h3 {
  margin: 0 0 10px 0; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--navy);
}
.trend-card canvas { max-height: 280px; }

/* Info-icon tooltip (Dashboard "Most Active Sites / Sellers", etc.) — shows
   the element's aria-label on hover/focus. Replaces the slow, unstyled native
   title bubble. Reusable: add class="site-info" + aria-label to any icon span. */
.site-info { position: relative; }
.site-info svg { display: block; }
.site-info::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: 240px;
  white-space: normal; text-align: left;
  background: #F7F4EA; color: #1B2A4A;      /* Option B — warm cream fill, navy text */
  border: 1.5px solid #B8860B;             /* gold */
  font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0;
  text-transform: none;
  padding: 7px 10px; border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.20); /* a touch stronger — lifts the light bubble off light surfaces */
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 50; pointer-events: none;
}
.site-info::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #F7F4EA;               /* caret matches cream fill (upward bubble) */
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 50; pointer-events: none;
}
.site-info:hover::after, .site-info:focus::after,
.site-info:hover::before, .site-info:focus::before {
  opacity: 1; visibility: visible;
}
/* Stale chip tooltip. The chip sits high, directly under the sticky sub-tabs, so
   the shared UPWARD bubble opened into the sticky header band — painted behind it
   (tooltip z-50 < topbar 101 / navs 100) and clipped at the viewport top. Scoped
   fixes (Dashboard tooltips keep their upward/z-50 behavior): open DOWNWARD below
   the chip, and lift above the sticky header chain. Widened too — it carries a
   longer multi-sentence explanation than the small icon tooltips. */
#staleChip.site-info::after {
  max-width: 300px;
  top: calc(100% + 9px); bottom: auto;   /* flip: anchor BELOW the chip */
  z-index: 1001;                          /* above topbar(101)/navs(100)/report-launcher(200) */
}
#staleChip.site-info::before {
  top: calc(100% + 3px); bottom: auto;
  border-top-color: transparent;          /* reset the upward caret */
  border-bottom-color: #F7F4EA;           /* caret now points UP toward the chip; cream to match fill */
  z-index: 1001;
}
.trend-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.trend-table th, .trend-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.trend-table th { background: #F9FAFB; font-weight: 600; color: var(--muted); }

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 4px;
  font-size: 13px; z-index: 1000;
}
.toast.error { background: var(--red); }
.toast.amber { background: var(--amber, #B45309); }

/* ---------- Proposal Builder ---------- */
.deal-header { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px 0; }
.deal-header-title { font-size: 18px; font-weight: 700; color: var(--navy); }
.proposal-panel {
  border: 1px solid var(--border); border-radius: 8px; background: var(--card, #fff);
  margin: 0 0 18px 0; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.pb-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px; background: var(--navy); color: #fff; border-radius: 8px 8px 0 0;
}
.pb-title { font-size: 18px; font-weight: 700; }
.pb-subtitle { font-size: 12px; opacity: 0.82; margin-top: 2px; }
.pb-close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pb-card {
  margin: 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card, #fff);
}
.pb-card-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--navy); margin-bottom: 10px; }
.pb-sub { font-size: 12px; color: var(--muted); margin: -4px 0 10px 0; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pb-field { display: flex; flex-direction: column; gap: 4px; }
.pb-field label { font-size: 12px; color: var(--muted); }
.pb-field .req { color: var(--red); font-weight: 700; }
.pb-field input, .pb-field select, .pb-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 4px; font-family: inherit; font-size: 13px;
}
.pb-field textarea { resize: vertical; }
.pb-field input.pb-invalid, .pb-field select.pb-invalid { border-color: var(--red); background: #FEF2F2; }
.pb-field-error { font-size: 12px; color: var(--red); margin-top: 2px; }
.pb-summary { margin-top: 12px; padding: 10px 12px; background: #F4F7FA; border-radius: 4px; font-size: 13px; font-weight: 600; color: var(--navy); }
.pb-spec-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.pb-spec-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 4px 6px; }
.pb-spec-table td { padding: 3px 6px; }
.pb-spec-table input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.pb-spec-remove { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.pb-spec-remove:hover { color: var(--red); }
.pb-autodraft { margin-top: 6px; align-self: flex-start; }
.pb-photo-thumb { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pb-photo-thumb img { width: 90px; height: 64px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; }
.pb-photo-thumb span { font-size: 12px; color: var(--muted); }
.pb-actionbar {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: #fff; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px;
}
.pb-required-note { font-size: 12px; color: var(--muted); }
.pb-actionbar-right { display: flex; gap: 8px; }
.pb-recent { padding: 0 16px 16px 16px; }
.pb-recent-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pb-recent-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pb-prev-section { margin-bottom: 14px; }
.pb-prev-section h4 { margin: 0 0 6px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--navy); }
.pb-prev-section ul { margin: 0; padding-left: 18px; }
.pb-spin, .pb-spin-dark {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  vertical-align: middle; animation: pb-spin 0.7s linear infinite;
}
.pb-spin { border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.pb-spin-dark { border: 2px solid rgba(26, 58, 92, 0.25); border-top-color: var(--navy); }
@keyframes pb-spin { to { transform: rotate(360deg); } }

/* ---------- Bulk soft-dedup (Possible Duplicates) ---------- */
/* Pair cards carry an inline `padding:12px` shorthand, so the left padding that
   makes room for the checkbox must beat it with !important — otherwise the
   absolutely-positioned checkbox overlaps the title's first character. */
.sd-card.sd-pair-selectable { position: relative; padding-left: 40px !important; }
.sd-select {
  position: absolute; top: 14px; left: 14px;
  width: 16px; height: 16px; margin: 0; cursor: pointer;
}
.sd-bulk-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--navy); color: #fff;
  padding: 10px 14px; border-radius: 6px; margin: 0 0 12px 0;
  font-size: 13px; box-shadow: 0 2px 6px rgba(15,23,42,0.18);
}
.sd-bulk-bar #sdBulkCount { font-weight: 600; }
.sd-bulk-sep { opacity: 0.5; }
.sd-bulk-bar .btn.small { padding: 4px 10px; }
/* Pair merge confirm (FIX 1) */
.sd-merge-pairhead { font-weight: 700; margin-bottom: 10px; }
.sd-merge-warn { background: #FFF4E5; border: 1px solid #F0B46A; color: #7A4A00; border-radius: 4px; padding: 6px 10px; margin-bottom: 10px; font-size: 13px; }
.sd-merge-cols { display: flex; gap: 12px; }
.sd-merge-col {
  flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 10px;
}
.sd-merge-col.keep { border-left: 4px solid var(--green); }
.sd-merge-col.remove { border-left: 4px solid var(--red); opacity: 0.9; }
.sd-merge-col .sd-merge-role {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 700; color: var(--muted);
}
.sd-merge-col .sd-merge-meta { font-size: 13px; margin-top: 4px; }
.sd-merge-col .sd-merge-score { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* Undo toast for bulk actions */
.sd-undo-toast { display: flex; align-items: center; gap: 8px; }
.sd-undo-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6);
  border-radius: 4px; padding: 2px 10px; cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.sd-undo-btn:hover { background: rgba(255,255,255,0.15); }

/* ---------- Merge modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal-card {
  background: #fff; border-radius: 8px; max-width: 860px; width: 92%;
  max-height: 88vh; overflow: auto; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-help { padding: 10px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.modal-body { padding: 8px 18px; overflow-y: auto; }
.modal-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.modal-body th, .modal-body td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.modal-body th { background: #F9FAFB; font-weight: 600; color: var(--muted); }
.modal-body td.field-name { color: var(--muted); width: 22%; }
.modal-body td.choice { cursor: pointer; }
.modal-body td.choice:hover { background: #EFF6FF; }
.modal-body td.choice.selected { background: #D1FAE5; outline: 2px solid var(--green); }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.card-actions .merge { color: var(--blue); }

/* ---------- Targets tab ---------- */
nav.tabs button.admin-only { display: none; }
body.admin-on nav.tabs button.admin-only { display: inline-block; }

.targets-toolbar { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.targets-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.targets-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.targets-table th, .targets-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.targets-table th { background: #F9FAFB; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.targets-table tr:last-child td { border-bottom: none; }
.targets-table .badge.b-active   { background: #D1FAE5; color: #064E3B; }
.targets-table .badge.b-paused   { background: #E5E7EB; color: #1F2937; }
.targets-table .badge.b-autopause{ background: #FEE2E2; color: #991B1B; }
.targets-table .badge.b-archived { background: #EDE9FE; color: #4C1D95; }
/* Outreach badges (T1-B, 2026-08-15). Deliberately distinct hues from the
   lifecycle badges above — a target can carry one of each at once, so
   "Active + No response" has to read as two separate facts. */
.targets-table .badge.b-notcontacted { background: #F3F4F6; color: #4B5563; }
.targets-table .badge.b-awaiting     { background: #DBEAFE; color: #1E40AF; }
.targets-table .badge.b-noresponse   { background: #FEF3C7; color: #92400E; }
.targets-table .badge.b-responded    { background: #D1FAE5; color: #065F46; }
.targets-table .badge.b-notifysys    { background: #E0E7FF; color: #3730A3; }
.targets-table .badge.b-donotuse     { background: #FEE2E2; color: #991B1B; font-weight: 700; }
/* A do-not-use target stays readable but visibly de-emphasised — it is still a
   record worth seeing (that is the point of the reason string), just not one to
   act on. */
.targets-table tr.target-dnu td { opacity: 0.62; }
.targets-table tr.target-dnu .badge.b-donotuse { opacity: 1; }
.targets-table .muted-sm { color: var(--muted); font-size: 11px; }
/* Section divider inside a modal form — separates the outreach block from the
   target-definition fields above it. */
.modal-subhead {
  margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--muted);
}
.ph-day { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ph-day:last-child { border-bottom: none; }
.ph-day-date { font-weight: 600; font-size: 13px; }
.ph-day-count { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.ph-day-clean { color: var(--muted); font-size: 12px; margin-top: 2px; }
.vip-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  background: #FEF3C7; color: #B45309;
}
.targets-table .target-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.targets-table .target-actions button { padding: 4px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); background: #fff; }
.targets-table .target-actions button.delete { color: var(--red); }
.targets-table .target-actions button.pause  { color: var(--amber); }
.targets-table .target-actions button.resume { color: var(--green); }
.targets-table .native-name { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; max-height: 140px; overflow-y: auto; background: #fff; }
.checkbox-grid label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: var(--text); cursor: pointer; }
.checkbox-grid input[type="checkbox"] { margin: 0; }

/* B3 Smart Alerts tab */
.targets-table .badge.b-never { background: #FEF3C7; color: #92400E; }
.alert-form-title { margin: 22px 0 8px; font-size: 15px; }
.alert-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.alert-form-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.alert-form-grid input[type="text"], .alert-form-grid input[type="number"], .alert-form-grid select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.alert-form-grid .af-full { grid-column: 1 / -1; }
.alert-form-grid .af-inline { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.alert-form-grid input[type="range"] { width: 100%; }
.alert-conditions { display: flex; flex-wrap: wrap; gap: 14px; }
.alert-conditions label { flex-direction: row; align-items: center; gap: 5px; font-size: 13px; color: var(--text); }
.alert-form-actions { margin-top: 12px; display: flex; gap: 10px; }
.alert-test-results { margin: 14px 0; border: 1px solid var(--border); border-radius: 6px; background: #F9FAFB; padding: 12px; }
.alert-test-head { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-test-row { font-size: 12px; padding: 5px 0; border-top: 1px solid var(--border); }
@media (max-width: 767px) { .alert-form-grid { grid-template-columns: 1fr; } }

/* B1 — Create email, listing-card footer (visible to every user) */
.create-email-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 4px; cursor: pointer; }
.create-email-btn:hover:not([disabled]) { background: #047857; }
.create-email-btn[disabled] { opacity: 0.6; cursor: progress; }
.outreach-log { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.outreach-log-row { font-size: 12px; color: #065F46; background: #ECFDF5; border-left: 3px solid var(--green); padding: 4px 8px; border-radius: 3px; }
.outreach-log-row .ol-kind { color: var(--muted); }

/* Sources Section 2 — admin-off prompt (subtle info, not an error) */
.sd-admin-locked { padding: 14px 16px; font-size: 13px; color: var(--muted); background: #F9FAFB; border: 1px dashed var(--border); border-radius: 6px; text-align: center; }

/* B1 confirm-send modal */
.os-confirm { font-size: 14px; color: var(--text); margin-bottom: 14px; }
.os-confirm .os-line { font-size: 12px; color: var(--muted); margin-top: 4px; }
.os-confirm .os-subj-preview { color: var(--text); margin-top: 6px; }
.os-hint { font-size: 11px; color: var(--amber); margin-top: 4px; }
.os-error { margin-top: 12px; padding: 8px 12px; font-size: 13px; color: #991B1B; background: #FEE2E2; border: 1px solid #FCA5A5; border-radius: 4px; }
#outreachSendModal textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; resize: vertical; }
#outreachSendModal input[type="email"], #outreachSendModal input[type="text"] { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }

#targetForm textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 13px; resize: vertical; }

/* Listings: target-source badge on cards */
.badge.b-target { background: #DBEAFE; color: #1E3A8A; font-weight: 700; }
.badge.b-rep-verified { background: #064E3B; color: #FFFFFF; }
.badge.b-internal { background: #FEF3C7; color: #78350F; }
.badge.b-hidden { background: #E5E7EB; color: #6B7280; }

/* Power-range filter — unit selector + min + "to" + max, inline. */
.power-filter { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; flex: 0 1 auto; }
.power-filter label { font-size: 11px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.power-filter select { padding: 6px 8px; font-size: 12px; min-width: 64px; }
.power-filter input { padding: 6px 8px; font-size: 12px; width: 90px; }
@media (max-width: 800px) {
  .power-filter { flex-wrap: wrap; }
  .power-filter input { width: 100%; }
}
.rf-power { display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px; }
.rf-power select, .rf-power input { padding: 6px 8px; font-size: 12px; }

/* Bulk action bar — appears above stats when selections exist. */
.bulk-bar {
  display: flex; gap: 10px; align-items: center;
  background: var(--navy); color: #fff;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 10px;
  font-size: 13px;
}
.bulk-bar button { font-size: 12px; }

/* Undo banner — soft amber pill above the listings. */
.undo-banner { display: block; background: #FEF3C7; border: 1px solid #FDE68A; color: #78350F; border-radius: 6px; padding: 4px 6px; margin-bottom: 10px; }
.undo-banner .undo-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.undo-banner .undo-row + .undo-row { border-top: 1px solid #FDE68A; }

/* Per-card admin checkbox lives inline at the start of .card-actions, so
   it never overlaps the listing title. The label wraps the checkbox so a
   click on the word "Select" toggles it too. */
.card { position: relative; }
.card-check-label {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px; color: var(--muted); cursor: pointer; user-select: none;
  background: #fff;
}
.card-check-label:hover { color: var(--navy); border-color: var(--navy); }
.card-check { width: 14px; height: 14px; cursor: pointer; margin: 0; }
.card-check-text { line-height: 1; }
.card-hidden { opacity: 0.7; }

/* Delete dropdown menu. z-index high enough to clear sibling cards. */
.action-menu { position: relative; display: inline-block; }
.action-menu-pop {
  position: absolute; top: 100%; left: 0; z-index: 9999;
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12); min-width: 180px;
  padding: 4px 0;
}
.action-menu-pop button {
  display: block; width: 100%; text-align: left;
  padding: 7px 12px; border: none; background: transparent; cursor: pointer; font-size: 12px;
  font-weight: 600;
}
.action-menu-pop button:hover { background: #F3F4F6; }
.action-menu-pop .opt-sold      { color: #047857; }
.action-menu-pop .opt-duplicate { color: #B45309; }
.action-menu-pop .opt-hide      { color: #6B7280; }

/* Inline edit panel inside a card. */
.card-edit {
  margin-top: 10px; padding: 12px; background: #F9FAFB;
  border: 1px solid var(--border); border-radius: 6px;
}
.card-edit h4 { margin: 0 0 8px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); }
.card-edit .edit-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.card-edit .edit-row label { font-size: 11px; color: var(--muted); }
.card-edit input, .card-edit select, .card-edit textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit; font-size: 12px;
}
.card-edit .edit-help { font-size: 10px; color: var(--muted); margin: 4px 0 8px 130px; }
.card-edit .edit-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Inline score-mini badge for live previews on the Add form + edit panel. */
.score-mini {
  display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 12px;
  color: #fff; font-weight: 700; font-size: 11px; text-align: center;
}
.score-mini.tier-high       { background: #064E3B; }
.score-mini.tier-good       { background: #059669; }
.score-mini.tier-verify     { background: #D97706; }
.score-mini.tier-incomplete { background: #EA580C; }
.score-mini.tier-low        { background: #DC2626; }
.score-mini-label { font-size: 11px; color: var(--text); margin-left: 4px; }

/* Pencil icon next to the score badge. */
.score-edit {
  margin-top: 4px; background: transparent; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; padding: 2px 6px; font-size: 12px; color: var(--muted);
}
.score-edit:hover { color: var(--navy); border-color: var(--navy); }

/* Internal-notes block — distinct from public notes. */
.notes-internal { background: #FEF9E7; padding: 6px 8px; border-radius: 4px; color: #78350F; }
/* TRUSTED Ready (2026-10-06) — super-user "why not Ready" line on a backlog card. */
.not-ready-why { margin: 4px 0; padding: 4px 8px; border-left: 3px solid #B45309; background: #FFF7ED; color: #7C2D12; font-size: 12px; }

/* Small button variants. */
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }

/* Admin-only DOM hide when admin is OFF. */
body:not(.admin-on) .admin-only { display: none !important; }

/* ---------- Outreach tab (Phase 2 revision — compact list) ---------- */
.outreach-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px 0; flex-wrap: wrap; }
.outreach-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.outreach-header-actions .btn { padding: 6px 12px; font-size: 13px; }
.outreach-header-actions #od-backfill { background: #1A3A5C; color: #fff; border-color: #1A3A5C; font-weight: 600; }
.outreach-header-actions #od-backfill:hover:not([disabled]) { background: #102740; }
.outreach-header-actions #od-backfill[disabled] { opacity: 0.55; cursor: not-allowed; }
.outreach-stats { font-size: 14px; margin: 0; }
.outreach-stats .outreach-window { color: var(--muted); font-weight: 600; margin-right: 4px; }
.outreach-batch-progress {
  margin: 0 0 12px 0; padding: 10px 14px;
  background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: 6px;
}
.batch-progress-bar { height: 6px; background: #E0F2FE; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.batch-progress-fill { height: 100%; background: #0284C7; transition: width 0.3s ease; }
.batch-progress-text { font-size: 12px; color: #1F2937; }

/* Compact list — one row per draft */
.outreach-list-compact { display: flex; flex-direction: column; gap: 6px; }
.draft-row {
  background: #fff; border: 1px solid #E2E8F0; border-radius: 6px;
  border-left: 3px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.draft-row.is-expanded { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.draft-row-line {
  display: grid;
  grid-template-columns:
    36px                  /* accuracy badge */
    minmax(140px, 1.3fr)  /* mfg · model */
    minmax(90px, 0.8fr)   /* capacity + ×N */
    minmax(120px, 1fr)    /* location */
    minmax(110px, 1fr)    /* seller */
    minmax(60px, auto)    /* price */
    minmax(55px, auto)    /* days on market */
    auto                  /* trail (sent timestamp / undo) */
    24px;                 /* chevron */
  align-items: center; gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #1F2937;
}
.draft-row-line:hover { background: #F9FAFB; }
.draft-row .row-acc {
  text-align: center; font-weight: 700; padding: 4px 0; min-width: 30px;
  background: #1A3A5C; color: #fff;
}
.draft-row .row-mm     { font-weight: 600; }
.draft-row .row-cap    { color: #1F2937; }
.draft-row .row-units  { color: #B45309; font-weight: 600; margin-left: 2px; }
.draft-row .row-loc    { color: var(--muted); }
.draft-row .row-seller { color: var(--muted); }
.draft-row .row-price  { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.draft-row .row-dom    { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.draft-row .row-trail  { color: var(--muted); font-size: 12px; text-align: right; }
.draft-row .row-chev   { color: var(--muted); font-size: 11px; text-align: center; }
.draft-row .row-sent-at { margin-right: 8px; color: #065F46; }
.draft-row .row-undo   { font-size: 12px; }

/* Row colors per status */
.draft-row-pending_review {} /* default white background */
.draft-row-approved      { border-left-color: #86EFAC; background: #F0FDF4; }
.draft-row-sent          { border-left-color: #059669; background: #ECFDF5; }
.draft-row-sent .row-mm,
.draft-row-sent .row-cap,
.draft-row-sent .row-loc,
.draft-row-sent .row-seller { color: #065F46; }
.draft-row-dismissed     { color: #9CA3AF; }
.draft-row-dismissed .row-mm,
.draft-row-dismissed .row-cap,
.draft-row-dismissed .row-loc,
.draft-row-dismissed .row-seller { text-decoration: line-through; color: #9CA3AF; }
.draft-row-dismissed .row-acc    { background: #9CA3AF; }

/* Expanded panel inside a row */
.draft-expanded { padding: 10px 14px 14px 14px; border-top: 1px dashed #E2E8F0; }
.draft-field { margin: 8px 0; }
.draft-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 4px; }
.draft-subject {
  width: 100%; padding: 7px 10px; font-size: 14px; font-weight: 600;
  border: 1px solid #D1D5DB; border-radius: 4px; box-sizing: border-box;
}
.draft-body {
  width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  border: 1px solid #D1D5DB; border-radius: 4px; box-sizing: border-box; resize: vertical;
}
.draft-meta-grid {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  font-size: 12px; color: #1F2937; margin: 8px 0;
}
.draft-meta-grid strong { color: var(--muted); font-weight: 600; margin-right: 4px; }
.draft-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.draft-row-actions .btn { padding: 6px 12px; font-size: 13px; }
.btn-approve { background: #059669; color: #fff; border-color: #059669; font-weight: 600; }
.btn-approve:hover:not([disabled]) { background: #047857; }
.btn-dismiss { background: #fff; color: #991B1B; border-color: #FCA5A5; }
.btn-dismiss:hover:not([disabled]) { background: #FEF2F2; }

.link-btn { background: none; border: 0; color: #2563EB; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.card-highlight { box-shadow: 0 0 0 3px #FDE68A; transition: box-shadow 0.4s ease; }

/* On-demand draft button on listing cards.
   The Listings-card instance has class="draft-outreach-btn" (no .btn), so the
   plain rule below styles it. The Deal-card instance has class="btn
   draft-outreach-btn", where base `button.btn` (0,1,1) would override the plain
   (0,1,0) rule and blank the label (white-on-white) — so `.btn.draft-outreach-btn`
   (0,2,0) restores the intended blue. Keep both: neither instance regresses. */
.draft-outreach-btn { background: #2563EB; color: #fff; border-color: #2563EB; }
.btn.draft-outreach-btn { background: #2563EB; color: #fff; border-color: #2563EB; }
.draft-outreach-btn:hover:not([disabled]) { background: #1D4ED8; }
.draft-outreach-btn[disabled] { opacity: 0.6; cursor: progress; }
.draft-outreach-btn.is-loading { padding-left: 22px; position: relative; }
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Compact row responsive collapse */
@media (max-width: 760px) {
  .draft-row-line {
    grid-template-columns: 36px 1fr 24px;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "acc mm chev"
      "acc cap chev"
      "acc seller chev"
      "acc trail chev";
    gap: 4px 12px;
  }
  .draft-row .row-acc    { grid-area: acc; align-self: start; }
  .draft-row .row-mm     { grid-area: mm; }
  .draft-row .row-cap    { grid-area: cap; }
  .draft-row .row-loc    { display: none; }
  .draft-row .row-seller { grid-area: seller; }
  .draft-row .row-price  { grid-area: trail; text-align: left; display: inline; }
  .draft-row .row-price::after { content: ' · '; color: var(--muted); }
  .draft-row .row-dom    { grid-area: trail; text-align: left; display: inline; }
  .draft-row .row-trail  { display: none; }
  .draft-row .row-chev   { grid-area: chev; }
}

.outreach-filters .filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.outreach-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.draft-card {
  background: #fff; border: 1px solid #E2E8F0; border-left: 4px solid #059669;
  border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.draft-head { margin-bottom: 8px; }
.draft-head-left { display: flex; flex-direction: column; gap: 4px; }
.draft-head-left .badge { margin-right: 4px; }
.draft-title { font-size: 16px; font-weight: 700; margin-top: 4px; }
.draft-meta  { font-size: 12px; color: var(--muted); }
.draft-field { margin: 10px 0; }
.draft-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 4px; }
.draft-subject {
  width: 100%; padding: 8px 10px; font-size: 14px; font-weight: 600;
  border: 1px solid #D1D5DB; border-radius: 4px; box-sizing: border-box;
}
.draft-body {
  width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  border: 1px solid #D1D5DB; border-radius: 4px; box-sizing: border-box; resize: vertical;
}
.draft-foot {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #E2E8F0;
}
.draft-foot-meta { font-size: 12px; line-height: 1.6; color: #1F2937; }
.draft-foot-meta strong { color: var(--muted); font-weight: 600; margin-right: 4px; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.draft-actions .btn { padding: 6px 12px; font-size: 12px; }
.draft-actions .btn-primary { background: #1A3A5C; color: #fff; border-color: #1A3A5C; }
.draft-actions .btn-primary:hover { background: #102740; }
.draft-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.draft-sent-note { font-size: 12px; color: #065F46; margin-bottom: 8px; }
.draft-dismissed-note { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.link-btn { background: none; border: 0; color: #2563EB; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.card-highlight { box-shadow: 0 0 0 3px #FDE68A; transition: box-shadow 0.4s ease; }

/* ---------- Print ---------- */
@media print {
  /* Force browsers to render background colors so accuracy badges keep their fill. */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  header, nav.tabs, .filters, .form-actions, .report-cols, .report-side .report-actions,
  .report-intro, .report-setup, .report-launcher, .report-actions,
  .card-actions, .whoami, button { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .cards { grid-template-columns: 1fr; }
  .card { page-break-inside: avoid; border: 1px solid #ccc; }
  .report-layout { grid-template-columns: 1fr; }
  .report-output { max-height: none; border: none; }
  /* T2 — the Sales Activity Delete control is UI-only: drop the whole column in
     print so no orphan header/cell remains (exports are data-driven and already
     exclude it). The generic `button` hide above also covers the button itself. */
  .activity-actions-col { display: none !important; }
}

/* Sources tab — section summary signpost + labeled divider (Fix 3) */
.sources-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 16px 0;
  font-size: 13px;
}
.sources-summary a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.sources-summary a:hover { text-decoration: underline; }
.sources-summary-sep { color: var(--muted); margin: 0 4px; }
.section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 28px 0 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px solid var(--border);
}
.section-divider span { padding: 0 12px; }

/* Soft-dedup disclosure arrow (Section 2): draw the toggle in-flow via ::before
   instead of the native marker, which renders in the outside marker box and is
   clipped at narrow widths (iPad/iPhone). Mirrors the .c48-box pattern. */
#softDedupPanel > summary { list-style: none; }
#softDedupPanel > summary::-webkit-details-marker { display: none; }
#softDedupPanel > summary::before { content: '▶'; font-size: 11px; margin-right: 8px; }
#softDedupPanel[open] > summary::before { content: '▼'; }

/* Sources-tab jump links must land below the sticky topbar + nav (~140px at all
   widths, see the sticky stack above), not scroll behind it. */
#gatedWatchlistSection,
#softDedupPanel { scroll-margin-top: 150px; }

/* Background pagination indicator in the stats bar (dashboard load optimization) */
.stats-bar-compact .metric.bg-loading {
  color: var(--muted);
  font-style: italic;
}

/* A2 — clickable avg-cost unit toggle in the stats bar */
.stats-bar-compact .metric.cost-toggle {
  cursor: pointer;
  user-select: none;
  border-bottom: 1px dotted #B7C7DA;
}
.stats-bar-compact .metric.cost-toggle:hover {
  border-bottom-style: solid;
  border-bottom-color: #FFFFFF;
}

/* Sticky Listings header stack: only the topbar + the two nav bars stay pinned.
   .ronn-topbar (top:0, z-index 101) is set in its own rule above.
   The stats bar + filter toolbar are intentionally NON-sticky at ALL widths
   (2026-07-01, T3): a chained fixed-offset sticky stack could not track their
   real rendered heights (the sub-tabs nav was allotted only 2px, 140→142), so
   the stats/filter bars pinned ~35px too high at ≥1024px and overlapped the
   sub-tabs nav + hid the top row of cards behind the header. They now flow with
   the content at every width — identical to the <1024px behavior that already
   shipped, killing the pixel-math fragility instead of re-tuning it. */
nav.tabs.main-tabs  { position: sticky; top: 88px;  z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.06); }
nav.tabs.sub-tabs   { position: sticky; top: 140px; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.06); }
.stats-bar-compact  { position: static; }
.filters-toolbar    { position: static; }

/* =========================================================================
   B2 — Responsive / mobile-friendly layout (2026-05-26)
   Devices:  iMac desktop (≥1024px) · iPad tablet (768–1023px) · iPhone (<768px)
   Desktop (≥1024px) is intentionally untouched below — no regression.

   Sticky stack: only the topbar + the two nav bars stay pinned (at every
   width). The stats bar + filter toolbar are non-sticky at all widths — set
   in the sticky-header block above (2026-07-01, T3). The previous per-breakpoint
   `position: static` override for <1024px is now redundant and was removed.
   ========================================================================= */

/* ---- Touch improvements (all sizes — removes the iOS blue tap flash) ---- */
* { -webkit-tap-highlight-color: transparent; }

/* =========================== TABLET 768–1023px =========================== */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Nav: allow wrap to a 2nd row, slightly smaller text */
  nav.tabs { flex-wrap: wrap; padding: 0 12px; }
  nav.tabs button { padding: 12px 14px; font-size: 12px; min-height: 44px; }

  /* Cards: keep 2-up but a narrower min so iPad portrait still shows two */
  .cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

  /* Touch targets on the busiest controls */
  button.btn, .card-actions button,
  .filters input, .filters select,
  .filters-toolbar #f-sort { min-height: 44px; }
  .filters-toolbar .btn-filters-toggle,
  .filters-toolbar .search-wrap input { min-height: 38px; }
}

/* ============================== MOBILE <768px ============================= */
@media (max-width: 767px) {
  main { padding: 12px 12px 32px 12px; }

  /* ---- Nav tabs: horizontal scroll, no wrap, hidden scrollbar ---- */
  nav.tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    padding: 0 8px;
  }
  nav.tabs::-webkit-scrollbar { display: none; }   /* WebKit/Blink */
  nav.tabs button {
    flex: 0 0 auto;
    min-width: 80px;
    min-height: 44px;
    padding: 12px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* ---- Listing cards: single full-width column (fixes 420px overflow) ---- */
  .cards { grid-template-columns: 1fr; gap: 10px; }

  /* card-head: title (+ score badge, top-right) on line 1, price on line 2 */
  .card-head { flex-direction: column; align-items: stretch; position: relative; gap: 4px; }
  .card-head > div:first-child { padding-right: 60px; }   /* clear the 50px score badge */
  .card-head .price { text-align: left; }
  .card-head .price .pu { font-size: 18px; }              /* price prominent */
  .score-wrap { position: absolute; top: 0; right: 0; margin-left: 0; }

  /* Key specs: 2-column mini-grid instead of 3 */
  .specs { grid-template-columns: repeat(2, 1fr); }

  /* Spec-sheet badge: full width */
  .spec-sheet-row { gap: 6px; }
  .spec-sheet-row .spec-btn {
    display: block; width: 100%; text-align: center;
    min-height: 44px; line-height: 44px; padding: 0 10px;
  }

  /* Foot links (phone / email / View listing): tappable */
  .foot { gap: 8px 16px; }
  .foot a, .foot span { display: inline-flex; align-items: center; min-height: 44px; }

  /* ---- Filter toolbar: search row 1, toggle + (right) sort row 2 ---- */
  .filters-toolbar { flex-wrap: wrap; gap: 8px; }
  .filters-toolbar .search-wrap { flex: 1 1 100%; }
  .filters-toolbar #f-sort { min-height: 44px; }
  .filters-toolbar .search-wrap input,
  .filters-toolbar .btn-filters-toggle { min-height: 38px; }
  .filters-toolbar #f-sort { margin-left: auto; }   /* right-aligned, same row as ⚙ Filters */

  /* Collapsible filters: stack every control full width */
  .filters-row { flex-direction: column; align-items: stretch; }
  .filters-row > input, .filters-row > select,
  .filters-row > input[type="search"] {
    min-width: 0; width: 100%; flex: 1 1 auto; min-height: 44px;
  }
  .filters-row .actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .filters-row .actions .btn { flex: 1 1 auto; min-height: 44px; }
  .power-filter, .rf-power { width: 100%; }

  /* ---- Stats bar: wrap freely, larger cost-toggle tap target ---- */
  .stats-bar-compact { max-height: none; }
  .stats-bar-compact .metric.cost-toggle { padding: 2px 6px; }

  /* ---- Card actions (admin): wrap + tappable, but kept compact (not
     full-width) — admin work is mainly desktop ---- */
  .card-actions { flex-wrap: wrap; }
  .card-actions button, .card-actions .card-check-label { min-height: 44px; }

  /* General buttons tappable */
  button.btn { min-height: 44px; }

  /* ---- Soft-dedup merge/action buttons: full width for easy tapping ---- */
  .sd-actions { flex-direction: column; }
  .sd-actions .btn { width: 100%; min-height: 44px; }

  /* Bulk action bar wraps */
  .bulk-bar { flex-wrap: wrap; }

  /* ---- Tables: min width so key columns aren't crushed (wrappers scroll) ---- */
  .targets-table, .report-output table { min-width: 640px; }
}

/* Topbar shrinks to ~64px at ≤560px (rule above) — pin the nav directly
   beneath it so the sticky stack stays gap-free on phones. */
@media (max-width: 560px) {
  nav.tabs.main-tabs { top: 64px; }
  nav.tabs.sub-tabs  { top: 112px; }
}

/* =========================================================================
   Deal Support Query tab (form reuses .form/.row; results reuse .cards/.card,
   so both inherit the B2 responsive behavior automatically).
   ========================================================================= */
.deal-saved-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.deal-saved-bar label { font-size: 12px; color: var(--muted); font-weight: 600; }
.deal-saved-bar select {
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px;
  font-size: 13px; background: #fff; min-width: 220px;
}
.deal-form { margin-bottom: 18px; }
/* NOTE: the condition row is rendered with inline styles in index.html so that
   no inherited rule (.checkbox-grid overflow/clip, .form label display, etc.)
   can break it. There are intentionally NO .deal-condition / .deal-cond-option
   rules here — do not re-add them; edit the inline styles instead. */

.deal-results-head { font-size: 14px; color: var(--text); margin: 4px 0 12px 0; }

/* Export-options dialog — stacked full-width choices + a helper note. */
.deal-export-options { display: flex; flex-direction: column; gap: 8px; }
.deal-export-options .btn { width: 100%; text-align: center; min-height: 44px; }
.deal-export-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 14px 0 0 0; }
.deal-export-note strong { color: var(--text); }

.deal-result-card { gap: 4px; }
.deal-result-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
/* Deal cards lay the match + accuracy badges out in flow; override the B2
   mobile rule that absolutely-positions .score-wrap inside .card-head. */
.deal-result-card .score-wrap { position: static; margin-left: 0; }
.deal-result-title { font-weight: 700; font-size: 15px; }
.deal-result-facts { font-size: 13px; color: var(--text); margin-top: 2px; }
.deal-result-price { font-size: 15px; font-weight: 700; margin-top: 6px; }
.deal-spec { font-size: 12px; margin-top: 6px; }
.deal-result-actions { margin-top: 10px; }

/* Match-score badge — same tier palette as the accuracy badge. */
.deal-match-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; min-height: 56px; border-radius: 8px; color: #fff; flex-shrink: 0; padding: 4px 0;
}
.deal-match-badge .dm-num { font-size: 22px; font-weight: 800; line-height: 1; }
.deal-match-badge .dm-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }
.deal-match-badge.tier-high       { background: #064E3B; }
.deal-match-badge.tier-good       { background: #059669; }
.deal-match-badge.tier-verify     { background: #D97706; }
.deal-match-badge.tier-incomplete { background: #EA580C; }
.deal-match-badge.tier-low        { background: #DC2626; }

@media (max-width: 767px) {
  .deal-saved-bar select { min-width: 0; flex: 1 1 100%; }
}

/* ---- Add to Deal badge (Deal match cards) ----
   Selectors use .btn.deal-add-btn (0,2,0) so they out-specify the base
   `button.btn` rule (0,1,1) — otherwise button.btn's `color:#fff` wins and the
   label renders white-on-white (invisible). Mirrors how .btn.secondary works. */
.btn.deal-add-btn { border: 1px solid var(--border); background: #fff; color: var(--navy); }
.btn.deal-add-btn.active {
  background: #16A34A; border-color: #16A34A; color: #fff;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

/* ---- Deal Summary panel (PART 5) ----
   Rep-curated, in-app preview rendered into #dealSummaryPanel below the form.
   Visible on screen; when printDealSummaryPanel() adds body.deal-printing the
   print stylesheet hides everything else and shows only this clean document. */
.deal-summary-panel {
  margin-top: 20px; padding: 28px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ds-header { border-bottom: 3px solid #0d1f9c; padding-bottom: 10px; margin-bottom: 16px; }
.ds-brand {
  font-family: 'Saira Condensed', Arial, sans-serif; font-weight: 800; font-size: 24px;
  letter-spacing: 0.03em; color: #0a0c12; text-transform: uppercase;
}
.ds-project { font-size: 16px; font-weight: 700; color: #1A3A5C; margin-top: 4px; }
.ds-date { font-size: 12px; color: #6a7180; margin-top: 2px; }
.deal-summary-panel table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 6px; }
.deal-summary-panel .ds-meta th { text-align: left; width: 200px; color: #6a7180; font-weight: 600; padding: 4px 8px; vertical-align: top; }
.deal-summary-panel .ds-meta td { padding: 4px 8px; }
.deal-summary-panel .ds-opts { margin-top: 14px; }
.deal-summary-panel .ds-opts th, .deal-summary-panel .ds-opts td { border: 1px solid #d0d5dd; padding: 6px 8px; text-align: left; }
.deal-summary-panel .ds-opts th {
  background: #f3f5f8; font-weight: 700;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ds-foot { margin-top: 18px; font-size: 12px; color: #374151; border-top: 1px solid #d0d5dd; padding-top: 10px; }
.ds-foot-by { margin-top: 6px; font-size: 11px; color: #6a7180; font-style: italic; }
.ds-actions { display: flex; gap: 10px; margin-top: 18px; }

/* Print only the panel: hide everything, then re-show just the panel subtree and
   float it to the top of the page. Structure-independent (no ancestor IDs). */
@media print {
  body.deal-printing * { visibility: hidden !important; }
  body.deal-printing #dealSummaryPanel,
  body.deal-printing #dealSummaryPanel * { visibility: visible !important; }
  body.deal-printing #dealSummaryPanel {
    position: absolute; left: 0; top: 0; width: 100%;
    border: none; box-shadow: none; padding: 0; margin: 0;
  }
  body.deal-printing #dealSummaryPanel .no-print { display: none !important; }
}

/* ---- Pipeline tab ---- */
.pipeline-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pipeline-toolbar-actions { display: flex; gap: 8px; }
.pipeline-toolbar-help { font-size: 11px; color: var(--muted); margin: -6px 0 12px 0; text-align: right; }
.p-group { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.p-group > summary { cursor: pointer; padding: 10px 14px; background: #F9FAFB; font-size: 14px; color: var(--navy); list-style: none; }
.p-group > summary::-webkit-details-marker { display: none; }
.p-group > summary::before { content: '▼'; font-size: 10px; margin-right: 8px; color: var(--muted); }
.p-group:not([open]) > summary::before { content: '▶'; }
.p-group-meta { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
/* One unified table for all segments → columns align across every section.
   Fixed layout + px colgroup; the wrapper scrolls horizontally on narrow
   screens so the column widths are never compressed. */
.p-table-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 6px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table-unified { table-layout: fixed; min-width: 1050px; }
.p-table th { background: #fff; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.p-table-unified thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border); }
.p-table td { padding: 8px 10px; border-bottom: 1px solid #EEF0F3; vertical-align: top; word-wrap: break-word; overflow-wrap: break-word; }
.p-note { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 3px; }
.p-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.p-num { text-align: center; color: var(--muted); }
.p-mw { white-space: nowrap; }
.p-owner { font-size: 12px; }

/* ── AUTH-2B-i-b — Internal Owner (ownership UX) ──────────────────────────
   Q1.2: a display-only owner (a name typed into the combo that matches no
   account) must be visibly different from a real assignment. An operator
   mid-company-transition needs to see at a glance which names are logins and
   which are still just written down — they have different consequences: a
   display-only record has owner_id null, so it is Admin/Super-Admin visible
   only and no rep can ever see it.
   Italic + a muted "(no account)" suffix, rather than a colour alone, so the
   distinction survives greyscale printing and colour-vision differences. */
.owner-display-only { font-style: italic; color: var(--muted); }
.owner-display-only::after {
  content: ' (no account)';
  font-size: 0.85em;
  font-style: normal;
  opacity: 0.75;
  white-space: nowrap;
}

/* The combo itself. Free-text input seeded by a shared <datalist>; the amber
   left edge appears only while what is typed resolves to no account, which is
   the same signal the ::after marker gives in list views. */
input.owner-combo { width: 100%; }
input.owner-combo.owner-combo-display-only {
  border-left: 3px solid var(--gold, #C6A15B);
  font-style: italic;
}
/* Navy full-width segment header row */
.p-seg-row td { background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; padding: 8px 10px; }
.p-seg-meta { float: right; font-weight: 400; text-transform: none; letter-spacing: 0; color: #cdd8e6; }
.p-actions button { padding: 4px 7px; font-size: 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); background: #fff; margin: 0 4px 4px 0; }
.p-actions button.danger { color: var(--red); }
.p-alerted { font-size: 11px; }
.p-matchcount { padding: 3px 10px; font-size: 13px; font-weight: 700; border-radius: 12px; cursor: pointer; border: 1px solid var(--border); background: #F3F4F6; color: var(--muted); }
.p-matchcount.has-matches { background: #ECFDF5; border-color: #A7F3D0; color: var(--green); }
.p-matchcount.has-matches:hover { background: var(--green); color: #fff; }
.pipeline-add { margin-top: 18px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 14px; }
.pipeline-add > summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; }

/* Pipeline status badges */
.p-status-green  { background: #D1FAE5; color: #065F46; }
.p-status-blue   { background: #DBEAFE; color: #1E40AF; }
.p-status-amber  { background: #FEF3C7; color: #92400E; }
.p-status-gray   { background: #E5E7EB; color: #374151; }
.p-status-purple { background: #EDE9FE; color: #5B21B6; }

/* Pipeline on-screen editable narrative fields */
.p-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.form input.pl-calc { background: #F4F7FA; cursor: default; }
.pipeline-intro-box { margin: 4px 0 16px 0; }
.pipeline-intro-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pipeline-intro-box textarea, .p-segnote-text { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; resize: vertical; }
.pipeline-intro-actions { margin-top: 6px; }
/* Inline editable segment-notes row (colspan) within the unified table */
.p-segnote-row td { padding: 10px 12px; background: #F9FAFB; }
.p-segnote-row label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.p-segnote-row button { margin-top: 6px; }

/* Pipeline print report — R3 Global PDF memo format.
   Hidden on screen; shown via body.pipeline-printing. */
#pipelinePrint { display: none; }
.pp-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 3px solid #1A3A5C; padding-bottom: 6px; margin-bottom: 10px; }
.pp-brand { font-family: 'Saira Condensed', Arial, sans-serif; font-weight: 800; font-size: 24px; letter-spacing: 0.04em; color: #1A3A5C; text-transform: uppercase; }
.pp-memo { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #6a7180; font-weight: 700; }
.pp-titlebar { margin-bottom: 10px; }
.pp-title { font-size: 19px; font-weight: 800; color: #0a0c12; }
.pp-update { font-size: 12px; font-weight: 600; color: #6a7180; }
.pp-subtitle { font-size: 12px; color: #6a7180; margin-top: 2px; }
.pp-intro { font-size: 12px; line-height: 1.5; color: #1F2937; margin: 0 0 14px 0; }
.pp-section { margin-bottom: 14px; page-break-inside: avoid; }
.pp-sec-head { font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: #1A3A5C; text-transform: uppercase; border-bottom: 1.5px solid #1A3A5C; padding-bottom: 3px; margin: 0 0 4px 0; }
.pp-sec-desc { font-size: 11px; font-style: italic; color: #6a7180; margin-bottom: 6px; }
#pipelinePrint table.pp-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 6px; table-layout: fixed; }
.pp-table th, .pp-table td { border: 1px solid #d0d5dd; padding: 5px 7px; text-align: left; vertical-align: top; word-wrap: break-word; overflow-wrap: break-word; }
.pp-table th { background: #f3f5f8; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; color: #374151; }
.pp-table thead th { position: sticky; top: 0; }
.pp-table .pp-num { text-align: center; }
/* Full-width colspan rows inside the single print table */
.pp-seg-row td { background: #1A3A5C; color: #fff; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 5px 7px; page-break-after: avoid; }
.pp-seg-desc-row td { font-style: italic; font-size: 11px; color: #6a7180; background: #fff; page-break-after: avoid; }
.pp-notes-row td { font-size: 11px; line-height: 1.45; color: #1F2937; background: #fcfcfd; }
.pp-table tr { page-break-inside: avoid; }
.pp-notes-label { font-weight: 700; color: #1A3A5C; }
.pp-legend { font-size: 11px; color: #374151; margin-top: 16px; padding-top: 8px; border-top: 1px solid #d0d5dd; }
.pp-leg { display: inline-flex; align-items: center; margin-right: 14px; white-space: nowrap; }
.pp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.pp-dot-green { background: #059669; } .pp-dot-blue { background: #2563EB; }
.pp-dot-amber { background: #D97706; } .pp-dot-gray { background: #9CA3AF; }
.pp-dot-purple { background: #7C3AED; }
.pp-foot { margin-top: 16px; font-size: 10px; letter-spacing: 0.06em; color: #6a7180; border-top: 1px solid #d0d5dd; padding-top: 8px; text-align: center; text-transform: uppercase; }

@media print {
  body.pipeline-printing > *:not(#pipelinePrint) { display: none !important; }
  body.pipeline-printing #pipelinePrint { display: block !important; }
}


/* =========================================================================
   Calculator tab (Sales ▸ Calculator) — Power Generation Cost Calculator.
   Ported natively from the standalone tool, restyled with GMM design tokens
   (flat, no gradients/shadows). All selectors scoped under #tab-calc.
   ========================================================================= */
#tab-calc .calc-intro { background:#fff; border:1px solid var(--border); border-radius:6px; padding:12px 14px; margin-bottom:14px; font-size:13px; }
#tab-calc .calc-intro strong { color:var(--navy); display:block; margin-bottom:2px; }
#tab-calc .calc-intro span { color:var(--muted); }
#tab-calc .calc-wrap { display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start; }
@media (max-width:860px){ #tab-calc .calc-wrap { grid-template-columns:1fr; } }
#tab-calc .calc-section { background:#fff; border:1px solid var(--border); border-radius:6px; margin-bottom:12px; overflow:hidden; }
#tab-calc .calc-shead { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; cursor:pointer; background:#fbfcfe; border-bottom:1px solid transparent; }
#tab-calc .calc-section.open .calc-shead { border-bottom:1px solid var(--border); }
#tab-calc .calc-lt { display:flex; align-items:center; gap:9px; }
#tab-calc .calc-shead h2 { font-size:13px; font-weight:600; color:var(--navy); text-transform:uppercase; letter-spacing:.4px; margin:0; }
#tab-calc .calc-rt { display:flex; align-items:center; gap:10px; }
#tab-calc .calc-tot { font-size:13px; font-weight:600; color:var(--navy); font-variant-numeric:tabular-nums; }
#tab-calc .calc-chev { transition:transform .2s; color:var(--muted); font-size:11px; }
#tab-calc .calc-section.open .calc-chev { transform:rotate(90deg); }
#tab-calc .calc-pinned { font-size:9px; background:#eef3f8; color:var(--navy); padding:2px 6px; border-radius:4px; text-transform:uppercase; letter-spacing:.5px; }
#tab-calc .calc-sbody { padding:14px; display:none; }
#tab-calc .calc-section.open .calc-sbody { display:block; }
#tab-calc .calc-row { display:grid; grid-template-columns:1fr 140px; gap:10px; align-items:center; margin-bottom:9px; }
#tab-calc .calc-row label { font-size:12.5px; color:var(--text); }
#tab-calc .calc-row input, #tab-calc .calc-row select { width:100%; padding:8px 9px; border:1px solid var(--border); border-radius:6px; font-size:13px; font-family:inherit; color:var(--text); background:#fff; text-align:right; }
#tab-calc .calc-row select, #tab-calc .calc-row input[type=text] { text-align:left; }
#tab-calc .calc-row input:focus, #tab-calc .calc-row select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 2px rgba(37,99,235,.12); }
/* Full-width stacked row (label above field) for multi-line free-text inputs
   — Deal Header's product/recommendation/required-actions (Session 3). */
#tab-calc .calc-row-full { grid-template-columns:1fr; }
#tab-calc .calc-row-full label { margin-bottom:4px; }
#tab-calc .calc-row-full textarea { width:100%; padding:8px 9px; border:1px solid var(--border); border-radius:6px; font-size:12.5px; font-family:inherit; color:var(--text); background:#fff; text-align:left; resize:vertical; }
#tab-calc .calc-row-full textarea:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 2px rgba(37,99,235,.12); }
#tab-calc .calc-ai { background:#eef3f8; border:1px solid #d6e2ee; color:var(--blue); border-radius:6px; padding:5px 9px; font-size:11px; cursor:pointer; white-space:nowrap; }
#tab-calc .calc-ai:hover { background:#e2ecf6; }
#tab-calc .calc-ai:disabled { opacity:.5; cursor:default; }
#tab-calc .calc-aihint { grid-column:1 / -1; font-size:11px; color:var(--muted); background:#fafbfd; border:1px dashed var(--border); border-radius:6px; padding:7px 9px; margin-top:4px; display:none; }
#tab-calc .calc-aihint.show { display:block; }
#tab-calc .calc-ratehint { grid-column:1 / -1; font-size:11px; color:var(--muted); background:#f4f8ff; border:1px dashed #b9d4ff; border-radius:6px; padding:7px 9px; margin-top:4px; display:none; }
#tab-calc .calc-ratehint.show { display:block; }
#tab-calc .calc-refnote { grid-column:1 / -1; font-size:11px; color:var(--muted); background:#f8faf4; border:1px dashed #c4d9a8; border-radius:6px; padding:7px 9px; margin-top:4px; line-height:1.5; }
#tab-calc .calc-applynote { font-size:11px; color:#1e40af; background:#eff6ff; border:1px dashed #93c5fd; border-radius:4px; padding:5px 8px; margin-top:4px; line-height:1.5; }
#tab-calc .calc-freight-warn { background:#fff7ed; border:1.5px solid #f59e0b; border-radius:6px; padding:10px 12px; margin-top:6px; font-size:12px; line-height:1.5; color:#78350f; }
#tab-calc .calc-freight-warn strong { color:#b45309; }
/* Legacy commission profile warning — same amber pattern as calc-freight-warn; not dismissible. */
#tab-calc .ra-legacy-warn { background:#fff7ed; border:1.5px solid #f59e0b; border-radius:6px; padding:10px 16px; margin:12px 16px 0; font-size:12px; line-height:1.5; color:#78350f; }
#tab-calc .ra-legacy-warn strong { color:#b45309; }
#tab-calc .calc-side { position:sticky; top:18px; }
#tab-calc .calc-card { background:#fff; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
#tab-calc .calc-ch { background:var(--navy); color:#fff; padding:12px 14px; font-size:12px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; }
#tab-calc .calc-cb { padding:16px; }
#tab-calc .calc-big { font-size:26px; font-weight:700; color:var(--navy); font-variant-numeric:tabular-nums; }
#tab-calc .calc-biglbl { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:2px; }
#tab-calc .calc-kv { display:flex; justify-content:space-between; padding:7px 0; border-top:1px solid var(--border); font-size:13px; }
#tab-calc .calc-kv .k { color:var(--muted); }
#tab-calc .calc-kv .v { font-weight:600; font-variant-numeric:tabular-nums; }
#tab-calc .calc-kv.hl .v { color:var(--green); }
#tab-calc .calc-bars { margin-top:14px; }
#tab-calc .calc-bar { margin-bottom:7px; }
#tab-calc .calc-bl { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); margin-bottom:3px; }
#tab-calc .calc-track { height:7px; background:#eef2f6; border-radius:4px; overflow:hidden; }
#tab-calc .calc-fill { height:100%; border-radius:4px; }
#tab-calc .calc-checklist { margin-top:14px; }
#tab-calc .calc-ci { display:flex; align-items:center; gap:8px; font-size:12px; padding:4px 0; color:var(--muted); }
#tab-calc .calc-dot { width:8px; height:8px; border-radius:50%; background:#cfd8e2; flex-shrink:0; }
#tab-calc .calc-ci.done { color:var(--text); }
#tab-calc .calc-ci.done .calc-dot { background:var(--green); }
#tab-calc .calc-foot { font-size:10.5px; color:var(--muted); padding:14px; line-height:1.5; display:flex; justify-content:space-between; align-items:center; gap:10px; }
#tab-calc #calcResetBtn { font-size:11px; padding:4px 10px; border:1px solid #fca5a5; border-radius:4px; background:#fff; color:#dc2626; cursor:pointer; white-space:nowrap; flex-shrink:0; }
#tab-calc #calcResetBtn:hover { background:#fef2f2; }

/* Revenue Analyzer — tier badge classes (extend .badge) */
.badge.b-tier-inadequate { background:#DC2626; color:#fff; font-weight:700; }
.badge.b-tier-marginal   { background:#D97706; color:#fff; font-weight:700; }
.badge.b-tier-solid      { background:#2563EB; color:#fff; font-weight:700; }
.badge.b-tier-optimal    { background:#059669; color:#fff; font-weight:700; }

/* Revenue Analyzer — collapsible panel + two-column layout (mirrors calc-wrap) */
#tab-calc .ra-panel { margin-top:24px; }
#tab-calc .ra-panel-head { display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; background:var(--navy); color:#fff; border-radius:6px 6px 0 0;
  cursor:pointer; border:none; width:100%; text-align:left; font-family:inherit; }
#tab-calc .ra-panel-head:hover { background:var(--navy-dark); }
#tab-calc .ra-panel-title { display:block; font-size:14px; font-weight:700; letter-spacing:.3px; }
#tab-calc .ra-panel-sub   { display:block; font-size:11px; opacity:.75; margin-top:2px; }
#tab-calc .ra-chev { font-size:12px; transition:transform .2s; flex-shrink:0; }
#tab-calc .ra-body { background:#f8fafc; border:1px solid var(--border); border-top:none;
  border-radius:0 0 6px 6px; padding:16px; }
#tab-calc .ra-wrap { display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start; }
@media (max-width:860px){ #tab-calc .ra-wrap { grid-template-columns:1fr; } }
#tab-calc .ra-side { position:sticky; top:18px; }
/* Tier hero block in the output card */
#tab-calc .ra-tier-hero { text-align:center; padding:10px 0 14px; }
#tab-calc .ra-tier-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; margin-bottom:5px; }
#tab-calc .ra-net-pct { font-size:22px; font-weight:700; color:var(--navy); margin-top:7px; font-variant-numeric:tabular-nums; }
#tab-calc .ra-net-sublabel { font-size:10px; color:var(--muted); margin-top:2px; }
#tab-calc .ra-bracket { font-size:11px; padding:4px 0; }
#tab-calc .ra-bracket .k { color:var(--muted); padding-left:14px; }
#tab-calc .ra-net-row { border-top:2px solid var(--navy); margin-top:5px; padding-top:9px; }
#tab-calc .ra-net-row .k { font-weight:600; color:var(--navy); }
#tab-calc .ra-net-row .v { color:var(--navy); font-size:16px; font-weight:700; }
/* Active commission-profile sub-label, shown beneath the Consultant Commission row. */
#tab-calc .ra-profile-sub { display:block; font-size:10px; font-weight:400; color:var(--muted); margin-top:2px; }

/* Revenue Analyzer — mode bar and scenario table (Session 2) */
#tab-calc .ra-mode-bar { display:flex; gap:6px; padding:10px 16px 0; border-top:1px solid var(--border); background:#fff; }
#tab-calc .ra-mode-btn { padding:5px 14px; border:1px solid var(--border); border-radius:4px; background:#fff; color:var(--muted); font-size:12px; font-weight:600; cursor:pointer; transition:background .15s,color .15s,border-color .15s; }
#tab-calc .ra-mode-btn:hover { background:var(--light); color:var(--text); }
#tab-calc .ra-mode-btn.active { background:var(--navy); color:#fff; border-color:var(--navy); }
#tab-calc .ra-reset-btn { color:#dc2626; border-color:#fca5a5; margin-left:auto; }
#tab-calc .ra-reset-btn:hover { background:#fef2f2; color:#dc2626; }
/* Top-level calc-mode bar (Backward-Solve / Forward-Calculate) — visually set
   apart from the nested Scenario/Custom sub-mode bar so the active mode is
   never ambiguous (Session 2, 2026-07-26). */
#tab-calc .ra-calcmode-bar { background:#f4f8ff; padding-bottom:10px; border-top:none; }

#tab-calc .ra-scenario-section { padding:14px 16px 18px; }
#tab-calc .ra-scenario-togglebar { display:flex; gap:6px; margin-bottom:10px; }
#tab-calc .ra-scenario-btn { padding:4px 12px; border:1px solid var(--border); border-radius:4px; background:#fff; color:var(--muted); font-size:11px; font-weight:600; cursor:pointer; }
#tab-calc .ra-scenario-btn.active { background:var(--navy); color:#fff; border-color:var(--navy); }
#tab-calc .ra-prop-callout { font-size:11.5px; color:var(--muted); background:#f4f8ff; border:1px dashed #b9d4ff; border-radius:4px; padding:5px 9px; margin-bottom:10px; line-height:1.5; }
#tab-calc .ra-prop-callout strong { color:var(--navy); }
#tab-calc .ra-profile-caption { font-size:11px; color:var(--muted); margin-bottom:8px; }

#tab-calc .ra-table-wrap { overflow-x:auto; }
#tab-calc .ra-scenario-table { border-collapse:collapse; width:100%; min-width:420px; font-size:12px; }
#tab-calc .ra-scenario-table th { padding:6px 10px; text-align:center; border-bottom:2px solid var(--navy); color:var(--navy); font-weight:700; font-size:11px; white-space:nowrap; }
#tab-calc .ra-th-label { text-align:left !important; color:var(--muted) !important; font-weight:600 !important; }
#tab-calc .ra-th-sub { font-size:9.5px; font-weight:400; color:var(--muted); }
#tab-calc .ra-scenario-table td { padding:5px 10px; border-bottom:1px solid var(--border); }
#tab-calc .ra-td-label { color:var(--muted); font-size:11.5px; white-space:nowrap; }
#tab-calc .ra-td-val { text-align:center; font-variant-numeric:tabular-nums; white-space:nowrap; }
#tab-calc .ra-td-center { text-align:center; }
#tab-calc .ra-scenario-table tr.ra-row-net td { border-top:2px solid var(--navy); font-weight:700; color:var(--navy); }
#tab-calc .ra-scenario-table tr.ra-row-net .ra-td-val { font-size:13px; }
#tab-calc .ra-scenario-table tbody tr:last-child td { border-bottom:none; }

/* =========================================================================
   Gen Market Importer — Section A of the Upload tab. Styled with the app's
   own CSS variables (no green accent theme from the standalone file).
   ========================================================================= */
.gmi-section { max-width: 980px; margin: 0 auto 22px; }
.gmi-section.gmi-section-b { padding-top: 18px; border-top: 1px solid var(--border); }
.gmi-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.gmi-h2 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.gmi-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; max-width: 760px; line-height: 1.5; }

.gmi-apikey-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.gmi-apikey-btn:hover { border-color: var(--navy); color: var(--navy); }
.gmi-api-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.gmi-api-dot.connected { background: var(--green); }

.gmi-step.card { padding: 18px; margin-bottom: 12px; }
.gmi-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gmi-step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gmi-step-num.done { background: var(--green); }
.gmi-step-num.pending { background: #cbd5e1; }
.gmi-step-title { font-size: 15px; font-weight: 600; color: var(--text); }
.gmi-step-title .gmi-opt { font-weight: 400; font-size: 13px; color: var(--muted); }
.gmi-step-sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }

.gmi-dropzone { margin-bottom: 0; }
.gmi-dropzone.has-file { border-style: solid; border-color: var(--green); background: #ECFDF5; color: var(--text); }

.gmi-step textarea { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 9px 11px;
  font-size: 13px; background: #fff; color: var(--text); font-family: inherit; resize: vertical; min-height: 70px; }
.gmi-step textarea:focus { outline: none; border-color: var(--navy); }

.gmi-status { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 18px; }
.gmi-status.error { color: var(--red); }
.gmi-status.success { color: var(--green); }

.gmi-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.gmi-summary-card { background: #F9FAFB; border: 1px solid var(--border); border-radius: 6px; padding: 11px 13px; }
.gmi-summary-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.gmi-summary-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.gmi-summary-value.warn { color: var(--amber); }

.gmi-warnings-list { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; }
.gmi-warnings-title { font-size: 11px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.gmi-warnings-list ul { list-style: none; padding: 0; margin: 0; }
.gmi-warnings-list li { font-size: 13px; color: var(--text); padding: 2px 0; }
.gmi-warnings-list li::before { content: "•"; color: var(--amber); margin-right: 6px; }

.gmi-preview-wrap { overflow-x: auto; overflow-y: auto; max-height: 480px; padding: 0; }
.gmi-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gmi-preview-table th { position: sticky; top: 0; background: #F9FAFB; text-align: left; padding: 7px 9px;
  font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.gmi-preview-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.gmi-preview-table tr.has-warning td { background: #FFFBEB; }

.gmi-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.gmi-spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff; border-radius: 50%; animation: gmi-spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes gmi-spin { to { transform: rotate(360deg); } }

.gmi-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center;
  justify-content: center; z-index: 200; padding: 1rem; }
.gmi-modal { background: #fff; border-radius: 8px; padding: 22px; max-width: 480px; width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18); }
.gmi-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.gmi-modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.gmi-modal-sub code { background: #F3F4F6; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.gmi-modal input { width: 100%; border: 1px solid var(--border); border-radius: 4px; padding: 9px 11px;
  font-size: 13px; background: #fff; color: var(--text); }
.gmi-modal input:focus { outline: none; border-color: var(--navy); }
.gmi-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- Availability Sheet modal ---- */
.avail-sheet-modal-box { width: min(92vw, 960px); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; }
.avail-sheet-fields { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border, #e5e7eb); }
.avail-sheet-fields-row { display: flex; gap: 12px; flex-wrap: wrap; }
.avail-sheet-fields-row .field { flex: 1; min-width: 160px; }
.avail-sheet-actions { display: flex; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border, #e5e7eb); flex-wrap: wrap; }
.avail-sheet-preview { padding: 20px; background: #f9fafb; }
.as-preview-doc { font-family: Arial, sans-serif; font-size: 12px; color: #000; max-width: 860px; margin: 0 auto; }
.as-preview-label { font-size: 10px; letter-spacing: 3px; color: #595959; text-transform: uppercase; margin-bottom: 14px; }
.as-preview-title { font-size: 24px; font-weight: bold; color: #1F3864; border-bottom: 3px solid #D6E4F0; padding-bottom: 5px; margin-bottom: 8px; }
.as-preview-project { font-size: 13px; color: #2E75B6; font-weight: bold; margin-bottom: 14px; }
.as-preview-info-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.as-preview-info-table td { border: 1px solid #CCC; padding: 5px 10px; font-size: 12px; }
.as-info-label { font-weight: bold; color: #2E75B6; width: 70px; white-space: nowrap; }
.as-preview-metrics { display: flex; gap: 8px; margin-bottom: 14px; }
.as-metric { flex: 1; border: 1px solid #CCC; text-align: center; padding: 8px 4px; }
.as-metric-label { font-size: 9px; color: #595959; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.as-metric-value { font-size: 16px; font-weight: bold; color: #1F3864; }
.as-preview-section-title { font-size: 14px; font-weight: bold; color: #2E75B6; border-bottom: 2px solid #2E75B6; padding-bottom: 3px; margin: 14px 0 6px; }
.as-preview-body { font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.as-preview-equip-table { width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 12px; }
.as-preview-equip-table th { background: #1F3864; color: #fff; padding: 5px 4px; font-size: 9px; text-align: center; }
.as-preview-equip-table td { border-bottom: 1px solid #eee; padding: 4px 3px; }
.as-preview-equip-table tr:nth-child(even) td { background: #F2F2F2; }
.as-preview-contact { background: #D6E4F0; padding: 10px 14px; font-size: 12px; margin-bottom: 10px; line-height: 1.7; }
.as-preview-disclaimer { font-size: 9px; color: #595959; font-style: italic; border-top: 1px solid #CCC; padding-top: 6px; line-height: 1.5; }

/* ============ Sourcing Partners (Intelligence ▸ Sourcing Partners, admin) ============
   Internal-only NSP / Named Broker intelligence. Navy/gold theme (--navy #1A3A5C,
   gold #C9A84C). Never buyer-facing. */
#tab-sourcing-partners { --gold: #C9A84C; }
.section-header { margin-bottom: 16px; }
.section-header h2 { margin: 0 0 4px 0; color: var(--navy); font-size: 20px; }
.section-desc { font-size: 13px; color: var(--muted); max-width: 760px; line-height: 1.5; }

.sourcing-confidential-banner {
  background: #FEF2F2; border: 1px solid #FECACA; border-left: 4px solid var(--red);
  color: #991B1B; font-size: 13px; font-weight: 600; line-height: 1.5;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px;
}

.sourcing-taxonomy {
  background: #F9FAFB; border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; margin-bottom: 18px;
}
.sourcing-taxonomy-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 8px;
}
.sourcing-taxonomy-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tax-pill {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  border: 1px solid transparent; white-space: nowrap;
}
.tax-nsp { background: #FCE7F3; color: #9D174D; border-color: #FBCFE8; }
.tax-ib  { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.tax-oem { background: #DBEAFE; color: #1E40AF; border-color: #BFDBFE; }
.tax-rr  { background: #FFEDD5; color: #9A3412; border-color: #FED7AA; }
.tax-dos { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }

.sourcing-section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold, #C9A84C); border-bottom: 2px solid var(--gold, #C9A84C);
  padding-bottom: 5px; margin: 22px 0 14px 0;
}

.sourcing-card {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--navy);
  border-radius: 6px; padding: 16px 18px; margin-bottom: 16px;
}
.sourcing-card-header { margin-bottom: 12px; }
.sourcing-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sourcing-card-name { font-size: 17px; font-weight: 700; color: var(--navy); }
.sourcing-card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.sourcing-card-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sourcing-card-stats span {
  font-size: 12px; font-weight: 600; color: var(--text);
  background: #F3F4F6; border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 10px;
}

.sourcing-card-warning {
  background: #FFFBEB; border: 1px solid #FDE68A; border-left: 4px solid var(--amber);
  color: #92400E; font-size: 12px; line-height: 1.5; padding: 10px 12px;
  border-radius: 6px; margin: 12px 0;
}
.sd-load-warning {
  background: #FFFBEB; border: 1px solid #FDE68A; border-left: 4px solid var(--amber);
  color: #92400E; font-size: 12px; line-height: 1.5; padding: 10px 12px;
  border-radius: 6px; margin-bottom: 12px;
}
.sd-load-warning a { color: #92400E; font-weight: 600; }
.sourcing-card-info {
  background: #EFF6FF; border: 1px solid #BFDBFE; border-left: 4px solid var(--blue);
  color: #1E3A8A; font-size: 12px; line-height: 1.6; padding: 10px 12px;
  border-radius: 6px; margin: 12px 0;
}
.sourcing-card-contacts, .sourcing-card-categories {
  font-size: 12px; color: var(--text); line-height: 1.6; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.sourcing-card-contacts strong, .sourcing-card-categories strong { color: var(--navy); }

.sp-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.sp-badge-nsp       { background: #FCE7F3; color: #9D174D; }
.sp-badge-ib        { background: #FEF3C7; color: #92400E; }
.sp-badge-qualified { background: #D1FAE5; color: #065F46; }
.sp-badge-active    { background: #D1FAE5; color: #065F46; }
.sp-badge-warning   { background: #FEF3C7; color: #92400E; }
.sp-badge-search    { background: #DBEAFE; color: #1E40AF; }

.sourcing-inventory-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0; }
.sourcing-inventory-table th {
  background: var(--navy); color: #fff; padding: 7px 8px; text-align: left;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
}
.sourcing-inventory-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sourcing-inventory-table tr:nth-child(even) td { background: #F9FAFB; }
.sourcing-inventory-table tr:last-child td { border-bottom: none; }

.sp-status {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; display: inline-block;
}
.sp-status-green  { background: #D1FAE5; color: #065F46; }
.sp-status-amber  { background: #FEF3C7; color: #92400E; }
.sp-status-blue   { background: #DBEAFE; color: #1E40AF; }
.sp-status-purple { background: #EDE9FE; color: #5B21B6; }

.sourcing-add-placeholder {
  border: 2px dashed var(--border); border-radius: 8px; padding: 16px 18px;
  margin-top: 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #FAFAFA;
}
.sourcing-add-note { font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; min-width: 240px; }

/* ============ Sales Activity (Sales ▸ Activity, admin) ============
   Navy/gold theme (--navy #1A3A5C, gold #C9A84C). Read-only deal roll-up. */
#tab-activity { --gold: #C9A84C; }

.activity-stats-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.activity-stat-card {
  flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--navy); border-radius: 6px; padding: 14px 16px;
}
.activity-stat-card--highlight { border-top-color: var(--gold, #C9A84C); }
.activity-stat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); margin-bottom: 6px;
}
.activity-stat-value { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.activity-stat-card--highlight .activity-stat-value { color: #9A7B1E; }

.activity-table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.activity-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.activity-table th, .activity-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
}
.activity-table th {
  background: #F9FAFB; font-weight: 600; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
}
.activity-table tbody tr:last-child td { border-bottom: none; }
.activity-empty-row td { text-align: center; color: var(--muted); padding: 24px; font-style: italic; }
.activity-totals-row td {
  background: var(--navy); color: #fff; font-weight: 700; border-bottom: none;
}
.activity-totals-row strong { color: #fff; }

.activity-attribution-wrap { margin-top: 22px; }
.activity-attribution-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold, #C9A84C); margin-bottom: 12px;
}
.activity-attribution-bars { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.activity-attr-bar { display: flex; align-items: center; gap: 10px; }
.activity-attr-label { flex: 0 0 130px; font-size: 12px; color: var(--text); }
.activity-attr-track {
  flex: 1; height: 14px; background: #F3F4F6; border: 1px solid var(--border);
  border-radius: 7px; overflow: hidden;
}
.activity-attr-fill { height: 100%; background: var(--navy); border-radius: 7px 0 0 7px; }
.activity-attr-pct { flex: 0 0 70px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.activity-attribution-legend { margin-top: 12px; max-width: 620px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.activity-attribution-legend strong { color: var(--text); font-weight: 600; }

/* Deal Velocity (outcome tracking) — Activity tab */
.deal-velocity-wrap { margin: 4px 0 22px; }
.deal-velocity-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold, #C9A84C); margin-bottom: 12px;
}
.deal-velocity-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.dv-card {
  flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--navy); border-radius: 6px; padding: 10px 12px;
}
.dv-card--won { border-top-color: #2E7D32; }
.dv-card--lost { border-top-color: #C0392B; }
.dv-card--noresp { border-top-color: #B08900; }
.dv-card--hold { border-top-color: #6B7280; }
.dv-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 4px; }
.dv-card-value { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.dv-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.deal-velocity-metrics { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12px; color: var(--text); margin-bottom: 10px; }
.deal-velocity-metrics b { color: var(--navy); }
.deal-velocity-stalled { max-width: 720px; background: #FFF7E6; border: 1px solid #F0D9A0; border-radius: 6px; padding: 10px 12px; }
/* Native <details>/<summary>, same disclosure-triangle treatment as .c48-box:
   collapsed by default, count in the always-visible summary line. */
.deal-velocity-stalled > summary { cursor: pointer; list-style: none; }
.deal-velocity-stalled > summary::-webkit-details-marker { display: none; }
.deal-velocity-stalled > summary::before { content: '▶'; font-size: 9px; margin-right: 6px; }
.deal-velocity-stalled[open] > summary::before { content: '▼'; }
.dv-stalled-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #9A6B00; margin-bottom: 6px; }
.dv-stalled-item { font-size: 12px; color: var(--text); padding: 2px 0; }
.dv-stalled-days { font-weight: 700; color: #C0392B; }

/* Pipeline table — outcome badge + stage-aging hint */
.badge.p-outcome { margin-left: 4px; }
.p-outcome.o-won { background: #E6F4EA; color: #1E7B34; }
.p-outcome.o-lost { background: #FBEAEA; color: #B03A2E; }
.p-outcome.o-noresp { background: #FBF3DD; color: #8A6D0B; }
.p-outcome.o-hold { background: #EEF0F2; color: #4B5563; }
.p-age { font-size: 11px; color: var(--muted); margin-top: 3px; }
.p-age-stalled { color: #C0392B; font-weight: 600; }

/* Proposal tab (Sales ▸ Proposal) — placeholder header + empty state. */
.proposal-tab-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.proposal-tab-head h2 { margin: 0; }
.proposal-empty-state { color: var(--muted); font-size: 14px; padding: 28px 0; }

/* Proposal tab — list table, inline form, computed summary, entity toggle. */
.proposal-list-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.proposal-list-table th, .proposal-list-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.proposal-list-table th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.proposal-list-table td.proposal-empty-state { padding: 22px 12px; font-size: 14px; }
.proposal-list-table td a { color: var(--navy); font-weight: 600; }
.proposal-form-wrap { margin-top: 4px; }
.entity-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.entity-toggle .entity-opt { padding: 8px 18px; background: var(--card); border: none; cursor: pointer; font-size: 13px; color: var(--muted); }
.entity-toggle .entity-opt + .entity-opt { border-left: 1px solid var(--border); }
.entity-toggle .entity-opt.active { background: var(--navy); color: #fff; font-weight: 600; }
.proposal-summary-box { background: #F2F2F2; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 18px 0; max-width: 520px; }
.proposal-summary-box .ps-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 13px; }
.proposal-summary-box .ps-k { color: var(--muted); }
.proposal-summary-box .ps-v { font-weight: 600; color: var(--text); }
.proposal-form-error { color: #B91C1C; background: #FEE2E2; border: 1px solid #FCA5A5; border-radius: 6px; padding: 9px 12px; margin: 12px 0; font-size: 13px; max-width: 520px; }

/* ===== Proposal Builder (Phase 2A + preview) ============================= */
.btn.btn-block { width: 100%; justify-content: center; }
/* Photo upload */
.pf-photo-preview { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pf-photo-preview img { max-height: 56px; max-width: 110px; border: 1px solid var(--border); border-radius: 4px; }
.pf-photo-name { font-size: 12px; color: var(--muted); }
.pf-photo-clear { font-size: 12px; color: #B91C1C; cursor: pointer; }
/* STATE 2 controls */
.pf-edit-header { display: inline-block; margin: 14px 0 10px; font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; cursor: pointer; }
.pf-edit-header:hover { text-decoration: underline; }
.pf-state2-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.psec-actionbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.psec-bar-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.psec-expand-links { font-size: 12px; font-weight: 600; }
.psec-expand-links a { color: var(--navy); text-decoration: none; cursor: pointer; }
.psec-expand-links a:hover { text-decoration: underline; }
.psec-sep { color: var(--border); margin: 0 4px; }
/* Panels */
.proposal-sections { display: flex; flex-direction: column; gap: 6px; }
.psec { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.psec-head { display: flex; align-items: center; gap: 9px; padding: 9px 12px; background: #F2F2F2; cursor: pointer; user-select: none; }
.psec-head:hover { background: #ECECEC; }
.psec-chev { font-size: 10px; color: var(--muted); transition: transform 0.12s ease; display: inline-block; width: 11px; }
.psec.open .psec-chev { transform: rotate(90deg); }
.psec-num { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 18px; }
.psec-title { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.psec-edited { font-size: 10px; font-weight: 600; color: #B8860B; background: #FBF3DC; border: 1px solid #E8D49A; border-radius: 10px; padding: 1px 8px; }
.psec-body { padding: 12px; border-top: 1px solid var(--border); background: var(--card); }
.psec-reset { float: right; font-size: 11px; font-weight: 600; color: var(--navy); text-decoration: none; cursor: pointer; margin-bottom: 6px; }
.psec-reset:hover { text-decoration: underline; }
.psec-textarea { width: 100%; font-size: 13px; line-height: 1.5; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); padding: 9px; border: 1px solid var(--border); border-radius: 5px; resize: vertical; box-sizing: border-box; clear: both; }
.psec-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; clear: both; }
.psec-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.psec-table td { padding: 2px 6px; }
.psec-table td.psec-delcell { width: 28px; padding: 2px; text-align: center; }
.psec-table input { width: 100%; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; }
.psec-delrow { color: #B91C1C; cursor: pointer; font-size: 14px; border: none; background: none; }
.psec-addrow { font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none; cursor: pointer; }
.psec-addrow:hover { text-decoration: underline; }
.psec-subhead { font-size: 12px; font-weight: 600; color: var(--text); margin: 10px 0 4px; }
.psec-readonly { display: flex; flex-direction: column; gap: 5px; }
.psec-readonly .pr-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid #F0F0F0; }
.psec-readonly .pr-k { color: var(--muted); }
.psec-readonly .pr-v { font-weight: 600; color: var(--text); }

/* ===== Client-side document preview (matches r6.2 PDF) =================== */
.pf-preview-pane { margin-top: 18px; border: 1px solid var(--border); border-radius: 6px; background: #525659; }
.pf-preview-controls { display: flex; gap: 8px; padding: 10px 12px; background: #F2F2F2; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.pf-doc-scroll { max-height: 80vh; overflow-y: auto; padding: 24px 0; }
.pf-doc-page { width: 794px; margin: 0 auto 24px; background: #fff; padding: 48px 56px; box-shadow: 0 2px 12px rgba(0,0,0,0.4); box-sizing: border-box; font-family: Calibri, "Segoe UI", Arial, sans-serif; color: #111; }
.pf-doc-page.cover { display: flex; flex-direction: column; min-height: 1040px; }
.pf-bar { text-align: center; font-size: 10px; color: #666; padding: 6px 0; }
.pf-bar.top { border-top: 2px solid #1a3a6b; }
.pf-bar.bottom { border-top: 1px solid #1a3a6b; margin-top: auto; color: #999; }
.pf-cover-logo { display: block; max-width: 200px; max-height: 130px; margin: 40px auto 20px; object-fit: contain; }
.pf-cover-mid { text-align: center; }
.pf-c-doctype { font-weight: bold; font-size: 16px; color: #1a3a6b; }
.pf-c-buyer { font-size: 28px; color: #B8860B; font-weight: 500; margin: 6px 0; }
.pf-c-sub { font-style: italic; font-size: 13px; color: #555; }
.pf-c-cat { font-weight: bold; font-size: 16px; color: #1a3a6b; margin-top: 14px; }
.pf-c-equip { font-size: 14px; color: #1a3a6b; margin-top: 4px; }
.pf-c-specs { font-style: italic; font-size: 12px; color: #555; margin-top: 2px; }
.pf-cover-photo { width: 100%; max-height: 300px; object-fit: contain; margin: 22px 0; }
.pf-cover-photo-ph { width: 100%; height: 240px; background: #EEE; border: 1px solid #DDD; display: flex; align-items: center; justify-content: center; color: #999; font-size: 13px; margin: 22px 0; }
/* interior */
.pf-pagebreak { height: 24px; }
.pf-int-head { text-align: center; margin-bottom: 18px; }
.pf-int-date { font-weight: bold; font-size: 14px; }
.pf-int-terms { font-style: italic; font-size: 12px; color: #555; margin-top: 3px; }
.pf-int-prep { font-weight: bold; font-size: 13px; margin-top: 3px; }
.pf-int-title { font-weight: bold; font-size: 15px; color: #1a3a6b; margin-top: 3px; }
.pf-int-equip { font-size: 12px; color: #555; margin-top: 3px; }
.pf-prepfor { display: flex; gap: 40px; justify-content: center; text-align: center; margin: 18px 0; }
.pf-prepfor .pf-pf-col { min-width: 200px; }
.pf-pf-label { font-weight: bold; font-size: 11px; color: #1a3a6b; }
.pf-pf-name { font-weight: bold; font-size: 13px; }
.pf-pf-line { font-size: 12px; }
.pf-toc-h { font-weight: bold; text-transform: uppercase; color: #1a3a6b; font-size: 14px; border-bottom: 1px solid #1a3a6b; padding-bottom: 3px; margin: 20px 0 8px; }
.pf-toc { list-style: disc; padding-left: 22px; font-size: 12.5px; line-height: 1.7; }
.pf-sec-h { font-weight: bold; text-transform: uppercase; color: #1a3a6b; font-size: 14px; border-bottom: 1px solid #1a3a6b; padding-bottom: 3px; margin: 24px 0 8px; }
.pf-sub-gold { color: #B8860B; font-weight: 500; font-size: 13px; display: block; margin-top: 12px; margin-bottom: 4px; }
.pf-body { font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; margin: 6px 0; }
.pf-dtable { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.pf-dtable th { background: #1a3a6b; color: #fff; font-weight: bold; text-align: left; padding: 6px 9px; }
.pf-dtable td { padding: 6px 9px; border-bottom: 1px solid #E5E5E5; }
.pf-dtable tbody tr:nth-child(even) td { background: #F6F6F6; }
.pf-dtable tr.total td { font-weight: bold; }
.pf-sig { display: flex; gap: 40px; margin-top: 14px; }
.pf-sig .pf-sig-col { flex: 1; font-size: 12px; line-height: 2; }
.pf-sig-cap { display: flex; justify-content: space-between; font-weight: bold; font-size: 12px; margin-top: 8px; }
.pf-endmark { text-align: center; font-weight: bold; margin-top: 24px; font-size: 13px; }
.pf-disc-h { font-weight: bold; font-size: 11px; margin-top: 18px; }
.pf-disc { font-size: 10px; color: #555; font-style: italic; margin-top: 4px; line-height: 1.5; }

/* Proposal Builder — STATE 1 action buttons (Continue full-width; Preview+Generate below). */
#pf-state1-actions { margin-top: 14px; }
.pf-state1-buttons { display: flex; gap: 8px; margin-top: 8px; }
.pf-state1-buttons .btn { flex: 1; justify-content: center; }

/* =========================================================================
   PDF Builder (Sales ▸ Proposal ▸ PDF Builder mode) — Session 4
   All classes use .ppdf-* prefix to avoid collision with existing .pb-* (PM).
   ========================================================================= */

/* Outer wrap */
.ppdf-wrap { margin-top: 4px; }
.ppdf-form { max-width: 1000px; }
.ppdf-form h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); margin: 0 0 16px 0; }

/* Form header row */
.ppdf-form-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }

/* Document Type bar — prominent top row */
.ppdf-doctype-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 14px; background: #F8F9FA; border: 1px solid var(--border); border-radius: 6px; flex-wrap: wrap; }
.ppdf-doctype-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); white-space: nowrap; }

/* Pipeline prefill row */
.ppdf-pipeline-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; padding: 12px 14px; background: #FBF8F1; border: 1px solid var(--gold); border-left: 4px solid var(--gold); border-radius: 6px; }
.ppdf-pipeline-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); white-space: nowrap; }
.ppdf-pipeline-select { font-size: 13px; padding: 6px 10px; border: 1px solid var(--navy); border-radius: 4px; min-width: 240px; font-weight: 600; color: var(--navy); }

.ppdf-variant-bar { display: flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.ppdf-variant-btn { background: #fff; color: var(--muted); border: none; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ppdf-variant-btn:hover { background: #F3F4F6; color: var(--text); }
.ppdf-variant-btn.active { background: var(--navy); color: #fff; }
.ppdf-variant-btn + .ppdf-variant-btn { border-left: 1px solid var(--border); }

/* Form blocks */
.ppdf-block { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.ppdf-block-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ppdf-block-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); }
.ppdf-block-actions { display: flex; gap: 6px; }
.ppdf-block-hint { font-size: 11px; color: var(--muted); }
/* Collapsible block header — clickable */
.ppdf-collapse-toggle { cursor: pointer; user-select: none; margin-bottom: 0; }
.ppdf-collapse-toggle:hover .ppdf-block-title { text-decoration: underline; }
.ppdf-chevron { font-size: 9px; margin-left: 4px; }
#pbSpecBlockBody { padding-top: 12px; }

/* Provenance badges (per-field next to labels) */
.ppdf-prov { display: inline-block; margin-left: 5px; vertical-align: middle; }
.ppdf-prov-typed     { background: #EFF6FF; color: #1D4ED8; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; border: 1px solid #BFDBFE; }
.ppdf-prov-extracted { background: #F0FDF4; color: #166534; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; border: 1px solid #BBF7D0; }
.ppdf-prov-corpus    { background: #F9FAFB; color: var(--muted); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; border: 1px solid var(--border); }

/* Payment schedule editor */
.ppdf-pay-block { margin-top: 14px; }
.ppdf-pay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ppdf-pay-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ppdf-pay-table th { text-align: left; padding: 4px 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--border); }
.ppdf-pay-table td { padding: 3px 4px; border-bottom: 1px solid #F3F4F6; }
.ppdf-pay-label, .ppdf-pay-trigger { width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.ppdf-pay-pct { width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; text-align: right; }
.ppdf-pay-usd { color: var(--muted); font-size: 12px; white-space: nowrap; padding: 3px 8px; }
.ppdf-pay-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.ppdf-pay-del:hover { color: var(--red); }
.ppdf-pay-sum { margin-top: 6px; font-size: 12px; color: var(--muted); }
.ppdf-pay-ok { color: #166534; }
.ppdf-pay-err { color: var(--red); }

/* Spec Sheet & Photo — adjacent two-column attach block */
.ppdf-attach-block { padding: 0; }
.ppdf-attach-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .ppdf-attach-row { grid-template-columns: 1fr; } }
.ppdf-attach-col { padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.ppdf-attach-note { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.4; }
/* S-B (2026-09-29) — per-proposal photo switch. */
.ppdf-photo-include { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin: 6px 0 8px; cursor: pointer; }
.ppdf-attach-default { display: flex; align-items: center; gap: 10px; }
.ppdf-attach-btn { background: #fff; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; color: var(--navy); }
.ppdf-attach-btn:hover { background: #F3F4F6; }
.ppdf-attach-hint { font-size: 11px; color: var(--muted); }
.ppdf-attach-alt { background: none; border: none; font-size: 11px; color: var(--navy); cursor: pointer; padding: 0; text-decoration: underline; }
.ppdf-attach-alt:hover { color: var(--text); }
.ppdf-attach-status { font-size: 12px; color: var(--muted); }
.ppdf-attach-error { font-size: 12px; color: var(--red); margin-top: 2px; }

/* Chip UI — file/library chip with × remove */
.ppdf-chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ppdf-chip { display: inline-flex; align-items: center; gap: 4px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 4px; padding: 4px 8px; font-size: 12px; max-width: 240px; }
.ppdf-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1D4ED8; }
.ppdf-chip-x { background: none; border: none; color: #93C5FD; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.ppdf-chip-x:hover { color: var(--red); }
.ppdf-chip-action { display: inline-flex; align-items: center; gap: 5px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 4px; padding: 5px 10px; font-size: 12px; font-weight: 600; color: #166534; cursor: pointer; text-align: left; }
.ppdf-chip-action:hover { background: #DCFCE7; }
/* Auto-found green chip variant */
.ppdf-chip-green .ppdf-chip { background: #F0FDF4; border-color: #86EFAC; }
.ppdf-chip-green .ppdf-chip-label { color: #166534; }
.ppdf-chip-green .ppdf-chip-x { color: #86EFAC; }
/* Amber warning for missing spec/photo */
.ppdf-amber-row { font-size: 12px; color: #92400E; background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 4px; padding: 6px 10px; line-height: 1.4; }
/* Count badge in collapsible section headers */
.ppdf-section-badge { font-size: 10px; font-weight: 600; color: #166534; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 10px; padding: 1px 7px; }
/* Equipment Details sub-section header */
.ppdf-sub-head { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; padding-top: 8px; border-top: 1px solid var(--border); cursor: pointer; user-select: none; }
.ppdf-sub-head:hover .ppdf-block-title { text-decoration: underline; }

/* Computed summary box */
.ppdf-computed-box { background: #F4F7FA; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 14px 0; max-width: 540px; }
.ppdf-sum-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #E8ECF0; }
.ppdf-sum-row:last-child { border-bottom: none; }
.ppdf-sum-row span:first-child { color: var(--muted); }
.ppdf-sum-row span:last-child { font-weight: 700; color: var(--navy); }

/* Actions row */
.ppdf-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.ppdf-gen-wrap { display: flex; align-items: center; gap: 8px; }
.ppdf-gen-type-label { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Preview wrapper (below form) */
.ppdf-preview-wrap { margin-top: 18px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ppdf-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #F2F2F2; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.ppdf-preview-frame { width: 100%; height: 80vh; border: none; display: block; background: #fff; }

/* Spec picker modal */
.ppdf-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: flex-start; justify-content: center; z-index: 9999; padding-top: 48px; }
.ppdf-modal-content { background: #fff; border-radius: 8px; width: 640px; max-width: 96vw; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.2); overflow: hidden; }
.ppdf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ppdf-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.ppdf-modal-close:hover { color: var(--text); }

/* Spec upload section */
.ppdf-spec-upload { padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ppdf-spec-upload-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ppdf-spec-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ppdf-spec-file-name { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppdf-spec-status { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 16px; }
.ppdf-save-lib-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 5px; font-size: 12px; color: #166534; }

/* Divider between upload and library */
.ppdf-spec-divider { text-align: center; font-size: 11px; color: var(--muted); padding: 10px 18px 8px; flex-shrink: 0; }

/* Spec search */
.ppdf-spec-search { width: 100%; border: none; border-bottom: 1px solid var(--border); padding: 10px 18px; font-size: 13px; outline: none; box-sizing: border-box; flex-shrink: 0; }
.ppdf-spec-search:focus { border-bottom-color: var(--navy); }

/* Spec library list */
.ppdf-spec-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.ppdf-spec-loading, .ppdf-spec-empty { padding: 20px 18px; font-size: 13px; color: var(--muted); }
.ppdf-spec-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 18px; border-bottom: 1px solid #F3F4F6; }
.ppdf-spec-item:hover { background: #FAFAFA; }
.ppdf-spec-item-info { flex: 1; min-width: 0; }
.ppdf-spec-mfg { font-size: 12px; font-weight: 700; color: var(--navy); }
.ppdf-spec-model { font-size: 12px; color: var(--text); margin-left: 6px; }
.ppdf-spec-title { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppdf-spec-meta { font-size: 10px; color: var(--muted); margin-left: 4px; }

/* =========================================================================
   Transaction Tracker (Sales ▸ Tracker)
   ========================================================================= */

/* Status dot — colored circle used in both list view phase pills and stepper */
.deal-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
}
.deal-dot.deal-dot-lg { width: 14px; height: 14px; }
.deal-dot.ds-not-started   { background: var(--muted); }
.deal-dot.ds-in-progress   { background: var(--navy); }
.deal-dot.ds-awaiting      { background: var(--gold); }
.deal-dot.ds-complete      { background: var(--green); }
.deal-dot.ds-blocked       { background: var(--red); }

/* List view */
.tracker-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0 10px;
}
.tracker-toolbar input[type="search"],
.tracker-toolbar select {
  border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px;
  font-size: 13px; background: #fff; color: var(--text); height: 32px;
}
.tracker-toolbar input[type="search"] { min-width: 200px; }
.deal-list-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.deal-list-table th {
  background: #F9FAFB; font-weight: 600; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; border-bottom: 2px solid var(--border); text-align: left;
}
.deal-list-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.deal-row:hover td { background: #F0F4FF; }
.deal-id-label { font-family: monospace; font-size: 12px; color: var(--muted); }
.deal-phase-pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: #EFF6FF; color: var(--navy); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.deal-progress-bar {
  height: 6px; background: var(--border); border-radius: 3px; min-width: 80px;
}
.deal-progress-fill { height: 100%; background: var(--navy); border-radius: 3px; }
.deal-cell-muted { color: var(--muted); font-size: 12px; }
.deal-cell-empty { text-align: center; color: var(--muted); padding: 28px 0; }

/* Detail toolbar */
.tracker-detail-toolbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 0 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.deal-detail-heading { font-size: 16px; font-weight: 700; margin: 0; color: var(--navy); }

/* Two-column layout */
.deal-detail-layout { display: flex; gap: 20px; align-items: flex-start; }
.deal-left-col { width: 34%; min-width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.deal-right-col { flex: 1; min-width: 0; }

/* Meta panel */
.deal-meta-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px;
}
.deal-meta-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.deal-meta-title { font-weight: 700; font-size: 15px; color: var(--navy); }
.deal-meta-edit-btn {
  font-size: 11px; background: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 8px;
  cursor: pointer; flex-shrink: 0;
}
.deal-meta-edit-btn:hover { color: var(--navy); border-color: var(--navy); }
/* Generate Report — positive/export action, same green as .create-email-btn */
.deal-meta-edit-btn.deal-report-btn { background: var(--green); color: #fff; border-color: var(--green); }
.deal-meta-edit-btn.deal-report-btn:hover { background: #047857; border-color: #047857; color: #fff; }
.deal-meta-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; padding: 3px 0; }
.deal-meta-label { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Spread box */
.deal-spread-box {
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px;
}
.deal-spread-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; padding: 3px 0; }
.deal-spread-label { color: var(--muted); font-size: 12px; }
.deal-spread-val { font-weight: 600; }
.spread-pos { color: var(--green); }
.spread-neg { color: var(--red); }

/* Earnest row */
.deal-meta-row .deal-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 11px;
  background: #F3F4F6; color: var(--muted); border: 1px solid var(--border);
}

/* Parties panel */
.deal-parties-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px;
}
.deal-panel-heading { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.party-chips-grid { display: flex; flex-direction: column; gap: 6px; }
.party-chip {
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; font-size: 12px;
}
.party-chip-empty { border-style: dashed; background: #FAFAFA; }
.party-chip-role { font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.party-chip-org { font-weight: 600; color: var(--navy); }
.party-chip-contact { color: var(--muted); font-size: 11px; }
.party-chip-none { color: var(--muted); }
.party-chip-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.party-status-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 11px; background: #D1FAE5; color: #065F46;
}
.party-tag {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 11px; background: #F3F4F6; color: var(--muted); border: 1px solid var(--border);
}
.party-tag-proposal { background: #EFF6FF; color: var(--navy); border-color: #BFDBFE; }
.party-tag-loi { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.party-tag-ndanc { background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.party-chip-notes { margin-top: 6px; font-size: 11px; color: var(--muted); white-space: pre-wrap; }

/* Stepper (right column) */
.deal-stepper { display: flex; flex-direction: column; border-left: 2px solid var(--border); margin-left: 7px; }
.deal-phase-item { padding-left: 14px; position: relative; }
.deal-phase-item + .deal-phase-item { margin-top: 2px; }
.deal-phase-header {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 6px;
  border-radius: 4px; user-select: none;
}
.deal-phase-header:hover { background: #F3F4F6; }
.deal-phase-active > .deal-phase-header { background: #EFF6FF; }
.deal-phase-label { font-weight: 600; font-size: 13px; flex: 1; }
.deal-phase-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.deal-phase-chevron { font-size: 10px; color: var(--muted); }
.deal-phase-substeps { padding: 4px 0 8px 6px; display: flex; flex-direction: column; gap: 8px; }
.deal-phase-note { margin: 0; font-size: 12px; color: var(--muted, #6b7280); font-style: italic; }

/* Sub-step row */
.deal-substep { display: flex; align-items: flex-start; gap: 8px; }
.deal-substep-body { flex: 1; min-width: 0; }
.deal-substep-label { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.deal-substep-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.deal-resp-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: #F3F4F6; color: var(--muted); padding: 1px 5px; border-radius: 3px;
}
.deal-step-status-sel {
  font-size: 11px; border: 1px solid var(--border); border-radius: 3px; padding: 2px 4px;
  background: #fff; color: var(--text); max-width: 160px;
}
.deal-step-status-label { font-size: 11px; color: var(--muted); }
.deal-step-status-label.ds-complete  { color: var(--green); }
.deal-step-status-label.ds-blocked   { color: var(--red); }
.deal-step-status-label.ds-in-progress { color: var(--navy); }
.deal-step-status-label.ds-awaiting  { color: var(--gold); }

/* Document chips — clickable buttons */
.deal-doc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.deal-doc-chip {
  font-size: 11px; background: #EFF6FF; color: var(--navy);
  border: 1px solid #BFDBFE; border-radius: 3px; padding: 1px 6px;
  cursor: pointer;
}
.deal-doc-chip:hover { background: #DBEAFE; }
.deal-doc-chip-wrap { display: inline-flex; align-items: center; gap: 2px; }
.deal-doc-remove-btn {
  font-size: 12px; line-height: 1; background: none; color: var(--muted);
  border: none; padding: 1px 4px; cursor: pointer;
}
.deal-doc-remove-btn:hover { color: var(--red); }
.deal-attach-btn {
  font-size: 11px; background: none; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 3px; padding: 1px 6px;
  cursor: pointer;
}
.deal-attach-btn:hover { color: var(--navy); border-color: var(--navy); }

/* Party chip edit button */
.party-chip-edit-btn {
  margin-top: 4px; font-size: 11px; background: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 8px;
  cursor: pointer; display: block;
}
.party-chip-edit-btn:hover { color: var(--navy); border-color: var(--navy); }

/* Shared modal form rows (upload + party edit modals) */
.deal-form-row { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* New Deal modal form */
.deal-form { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.deal-form-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.deal-form-label .req { color: var(--red); }
/* The flex rule above outranks the UA [hidden] rule (LOI approver, 2026-09-29). */
.deal-form-label[hidden] { display: none !important; }
.deal-form-input {
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px;
  font-size: 13px; color: var(--text); background: #fff; font-weight: 400;
}
.deal-form-input:focus { outline: none; border-color: var(--navy); }
.deal-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* Deal deletion — soft-deleted list rows */
.deal-row-deleted td { opacity: 0.55; }
.deal-row-deleted .deal-id-label,
.deal-row-deleted td:nth-child(2) { text-decoration: line-through; }
.deal-row-deleted td.deal-actions-cell { text-decoration: none; }
.deal-row-deleted .btn { text-decoration: none; opacity: 1; }
.deal-deleted-badge {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 8px;
  background: #FEE2E2; color: #991B1B; font-size: 11px; font-weight: 600;
  text-decoration: none; vertical-align: middle;
}
.tracker-show-deleted-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap;
}

/* Deal detail — deleted-state banner */
.deal-deleted-banner {
  display: flex; align-items: center; gap: 12px;
  background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 6px;
  padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #92400E;
}
.deal-deleted-banner > span { flex: 1; }

/* Permanent-delete modal warning block */
.pdm-warning {
  background: #FEF2F2; border: 1px solid #FCA5A5; border-radius: 6px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: #7F1D1D;
}
.pdm-warning p { margin: 0 0 6px; }
.pdm-warning ul { margin: 4px 0 6px 18px; padding: 0; }
.pdm-warning li { margin-bottom: 3px; }

/* Loading message */
.loading-msg { color: var(--muted); padding: 24px; text-align: center; }
.loading-msg.err { color: var(--red); }

/* Proposal Status column + Pending Approvals panel (2026-09-29) — ONE state
   per row: Awaiting approval / Approved / Returned (+ note). Sentence case on
   purpose: the words are the ruled wording. Replaces the old uppercase
   .approval-badge on the Type cell (and its orphaned .pending-super rule). */
.proposal-status {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.proposal-status.awaiting { background: #FEF3C7; color: #78350F; }
.proposal-status.approved { background: #DCFCE7; color: #166534; }
.proposal-status.returned { background: #FEE2E2; color: #991B1B; }
.proposal-status-note { color: #991B1B; font-size: 11px; margin-top: 3px; max-width: 260px; }
.proposal-status-note.notice-failed { font-weight: 600; }

/* ======== Library tab + in-app picker (library-tab-and-inapp-picker) ======== */
.lib-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.lib-header h2 { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0; flex: 1 1 auto; }
.lib-search { border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; font-size: 13px; width: 240px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lib-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.lib-card-title { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.lib-card-sub { font-size: 11px; color: var(--muted); line-height: 1.4; }
.lib-card-meta { font-size: 11px; color: #9AA5B1; }
.lib-card-actions { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.lib-card-img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; background: #F3F4F6; display: block; }
.lib-card-img-placeholder { width: 100%; height: 120px; background: #F3F4F6; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #9AA5B1; font-size: 26px; }
.lib-card.picker-card { cursor: pointer; }
.lib-card.picker-card:hover { border-color: #93C5FD; background: #EFF6FF; }
.lib-empty { color: var(--muted); padding: 32px; text-align: center; font-size: 13px; }

/* Library picker modal */
.lib-picker-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.lib-picker-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.lib-picker-dialog { position: relative; background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); width: min(90vw, 740px); max-height: 80vh; display: flex; flex-direction: column; padding: 18px 20px 16px; gap: 10px; }
.lib-picker-head { display: flex; align-items: center; justify-content: space-between; }
.lib-picker-head h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0; }
.lib-picker-tabs { display: flex; gap: 4px; }
.lib-picker-tab { background: #F3F4F6; border: 1px solid var(--border); border-radius: 4px; padding: 4px 14px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.lib-picker-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.lib-picker-search { border: 1px solid var(--border); border-radius: 4px; padding: 5px 10px; font-size: 13px; width: 100%; box-sizing: border-box; }
.lib-picker-grid { overflow-y: auto; flex: 1; padding-right: 4px; }
.lib-picker-grid .lib-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ── Library direct-upload modal (2026-08-13) ─────────────────────────────
   Reuses .lib-picker-modal / -overlay / -dialog / -head from the picker above;
   only the body, hint, status and action row are new. */
.lib-upload-body { padding: 14px 16px; display: grid; gap: 12px; }
.lib-upload-body .field label { display: block; font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.lib-upload-body .field input[type="text"],
.lib-upload-body .field input[type="file"] { width: 100%; box-sizing: border-box; }
.lib-upload-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.lib-upload-status { font-size: 12px; color: var(--muted); min-height: 16px; }
.lib-upload-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }

/* LOI Builder modal */
.loi-builder-card { max-width: 700px !important; }
.loi-builder-body { padding: 0 18px 18px; overflow-y: auto; }
.loi-section-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); padding: 12px 0 4px; margin: 14px 0 10px; }
.loi-section-head:first-child { margin-top: 6px; }
.loi-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loi-config-header { display: grid; grid-template-columns: 2fr .7fr .8fr .8fr 1fr 28px; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 0 4px; }
.loi-config-row { display: grid; grid-template-columns: 2fr .7fr .8fr .8fr 1fr 28px; gap: 6px; align-items: center; margin-bottom: 5px; }
.loi-config-row .deal-form-input { padding: 5px 6px; font-size: 12px; }
.loi-cfg-remove { padding: 2px 6px; font-size: 16px; line-height: 1; }
.loi-derived-totals { font-size: 12px; color: var(--muted); padding: 4px 0 8px; min-height: 20px; }

/* ── Scout Availability Search (2026-08-15, scout-corpus-availability-match) ──
   In-app panel chrome only. The PRINTED/PREVIEWED report carries its own
   self-contained stylesheet (SCOUT_STANDALONE_CSS in app.js) because that
   document opens in a blank window this file never reaches — the two are
   deliberately separate, and the house-style hexes live with the report. */
.sa-panel { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 16px 18px; margin: 14px 0 18px; background: var(--card, #fff); }
.sa-title { font-weight: 700; font-size: 15px; }
.sa-sub { font-size: 12.5px; color: var(--muted, #64748b); margin-top: 4px; max-width: 760px; }
.sa-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 12px; }
.sa-field { display: flex; flex-direction: column; gap: 4px; }
.sa-field label { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.sa-field input, .sa-field select { padding: 7px 8px; border: 1px solid var(--border, #cbd5e1); border-radius: 6px; font-size: 13px; background: var(--card, #fff); color: inherit; }
/* D3 "Include alternatives" — the rule above is written for text inputs and
   selects, so an unreset checkbox inherits its padding and border and renders as
   a small empty text box. The checkbox sits INSIDE its label so the caption is
   a click target, which is why the label is a row here rather than the column
   .sa-field otherwise sets. */
.sa-field-check { justify-content: flex-end; }
.sa-field-check label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.sa-field-check input[type="checkbox"] { padding: 0; border-radius: 3px; width: 15px; height: 15px; flex: 0 0 auto; accent-color: #142440; cursor: pointer; }
.sa-field-check .sa-hint { margin-top: 3px; font-size: 11px; line-height: 1.35; }
/* ── Scout tab: one header, two modes (2026-08-16) ────────────────────────
   The panels are HIDDEN, never removed — renderRfqList() syncs #pm-run-all on
   every render and the RFQ table's click delegation is bound on #pmRfqList
   itself, so both nodes must survive while the other mode is showing.
   The !important is not decoration: [hidden] is a UA rule that ANY author
   display rule outranks, which is exactly how .sa-report-actions stayed visible
   with the attribute set until smoke test 38 caught it. */
.scout-mode-panel[hidden] { display: none !important; }
.scout-mode-switch { display: flex; gap: 0; border: 1px solid var(--border, #cbd5e1); border-radius: 999px; padding: 3px; background: var(--card, #fff); }
.scout-pill { border: 0; background: transparent; color: var(--muted, #64748b); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.scout-pill:hover { color: inherit; }
.scout-pill.active { background: #142440; color: #fff; }
.scout-pill-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--border, #cbd5e1); color: #142440; font-size: 11px; font-weight: 700; }
.scout-pill.active .scout-pill-badge { background: #C6A15B; color: #142440; }
.scout-pill-badge[hidden] { display: none !important; }
/* RFQ-mode action row: same buttons, now inside the mode rather than in the
   shared header. */
.pm-mode-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Did-you-mean hint under the manufacturer combo. [hidden] needs the same
   !important guard the report actions needed: .sa-hint sets display:flex, and
   any author display rule outranks the UA [hidden] rule. */
.sa-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 11.5px; color: var(--muted, #64748b); }
.sa-hint[hidden] { display: none !important; }
.sa-hint-use { border: 1px solid var(--border, #cbd5e1); background: var(--card, #fff); color: inherit; border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 600; cursor: pointer; }
.sa-hint-use:hover { border-color: #C6A15B; }
/* "(optional)" beside the Manufacturer and Model labels, revealed by
   scoutSyncOptionalHints() once an equipment type is chosen. The [hidden] guard
   is carried for the same reason .sa-hint above carries one — an author display
   rule outranks the UA [hidden] rule, so any future change to this selector's
   display would silently un-hide it. A span inherits display:inline today and
   would not need it; the guard is here so that stays true. */
.sa-opt { font-weight: 500; font-style: italic; color: var(--muted, #94a3b8); }
.sa-opt[hidden] { display: none !important; }
.sa-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.sa-status { font-size: 12.5px; color: var(--muted, #64748b); }
/* Truncated / refused deep search. Deliberately not the muted grey the normal
   status line uses — the whole point is that this must not read as a routine
   "search finished" message. */
.sa-status.sa-warn { color: #b45309; font-weight: 600; }
.sa-status.sa-busy::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sa-spin 0.7s linear infinite; vertical-align: -1px; }
@keyframes sa-spin { to { transform: rotate(360deg); } }
.sa-report-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
/* [hidden] is a UA rule (display:none) and ANY author display rule outranks it.
   .sa-report-actions sets display:flex, so the attribute alone did not hide it —
   caught by smoke test 38 before ship. #saDeepSearch is guarded the same way
   even though .btn sets no display today: that button is CAPABILITY-GATED, and a
   future display rule on .btn would otherwise reveal a credit-spending action to
   every tier with no code change and no failing test elsewhere. */
.sa-report-actions[hidden], #saDeepSearch[hidden] { display: none !important; }
.sa-inline-report { margin-top: 14px; overflow-x: auto; }
/* Report styling is NOT here. It is generated once by scoutReportCss() in
   app.js and injected as #saInlineCss — a second copy here is exactly how an
   alignment change lands on one surface and not the other. This file keeps only
   the panel chrome above.
   Since 2026-08-16 this stylesheet governs the SCREEN alone: Preview, Print and
   Save-as-PDF serve a jsPDF-generated document and Download Word a .docx, both
   painted from scoutReportModel() with the same house tokens. The guarantee
   that the four agree is the shared model, not shared CSS. */

/* ── Administration ▸ Data Run (row 51, 2026-08-16) ─────────────────────── */
.dr-panel { border: 1px solid var(--border, #cbd5e1); border-radius: 8px; padding: 12px 14px; max-width: 820px; background: var(--card, #fff); }
.dr-row { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; }
.dr-label { color: var(--muted, #64748b); min-width: 130px; }
.dr-value { font-weight: 600; }
.dr-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; max-width: 820px; }
.dr-note { font-size: 12px; color: var(--muted, #64748b); }
.dr-history { margin-top: 18px; max-width: 820px; overflow-x: auto; }
.dr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dr-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #64748b); border-bottom: 1px solid var(--border, #cbd5e1); padding: 6px 8px; }
.dr-table td { padding: 6px 8px; border-bottom: 1px solid var(--border, #e2e8f0); }
/* [hidden] is a UA rule that any author display rule outranks — same guard the
   report actions and the Scout mode panels needed. */
.dr-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.dr-modal[hidden] { display: none !important; }
.dr-dialog { background: var(--card, #fff); border-radius: 10px; max-width: 480px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0,0,0,0.25); overflow: hidden; }
.dr-dialog-head { background: #142440; color: #fff; font-weight: 700; font-size: 15px; padding: 12px 16px; border-bottom: 3px solid #C6A15B; }
.dr-dialog-body { padding: 16px; font-size: 13px; line-height: 1.5; }
.dr-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border, #e2e8f0); }


/* =========================================================================
   Model Coverage — the Inventory Gap Monitor grid.

   MOVED HERE FROM AN INLINE <style> IN index.html on 2026-08-18. The block
   carried a comment claiming it lived inline "because the deploy pushes
   index.html + app.js (not style.css)". That was stale: deploy-web.yml has
   shipped all three files for a long time, so the reason for keeping it inline
   no longer existed. Selectors are unchanged and still scoped to #gapMonitor.
   ========================================================================= */
  #gapMonitor { background:#fff; border:1px solid var(--border); border-radius:8px; margin-bottom:16px; overflow:hidden; }
  #gapMonitor .gap-header { display:flex; align-items:center; justify-content:space-between; background:var(--navy); color:#fff; padding:10px 14px; }
  #gapMonitor .gap-header h3 { margin:0; font-size:14px; font-weight:700; letter-spacing:.02em; }
  /* Renamed from .gap-toggle 2026-08-18 when the Collapse button was removed. The
     rules are reused rather than re-authored — same flex slot, same size — but
     recoloured to gold so the control reads as help rather than as the destructive
     -looking white-on-navy button it replaced. .gap-toggle had exactly one consumer
     and is gone; nothing else referenced it. */
  #gapMonitor .gap-help { background:transparent; color:var(--gold); border:1px solid var(--gold); border-radius:4px; padding:3px 10px; font-size:12px; cursor:pointer; }
  #gapMonitor .gap-help:hover { background:rgba(198,161,91,.15); }
  #gapMonitor .gap-legend { font-size:12px; color:var(--muted); line-height:1.5; margin:-6px 0 14px; }
  #gapMonitor .gap-help-panel { background:#F9FAFB; border:1px solid var(--border); border-left:3px solid var(--gold); border-radius:6px; padding:12px 14px; margin-bottom:14px; font-size:12px; line-height:1.6; color:var(--muted); }
  #gapMonitor .gap-help-panel p { margin:0 0 8px; }
  #gapMonitor .gap-help-panel p:last-child { margin-bottom:0; }
  #gapMonitor .gap-help-panel strong { color:var(--navy); }
  #gapMonitor .gap-body { padding:14px; }
  #gapMonitor .gap-summary { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:600; margin-bottom:14px; }
  #gapMonitor .gap-sum-covered { color:var(--navy); }
  #gapMonitor .gap-sum-gaps { color:var(--red); }
  #gapMonitor .gap-sum-thin { color:var(--amber); }
  #gapMonitor .gap-sum-sep { color:var(--gray); }
  #gapMonitor .gap-rollup { background:#F9FAFB; border:1px solid var(--border); border-radius:6px; padding:12px 14px; margin-bottom:14px; }
  #gapMonitor .gap-rollup-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:8px; }
  #gapMonitor .gap-rollup-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--navy); }
  #gapMonitor .gap-rollup-count { font-size:13px; font-weight:700; color:var(--navy); }
  #gapMonitor .gap-rollup-bar { display:flex; width:100%; height:10px; border-radius:5px; overflow:hidden; background:var(--border); margin-bottom:8px; }
  #gapMonitor .gap-bar-seg { height:100%; }
  #gapMonitor .gap-bar-green { background:var(--green); }
  #gapMonitor .gap-bar-yellow { background:var(--amber); }
  #gapMonitor .gap-bar-red { background:var(--red); }
  #gapMonitor .gap-rollup-legend { display:flex; gap:16px; font-size:12px; font-weight:600; margin-bottom:8px; }
  #gapMonitor .gap-rollup-gaps { font-size:12px; color:var(--muted); display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  #gapMonitor .gap-rollup-gaps-label { font-weight:600; color:var(--text); }
  #gapMonitor .gap-rollup-allgood { color:var(--green); font-weight:600; }
  #gapMonitor .gap-rollup-chip { background:#fff; border:1px solid var(--red); color:var(--red); border-radius:12px; padding:2px 10px; font-size:11px; font-weight:600; cursor:pointer; font-family:inherit; }
  #gapMonitor .gap-rollup-chip:hover { background:var(--red); color:#fff; }
  #gapMonitor .gap-rollup-more { font-size:11px; color:var(--muted); }
  #gapMonitor .gap-mfg-group { margin-bottom:14px; }
  #gapMonitor .gap-mfg-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--navy); border-bottom:2px solid var(--amber); padding-bottom:4px; margin-bottom:8px; }
  #gapMonitor .gap-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
  #gapMonitor .gap-card { border:1px solid var(--border); border-left:4px solid var(--gray); border-radius:6px; padding:8px 10px; }
  #gapMonitor .gap-card.gap-red { border-left-color:var(--red); background:#FEF2F2; }
  #gapMonitor .gap-card.gap-yellow { border-left-color:var(--amber); background:#FFFBEB; }
  #gapMonitor .gap-card.gap-green { border-left-color:var(--green); background:#F0FDF4; }
  #gapMonitor .gap-clickable { cursor:pointer; }
  #gapMonitor .gap-clickable:hover { box-shadow:inset 0 0 0 2px var(--navy); }
  #gapMonitor .gap-card-top { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
  #gapMonitor .gap-model { font-size:13px; font-weight:700; color:var(--text); }
  #gapMonitor .gap-card-meta { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); }
  #gapMonitor .gap-count { font-weight:600; }
  #gapMonitor .gap-add-btn { margin-top:8px; width:100%; background:#fff; color:var(--navy); border:1px solid var(--navy); border-radius:4px; padding:4px 8px; font-size:11px; font-weight:600; cursor:pointer; }
  #gapMonitor .gap-add-btn:hover { background:var(--navy); color:#fff; }
  #gapMonitor .gap-add-region { border-top:1px solid var(--border); margin-top:8px; padding:10px; background:#F9FAFB; border-radius:0 0 4px 4px; }
  #gapMonitor .gap-in { width:100%; box-sizing:border-box; margin-bottom:6px; padding:5px 7px; font-size:12px; border:1px solid var(--border); border-radius:4px; background:#fff; color:var(--text); font-family:inherit; }
  #gapMonitor textarea.gap-in { resize:vertical; }
  #gapMonitor .gap-add-actions { display:flex; align-items:center; gap:10px; margin-top:2px; }
  #gapMonitor .gap-submit { background:var(--navy); color:#fff; border:none; border-radius:4px; padding:5px 12px; font-size:12px; font-weight:600; cursor:pointer; }
  #gapMonitor .gap-submit:hover { background:var(--navy-dark); }
  #gapMonitor .gap-submit:disabled { opacity:.6; cursor:default; }
  #gapMonitor .gap-cancel { color:var(--muted); font-size:12px; cursor:pointer; text-decoration:none; }
  #gapMonitor .gap-cancel:hover { text-decoration:underline; }
  #gapMonitor .gap-add-msg { font-size:11px; margin-top:6px; }
  #gapMonitor .gap-watch { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:14px; padding:10px; background:#F9FAFB; border:1px dashed var(--border); border-radius:6px; }
  #gapMonitor .gap-watch .gap-in { width:auto; flex:1 1 160px; margin-bottom:0; }
  #gapMonitor #gapWatchAdd { background:var(--navy); color:#fff; border:none; border-radius:4px; padding:6px 14px; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; }
  #gapMonitor #gapWatchAdd:hover { background:var(--navy-dark); }
  #gapMonitor .gap-watch-msg { font-size:11px; flex-basis:100%; }
  #gapMonitor .gap-unwatch { margin-left:auto; background:transparent; border:none; color:var(--muted); font-size:12px; line-height:1; cursor:pointer; padding:0 2px; opacity:.5; }
  #gapMonitor .gap-unwatch:hover { color:var(--red); opacity:1; }

/* P1-B additions — the search-health strip, the scope/VIP chips and the
   Alert-me action. A Coverage card now answers two questions rather than one:
   how much stock do we have, and is anything actually looking for more. */
#gapMonitor .gap-search-health { margin-top:8px; padding:6px 8px; border-radius:4px; font-size:11px; line-height:1.45; background:#F9FAFB; border:1px solid var(--border); }
#gapMonitor .gap-sh-line { display:block; color:var(--text); }
#gapMonitor .gap-sh-chips { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
#gapMonitor .gap-sh-none { color:var(--muted); font-style:italic; background:#fff; border-style:dashed; }
#gapMonitor .gap-sh-ok { border-left:3px solid var(--green); }
#gapMonitor .gap-sh-warn { border-left:3px solid var(--amber); }
#gapMonitor .gap-sh-bad { border-left:3px solid var(--red); }
/* "Never searched" is the loudest of the five states on purpose — it is the one
   an operator can act on and the one an em-dash used to hide (R6). */
#gapMonitor .gap-sh-never { border-left:3px solid var(--red); background:#FEF2F2; font-weight:700; color:var(--red); }
/* .gap-sh-vip was removed 2026-08-18 with the card chip it styled — it had
   exactly one consumer, so a reappearance of either means the removal was
   reverted rather than reworked. The Targets-table badge uses `.vip-badge`
   and is unrelated to this block. */
#gapMonitor .gap-sh-scope,
#gapMonitor .gap-sh-paused { display:inline-block; font-size:10px; font-weight:700; padding:1px 6px; border-radius:9px; white-space:nowrap; }
#gapMonitor .gap-sh-scope { background:#EEF2FF; color:var(--navy); border:1px solid #C7D2FE; }
#gapMonitor .gap-sh-paused { background:#F3F4F6; color:var(--muted); border:1px solid var(--border); }
#gapMonitor .gap-alert-btn { margin-top:6px; width:100%; background:#fff; color:var(--navy); border:1px dashed var(--navy); border-radius:4px; padding:4px 8px; font-size:11px; font-weight:600; cursor:pointer; font-family:inherit; }
#gapMonitor .gap-alert-btn:hover { background:var(--navy); color:#fff; border-style:solid; }
/* Bundled-fallback warning — a stale hardcoded watch list must never render
   silently as if it were live data. */
#gapMonitor .gap-stale-note { background:#FFFBEB; border:1px solid var(--amber); color:#92400E; border-radius:4px; padding:6px 10px; font-size:12px; font-weight:600; margin-bottom:10px; }

/* Targets class badges (P1-C) and the never-searched state (R6). */
.badge.b-oem-watch { background:#EEF2FF; color:var(--navy); border:1px solid #C7D2FE; }
.badge.b-company { background:#F3F4F6; color:var(--muted); border:1px solid var(--border); }
.badge.b-never-searched { background:#FEF2F2; color:var(--red); border:1px solid var(--red); font-weight:700; }

/* Intelligence ▸ Sources — the unified roster (2026-08-20). */
.src-banner { background:#F9FAFB; border:1px solid var(--border); border-left:3px solid var(--navy); border-radius:4px; padding:9px 12px; font-size:12px; line-height:1.55; color:var(--muted); margin-bottom:10px; }
.src-banner strong { color:var(--text, #111827); }
.src-count { font-size:12px; color:var(--muted); font-weight:600; }
.src-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.src-toolbar input[type="search"] { flex:1; min-width:220px; max-width:360px; padding:7px 10px; border:1px solid var(--border); border-radius:4px; font-size:13px; }
/* Type/note subtext under the domain. Muted and one line down, so the domain
   stays the thing the eye lands on when scanning a hundred rows. */
.src-sub { display:block; font-size:11px; color:var(--muted); margin-top:2px; line-height:1.4; }
/* ONE badge per row. Green / red / amber, matching the banner's three terms —
   the colours carry the same meaning as the provenance badges further down this
   file (red explains an absence, amber is a caveat) so a reader who has seen
   one set does not have to relearn the other. */
.badge.b-src-active  { background:#D1FAE5; color:#064E3B; }
.badge.b-src-blocked { background:#FEE2E2; color:#991B1B; }
.badge.b-src-gated   { background:#FEF3C7; color:#78350F; }
/* Affected-locations list in the Block dialog. */
.src-affected { border:1px solid var(--border); border-radius:4px; padding:10px 12px; background:#FFFBEB; font-size:12px; line-height:1.5; }
.src-affected ul { margin:6px 0 0 16px; padding:0; }
.src-affected li { margin-bottom:6px; }
.src-affected code { font-size:11px; background:#FFF; padding:1px 4px; border-radius:3px; border:1px solid var(--border); }
.src-affected .src-flagged { color:#92400E; }

/* Gated-source metrics inside the Edit modal (2026-08-20, ticket
   sources-gated-metrics-not-rendered). A two-column definition list rather
   than five inputs: these are the Sunday rollup's OUTPUT and are read-only, so
   an input would misrepresent them as editable, and five full-width inputs do
   not fit legibly in a 520px card.

   The grid is fixed-label / flexible-value so the numbers align down the right
   of the labels and stay scannable — the whole point of the block is a
   sign-up decision taken by comparing figures. */
.src-gated-metrics {
  display:grid; grid-template-columns:minmax(120px,auto) 1fr; gap:4px 12px;
  margin:0; padding:8px 10px; font-size:12px; line-height:1.45;
  border:1px solid var(--border); border-radius:4px; background:#FFFBEB;
}
.src-gated-metrics dt { color:var(--muted); }
.src-gated-metrics dd { margin:0; font-variant-numeric:tabular-nums; }
/* A value the rollup has not produced yet is muted, so "no data" reads
   differently from a real zero at a glance. */
.src-gated-metrics dd.src-gated-na { color:var(--muted); }
.src-gated-foot {
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-top:6px;
}
.src-gated-foot .field-hint { margin-top:0; }

/* B4 / B7 (2026-08-18) — Listings record-view provenance badges.
   Both are READ-ONLY annotations: neither affects Browse visibility. Blocked is
   red because it explains an absence elsewhere (the listing is withheld from
   availability reports); gated is amber because it is a caveat on something the
   reader can still quote, provided they confirm access first. */
.badge.b-blocked { background:#FEF2F2; color:var(--red); border:1px solid var(--red); font-weight:700; }
.badge.b-gated { background:#FFFBEB; color:#92400E; border:1px solid var(--amber); font-weight:600; }
/* b-warn (2026-09-04) — a listing KEPT after its fabricated source_url was
   nulled. Amber like b-gated because both say "this record is usable but needs
   a manual step", distinguished from b-blocked's red, which means suppressed.
   Its own class rather than reuse of b-gated so the two can diverge without one
   silently restyling the other. */
.badge.b-warn { background:#FFFBEB; color:#92400E; border:1px dashed var(--amber); font-weight:600; }

/* =========================================================================
   CONTACTS SCREEN REDESIGN (2026-08-22)
   Built to DOCS/specs/GMM_CRM_Contacts_Redesign_2026-08-22.md.

   Three new things live here and nothing else in the app has them yet: a
   list-and-detail layout that keeps the list MOUNTED beside the detail, a
   category chip row with live counts, and a list that scrolls inside its own
   measured box under pinned column headers (R1, 2026-08-23). Each block below
   says which existing family it borrows from, because "consistent with the rest
   of the app" is only checkable if the borrowing is written down.

   The third of those used to be a kebab overflow menu; R2 retired it on
   2026-08-23 when Delete moved onto the panel's button row. The chips' More
   menu was always a separate implementation and survived it.
   ========================================================================= */

/* Toolbar. Borrows .targets-toolbar wholesale and adds one thing: a spacer that
   pushes the narrowing controls (search, status) to the right, away from the
   controls that write. Without it the operator's eye has to sort four buttons
   and two filters out of one undifferentiated row. */
.contacts-toolbar { flex-wrap: wrap; margin: 14px 0 8px; }
.contacts-toolbar-spacer { flex: 1 1 auto; }

/* ── CATEGORY CHIPS ──────────────────────────────────────────────────────
   Structure is the .scout-pill family (Scout's mode switch), reused rather
   than re-declared so the two chip rows in the app cannot drift apart.

   THE ONE OVERRIDE IS THE ACTIVE COLOUR, and it is scoped to #contactChips so
   Scout is untouched. Operator ruling O5: the active chip is gold #C6A15B —
   the --gold token declared at the top of this file, NOT the #C9A84C fork that
   two other tabs hardcode. Scout's own active pill stays navy. */
.contact-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 12px; position: relative; }
#contactChips .scout-pill { border: 1px solid transparent; }
#contactChips .scout-pill:hover { background: #F3F4F6; color: inherit; }
#contactChips .scout-pill.active { background: var(--gold, #C6A15B); color: #142440; border-color: var(--gold, #C6A15B); }
#contactChips .scout-pill.active .scout-pill-badge { background: rgba(20, 36, 64, 0.16); color: #142440; }
#contactChips .scout-pill-badge { background: #E5E7EB; }

/* The More menu. It borrowed its overflow idiom from the panel kebab, which R2
   retired on 2026-08-23 when Delete moved onto the button row — this is now the
   only dropdown on the screen, and the last of that grammar. Its markup,
   toggle and dismissal contract were always a separate implementation and are
   untouched by that removal. */
.contact-chip-more-wrap { position: relative; display: inline-flex; }
.contact-chip-menu { position: absolute; left: 0; top: calc(100% + 5px); z-index: 1200; min-width: 210px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.contact-chip-menu[hidden] { display: none !important; }
.contact-chip-menu button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; font-size: 13px; font-weight: 600; color: var(--text, #1F2937); text-align: left; cursor: pointer; }
.contact-chip-menu button:hover { background: #F3F4F6; }
.contact-chip-menu button.active { background: var(--gold, #C6A15B); color: #142440; }
.contact-chip-menu .contact-chip-menu-count { color: var(--muted); font-size: 11px; font-weight: 700; }
.contact-chip-menu button.active .contact-chip-menu-count { color: #142440; }

/* ── LIST + DETAIL LAYOUT ────────────────────────────────────────────────
   Borrows .deal-detail-layout's flex/gap/align-items, at the 60/40 split the
   design authority names. `min-width: 0` on the list column is load-bearing: a
   flex child defaults to min-width:auto and would refuse to shrink below its
   table's intrinsic width, pushing the panel off screen instead of scrolling
   the table inside its own wrap. */
.contacts-layout { display: flex; gap: 20px; align-items: flex-start; }
.contacts-list-col { flex: 1 1 60%; min-width: 0; }

/* Row selection. The only precedent in the file is `.deal-row:hover td`'s
   #F0F4FF, so hover matches it exactly and SELECTED is a stronger version of
   the same blue plus a gold left edge — the same "this is the current one"
   grammar the app already uses at .pm-* and the card decks. */
.contacts-table tbody tr { cursor: pointer; }
.contacts-table tbody tr:hover td { background: #F0F4FF; }
.contacts-table tbody tr.contact-row-selected td { background: #E6EDFB; }
.contacts-table tbody tr.contact-row-selected td:first-child { box-shadow: inset 3px 0 0 var(--gold, #C6A15B); }
.contacts-table td { vertical-align: middle; }
/* Name cell: primary line at full weight, sub-line muted. The type glyph is
   sized down and de-saturated so it reads as a marker rather than as art. */
.contact-name-cell { display: flex; align-items: flex-start; gap: 9px; }
.contact-type-icon { flex: 0 0 auto; font-size: 13px; line-height: 18px; filter: grayscale(1); opacity: 0.65; }
.contact-name-main { font-weight: 600; color: var(--text, #1F2937); }
.contact-name-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }

/* ── SIDE PANEL ──────────────────────────────────────────────────────────
   Adapted from .pm-drawer, which is a FIXED full-height overlay. This is an
   in-flow column instead: same card chrome, no overlay, no transform, and it
   sticks to the top of the viewport so a long list scrolls past a panel that
   stays put. */
.contact-panel { flex: 0 0 40%; align-self: flex-start; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.contact-panel[hidden] { display: none !important; }
.contact-panel-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.contact-panel-head .contact-type-icon { font-size: 18px; line-height: 22px; opacity: 0.75; }
.contact-panel-headings { flex: 1 1 auto; min-width: 0; }
.contact-panel-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy, #1e3a5f); word-break: break-word; }
.contact-panel-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.contact-panel-close { flex: 0 0 auto; background: none; border: 0; font-size: 22px; line-height: 1; padding: 0 2px; color: var(--muted); cursor: pointer; }

/* Button row. Neutral outline throughout, including Delete — the 2026-08-21
   ruling that took the red fill off the row Delete applies here too: the
   confirmation dialog is the safety mechanism, not the colour.

   DELETE IS A PLAIN FOURTH BUTTON IN THIS ROW as of the operator ruling of
   2026-08-23 (R2), which SUPERSEDES the 2026-08-22 decision to file it behind a
   three-dot kebab. The kebab is gone entirely — wrap, button, menu, and the
   `margin-left: auto` that pushed it to the right edge — so this rule is now the
   whole story of the row: four `.btn.small.secondary` siblings at one size and
   one weight, laid out left to right as Email, Edit, Full record, Delete.

   R2 MOVED DELETE, IT DID NOT REPAINT IT. The neutral colour above is still the
   2026-08-21 ruling's and is unchanged by this one. */
.contact-panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }

/* Field table. Borrows .cd-row/.cd-label/.cd-value from the record modal
   verbatim — the panel and the Full-record modal show the same fields, so they
   read as the same document at two sizes. */
.contact-panel-fields { padding: 6px 16px 16px; }
.contact-panel-fields .cd-label { flex-basis: 104px; }
.contact-panel-fields .cd-value { min-height: 18px; }
.contact-panel-fields .cd-value pre { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
/* The shared inline editor's select. Sized to sit inside a field row without
   making the row taller than a static value would. */
.contact-inline-sel { max-width: 100%; padding: 3px 6px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px; background: #fff; }

/* ── THE PINNED TOP REGION (R1, operator ruling 2026-08-23) ──────────────
   Every piece of chrome above the rows stays visible at any scroll depth:
   topbar, main tabs, sub tabs, page header, toolbar, chips, column headers.
   Only the rows move.

   THERE IS NOT A SINGLE PIXEL OFFSET HERE, AND THAT IS DELIBERATE. The comment
   at the sticky Listings stack above (`nav.tabs.main-tabs`) records the
   2026-07-01 failure of the obvious approach: chaining a `top` per bar means
   every offset encodes the rendered height of everything above it, those
   heights vary with tier, font and width, and the stack pinned ~35px too high
   and hid content behind the header. That screen was reverted to static rather
   than retuned, and this one does not repeat the attempt.

   Instead the LIST becomes the scroller. app.js measures where the wrap
   actually landed and hands the leftover viewport in as
   `--contacts-list-max-h`; the page then has nothing left to scroll, so
   everything above stays put with no offset to get wrong. See
   updateContactsListHeight() for the measurement and why it adds scrollY back.

   `max-height`, not `height`: a three-row list collapses to three rows instead
   of sitting in a tall box of dead space, and a long one still gets capped.

   The panel takes the SAME measured number rather than inventing a second one.
   Its `top: 16px` sits well above the ~178px nav stack, so on a viewport short
   enough that the page can still scroll, that value would slide the card under
   the sub-tabs. Pinning it at its own measured resting position means it can
   never rise above where it already sits. Both fall back to the pre-R1 values
   if the property is never set, so a JS failure degrades to the old behaviour
   rather than to a collapsed or invisible list.

   Scoped to `.contacts-list-col >` on purpose: `.targets-table-wrap` is shared
   with Targets, Recipients and others, and none of them are asking for this. */
@media (min-width: 1101px) {
  .contacts-list-col > .targets-table-wrap { max-height: var(--contacts-list-max-h, none); overflow-y: auto; }
  .contact-panel { top: var(--contacts-panel-top, 16px); max-height: var(--contacts-list-max-h, calc(100vh - 40px)); }
}

/* The column headers, pinned inside that scroller. `top: 0` resolves against
   the wrap rather than the viewport because the wrap is the scroll container —
   which is also why this rule does nothing until the max-height above gives the
   wrap a real one to scroll within, and why it is inert rather than wrong at
   ≤1100px. The background is restated from `.targets-table th` because a sticky
   cell paints over the rows sliding under it and a transparent one would let
   them through. The box-shadow redraws the bottom border: `border-collapse:
   collapse` hands cell borders to the table's own border grid, which does not
   travel with a sticky cell, so the rule line would vanish on first scroll.
   z-index 2 clears the rows only — the chip menu (1200) still paints above. */
#contactsTable thead th { position: sticky; top: 0; z-index: 2; background: #F9FAFB; box-shadow: inset 0 -1px 0 var(--border); }

@media (max-width: 1100px) {
  .contacts-layout { flex-direction: column; }
  .contacts-list-col, .contact-panel { flex: 1 1 auto; width: 100%; }
  .contact-panel { position: static; max-height: none; }
}

/* ── Contacts: R3 Title column, R3 category combobox, R6 notes history ─────
   Added 2026-08-23. All three features draw inside surfaces that already exist
   (the table, the Add/Edit modal, the side panel), so this block adds no layout
   primitives — only the type, spacing and the one dropdown the combobox needs. */

/* R3 — the Title column. Muted and slightly smaller than the Name cell so the
   row still reads Name-first at a glance; ellipsised rather than wrapped,
   because a two-line title would change row height and the forty-row overflow
   margin that test 52 measures. */
.contact-title-cell {
  color: var(--muted); font-size: 12px;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* R3 — the title line in the panel head, between the name and the category
   badge. Same muted treatment as the row cell so the two surfaces agree. */
.contact-panel-role { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* R3 — the category combobox. `position: relative` on the wrap is what the
   absolutely-positioned menu hangs from. This lives in the Add/Edit MODAL,
   never inside `.targets-table-wrap` — that wrap is `overflow-y: auto` since the
   sticky-header build and would clip this menu entirely. */
.contact-cat-combo { position: relative; }
.contact-cat-menu {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1300;
  max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 4px;
}
.contact-cat-menu button {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; font-size: 13px;
}
.contact-cat-menu button:hover { background: #f1f5f9; }
.contact-cat-menu .contact-cat-create { color: var(--accent, #2563eb); font-weight: 600; }
.contact-cat-none { padding: 8px 9px; }

/* R6 — the notes block. It sits below `.contact-panel-fields` rather than as a
   row inside it, because a history is a region and not a field value. The panel
   is already `overflow-y: auto`, so a long timeline scrolls INSIDE the card and
   the page height is unaffected — which is what keeps the measured pinned-chrome
   geometry unchanged by a contact that happens to have many notes. */
.contact-notes-block { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.contact-note-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.contact-note-range { font-size: 12px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; }
.contact-note-entry { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.contact-note-entry:last-child { border-bottom: 0; }
.contact-note-meta { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.contact-note-text { font-size: 13px; line-height: 1.45; white-space: normal; word-break: break-word; }
/* The newest entry is the one the operator came to read. */
.contact-note-latest .contact-note-text { font-weight: 500; }
.contact-note-timeline { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--border); opacity: 0.92; }
.contact-note-more { margin-top: 6px; color: var(--muted); font-size: 11px; font-style: italic; }
.contact-note-add {
  margin-top: 6px; padding: 0; border: 0; background: transparent;
  color: var(--accent, #2563eb); font-size: 12px; cursor: pointer;
}
.contact-note-add:hover { text-decoration: underline; }
.contact-note-draft { width: 100%; font-size: 13px; }
.contact-note-editor-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.contact-note-hint { color: var(--muted); font-size: 11px; }

/* Session E (2026-09-26) — approval flow + Sales Activity soft delete */
.ppdf-approver-field { display: flex; align-items: center; gap: 8px; margin-right: 12px; }
.ppdf-approver-field label { font-weight: 600; white-space: nowrap; }
/* [hidden] must win over the flex rule above (the field shows for everyone
   since 2026-10-19, but the hook stays honest). The gold Pending Approvals
   panel's rules were removed with the panel (ruling 2026-10-19, A4). */
.ppdf-approver-field[hidden] { display: none !important; }
.dv-stalled-approx { font-style: italic; }
.dv-stalled-del { margin-left: 8px; padding: 1px 8px; font-size: 11px; }
.activity-deleted-wrap { margin: 10px 0; }
.activity-deleted-toggle { font-size: 13px; cursor: pointer; }
.activity-deleted-table { margin-top: 6px; }
/* Session G — selling company under a Sales Activity project name. */
.activity-company { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* Card 1 (2026-09-29) — the Outcome under the stage text in the Status cell. */
.activity-outcome { margin-top: 4px; font-size: 12px; }
.activity-outcome-select { font-size: 12px; padding: 2px 4px; }

/* Session J (2026-09-28) — item 14 fleet finder (Listings ▸ Ready to sell). */
.fleet-finder { border: 1px solid var(--border); border-radius: 6px; background: #F9FAFB; margin: 8px 0 10px; padding: 0 12px; }
.fleet-finder > summary { cursor: pointer; font-weight: 600; padding: 9px 0; color: var(--text, #1F2937); }
.fleet-finder[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.ff-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ff-row label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.ff-row input, .ff-row select { font-size: 13px; padding: 5px 6px; }
.ff-row input[type="number"] { width: 84px; }
.ff-pair { display: flex; gap: 4px; }
.ff-caption { font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
.ff-summary { font-weight: 700; margin: 6px 0 8px; }
.ff-block { margin-bottom: 12px; }
.ff-block-title { font-weight: 600; font-size: 13px; margin: 6px 0; }
.ff-lot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.ff-lot-text { flex: 1 1 320px; min-width: 0; }
.ff-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.ff-tag { font-size: 11px; }
.ff-group { margin: 6px 0 10px; }
.ff-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.ff-group-lots { margin-left: 14px; }
.ff-empty { color: var(--muted); font-size: 12px; padding: 4px 0 10px; }
/* Item 12 — "← Back to …" strip atop the Deal panel. */
.deal-back-strip { margin: 0 0 10px; }
/* Item 13 — "Sign as" chooser. */
.sign-as-options { display: flex; flex-direction: column; gap: 8px; padding: 12px 18px; }
.sign-as-option { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
