/* =============================================================================
   Bid Workspace — built on styles.css tokens (light DS theme)
   ============================================================================= */

.bw-page { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* --- Header --------------------------------------------------------------- */
.bw-header { display: flex; align-items: center; gap: var(--space-md); padding: 14px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); }
.bw-header__titles { min-width: 0; flex: 1; }
.bw-header__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.bw-header__title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.bw-ring { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.bw-ring svg { transform: rotate(-90deg); }
.bw-ring__track { stroke: var(--border-subtle); }
.bw-ring__arc { transition: stroke-dashoffset var(--duration-slow) var(--ease-out); }
.bw-ring__label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--text-primary); }

.bw-countdown { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--text-dim); }
.bw-countdown strong { font-size: 18px; color: var(--text-primary); line-height: 1.1; }
.bw-countdown--urgent strong { color: var(--priority-disqualified); }

.bw-stages { display: flex; gap: 4px; padding: 8px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
.bw-stage { border: 1px solid var(--border-subtle); background: var(--bg-primary); color: var(--text-secondary); font: 600 12px var(--font-sans); padding: 5px 12px; border-radius: var(--radius-full); cursor: pointer; white-space: nowrap; transition: all var(--duration-fast); }
.bw-stage:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.bw-stage--done { background: var(--accent-blue-glow); color: var(--accent-blue); border-color: transparent; }
.bw-stage--current { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* --- Presence ------------------------------------------------------------- */
.bw-presence { display: flex; align-items: center; padding-left: 6px; }
.bw-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 11px var(--font-sans); color: #fff; border: 2px solid var(--bg-card); margin-left: -6px; position: relative; }
.bw-avatar--editing::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--priority-high); border: 2px solid var(--bg-card); }
.bw-editing-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: rgba(34,197,94,.1); color: #15803d; padding: 3px 10px; border-radius: var(--radius-full); }
.bw-editing-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--priority-high); animation: bwPulse 1.6s infinite; }
@keyframes bwPulse { 50% { opacity: .35; } }

/* --- Three panes ---------------------------------------------------------- */
.bw-body { flex: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr) 360px; min-height: 0; }
.bw-pane { min-height: 0; overflow-y: auto; }
.bw-outline { background: var(--bg-card); border-right: 1px solid var(--border-subtle); padding: 14px 10px; }
.bw-rail { background: var(--bg-card); border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; }
.bw-center { background: var(--bg-primary); padding: 24px clamp(16px, 4vw, 48px); }

.bw-outline__head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 10px; }
.bw-outline__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.bw-sec { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; font: 500 13px var(--font-sans); color: var(--text-secondary); transition: background var(--duration-fast); }
.bw-sec:hover { background: var(--bg-secondary); }
.bw-sec--active { background: var(--accent-blue-glow); color: var(--text-primary); }
.bw-sec__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--border-subtle); }
.bw-sec__dot--drafting { background: var(--priority-medium); }
.bw-sec__dot--review { background: var(--accent-purple); }
.bw-sec__dot--final { background: var(--priority-high); }
.bw-sec__main { min-width: 0; flex: 1; }
.bw-sec__title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-sec__meta { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.bw-sec__meta--over { color: var(--priority-disqualified); font-weight: 600; }
.bw-sec__who { display: inline-block; margin-left: 4px; color: #15803d; font-weight: 600; }
/* --- Editor --------------------------------------------------------------- */
.bw-editor-card { max-width: 860px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.bw-editor-head { padding: 18px 24px 12px; border-bottom: 1px solid var(--border-subtle); }
.bw-editor-title { width: 100%; border: 0; font: 700 1.35rem var(--font-sans); color: var(--text-primary); background: transparent; outline: none; }
.bw-editor-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.bw-editor-meta select { font: 500 12px var(--font-sans); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 3px 6px; background: var(--bg-input); color: var(--text-secondary); }
.bw-guidance { margin: 12px 24px 0; padding: 10px 12px; background: var(--bg-secondary); border-radius: var(--radius-md); font-size: 12.5px; color: var(--text-secondary); }
.bw-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); position: sticky; top: -24px; background: var(--bg-card); z-index: 2; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.bw-tb { border: 0; background: none; min-width: 32px; height: 30px; padding: 0 6px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); display: inline-grid; place-items: center; font: 700 12px var(--font-sans); }
.bw-tb:hover { background: var(--bg-secondary); color: var(--text-primary); }
.bw-tb--on { background: var(--accent-blue-glow); color: var(--accent-blue); }
.bw-tb svg { width: 16px; height: 16px; }
.bw-tb-sep { width: 1px; background: var(--border-subtle); margin: 4px 6px; }
.bw-save-state { margin-left: auto; align-self: center; font-size: 12px; color: var(--text-muted); }
.bw-save-state--error { color: var(--priority-disqualified); font-weight: 600; }

.bw-prose { padding: 20px 28px 48px; min-height: 420px; font-size: 15px; line-height: 1.7; color: var(--text-primary); }
.bw-prose .ProseMirror { outline: none; min-height: 380px; }
.bw-prose h1, .bw-prose h2 { font-size: 1.2rem; margin: 1.2em 0 .4em; }
.bw-prose h3 { font-size: 1.05rem; margin: 1em 0 .3em; }
.bw-prose p { margin: 0 0 .8em; }
.bw-prose ul, .bw-prose ol { margin: 0 0 .8em 1.4em; }
.bw-prose blockquote { border-left: 3px solid var(--border-active); padding-left: 12px; color: var(--text-secondary); }
.bw-prose code { font-family: var(--font-mono); background: var(--bg-secondary); padding: 1px 5px; border-radius: 4px; }
.bw-prose p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--text-muted); float: left; height: 0; pointer-events: none; }
.bw-flash { animation: bwFlash 1.6s var(--ease-out); }
@keyframes bwFlash { 0%, 40% { background: rgba(234,179,8,.35); } 100% { background: transparent; } }
.bw-notice { margin: 12px 24px 0; padding: 10px 12px; border-radius: var(--radius-md); background: rgba(139,92,246,.08); color: #6d28d9; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.bw-notice--warn { background: rgba(234,179,8,.12); color: #92400e; }

/* Bubble menu (Tandy inline actions) */
.bw-bubble { display: flex; gap: 2px; padding: 4px; background: #0f172a; border-radius: var(--radius-md); box-shadow: var(--shadow-glow); }
.bw-bubble button { border: 0; background: none; color: #e2e8f0; font: 600 12px var(--font-sans); padding: 6px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.bw-bubble button:hover { background: rgba(255,255,255,.12); color: #fff; }
.bw-bubble .bw-bubble__tandy { color: #93c5fd; }

/* Diff (tracked changes) */
/* Centered and above Tandy's floating bubble (z 99998-99999) so nothing covers the suggestion. */
.bw-diff-backdrop { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.35); animation: bwFade var(--duration-fast); }
.bw-diff { width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(15,23,42,.28); animation: bwRise var(--duration-normal) var(--ease-out); }
.bw-diff__legend { padding: 8px 16px 0; font-size: 12px; color: var(--text-dim); }
.bw-diff__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); font-weight: 700; font-size: 13px; }
.bw-diff__body { max-height: 44vh; overflow-y: auto; padding: 14px 16px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.bw-diff__body del { background: rgba(239,68,68,.12); color: #b91c1c; text-decoration: line-through; }
.bw-diff__body ins { background: rgba(34,197,94,.14); color: #15803d; text-decoration: none; }
.bw-diff__foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border-subtle); }
.bw-diff__hint { margin-right: auto; font-size: 11.5px; color: var(--text-muted); }
.bw-streaming::after { content: "▍"; animation: bwPulse 1s infinite; color: var(--accent-blue); }
/* --- Rail tabs ------------------------------------------------------------ */
.bw-tabs { display: flex; border-bottom: 1px solid var(--border-subtle); padding: 0 8px; flex-shrink: 0; }
.bw-tab { flex: 1; border: 0; background: none; padding: 12px 4px; font: 600 12.5px var(--font-sans); color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; }
.bw-tab--on { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.bw-tab__count { font-size: 11px; background: var(--bg-secondary); color: var(--text-secondary); border-radius: var(--radius-full); padding: 0 6px; margin-left: 3px; }
.bw-rail__body { flex: 1; overflow-y: auto; padding: 14px; }
.bw-rail__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.bw-score-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.bw-score-row .bw-chip { min-width: 0; padding: 7px 2px; }
.bw-rail { min-width: 0; }
.bw-rail__body { min-width: 0; overflow-x: hidden; padding-bottom: 96px; } /* clear Tandy's bubble */
.bw-chip { flex: 1; text-align: center; padding: 8px 4px; border-radius: var(--radius-md); background: var(--bg-secondary); font: 500 11px var(--font-sans); color: var(--text-dim); cursor: pointer; border: 1px solid transparent; }
.bw-chip strong { display: block; font-size: 17px; color: var(--text-primary); }
.bw-chip--on { border-color: var(--accent-blue); }

.bw-req { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; transition: border-color var(--duration-fast); }
.bw-req:hover { border-color: var(--border-active); }
.bw-req--stale { opacity: .65; border-style: dashed; }
/* Stacked card: [ref ........ badge] then the requirement text at full width (never squeezed). */
.bw-req { min-width: 0; overflow-wrap: anywhere; }
.bw-req__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ref badge" "text text"; gap: 4px 8px; align-items: center; }
.bw-req__top > .bw-badge { grid-area: badge; justify-self: end; }
.bw-req__ref { grid-area: ref; font: 600 10.5px var(--font-mono); color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-req__text { grid-area: text; font-size: 12.5px; line-height: 1.5; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.bw-req__src { font-size: 11px; color: var(--text-dim); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-req__evidence { margin-top: 8px; font-size: 12px; color: var(--text-secondary); border-left: 2px solid var(--priority-medium); padding-left: 8px; overflow-wrap: anywhere; }
.bw-req__actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bw-link { border: 0; background: none; padding: 0; color: var(--accent-blue); font: 600 12px var(--font-sans); cursor: pointer; }
.bw-link--muted { color: var(--text-dim); }

.bw-badge { font: 700 10.5px var(--font-sans); letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-full); flex-shrink: 0; }
.bw-badge--covered { background: var(--priority-high-bg); color: #15803d; }
.bw-badge--partial { background: var(--priority-medium-bg); color: #a16207; }
.bw-badge--missing { background: var(--priority-disqualified-bg); color: #b91c1c; }
.bw-badge--n_a { background: var(--bg-secondary); color: var(--text-dim); }

.bw-task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
.bw-task input[type=checkbox] { margin-top: 3px; accent-color: var(--accent-blue); }
.bw-task__main { flex: 1; min-width: 0; }
.bw-task__title { font-size: 13px; color: var(--text-primary); }
.bw-task--done .bw-task__title { text-decoration: line-through; color: var(--text-muted); }
.bw-task__meta { font-size: 11.5px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.bw-task__meta select, .bw-task__meta input { font: 500 11.5px var(--font-sans); border: 1px solid var(--border-subtle); border-radius: 5px; padding: 1px 4px; background: var(--bg-input); color: var(--text-secondary); }
.bw-overdue { color: var(--priority-disqualified); font-weight: 600; }

.bw-finding { border-radius: var(--radius-md); padding: 8px 10px; margin-bottom: 6px; font-size: 12.5px; }
.bw-finding--strengths { background: var(--priority-high-bg); }
.bw-finding--weaknesses { background: var(--priority-medium-bg); }
.bw-finding--deficiencies { background: var(--priority-disqualified-bg); }
.bw-finding--risks { background: rgba(139,92,246,.1); }
.bw-finding__fix { color: var(--text-secondary); margin-top: 4px; }
.bw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bw-chips .bw-chip { flex: 0 0 auto; flex-direction: row; gap: 4px; padding: 5px 10px; font-size: 12px; }
.bw-review-desc { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; }
.bw-select-sm { font: 12px var(--font-sans); padding: 4px 6px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-secondary); max-width: 170px; }
.bw-section-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); margin: 14px 0 6px; }

.bw-job { padding: 10px 12px; border-radius: var(--radius-md); background: var(--accent-blue-glow); font-size: 12.5px; margin-bottom: 10px; }
.bw-job__row { display: flex; gap: 10px; align-items: center; }
.bw-job--failed { background: var(--priority-disqualified-bg); color: #b91c1c; }
.bw-job__bar { height: 4px; background: rgba(59,130,246,.2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.bw-job__bar > span { display: block; height: 100%; background: var(--accent-blue); transition: width var(--duration-normal); }
.bw-spinner { width: 16px; height: 16px; border: 2px solid rgba(59,130,246,.25); border-top-color: var(--accent-blue); border-radius: 50%; animation: bwSpin .8s linear infinite; flex-shrink: 0; }
@keyframes bwSpin { to { transform: rotate(360deg); } }

.bw-doc { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
.bw-doc__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.bw-dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1.5px dashed var(--border-active, #cbd5e1); border-radius: var(--radius-md); padding: 18px 14px; text-align: center; font-size: 12.5px; line-height: 1.45; color: var(--text-dim); margin: 12px 0 14px; cursor: pointer; background: var(--bg-primary); transition: border-color var(--duration-fast), background var(--duration-fast); }
.bw-dropzone:hover { border-color: var(--accent-blue); }
.bw-dropzone svg { width: 22px; height: 22px; color: var(--accent-blue); }
.bw-dropzone strong { color: var(--text-primary); font-size: 13px; }
.bw-reading { font-size: 12px; color: var(--text-secondary); background: var(--bg-primary); border-radius: var(--radius-md); padding: 8px 10px; margin-bottom: 10px; }
.bw-reading summary { cursor: pointer; }
.bw-reading__row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid var(--border-subtle); }
.bw-reading__row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-reading__row span:last-child { flex-shrink: 0; color: var(--text-dim); }
.bw-docs-note { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 0 0 14px; }
.bw-doc-list-head { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); margin: 4px 0 4px; }
.bw-dropzone--over { border-color: var(--accent-blue); background: var(--accent-blue-glow); }

.bw-empty { text-align: center; padding: 28px 12px; color: var(--text-dim); font-size: 13px; }
.bw-empty strong { display: block; color: var(--text-primary); font-size: 14px; margin-bottom: 4px; }
/* --- Modal (replaces prompt/alert) --------------------------------------- */
.bw-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 100001; animation: bwFade var(--duration-fast); padding: 16px; }
.bw-modal { width: min(520px, 100%); background: var(--bg-card); border-radius: var(--radius-xl); box-shadow: 0 30px 80px rgba(15,23,42,.25); animation: bwRise var(--duration-normal) var(--ease-out); max-height: 90vh; display: flex; flex-direction: column; }
.bw-modal--wide { width: min(760px, 100%); }
.bw-modal__head { padding: 18px 20px 6px; font-weight: 700; font-size: 1.05rem; color: var(--text-primary); }
.bw-modal__body { padding: 8px 20px 4px; overflow-y: auto; font-size: 14px; color: var(--text-secondary); }
.bw-modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.bw-field { display: block; margin: 10px 0; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.bw-field input, .bw-field select, .bw-field textarea { display: block; width: 100%; margin-top: 5px; font: 400 14px var(--font-sans); padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input); color: var(--text-primary); }
.bw-field textarea { min-height: 90px; resize: vertical; }
.bw-kbd { font: 600 11px var(--font-mono); background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
@keyframes bwFade { from { opacity: 0; } }
@keyframes bwRise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* --- Bids list ----------------------------------------------------------- */
.bids-wrap { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 4vw, 40px); }
.bids-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bids-head p { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.bids-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 26px 20px; padding-top: 14px; }
/* Folder card: a tab on top-left + a roomy body */
.bid-folder { position: relative; display: block; color: inherit; text-decoration: none; }
.bid-folder__tab { position: absolute; top: -13px; left: 0; height: 26px; padding: 0 16px; display: inline-flex; align-items: center; font: 700 11px var(--font-sans); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-blue); background: linear-gradient(180deg, #eaf1ff, var(--bg-card)); border: 1px solid var(--border-subtle); border-bottom: 0; border-radius: 10px 14px 0 0; }
.bid-folder__body { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-card); transition: transform var(--duration-fast), box-shadow var(--duration-fast), border-color var(--duration-fast); min-height: 250px; }
.bid-folder:hover .bid-folder__body, .bid-folder:focus-visible .bid-folder__body { transform: translateY(-2px); box-shadow: var(--shadow-glow); border-color: rgba(59,130,246,.35); }
.bid-folder:focus-visible { outline: none; }
.bid-folder--closed .bid-folder__tab { color: var(--text-dim); background: var(--bg-primary); }
.bid-folder--closed .bid-folder__body { opacity: .82; }
.bid-folder__top { display: flex; gap: 14px; align-items: flex-start; }
.bid-folder__titles { flex: 1; min-width: 0; }
.bid-folder__title { font-weight: 700; font-size: 16px; line-height: 1.35; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid-folder__agency { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bid-folder__due { display: flex; flex-direction: column; align-items: flex-end; font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }
.bid-folder__due strong { font-size: 24px; line-height: 1; color: var(--text-primary); }
.bid-folder__due.is-urgent strong, .bid-folder__due.is-urgent span { color: var(--priority-disqualified); }
.bid-folder__track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bid-folder__step { height: 5px; border-radius: 3px; background: var(--border-subtle); }
.bid-folder__step.is-done { background: rgba(59,130,246,.45); }
.bid-folder__step.is-current { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.bid-folder__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bid-folder__stats > span { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-primary); font-weight: 700; font-size: 15px; color: var(--text-primary); }
.bid-folder__stats > span small { font-weight: 500; font-size: 11px; color: var(--text-dim); }
.bid-folder__stats svg { width: 14px; height: 14px; color: var(--text-dim); }
.bid-folder__stats .is-urgent, .bid-folder__stats .is-urgent small { color: var(--priority-disqualified); }
.bid-folder__stats .is-dim { color: var(--text-dim); }
.bid-folder__next { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary); padding: 8px 10px; border-left: 3px solid var(--accent-purple, #8b5cf6); background: rgba(139,92,246,.06); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.bid-folder__next svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: #7c3aed; }
.bid-folder__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.bid-folder__people { display: flex; padding-left: 6px; }
.bid-folder__nobody { font-size: 12px; color: var(--text-dim); font-style: italic; }
.bid-folder__edited { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.bid-folder__edited svg { width: 13px; height: 13px; }
@media (max-width: 520px) { .bid-folder__stats { grid-template-columns: repeat(2, 1fr); } }
.bid-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); color: inherit; text-decoration: none; transition: transform var(--duration-fast), box-shadow var(--duration-fast); }
.bid-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); color: inherit; }
.bid-card__top { display: flex; gap: 12px; align-items: flex-start; }
.bid-card__title { font-weight: 700; font-size: 14.5px; color: var(--text-primary); line-height: 1.35; }
.bid-card__agency { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.bid-card__foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-dim); gap: 8px; }
.bid-upgrade { max-width: 560px; margin: 40px auto; text-align: center; padding: 32px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.bid-upgrade__price { font-size: 2rem; font-weight: 800; color: var(--text-primary); margin: 10px 0; }
.bid-upgrade ul { text-align: left; margin: 16px auto; max-width: 380px; color: var(--text-secondary); font-size: 14px; }

.bw-import { display: flex; flex-direction: column; gap: 10px; align-items: stretch; padding: 12px; margin-bottom: 8px; border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(139,92,246,.08)); border: 1px solid rgba(59,130,246,.2); }
.bw-import strong { display: block; font-size: 13px; color: var(--text-primary); }
.bw-import span { font-size: 12px; color: var(--text-secondary); }
.bw-import .btn { align-self: flex-start; }
.bw-closed-banner { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 16px; font-size: 13px; background: var(--bg-primary); border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }

/* --- Company Library --------------------------------------------------- */
.lib-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 16px; overflow-x: auto; }
.lib-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; background: none; font: 600 13px var(--font-sans); color: var(--text-secondary); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.lib-tab svg { width: 15px; height: 15px; }
.lib-tab--on { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.lib-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.lib-bar p { color: var(--text-secondary); font-size: 13.5px; margin: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 14px; }
.lib-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 6px; }
.lib-card__head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: 14.5px; color: var(--text-primary); }
.lib-card__meta { font-size: 12px; color: var(--text-dim); }
.lib-card__text { font-size: 13px; color: var(--text-secondary); margin: 0; white-space: pre-wrap; }
.lib-card__dim { color: var(--text-dim); font-size: 12px; }
.lib-card__actions { display: flex; gap: 12px; margin-top: auto; padding-top: 6px; }
.lib-profile { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-md); background: var(--bg-primary); font-size: 13px; color: var(--text-secondary); }
.lib-profile svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.lib-table { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; margin-top: 12px; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border-subtle); }
.lib-row:first-child { border-top: 0; }
.lib-row__main { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; color: var(--text-primary); }
.lib-row__main small { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row__actions { display: flex; gap: 12px; }
@media (max-width: 640px) { .lib-row { grid-template-columns: 1fr; gap: 6px; } }

/* --- CTA on the opportunity modal ---------------------------------------- */
.bid-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(139,92,246,.08)); border: 1px solid rgba(59,130,246,.18); }
.bid-cta__text { font-size: 13px; color: var(--text-secondary); }
.bid-cta__text strong { display: block; color: var(--text-primary); font-size: 14px; }
.tandy-bid-link { color: var(--accent-blue); font-weight: 600; text-decoration: underline; }

/* --- Responsive ---------------------------------------------------------- */
.bw-mobile-tabs { display: none; }
@media (max-width: 1180px) { .bw-body { grid-template-columns: 220px minmax(0, 1fr) 320px; } }
@media (max-width: 900px) {
    .bw-page { height: auto; min-height: 100vh; overflow: visible; }
    .bw-header { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
    .bw-header .btn__label { display: none; }
    .bw-header__titles { order: 10; flex-basis: 100%; }
    .bw-header__eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .bw-header__title { white-space: normal; font-size: 1.05rem; line-height: 1.3; }
    .bw-header__actions { margin-left: auto; }
    .bw-body { display: block; }
    .bw-pane { display: none; overflow: visible; }
    .bw-pane--mobile-on { display: block; }
    .bw-rail.bw-pane--mobile-on { display: flex; }
    .bw-outline, .bw-rail { border: 0; }
    .bw-center { padding: 12px; }
    .bw-mobile-tabs { display: flex; position: sticky; top: 0; z-index: 5; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); }
    .bw-toolbar { top: 41px; }
    .bw-prose { padding: 16px; }
    .bw-diff-backdrop { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .bw-page *, .bw-modal, .bw-diff, .bw-diff-backdrop { animation: none !important; transition: none !important; } }
