/* ================================================================
   BidBud content panel — enterprise design system
   Tokens: spacing 4/8/12/16/20/24 · radius 6/8/10 · one accent
   ================================================================ */

#bidbud-root, #bidbud-trigger {
  --bb-bg: #fafafa;
  --bb-surface: #ffffff;
  --bb-border: #e6e8eb;
  --bb-border-strong: #d0d5dd;
  --bb-text: #101828;
  --bb-text-2: #475467;
  --bb-text-3: #667085;
  --bb-text-4: #98a2b3;
  --bb-accent: #0d9168;
  --bb-accent-strong: #067a52;
  --bb-error-bg: #fef3f2;
  --bb-error: #b42318;
  --bb-info-bg: #f5f8ff;
  --bb-info: #3538cd;
  --bb-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --bb-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --bb-ring: 0 0 0 3px rgba(13, 145, 104, 0.22);
  --bb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

/* ---- Trigger button (on the BaT page) ---- */
#bidbud-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px;
  background: var(--bb-surface); color: var(--bb-text);
  border: 1px solid var(--bb-border-strong); border-radius: 6px;
  padding: 0 18px; margin-right: 8px;
  font: 600 15px/1 var(--bb-font);
  cursor: pointer; vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
#bidbud-trigger:hover { border-color: var(--bb-text-4); }
#bidbud-trigger:focus-visible { outline: none; box-shadow: var(--bb-ring); }
#bidbud-trigger.bidbud-floating {
  position: fixed; right: 24px; bottom: 24px; z-index: 2147483646;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.16);
}

/* ---- Panel shell ---- */
#bidbud-root {
  position: fixed; inset: 0; z-index: 2147483646; pointer-events: none;
  overflow: hidden; contain: paint;
}
#bidbud-root .bb-panel {
  pointer-events: auto;
  --bb-panel-pad: 20px;
  position: absolute; top: 0; right: 0; height: 100vh;
  width: min(440px, 94vw); max-width: 100%; min-width: 0;
  background: var(--bb-bg); color: var(--bb-text);
  border-left: 1px solid var(--bb-border);
  box-shadow: -16px 0 48px rgba(16, 24, 40, 0.08);
  font-family: var(--bb-font);
  font-size: 13px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-y: auto; padding: 0;
  transform: translateX(100%); transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
#bidbud-root.bb-open .bb-panel { transform: none; }
#bidbud-root .bb-panel * { box-sizing: border-box; margin: 0; font-family: inherit; }
#bidbud-root .bb-panel :focus-visible { outline: none; box-shadow: var(--bb-ring); border-radius: 6px; }

/* ---- Header ---- */
.bb-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.bb-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; border: 1px solid var(--bb-border); }
.bb-header-text { flex: 1; min-width: 0; }
.bb-header h1 {
  font-size: 14px; font-weight: 600; letter-spacing: -0.1px; line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bb-pricepred { font-size: 12px; color: var(--bb-text-3); margin-top: 3px; }
.bb-pricepred strong { color: var(--bb-text); font-size: 13px; font-weight: 700; margin-left: 2px; font-variant-numeric: tabular-nums; }
.bb-x {
  background: none; border: none; font-size: 20px; color: var(--bb-text-3); cursor: pointer;
  line-height: 1; padding: 2px 4px; flex: none; border-radius: 6px;
  transition: color 150ms ease;
}
.bb-x:hover { color: var(--bb-text); }

/* ---- Strategy tabs (segmented control) ---- */
.bb-tabs {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px;
  background: #eef0f3; border-radius: 8px; padding: 3px; margin-bottom: 12px;
}
.bb-tab {
  border: none; background: transparent; color: var(--bb-text-2);
  font-size: 12.5px; font-weight: 600; height: 44px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.bb-tab:hover { color: var(--bb-text); }
.bb-tab small {
  font-size: 10.5px; font-weight: 600; opacity: 0.75; font-variant-numeric: tabular-nums;
}

/* ---- Insight card ---- */
.bb-insight { border: 1px solid; border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.bb-headline { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.bb-hero { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(16, 24, 40, 0.07); }
.bb-hero-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bb-hero-num { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--bb-text); }
.bb-delta {
  font-size: 11.5px; font-weight: 600; color: var(--bb-text-2);
  background: rgba(16, 24, 40, 0.06); border-radius: 999px; padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.bb-skel-hero { width: 150px; height: 36px; margin-top: 2px; }
.bb-insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bb-k {
  font-size: 10.5px; font-weight: 600; color: var(--bb-text-3);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px;
}
.bb-big { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bb-fine { font-size: 11px; color: var(--bb-text-3); margin-top: 12px; }

.bb-action-chip {
  display: inline-block; margin-top: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--bb-text-2);
  background: rgba(16, 24, 40, 0.06); border-radius: 999px; padding: 2px 9px;
}
.bb-momentum { display: block; margin-top: 6px; font-size: 10.5px; color: var(--bb-text-3); }
.bb-momentum strong { font-variant-numeric: tabular-nums; }

.bb-whatif {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(16, 24, 40, 0.07);
}
.bb-whatif .bb-slider-top { font-size: 12px; color: var(--bb-text-2); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; }
.bb-whatif .bb-slider-top strong { font-variant-numeric: tabular-nums; font-size: 13px; }
.bb-whatif input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(16, 24, 40, 0.12); cursor: pointer; margin: 6px 0 0;
}
.bb-whatif input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--bb-border-strong);
  box-shadow: var(--bb-shadow-sm); cursor: grab;
}

/* States: skeleton / error / notice */
.bb-skel {
  display: inline-block; border-radius: 6px;
  background: linear-gradient(90deg, #eceef1 25%, #f6f7f8 50%, #eceef1 75%);
  background-size: 200% 100%; animation: bb-shimmer 1.4s ease infinite;
}
.bb-skel-big { width: 86px; height: 30px; margin-top: 2px; }
@keyframes bb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.bb-error {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; background: var(--bb-error-bg); color: var(--bb-error);
  border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.45;
}
.bb-notice {
  margin-top: 12px; background: var(--bb-info-bg); color: var(--bb-info);
  border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.45;
}

/* ---- Cards ---- */
.bb-card {
  background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--bb-shadow-xs);
}
.bb-card-head {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--bb-text); letter-spacing: -0.1px;
}
.bb-card-head.bb-static { cursor: default; }
.bb-strat-head { gap: 10px; }
.bb-head-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--bb-text);
  letter-spacing: -0.1px;
}
.bb-head-right { display: flex; align-items: center; gap: 8px; }
.bb-summary { font-size: 11.5px; font-weight: 500; color: var(--bb-text-3); }
.bb-chev { color: var(--bb-text-3); font-size: 11px; }
.bb-card-body { margin-top: 14px; border-top: 1px solid #f2f4f6; padding-top: 14px; }
.bb-pill {
  font-size: 11.5px; font-weight: 600; color: var(--bb-text-2); font-variant-numeric: tabular-nums;
  background: #f2f4f6; border-radius: 999px; padding: 4px 11px;
}

/* ---- Sliders ---- */
.bb-slider { margin-bottom: 16px; }
.bb-slider-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 500; color: var(--bb-text-2); margin-bottom: 7px; }
.bb-slider-top strong { font-size: 13px; font-weight: 700; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.bb-slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: #e6e8eb; cursor: pointer; margin: 6px 0;
}
.bb-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--bb-border-strong);
  box-shadow: var(--bb-shadow-sm); cursor: grab;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.bb-slider input[type="range"]:hover::-webkit-slider-thumb { border-color: var(--bb-text-4); }
.bb-slider input[type="range"]:focus-visible { box-shadow: none; }
.bb-slider input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--bb-accent); box-shadow: var(--bb-ring); }

/* ---- Timeline ---- */
.bb-section-label { font-size: 12.5px; font-weight: 600; letter-spacing: -0.1px; }
.bb-tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin: 2px 0 8px; }
.bb-tl-compare {
  order: 3; width: 100%; min-width: 0; display: flex; align-items: center; gap: 3px;
}
.bb-tl-compare > span { margin-right: 3px; color: var(--bb-text-3); font-size: 10.5px; font-weight: 600; }
.bb-tl-strategy {
  display: inline-flex; min-width: 0; height: 26px; align-items: center; gap: 4px; padding: 0 6px;
  border: 1px solid var(--bb-border); border-radius: 6px; background: var(--bb-surface);
  color: var(--bb-text-2); font-size: 9.5px; font-weight: 600; cursor: pointer;
}
.bb-tl-strategy i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--bb-strategy); }
.bb-tl-strategy-active { border-color: var(--bb-strategy); background: var(--bb-strategy); color: #fff; }
.bb-tl-strategy-active i { background: #fff; }
.bb-zoom { display: flex; gap: 4px; }
.bb-zoom button {
  border: 1px solid var(--bb-border); background: var(--bb-surface); color: var(--bb-text-2);
  border-radius: 6px; font-size: 11.5px; font-weight: 600;
  height: 26px; min-width: 26px; padding: 0 8px; cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.bb-zoom button:hover { border-color: var(--bb-text-4); color: var(--bb-text); }
.bb-canvas-lg { width: 100%; height: 216px; display: block; }
.bb-tl-wrap { position: relative; }
.bb-tl-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--bb-surface); border: 1px solid var(--bb-border); border-left: 3px solid var(--bb-tip-color, var(--bb-border-strong));
  border-radius: 8px; box-shadow: var(--bb-shadow-sm);
  padding: 7px 10px; min-width: 90px; white-space: nowrap;
}
.bb-tl-tip strong {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--bb-text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.2px;
}
.bb-tl-tip span { display: block; font-size: 11px; color: var(--bb-text-2); margin-top: 1px; }
.bb-tl-tip em {
  display: block; font-style: normal; font-size: 9.5px; font-weight: 600;
  color: var(--bb-tip-color, var(--bb-text-3)); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px;
}
.bb-canvas-md { width: 100%; height: 164px; display: block; margin-top: 12px; }
.bb-tl-hint { font-size: 10.5px; color: var(--bb-text-3); margin-top: 4px; text-align: right; }

.bb-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 10.5px; color: var(--bb-text-3); margin: 8px 0 0; }
.bb-legend span { display: inline-flex; align-items: center; }
.bb-dotline { display: inline-block; width: 13px; height: 2px; margin-right: 5px; border-radius: 2px; }
.bb-dashed { background: repeating-linear-gradient(90deg, #8a94a6 0 3px, transparent 3px 6px); }
.bb-sq { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: #5b8def; }
.bb-sq-outline { border: 1.5px dashed #b3c7f7; background: #f5f8ff; }

/* ---- Buttons (hierarchy: dark primary > outlined secondary) ---- */
.bb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.bb-btn-ghost {
  background: var(--bb-surface); border: 1px solid var(--bb-border-strong); color: var(--bb-text);
  border-radius: 6px; height: 32px; padding: 0 16px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.bb-btn-ghost:hover { border-color: var(--bb-text-4); background: #fcfcfd; }
.bb-btn-dark:disabled, .bb-btn-ghost:disabled { opacity: 0.55; cursor: wait; }
.bb-btn-sm { height: 26px; padding: 0 10px; font-size: 11.5px; flex: none; }
.bb-btn-dark {
  background: var(--bb-text); border: 1px solid var(--bb-text); color: #fff;
  border-radius: 6px; height: 32px; padding: 0 18px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 150ms ease;
}
.bb-btn-dark:hover { background: #1d2939; }

/* ---- Monitor toggle ---- */
.bb-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: #eef0f3; border-radius: 8px; padding: 3px; margin-top: 12px;
}
.bb-toggle button {
  border: none; background: transparent; color: var(--bb-text-2);
  font-size: 12px; font-weight: 600; height: 28px; cursor: pointer;
  border-radius: 6px; transition: all 150ms ease;
}
.bb-toggle .bb-tog-active { background: var(--bb-surface); color: var(--bb-text); box-shadow: var(--bb-shadow-xs); }

/* ---- Live feed ---- */
.bb-feed { list-style: none; padding: 6px 0 0; }
.bb-feed li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid #f2f4f6; font-size: 12.5px;
}
.bb-feed li:last-child { border-bottom: none; }
.bb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.bb-feed-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-feed-time { color: var(--bb-text-3); font-size: 11px; margin-left: auto; flex: none; }
.bb-feed strong { min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }

.bb-foot { font-size: 10.5px; color: var(--bb-text-3); text-align: center; margin-top: 8px; }

/* ---- Phase banner, recommendation, wizard, plan view ---- */
.bb-phase {
  border-left: 3px solid; border-radius: 0 8px 8px 0;
  background: #fbfbfa; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12px; line-height: 1.5; color: var(--bb-text-2);
}
.bb-rec-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bb-rec-chip {
  border: 1px solid; border-radius: 999px; padding: 3px 11px;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
  background: #fff; transition: box-shadow 150ms ease;
}
.bb-rec-chip:hover { box-shadow: var(--bb-shadow-sm); }
.bb-rec-why { font-size: 11px; color: var(--bb-text-3); flex: 1; min-width: 160px; }
.bb-rec { margin: 0 0 12px; }

.bb-btn-block { width: 100%; margin: 4px 0 14px; height: 36px; }

.bb-wiz-step {
  font-size: 10.5px; font-weight: 700; color: var(--bb-text-3);
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 12px;
}
.bb-wiz-tabs { margin-bottom: 4px; }
.bb-wiz-tabs .bb-tab { height: 32px; flex-direction: row; }

.bb-plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bb-plan-title { font-size: 13px; font-weight: 700; }
.bb-plan-progress { font-size: 11px; font-weight: 600; color: var(--bb-text-3); }
.bb-plan-entry { font-size: 12px; color: var(--bb-text-2); line-height: 1.5; margin-bottom: 10px; }

.bb-ladder { margin-bottom: 12px; }
.bb-rung {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid #f2f4f6; font-size: 12.5px;
}
.bb-rung:last-child { border-bottom: none; }
.bb-rung-idx {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: #eef0f3; color: var(--bb-text-3);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.bb-rung strong { font-variant-numeric: tabular-nums; min-width: 80px; }
.bb-rung-win { font-size: 11px; color: var(--bb-text-3); }
.bb-rung-passed { opacity: 0.55; }
.bb-rung-passed strong { text-decoration: line-through; }
.bb-rung-passed .bb-rung-idx { background: #e7f6ee; color: var(--bb-accent-strong); }
.bb-rung-current .bb-rung-idx { background: var(--bb-text); color: #fff; }
.bb-rung-current strong { font-weight: 700; }
.bb-rung-chip {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--bb-text);
  border-radius: 999px; padding: 2px 8px; margin-left: auto;
}
.bb-rung-stop .bb-rung-idx { background: #fef3f2; color: var(--bb-error); }
.bb-rung-stop strong { color: var(--bb-error); }

.bb-over { color: var(--bb-error) !important; }
.bb-over-chip {
  font-size: 10px; font-weight: 700; color: var(--bb-error); background: var(--bb-error-bg);
  border-radius: 999px; padding: 2px 8px; margin-left: 6px;
}

/* ---- Buyer view: changes banner, cockpit, all-in, diligence, comps, notes ---- */
.bb-changes {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  background: var(--bb-info-bg); border: 1px solid #dde4f8; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px;
}
.bb-changes strong { font-size: 12px; color: var(--bb-info); display: block; margin-bottom: 5px; }
.bb-changes ul { list-style: none; padding: 0; margin: 0; }
.bb-changes li { font-size: 12px; color: var(--bb-text-2); padding: 1.5px 0; }

.bb-cockpit {
  background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; box-shadow: var(--bb-shadow-sm);
}
.bb-cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bb-verdict {
  border: 2px solid; border-radius: 10px; text-align: center;
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  padding: 12px; margin-bottom: 8px;
}
.bb-cp-why { font-size: 12px; color: var(--bb-text-2); text-align: center; margin-bottom: 14px; }
.bb-cp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.bb-cp-grid > div { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid #f4f5f7; }
.bb-cp-grid span { color: var(--bb-text-3); }
.bb-cp-grid strong { font-variant-numeric: tabular-nums; }
.bb-cp-meta { font-size: 11px; color: var(--bb-text-3); margin-top: 10px; line-height: 1.5; }

.bb-allin-rows { margin-top: 4px; }
.bb-allin-rows > div { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid #f4f5f7; }
.bb-allin-rows > div > span:first-child { color: var(--bb-text-3); }
.bb-allin-rows > div > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.bb-allin-total > span { font-weight: 700 !important; color: var(--bb-text) !important; }
.bb-allin-ceiling { margin-top: 8px; background: #f8fafc; border-radius: 8px; padding: 4px 10px; }
.bb-allin-ceiling > div { border-bottom-color: #eef0f3; }
.bb-allin-edit { margin-top: 10px; }
.bb-allin-edit summary { font-size: 11.5px; color: var(--bb-text-3); cursor: pointer; }
.bb-allin-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; margin-top: 10px; }
.bb-allin-inputs label {
  display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px;
  font-size: 11px; line-height: 1.35; color: var(--bb-text-3);
}
.bb-number-field {
  display: inline-flex; align-items: center; max-width: 100%; height: 30px;
  border: 1px solid var(--bb-border-strong); border-radius: 6px; background: var(--bb-surface);
  color: var(--bb-text-3); overflow: hidden;
}
.bb-number-percent { width: 72px; }
.bb-number-dollar { width: 116px; }
.bb-number-field:focus-within { border-color: var(--bb-accent); box-shadow: var(--bb-ring); }
.bb-number-field input {
  width: 100%; min-width: 0; height: 100%; padding: 0 6px; border: 0; outline: 0;
  background: transparent; color: var(--bb-text); text-align: right;
  font-size: 12.5px; font-family: inherit; font-variant-numeric: tabular-nums;
}
.bb-number-affix { flex: none; color: var(--bb-text-3); font-size: 11px; line-height: 1; }
.bb-number-dollar .bb-number-affix { padding-left: 7px; }
.bb-number-percent .bb-number-affix { padding-right: 7px; }
.bb-lockprompt { margin-top: 12px; }
.bb-lockprompt p { margin-bottom: 8px; }
.bb-lockprompt input {
  width: 100%; border: 1px solid var(--bb-border-strong); border-radius: 6px;
  height: 32px; padding: 0 10px; font-size: 12.5px; font-family: inherit; margin-bottom: 8px;
}

.bb-dd { list-style: none; padding: 4px 0 0; }
.bb-dd li { padding: 8px 0; border-bottom: 1px solid #f4f5f7; }
.bb-dd li:last-child { border-bottom: none; }
.bb-dd-top { display: flex; align-items: baseline; gap: 8px; }
.bb-dd-top strong { font-size: 12.5px; }
.bb-dd-count { font-size: 11px; color: var(--bb-text-3); }
.bb-dd p { font-size: 11.5px; color: var(--bb-text-3); margin-top: 3px; line-height: 1.5; }

.bb-comps { list-style: none; padding: 6px 0 0; }
.bb-comps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f4f5f7; }
.bb-comps li:last-child { border-bottom: none; }
.bb-comps input[type="checkbox"] { accent-color: var(--bb-accent); flex: none; }
.bb-comp-link {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  text-decoration: none; color: inherit; border-radius: 8px; padding: 3px 4px;
  transition: background 120ms ease;
}
.bb-comp-link:hover { background: #f8fafc; }
.bb-comp-img {
  width: 58px; height: 42px; flex: none; border-radius: 6px; overflow: hidden;
  background: #eef0f3; display: block;
}
.bb-comp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-comp-main { flex: 1; min-width: 0; display: block; }
.bb-comp-main strong { font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-comp-meta { font-size: 10.5px; color: var(--bb-text-3); display: block; white-space: nowrap; }
.bb-comp-meta em { font-style: normal; }
.bb-comp-detail { display: block; margin-top: 1px; color: var(--bb-text-3); font-size: 10.5px; line-height: 1.35; }
.bb-sold { color: var(--bb-accent-strong); font-weight: 600; }
.bb-rnm { color: #b54708; font-weight: 500; }
.bb-comp-price { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; flex: none; }
.bb-comp-price small { color: #b54708; font-size: 9.5px; font-weight: 600; line-height: 1.2; }
.bb-comp-price strong { font-size: 12.5px; line-height: 1.35; }
.bb-comp-off .bb-comp-link { opacity: 0.45; }
.bb-comp-off .bb-comp-price { text-decoration: line-through; }

.bb-analysis-card + .bb-analysis-card { margin-top: 12px; }
.bb-analysis-update {
  margin: 8px 0 2px; padding: 7px 9px; border-radius: 6px;
  background: var(--bb-info-bg); color: var(--bb-info); font-size: 11px;
}
.bb-analysis-list { list-style: none; padding: 5px 0 0; }
.bb-analysis-list li { padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.bb-analysis-list li:last-child { border-bottom: 0; }
.bb-analysis-list strong { display: block; font-size: 12.5px; line-height: 1.4; }
.bb-analysis-list p { margin-top: 3px; color: var(--bb-text-2); font-size: 11.5px; line-height: 1.5; }
.bb-analysis-list li > span {
  display: inline-block; margin-top: 5px; color: var(--bb-text-3);
  font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.45px;
}
.bb-question-list { list-style: none; padding: 6px 0 0; counter-reset: bb-question; }
.bb-question-list li {
  counter-increment: bb-question; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start; gap: 7px; padding: 9px 0; border-bottom: 1px solid #f0f2f5;
  color: var(--bb-text-2); font-size: 11.5px; line-height: 1.5;
}
.bb-question-list li::before { content: counter(bb-question) "."; color: var(--bb-text-3); font-weight: 600; }
.bb-question-list li:last-child { border-bottom: 0; }
.bb-copy-question {
  border: 0; border-radius: 5px; padding: 3px 6px; background: transparent;
  color: var(--bb-accent-strong); font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.bb-copy-question:hover { background: #f0fdf7; }
.bb-analysis-disclaimer { margin-top: 10px; color: var(--bb-text-3); font-size: 10.5px; line-height: 1.45; }
.bb-analysis-loading { display: grid; gap: 8px; margin-top: 14px; }
.bb-analysis-loading .bb-skel { display: block; width: 100%; height: 12px; }
.bb-analysis-loading .bb-skel:nth-child(2) { width: 84%; }
.bb-analysis-loading .bb-skel:nth-child(3) { width: 68%; }

.bb-ceiling-row { align-items: center; }
.bb-ceiling-edit { display: inline-flex; align-items: center; gap: 6px; }
.bb-ceiling-edit input {
  width: 92px; height: 28px; text-align: right;
  border: 1px solid var(--bb-border-strong); border-radius: 6px; padding: 0 8px;
  font-size: 12.5px; font-weight: 700; font-family: inherit; font-variant-numeric: tabular-nums;
}
.bb-ceiling-edit input:focus-visible { outline: none; box-shadow: var(--bb-ring); border-color: var(--bb-accent); }
.bb-lock-label { display: block; font-size: 11px; color: var(--bb-text-3); margin: 6px 0 4px; }

.bb-notes {
  width: 100%; min-height: 72px; resize: vertical;
  border: 1px solid var(--bb-border); border-radius: 8px; padding: 10px;
  font-family: inherit; font-size: 12.5px; line-height: 1.5; color: var(--bb-text);
  margin-top: 10px; box-sizing: border-box;
}
.bb-notes:focus-visible { outline: none; box-shadow: var(--bb-ring); border-color: var(--bb-accent); }

.bb-pred-sub { font-size: 11px; color: var(--bb-text-3); }

/* ---- Watchlist star in the summary strip ---- */
.bb-watch {
  background: none; border: none; cursor: pointer; flex: none;
  font-size: 17px; line-height: 1; padding: 2px 4px; border-radius: 6px;
  color: var(--bb-text-4); transition: color 150ms ease;
}
.bb-watch:hover { color: var(--bb-text-2); }
.bb-watch[aria-pressed="true"] { color: var(--bb-accent); }

/* Dimmed pulse while re-predicting after a new bid (numbers stay visible) */
.bb-updating .bb-hero-num,
.bb-updating .bb-big,
.bb-updating .bb-delta { animation: bb-pulse 1.1s ease infinite; }
@keyframes bb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ================================================================
   Task-based information architecture
   ================================================================ */
.bb-sticky-shell {
  position: sticky; top: 0; z-index: 20;
  background: var(--bb-surface); border-bottom: 1px solid var(--bb-border);
  box-shadow: var(--bb-shadow-xs); overflow-x: hidden;
}
.bb-summary-strip {
  min-height: 58px; display: flex; align-items: center; gap: 8px;
  padding: 8px var(--bb-panel-pad); background: var(--bb-surface); border-bottom: 1px solid var(--bb-border);
  min-width: 0;
}
.bb-summary-strip .bb-thumb {
  width: 40px; height: 30px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--bb-border); flex: none;
}
.bb-thumb-empty { background: var(--bb-bg); }
.bb-summary-main { min-width: 0; flex: 1; }
.bb-summary-main h1 {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; line-height: 1.3;
}
.bb-summary-main p { color: var(--bb-text-3); font-size: 10.5px; white-space: nowrap; }
.bb-summary-figures { display: flex; align-items: center; gap: 8px; flex: none; }
.bb-summary-figures > span { display: flex; flex-direction: column; align-items: flex-end; }
.bb-summary-figures small { color: var(--bb-text-3); font-size: 9px; line-height: 1.2; }
.bb-summary-figures strong {
  color: var(--bb-text); font-size: 10.5px; line-height: 1.25;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bb-status-pill {
  border: 1px solid currentColor; border-radius: 999px; padding: 3px 7px;
  font-size: 10.5px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.bb-status-bid { color: var(--bb-accent-strong); background: #f0fdf7; }
.bb-status-pause { color: #b54708; background: #fffaeb; }
.bb-status-walk { color: var(--bb-error); background: var(--bb-error-bg); }
.bb-primary-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  padding: 4px var(--bb-panel-pad); background: var(--bb-surface);
}
.bb-primary-tab {
  height: 32px; border: 0; border-radius: 6px; background: transparent;
  color: var(--bb-text-3); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.bb-primary-tab:hover { color: var(--bb-text); background: var(--bb-bg); }
.bb-primary-tab-active { color: var(--bb-text); background: var(--bb-bg); box-shadow: inset 0 -2px 0 var(--bb-accent); }
.bb-advisory { padding: 0 var(--bb-panel-pad) 5px; text-align: center; color: var(--bb-text-3); font-size: 9.5px; }
.bb-tab-content { padding: 12px var(--bb-panel-pad) 28px; min-width: 0; min-height: calc(100vh - 110px); }

.bb-strategy-card { padding-bottom: 10px; }
.bb-strategy-tabs { margin: 10px 0 0; }
.bb-strategy-tabs .bb-tab {
  height: 68px; padding: 6px 4px; border: 1px solid transparent;
}
.bb-strategy-tabs .bb-tab strong {
  color: var(--bb-text); font-size: 12px; font-variant-numeric: tabular-nums;
}
.bb-strategy-tabs .bb-tab small { font-size: 9.5px; }
.bb-strategy-tabs .bb-tab-active {
  background: var(--bb-surface); border-color: var(--bb-strategy);
  box-shadow: var(--bb-shadow-xs); color: var(--bb-text);
}
.bb-value-summary {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  margin-bottom: 12px; border: 1px solid var(--bb-border); border-radius: 10px;
  background: var(--bb-surface); box-shadow: var(--bb-shadow-xs);
}
.bb-value-summary strong { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bb-value-summary > span { color: var(--bb-text-3); font-size: 11px; }
.bb-empty, .bb-live-status { margin-top: 12px; color: var(--bb-text-3); font-size: 12px; line-height: 1.5; }
.bb-live-status {
  margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--bb-border);
  border-radius: 8px; background: var(--bb-surface);
}

.bb-ceiling-edit { min-width: 0; }
.bb-ceiling-value {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 6px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--bb-text); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: text;
  transition: border-color 150ms ease, background 150ms ease;
}
.bb-ceiling-value:hover { border-color: var(--bb-border); background: var(--bb-surface); }
.bb-pencil { color: var(--bb-text-4); font-size: 11px; opacity: 0; transition: opacity 150ms ease; }
.bb-ceiling-value:hover .bb-pencil, .bb-ceiling-value:focus-visible .bb-pencil { opacity: 1; }
.bb-money-input {
  display: inline-flex; align-items: center; width: 110px; height: 30px;
  border: 1px solid var(--bb-border-strong); border-radius: 6px; background: var(--bb-surface);
  color: var(--bb-text-3); padding-left: 8px;
}
.bb-money-input:focus-within { border-color: var(--bb-accent); box-shadow: var(--bb-ring); }
.bb-money-input input {
  width: 100%; min-width: 0; height: 100%; padding: 0 8px 0 2px;
  border: 0; outline: 0; background: transparent; color: var(--bb-text);
  text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.bb-lock-toggle {
  height: 28px; padding: 0 9px; border: 1px solid var(--bb-border-strong);
  border-radius: 6px; background: var(--bb-surface); color: var(--bb-text-2);
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.bb-lock-on { border-color: var(--bb-accent); color: var(--bb-accent-strong); background: #f0fdf7; }

.bb-pref-details { padding: 0; overflow: hidden; }
.bb-pref-details > summary, .bb-allin-edit > summary {
  list-style: none; cursor: pointer; color: var(--bb-text-2); font-size: 12px; font-weight: 600;
}
.bb-pref-details > summary { padding: 13px 16px; }
.bb-pref-details > summary::-webkit-details-marker, .bb-allin-edit > summary::-webkit-details-marker { display: none; }
.bb-pref-details > summary::after, .bb-allin-edit > summary::after { content: "＋"; float: right; color: var(--bb-text-4); }
.bb-pref-details[open] > summary::after, .bb-allin-edit[open] > summary::after { content: "−"; }
.bb-disclosure-body { padding: 14px 16px; border-top: 1px solid var(--bb-border); }

.bb-modal-backdrop, .bb-sheet-backdrop {
  position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(440px, 94vw); height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(16, 24, 40, 0.36);
}
.bb-modal {
  width: 100%; padding: 16px; border: 1px solid var(--bb-border); border-radius: 12px;
  background: var(--bb-surface); box-shadow: var(--bb-shadow-sm);
}
.bb-modal-head, .bb-sheet-head { display: flex; align-items: flex-start; gap: 10px; }
.bb-modal-head > div, .bb-sheet-head > div { min-width: 0; flex: 1; }
.bb-modal h2, .bb-plan-sheet h2 { font-size: 15px; line-height: 1.35; }
.bb-modal-copy { margin: 12px 0; color: var(--bb-text-2); font-size: 12px; line-height: 1.5; }
.bb-ceiling-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 12px; }
.bb-ceiling-compare > div { padding: 10px; border-radius: 8px; background: var(--bb-bg); }
.bb-ceiling-compare span { display: block; color: var(--bb-text-3); font-size: 10.5px; }
.bb-ceiling-compare strong { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.bb-field-label { display: block; margin: 12px 0 5px; color: var(--bb-text-2); font-size: 11.5px; font-weight: 600; }
.bb-text-input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--bb-border-strong);
  border-radius: 6px; background: var(--bb-surface); color: var(--bb-text); font-size: 12.5px;
}
.bb-text-input[aria-invalid="true"] { border-color: var(--bb-error); }
.bb-modal-money { width: 100%; }
.bb-field-error { min-height: 17px; margin-top: 4px; color: var(--bb-error); font-size: 11px; }

.bb-sheet-backdrop { align-items: stretch; justify-content: flex-end; padding: 0; background: rgba(16, 24, 40, 0.18); }
.bb-plan-sheet {
  width: calc(100% - 20px); height: 100%; overflow-y: auto;
  background: var(--bb-bg); border-left: 1px solid var(--bb-border); box-shadow: var(--bb-shadow-sm);
  animation: bb-sheet-in 150ms ease;
}
@keyframes bb-sheet-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.bb-sheet-head {
  position: sticky; top: 0; z-index: 2; padding: 14px 12px;
  border-bottom: 1px solid var(--bb-border); background: var(--bb-surface);
}
.bb-sheet-back {
  width: 30px; height: 30px; border: 1px solid var(--bb-border); border-radius: 6px;
  background: var(--bb-surface); color: var(--bb-text); cursor: pointer; flex: none;
}
.bb-sheet-body { padding: 16px; }
.bb-feedback {
  position: fixed; right: 16px; bottom: 16px; z-index: 80; max-width: 300px;
  padding: 9px 12px; border: 1px solid var(--bb-border-strong); border-radius: 8px;
  background: var(--bb-surface); color: var(--bb-text-2); box-shadow: var(--bb-shadow-sm);
  font-size: 11.5px;
}
.bb-feedback:empty { display: none; }

@media (max-width: 390px) {
  #bidbud-root .bb-panel { --bb-panel-pad: 12px; }
  .bb-summary-figures > span:nth-child(2) { display: none; }
}

/* ---------------------------------------------------------------------------
   Comp confidence, market trend, seller replies, tax jurisdiction

   Added after beta feedback. A fair-value range presented without its
   confidence reads as authoritative regardless of whether it rests on eleven
   close sales or one loose one, so the banner is deliberately prominent and
   colour-coded rather than tucked into small print.
   --------------------------------------------------------------------------- */
.bb-conf {
  font-size: 12px; line-height: 1.5; margin: 10px 0 4px;
  padding: 9px 11px; border-radius: 8px; border: 1px solid transparent;
}
.bb-conf strong { font-weight: 650; }
.bb-conf-high { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.bb-conf-med  { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.bb-conf-low  { background: #fef3f2; border-color: #fecdca; color: #b42318; }

.bb-trend {
  font-size: 12px; line-height: 1.5; color: var(--bb-text-2);
  margin: 8px 0 4px; padding: 8px 11px;
  background: var(--bb-surface-2, #f9fafb);
  border-radius: 8px; border: 1px solid #eaecf0;
}
.bb-trend strong { color: var(--bb-text-1); font-weight: 650; }
.bb-freshness { margin-top: 6px; }

.bb-branded { color: #b42318; font-style: normal; font-weight: 600; }

.bb-seller-replies { list-style: none; margin: 6px 0 0; padding: 0; }
.bb-seller-replies li {
  font-size: 12.5px; line-height: 1.55; color: var(--bb-text-2);
  padding: 8px 0 8px 11px; border-bottom: 1px solid #f4f5f7;
  border-left: 2px solid var(--bb-accent, #175cd3); margin-bottom: 2px;
}
.bb-seller-replies li:last-child { border-bottom: none; }

.bb-allin-state { margin-bottom: 10px; }
.bb-allin-state label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bb-allin-state label > span { font-size: 12px; color: var(--bb-text-3); white-space: nowrap; }
.bb-allin-state select {
  flex: 1 1 auto; min-width: 0; width: 100%;
  font: inherit; font-size: 12.5px; padding: 6px 8px;
  border: 1px solid var(--bb-border, #d0d5dd); border-radius: 7px;
  background: #fff; color: var(--bb-text-1);
}
.bb-allin-state .bb-hint {
  font-size: 11px; color: var(--bb-text-3); line-height: 1.5; margin: 6px 0 0;
}

/* Confidence ladder — what each level of certainty costs.
   Answers "what would winning take?" rather than only "are you likely to win?" */
.bb-ladder { margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(0,0,0,.07); }
.bb-ladder-rungs { display: flex; gap: 8px; margin-top: 7px; }
.bb-ladder-rungs > span {
  flex: 1 1 0; min-width: 0; text-align: center;
  padding: 7px 4px; border-radius: 8px;
  background: rgba(255,255,255,.62); border: 1px solid rgba(0,0,0,.07);
}
.bb-ladder-rungs em {
  display: block; font-style: normal; font-size: 10.5px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--bb-text-3);
}
.bb-ladder-rungs strong {
  display: block; margin-top: 2px; font-size: 14px;
  font-variant-numeric: tabular-nums; color: var(--bb-text-1);
}
/* A rung already covered by the user's ceiling. */
.bb-ladder-rungs .bb-ladder-met { background: #ecfdf3; border-color: #abefc6; }
.bb-ladder-rungs .bb-ladder-met strong { color: #067647; }
.bb-ladder-note { font-size: 11px; color: var(--bb-text-3); line-height: 1.5; margin-top: 7px; }

/* Keep the vehicle identity and evidence text clear of the price figures. */
.bb-summary-strip { flex-wrap: wrap; }
.bb-summary-main { flex: 1 1 200px; }
.bb-summary-main p { white-space: normal; overflow-wrap: anywhere; }
.bb-summary-figures { flex: 1 1 220px; }
.bb-status-pill { max-width: 130px; white-space: normal; }
