@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
  color-scheme: light;
  --bg: #d9e0e8;
  --bg-deep: #c8d1dc;
  --text: #10161f;
  --muted: #2f3b4c;
  --panel: #e8edf3;
  --panel-raised: #ffffff;
  --panel-recessed: #dfe5ed;
  --row-odd: #e8eef5;
  --row-even: #f7f9fc;
  --row-hover: #d4e2f7;
  --accent: #0a4fd6;
  --accent-strong: #063a9e;
  --accent-text: #ffffff;
  --interest: #0a6b42;
  --interest-strong: #084e31;
  --interest-soft: #c8eedc;
  --danger: #9f1d14;
  --hairline: rgba(16, 22, 31, 0.14);
  --focus: #4d82ef;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #d9e0e8;
  --bg-deep: #c8d1dc;
  --text: #10161f;
  --muted: #2f3b4c;
  --panel: #e8edf3;
  --panel-raised: #ffffff;
  --panel-recessed: #dfe5ed;
  --row-odd: #e8eef5;
  --row-even: #f7f9fc;
  --row-hover: #d4e2f7;
  --accent: #0a4fd6;
  --accent-strong: #063a9e;
  --accent-text: #ffffff;
  --interest: #0a6b42;
  --interest-strong: #084e31;
  --interest-soft: #c8eedc;
  --danger: #9f1d14;
  --hairline: rgba(16, 22, 31, 0.14);
  --focus: #4d82ef;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e131a;
  --bg-deep: #090d12;
  --text: #f3f6fb;
  --muted: #c2cad8;
  --panel: #171e28;
  --panel-raised: #222b3a;
  --panel-recessed: #121821;
  --row-odd: #1a222e;
  --row-even: #222b3a;
  --row-hover: #2c3c56;
  --accent: #7aafff;
  --accent-strong: #a8c9ff;
  --accent-text: #071018;
  --interest: #3dcc8c;
  --interest-strong: #8be0b5;
  --interest-soft: #163528;
  --danger: #ff8d80;
  --hairline: rgba(243, 246, 251, 0.12);
  --focus: #7aafff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Figtree", "Segoe UI", sans-serif;
  font-weight: 600;
  line-height: 1.45;
  background: var(--bg);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 700;
}

a:hover { color: var(--accent); }

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--panel-raised);
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  min-width: auto;
}

.brand h1 {
  margin: 0;
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand .tagline {
  display: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.nav a,
.nav button,
button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
}

.nav a.secondary,
.nav button.secondary,
button.secondary,
.btn.secondary {
  background: var(--panel-recessed);
  color: var(--text);
}

.nav a.active {
  background: var(--accent-strong);
  color: var(--accent-text);
}

.nav a:hover,
button:hover,
.btn:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.meta {
  display: none;
}

.meta-line {
  margin: 0 0 10px;
  padding: 0 2px;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-bar {
  gap: 10px;
  align-items: end;
}

.muted { color: var(--muted); }

.header-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.download-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-recessed);
}

.panel {
  background: var(--panel);
  border: 0;
  border-radius: 10px;
  padding: 18px 16px;
  margin-bottom: 14px;
  color: var(--text);
}

.panel h2 {
  margin: 0;
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.row.actions { align-items: center; }
.spacer { flex: 1 1 auto; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.field > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  min-width: auto;
}

.field.inline span {
  margin-right: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

input,
select,
textarea {
  padding: 9px 11px;
  border-radius: 8px;
  border: 0;
  background: var(--panel-raised);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--panel-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 11px 10px;
  border: 0;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--bg-deep);
  box-shadow: inset 0 -3px 0 var(--accent);
}

tbody tr:nth-child(odd) td {
  background: var(--row-odd);
}

tbody tr:nth-child(even) td {
  background: var(--row-even);
}

tbody tr:hover td {
  background: var(--row-hover);
}

/* Card-like opportunity rows: still a table, but multiline and spaced. */
.opp-table-wrap {
  background: transparent;
  overflow: visible;
}

.opp-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.opp-table thead th {
  background: transparent;
  box-shadow: none;
  padding: 4px 14px 8px;
  color: var(--muted);
}

.opp-table tbody tr.opp-row td {
  background: var(--panel-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 14px;
  vertical-align: top;
}

.opp-table tbody tr.opp-row td:first-child {
  border-left: 1px solid var(--border);
  border-radius: 12px 0 0 12px;
}

.opp-table tbody tr.opp-row td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 12px 12px 0;
}

.opp-table tbody tr.opp-row td:first-child:last-child {
  border-radius: 12px;
}

.opp-table tbody tr.opp-row:hover td {
  background: var(--row-hover);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.opp-col-score {
  width: 5.5rem;
  white-space: nowrap;
  vertical-align: top;
}

.score-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.score-ai {
  color: var(--accent-strong);
}

.opp-col-main {
  min-width: 18rem;
}

.opp-head-line {
  display: grid;
  gap: 10px 14px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.opp-head-title {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.opp-head-detail {
  margin-top: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.opp-head-detail-bid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.docs-count-ready {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--interest-strong);
}

.opp-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.opp-line {
  display: grid;
  gap: 10px 14px;
  align-items: start;
  min-width: 0;
}

.opp-line-title {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.opp-title-actions {
  flex-shrink: 0;
  justify-self: end;
}

.opp-line-ai {
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  padding-top: 10px;
  border-top: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}

.opp-line-ai-error .opp-title,
.opp-line-ai-error .desc {
  color: var(--danger);
}

.ai-response-body {
  white-space: pre-wrap;
}

.opp-line-detail {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.opp-line-detail-bid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.opp-notice {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.opp-title-block {
  min-width: 0;
}

.opp-title {
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.35;
}

.opp-title a {
  color: var(--text);
  text-decoration-thickness: 1px;
}

.opp-reasons {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.opp-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.opp-field-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.opp-field-value {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.opp-sub {
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.opp-closing-date {
  font-weight: 750;
}

.opp-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 8px 14px;
}

.opp-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
}

@media (max-width: 900px) {
  .opp-head-detail,
  .opp-line-detail {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .opp-line-title {
    grid-template-columns: 1fr;
  }

  .opp-title-actions {
    justify-self: start;
  }

  .opp-head-detail,
  .opp-line-detail {
    grid-template-columns: 1fr;
  }
}

.tiny {
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
}

.icon-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--panel-recessed);
  color: var(--text);
  border: 1px solid var(--border);
  position: relative;
  text-decoration: none;
}

.icon-btn:hover,
.icon-btn:focus-visible,
[data-tooltip]:hover,
[data-tooltip]:focus-visible {
  z-index: 40;
}

[data-tooltip] {
  position: relative;
}

/* Pseudo tooltips disabled — floating tip is positioned in JS to stay in-bounds. */
[data-tooltip]::after {
  content: none !important;
  display: none !important;
}

.app-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(18rem, calc(100vw - 16px));
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  text-align: left;
  box-shadow: 0 8px 22px color-mix(in srgb, #000 28%, transparent);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.app-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.app-tooltip.is-wrap {
  white-space: normal;
  min-width: 10rem;
}


.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.icon-btn.danger {
  color: var(--danger);
}

.icon-btn:hover:not(:disabled) {
  background: var(--panel);
}

.icon-btn.not-interested-on {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.icon-btn.interest-on {
  color: var(--interest-strong);
  border-color: color-mix(in srgb, var(--interest) 45%, var(--border));
  background: var(--interest-soft);
}

.icon-spin {
  font-size: 0.85rem;
  line-height: 1;
}

.review-actions.icon-actions {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  width: max-content;
}

.ai-triage-panel {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-recessed);
}

.ai-triage-panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.ai-triage-match {
  background: color-mix(in srgb, var(--interest) 10%, transparent);
}

.ai-triage-rationale {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}

.ai-triage-chip-match {
  background: var(--interest-soft);
  color: var(--interest-strong);
}

.ai-triage-chip-skip {
  opacity: 0.85;
}

.column-picker {
  position: relative;
}

.column-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 18rem;
  max-width: min(32rem, 90vw);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 22%, transparent);
}

.column-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

@media (max-width: 640px) {
  .column-picker-grid {
    grid-template-columns: 1fr;
  }
}

button.interest,
.btn.interest {
  background: var(--interest);
  color: #ffffff;
}

button.interested,
.btn.interested {
  background: var(--interest-soft);
  color: var(--interest-strong);
  font-weight: 800;
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 9.5rem;
}

.ai-fit {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent, #2a6);
  background: var(--panel-recessed);
  border-radius: 0 8px 8px 0;
  max-width: 52rem;
}

.ai-fit-ready {
  border-left-color: var(--ok, #2a7);
}

.ai-fit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
}

.ai-fit-score {
  font-weight: 800;
  color: var(--text);
}

.ai-fit-body {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.ai-fit-error {
  color: var(--danger);
  font-size: 13px;
}

button.not-interested,
.btn.not-interested {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

button.not-interested-on,
.btn.not-interested-on {
  background: var(--panel-recessed);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
}

.theme-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--panel-recessed);
}

.theme-seg button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 7px 11px;
  box-shadow: none;
  font-weight: 700;
}

.theme-seg button.active {
  background: var(--accent);
  color: var(--accent-text);
}

.score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: var(--text);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.rule-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.rule-section h3 {
  margin: 0;
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.rule-card {
  margin-top: 10px;
  padding: 14px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.rule-card:nth-child(even) {
  background: var(--panel-recessed);
}

.rule-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
}

#blazor-error-ui {
  background: var(--danger);
  bottom: 0;
  display: none;
  left: 0;
  padding: 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  color: #fff;
  font-weight: 700;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
  color: #fff;
  margin-left: 1rem;
}

.loading-progress {
  position: relative;
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 20vh auto 1rem;
}

.loading-progress circle {
  fill: none;
  stroke: var(--accent, #0a4fd6);
  stroke-width: 0.55rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: transparent;
  stroke-dasharray: calc(3.14159265359 * 8rem);
  stroke-dashoffset: calc(3.14159265359 * 8rem);
  animation: progress 1.2s ease-in-out infinite;
}

@keyframes progress {
  0% { stroke-dashoffset: calc(3.14159265359 * 8rem); }
  50% { stroke: var(--accent, #0a4fd6); }
  100% { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-progress circle:last-child { animation: none; }
}

/* —— Bid system (separate shell from Procurement browse) —— */
.bid-system-shell {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.bid-system {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 100vh;
}

.bid-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 100vh;
  padding: 12px 8px;
  border-right: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--panel) 88%, var(--bg-deep));
}

.bid-rail-exit {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
}

.bid-rail-exit:hover {
  background: var(--row-hover);
  color: var(--text);
}

.bid-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 56px;
  min-height: 56px;
  padding: 8px 4px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

.bid-rail-item:hover {
  background: var(--row-hover);
  color: var(--text);
}

.bid-rail-item.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel-raised));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.bid-rail-glyph {
  display: grid;
  place-items: center;
  line-height: 0;
}

.bid-rail-glyph svg {
  display: block;
}

.bid-rail-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
}

.bid-system-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bid-system-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
}

.bid-system-header .bid-deadline {
  margin: 0;
}

.bid-system-titleblock {
  min-width: 0;
}

.bid-system-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: min(72ch, 100%);
}

.bid-system-title a {
  color: inherit;
  text-decoration: none;
}

.bid-system-title a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.bid-system-content,
.bid-system-body {
  padding: 14px 18px 28px;
}

@media (max-width: 720px) {
  .bid-system {
    grid-template-columns: 1fr;
  }

  .bid-rail {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    min-height: 0;
    width: 100%;
    padding: 8px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }

  .bid-rail-exit {
    margin-bottom: 0;
    flex: 0 0 auto;
  }

  .bid-rail-item {
    flex: 0 0 auto;
    width: 64px;
  }

  .bid-rail-label {
    display: none;
  }

  .bid-deadline-date {
    margin-left: 0;
  }
}

.bid-deadline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-recessed);
}

.bid-deadline-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.bid-deadline-remaining {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bid-deadline-date {
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--muted);
}

.bid-deadline-ok {
  border-color: color-mix(in srgb, #2f8f5b 40%, var(--border));
  background: color-mix(in srgb, #2f8f5b 10%, var(--panel-recessed));
}

.bid-deadline-soon {
  border-color: color-mix(in srgb, #c98512 50%, var(--border));
  background: color-mix(in srgb, #c98512 12%, var(--panel-recessed));
}

.bid-deadline-soon .bid-deadline-remaining {
  color: #a66a00;
}

.bid-deadline-urgent,
.bid-deadline-closed {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--panel-recessed));
}

.bid-deadline-urgent .bid-deadline-remaining,
.bid-deadline-closed .bid-deadline-remaining {
  color: var(--danger);
}

.bid-deadline-unknown .bid-deadline-remaining {
  font-size: 1.1rem;
}

.bid-hero {
  margin-top: 10px;
  padding-top: 4px;
}

.bid-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 6px;
  font-size: 0.92rem;
}

.bid-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.bid-col h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.bid-col h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.bid-file-list,
.bid-note-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bid-file-list li,
.bid-note-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-recessed);
  border: 1px solid var(--border);
}

.bid-file-list button.file-open-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 650;
  color: var(--accent, #0b5cab);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.bid-file-list button.file-open-link:hover:not(:disabled) {
  filter: brightness(1.08);
}

.bid-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.bid-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted, #667);
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  font: inherit;
  cursor: pointer;
}

.bid-tabs button.active {
  color: var(--text);
  background: var(--panel-recessed);
  font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--accent, #0b5cab);
}

.kebab {
  position: relative;
}

.kebab-toggle {
  min-width: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.kebab-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 10px;
  background: var(--panel, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.kebab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
}

.kebab-menu.kebab-menu-portal {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 100;
}

.kebab-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.kebab-menu button:hover:not(:disabled) {
  background: var(--panel-recessed);
}

.kebab-menu hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.kebab-menu a.kebab-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
}

.kebab-menu a.kebab-link:hover {
  background: var(--panel-recessed);
}

.opp-table.opp-table-compact {
  border-spacing: 0;
  width: 100%;
  table-layout: fixed;
}

.opp-table.opp-table-compact thead th {
  padding: 6px 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opp-table.opp-table-compact tbody tr.opp-row td {
  padding: 8px 10px;
  vertical-align: middle;
  border-radius: 0;
}

.opp-table.opp-table-compact tbody tr.opp-row td:first-child {
  border-radius: 8px 0 0 8px;
}

.opp-table.opp-table-compact tbody tr.opp-row td:last-child {
  border-radius: 0 8px 8px 0;
}

.opp-table.opp-table-compact .opp-col-rules,
.opp-table.opp-table-compact .opp-col-ai {
  width: 5.5rem;
  white-space: nowrap;
}

.opp-table.opp-table-compact .opp-col-due {
  width: 9.5rem;
  white-space: nowrap;
}

.opp-table.opp-table-compact .opp-col-menu {
  width: 2.75rem;
  text-align: right;
  overflow: visible;
  position: relative;
}

.opp-table.opp-table-compact tbody tr.opp-row td.opp-col-menu {
  overflow: visible;
  z-index: 1;
}

.opp-table.opp-table-compact tbody tr.opp-row:has(.kebab.open) {
  position: relative;
  z-index: 20;
}

.opp-table.opp-table-compact tbody tr.opp-row:has(.kebab.open) td.opp-col-menu {
  z-index: 30;
}

.kebab.open {
  z-index: 40;
}

.kebab.open .kebab-menu {
  z-index: 50;
}

.opp-table.opp-table-compact .opp-col-title-compact {
  min-width: 0;
}

.opp-title-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

a.opp-title-ellipsis:hover {
  text-decoration: underline;
}

.opp-due-text {
  font-size: 0.9rem;
}

.opp-fit-why {
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-table.opp-table-compact .score {
  display: inline;
  margin-right: 4px;
}

.opp-table.opp-table-compact .score-label {
  display: inline;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

button.ai-fit-get {
  padding: 3px 8px;
  font-size: 0.75rem;
  line-height: 1.2;
  min-height: 0;
  white-space: nowrap;
}

.ai-fit-spinner {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-top-color: var(--accent-strong, var(--accent));
  border-radius: 50%;
  animation: ai-fit-spin 0.65s linear infinite;
  vertical-align: middle;
}

@keyframes ai-fit-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-fit-spinner { animation: none; border-top-color: var(--accent); opacity: 0.7; }
}

.view-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}

.view-toggle button.active {
  background: var(--panel-recessed);
  color: var(--text);
  font-weight: 600;
}

.bid-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.bid-honest-take {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--panel-recessed);
}

.bid-honest-take h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.bid-honest-take > p {
  margin: 0 0 8px;
  line-height: 1.45;
}

.bid-match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 820px) {
  .bid-match-grid {
    grid-template-columns: 1fr;
  }
}

.bid-match-col {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-recessed);
  padding: 12px 14px;
  min-width: 0;
}

.bid-match-col h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.bid-match-yes {
  border-color: color-mix(in srgb, #2f8f5b 45%, var(--border));
}

.bid-match-no {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.bid-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bid-match-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.35;
}

.bid-match-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
  min-width: 4.5rem;
}

.bid-check-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bid-check-list label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.bid-comp-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bid-comp-row span {
  flex: 1;
}

.bid-inline-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-recessed);
}

.bid-details {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-recessed);
}

.bid-details summary {
  cursor: pointer;
  font-weight: 650;
}

.bid-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

.bid-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.bid-mini-table th,
.bid-mini-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.bid-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 50;
}

.bid-modal {
  position: fixed;
  z-index: 51;
  left: 50%;
  top: 10vh;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  max-height: 80vh;
  overflow: auto;
}

.review-tools-modal {
  width: min(720px, calc(100vw - 24px));
  top: 6vh;
  max-height: 88vh;
}

.review-tool-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.review-tool-block:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

.review-tool-block h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}


.bid-note-body {
  white-space: pre-wrap;
  line-height: 1.4;
  margin: 4px 0 8px;
}

.bid-note-input,
.bid-chat-input {
  width: 100%;
  resize: vertical;
  margin-top: 6px;
}

.bid-chat-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

.bid-chat-log {
  flex: 1 1 auto;
  min-height: 16rem;
  max-height: 48vh;
  overflow: auto;
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--panel-recessed);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bid-chat-msg {
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 95%;
}

.bid-chat-msg.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--interest) 18%, var(--panel-raised));
}

.bid-chat-msg.assistant {
  align-self: flex-start;
  background: var(--panel-raised);
  border: 1px solid var(--border);
}

.bid-chat-role {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.bid-chat-content {
  white-space: pre-wrap;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .bid-grid {
    grid-template-columns: 1fr;
  }

  .bid-chat-panel {
    position: static;
    max-height: none;
  }
}
