:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dbe4f0;
  --soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0369a1;
  --accent-strong: #075985;
  --green: #15803d;
  --red: #b91c1c;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef4fb 0%, var(--bg) 220px),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.subtitle,
.status-text,
.empty,
.section-head span {
  color: var(--muted);
}

.tabs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.tab.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.spread-top-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.spread-search-input {
  height: 58px;
  width: 100%;
  min-width: 0;
  padding: 0 20px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  box-shadow: var(--shadow);
}

.spread-search-input:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.25);
}

.spread-auto-status {
  min-width: 300px;
  height: 58px;
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.26);
}

.spread-auto-status strong {
  font-size: 15px;
  line-height: 1;
}

.spread-auto-status em {
  font-size: 14px;
  font-style: normal;
  opacity: 0.82;
  line-height: 1;
}

.spread-auto-status small {
  grid-column: 1 / -1;
  justify-self: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.spread-auto-status b {
  font-weight: 800;
}

.auto-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.funding-summary {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.exchange-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.metric,
.panel,
.asset-card,
.status-card,
.empty-card,
.summary-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric,
.summary-card {
  padding: 14px;
}

.metric span,
.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong,
.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.summary-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-refresh-card {
  position: relative;
  padding-right: 44px;
  overflow: hidden;
  min-height: 92px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.exchange-refresh-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #bae6fd;
}

.exchange-refresh-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.exchange-refresh-dot {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(15, 23, 42, 0.04);
}

.exchange-refresh-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 6px #dcfce7;
}

.exchange-refresh-dot.bad {
  background: #ef4444;
  box-shadow: 0 0 0 6px #fee2e2;
}

.exchange-refresh-dot.refreshing {
  background: #22c55e;
  box-shadow: 0 0 0 6px #dcfce7;
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 0.45;
    transform: translateY(-50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
  }
}

.page { display: none; }
.page.active { display: block; }

.section-head,
.panel-head,
.asset-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-head {
  margin: 4px 0 12px;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.section-head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.countdown {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.toolbar-button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 700;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease, transform 120ms ease;
}

.toolbar-input {
  height: 30px;
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

.toolbar-button:hover,
.toolbar-button.active {
  border-color: #7dd3fc;
  color: var(--accent);
  transform: translateY(-1px);
}

.toolbar-button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-strong), #0284c7);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(3, 105, 161, 0.18);
}

.toolbar-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.filter-hint {
  display: none;
  margin: -4px 0 12px;
}

.filter-hint.visible {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.blocked-assets-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.blocked-asset-chip {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--red);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.blocked-asset-chip:hover {
  background: #ffffff;
  border-color: #f87171;
}

.asset-list {
  display: grid;
  gap: 10px;
}

.spread-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.spread-pagination span {
  margin-right: 4px;
}

.asset-card {
  padding: 12px;
  box-shadow: var(--shadow);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.asset-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.asset-title {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.asset-spread {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.asset-spread > span:first-child {
  color: var(--accent-strong);
  font-size: 14px;
}

.funding-spread-highlight {
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.funding-daily-spread {
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.inline-button {
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.inline-button:hover {
  border-color: #fecaca;
  color: var(--red);
}

.funding-card {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #ffffff 100%),
    var(--panel);
}

.funding-grid {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  gap: 10px;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: #bfdbfe transparent;
}

.funding-grid::-webkit-scrollbar {
  height: 6px;
}

.funding-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #bfdbfe;
}

.funding-chart-toggle {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #e8eef7;
  color: #334155;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.funding-chart-toggle:hover,
.funding-chart-toggle.active {
  background: #dbeafe;
  color: var(--accent);
}

.funding-chart-toggle-cell {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 124px;
}

.funding-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.funding-chart-head h3 {
  margin: 0;
  font-size: 15px;
}

.exchange-rate,
.funding-carry-card,
.recommendation {
  min-height: 124px;
  padding: 10px 12px;
  border: 1px solid #cfe0f2;
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(219, 234, 254, 0.45), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.funding-grid .exchange-rate,
.funding-grid .funding-carry-card {
  flex: 0 0 280px;
  max-height: 124px;
}

.funding-carry-card {
  flex-basis: 300px;
}

.exchange-rate {
  box-shadow: inset 3px 0 0 #dbeafe, 0 1px 2px rgba(15, 23, 42, 0.04);
}

.exchange-rate.max-positive-funding {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  box-shadow: inset 3px 0 0 #2563eb, 0 8px 18px rgba(37, 99, 235, 0.12);
}

.exchange-rate.max-positive-funding .kv:first-child strong {
  color: #1d4ed8;
}

.funding-carry-card {
  border-color: #86efac;
  background:
    radial-gradient(circle at top right, rgba(187, 247, 208, 0.7), transparent 38%),
    linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: inset 3px 0 0 #22c55e, 0 8px 18px rgba(34, 197, 94, 0.1);
}

.funding-carry-card::before {
  content: "资费开仓建议";
  display: block;
  margin-bottom: 6px;
  color: #047857;
  font-size: 13px;
  font-weight: 900;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  font-size: 13px;
}

.kv span {
  color: var(--muted);
  font-weight: 700;
}

.kv strong {
  text-align: right;
  font-weight: 850;
}

.kv strong.positive {
  color: var(--green);
}

.kv strong.negative {
  color: var(--red);
}

.funding-chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  margin-top: 14px;
  border: 1px solid #243244;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1118;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.funding-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #e5e7eb;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-tooltip-title {
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.chart-tooltip-line {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
  font-size: 12px;
}

.chart-tooltip-line span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.chart-tooltip-line strong {
  color: #f8fafc;
}

.chart-tooltip-line em {
  color: #e5e7eb;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.spread-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

.quote-side {
  min-width: 0;
  overflow: auto;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #ffffff;
}

.quote-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 7px 10px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover td {
  background: #f8fafc;
}

.quote-row-selected td {
  background: #dcfce7;
  color: #065f46;
  font-weight: 800;
}

.quote-row-selected:hover td {
  background: #bbf7d0;
}

.quote-row-selected td:first-child {
  border-left: 3px solid #22c55e;
}

.refresh-state {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.refresh-state.ok {
  color: var(--green);
  background: #f0fdf4;
}

.refresh-state.bad {
  color: var(--red);
  background: #fef2f2;
}

.recommendation-side {
  position: sticky;
  top: 88px;
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  max-height: 430px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #bfdbfe transparent;
}

.spread-card.has-history .recommendation-side {
  position: static;
}

.recommendation-side::-webkit-scrollbar {
  width: 6px;
}

.recommendation-side::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #bfdbfe;
}

.recommendation-side-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  background: var(--panel);
}

.recommendation-side-head h2 {
  margin: 0;
  font-size: 15px;
}

.recommendation-side-head span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.recommendation {
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.recommendation::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #93c5fd;
}

.recommendation.clickable {
  cursor: pointer;
  border-radius: 6px;
  outline: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.recommendation.clickable:hover {
  outline-color: #7dd3fc;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.recommendation.active {
  border-color: #22c55e;
  outline-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.12);
}

.recommendation.pending {
  animation: recommendation-flash 360ms ease-out;
}

@keyframes recommendation-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.38);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

.recommendation.active::before {
  background: #22c55e;
}

.recommendation.active .recommendation-head strong {
  color: #047857;
}

.recommendation.top-pick {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #eef7ff 100%);
}

.recommendation.top-pick .recommendation-type::after {
  content: " / TOP";
  color: var(--accent-strong);
}

.recommendation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.recommendation-head strong {
  color: var(--accent-strong);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.recommendation-type {
  padding: 1px 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
}

.recommendation-cta {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed #dbe4f0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-cta.active {
  color: #047857;
}

.spread-history-panel {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--shadow);
}

.spread-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.spread-history-title-wrap {
  min-width: 0;
}

.spread-history-title-wrap h3 {
  margin: 0;
  font-size: 15px;
}

.spread-history-title-wrap span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spread-history-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.spread-history-close {
  height: 32px;
}

.spread-history-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.spread-history-context .kv {
  padding: 6px 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}

.spread-history-context .kv strong {
  color: var(--accent-strong);
}

.range-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.range-tab {
  min-width: 42px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.range-tab.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.spread-line-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.spread-line-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.spread-line-group span {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.spread-line-button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
}

.spread-line-button:hover,
.spread-line-button.active {
  border-color: #7dd3fc;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.spread-history-chart-wrap {
  height: 300px;
  margin-top: 0;
}

.spread-chart-tooltip {
  min-width: 340px;
  max-width: 520px;
}

.spread-tooltip-line {
  grid-template-columns: 8px minmax(0, 1fr) auto;
}

.spread-tooltip-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-title {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 800;
}

.empty-card {
  padding: 18px;
  color: var(--muted);
}

.panel {
  margin-top: 14px;
  padding: 12px;
}

.funding-connection-panel {
  margin: 0 0 14px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

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

.status-card {
  padding: 10px;
}

.status-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.state {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid;
}

.state.ok {
  color: var(--green);
  background: #f0fdf4;
  border-color: #86efac;
}

.state.bad {
  color: var(--red);
  background: #fef2f2;
  border-color: #fecaca;
}

.status-detail {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .spread-card { grid-template-columns: 1fr; }
  .recommendation-side {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .funding-summary { grid-template-columns: 1fr; }
  .spread-top-row { grid-template-columns: 1fr; }
  .spread-auto-status {
    width: 100%;
    min-width: 0;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .section-actions {
    justify-content: flex-start;
    width: 100%;
  }
  .spread-history-head,
  .spread-history-controls {
    align-items: flex-start;
    flex-direction: column;
  }
  .spread-history-context {
    grid-template-columns: 1fr;
  }
  .topbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
}
