:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #fbfbfd;
  --line: #d9d9de;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --blue: #0071e3;
  --blue-strong: #0066cc;
  --blue-soft: #e8f2ff;
  --green: #248a3d;
  --amber: #b66a00;
  --red: #d70015;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.045);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
}

body.dark {
  --bg: #000000;
  --panel: #1c1c1e;
  --panel-soft: #2c2c2e;
  --line: #3a3a3c;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --blue-soft: #0b2945;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-locked {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #f5f5f7;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(20px);
  padding: 28px;
}

.login-card .brand-mark {
  width: 42px;
  height: 42px;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.login-card p {
  margin: -6px 0 4px;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.login-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.login-hint {
  display: grid;
  gap: 4px;
  border: 1px solid #e5e5ea;
  border-radius: var(--radius-sm);
  background: rgba(245, 245, 247, 0.78);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
}

.login-error {
  color: var(--red);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 28px;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0 0 20px;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .brand div:last-child,
.app-shell.sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  width: 40px;
  min-height: 40px;
  margin: 0 auto;
  padding: 0;
  font-size: 0;
}

.app-shell.sidebar-collapsed .sidebar {
  overflow: hidden;
  padding: 16px 8px;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 34px;
  height: 34px;
}

.app-shell.sidebar-collapsed .workspace {
  max-width: 1240px;
  padding-left: 20px;
  padding-right: 20px;
}

.app-shell.sidebar-collapsed .nav-icon {
  color: #6e6e73;
  font-size: 10px;
}

.app-shell.sidebar-collapsed .nav-item.active .nav-icon {
  color: #fff;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #0071e3, #2997ff);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.nav-item.active {
  background: var(--blue);
  color: #fff;
}

.nav-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: #f5f5f7;
  color: #6e6e73;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.workspace {
  min-width: 0;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 0 16px;
}

.topbar h1 {
  margin: 0 0 0 12px;
  font-size: 17px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button,
.user-button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfbfd;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
}

.text-icon {
  min-width: 50px;
  padding: 0 12px;
}

body.dark .icon-button,
body.dark .user-button,
body.dark select,
body.dark .secondary-button,
body.dark .clear-button,
body.dark .row-actions button,
body.dark .pagination button {
  background: #2c2c2e;
  color: var(--text);
}

body.dark .search-box input {
  background: transparent;
  color: var(--text);
}

body.dark .tabs {
  background: #2c2c2e;
}

body.dark .search-panel {
  background: rgba(28, 28, 30, 0.9);
}

body.dark .search-box {
  background: #2c2c2e;
}

body.dark .tab.active,
body.dark .bid-list,
body.dark .metric-card,
body.dark .panel,
body.dark .ops-card,
body.dark .etl-table,
body.dark .modal {
  background: var(--panel);
}

body.dark .modal,
body.dark .modal p,
body.dark .detail-grid span,
body.dark .form-grid label,
body.dark .choice-chip,
body.dark .bid-table-head,
body.dark .bid-list-note,
body.dark .bid-card,
body.dark .risk-stack span,
body.dark .risk-stack button,
body.dark .budget-stack span,
body.dark .budget-stack button,
body.dark .keyword-list span,
body.dark .message-card,
body.dark .recommend-card,
body.dark .follow-item,
body.dark .rule-list span,
body.dark .run-log span,
body.dark .funnel-stage,
body.dark .model-strip span {
  color: var(--text);
  background: #1c1c1e;
}

body.dark .bar-row:hover {
  background: #2c2c2e;
}

body.dark .bid-card:hover {
  background: #242426;
}

body.dark .row-actions button,
body.dark .dashboard-recommend-card,
body.dark .bid-card {
  background: #242426;
}

body.dark .metric-card.blue {
  border-color: #1d4f8f;
  background: #1c1c1e;
}

body.dark .metric-card.green {
  border-color: #1f6f3d;
  background: #1c1c1e;
}

body.dark .metric-card.orange {
  border-color: #8a5a12;
  background: #1c1c1e;
}

body.dark .metric-card.purple {
  border-color: #5b35a3;
  background: #1c1c1e;
}

body.dark .dashboard-recommend-card {
  background: #242426;
}

body.dark .dashboard-recommend-card strong {
  color: var(--text);
}

body.dark .choice-chip.selected {
  border-color: #2997ff;
  background: #0b2945;
  color: #f5f5f7;
}

.user-button {
  min-width: 68px;
  font-size: 13px;
}

.badge {
  position: relative;
}

.badge span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #ff3b35;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.view {
  display: none;
  padding: 24px 0 0;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.heading-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.14;
}

h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pill {
  border-radius: 999px;
  background: #dceaff;
  color: #1769e0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.heading-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

.primary-button,
.secondary-button,
.clear-button {
  min-height: 34px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.primary-button {
  border: 0;
  background: var(--blue-strong);
  color: #fff;
}

.secondary-button,
.clear-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: #344054;
}

.primary-button:disabled,
.secondary-button:disabled,
.clear-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.trial-status {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  padding: 12px 14px;
}

.trial-primary {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.eyebrow {
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 800;
}

.trial-primary strong {
  font-size: 22px;
  line-height: 1.12;
  font-weight: 800;
}

.trial-primary p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.trial-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dde7f5;
  border-radius: var(--radius-md);
  background: #dde7f5;
}

.trial-metrics span {
  display: grid;
  align-content: center;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
}

.trial-metrics b {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 800;
}

.trial-metrics small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(28, 39, 64, 0.05);
}

.metric-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 16px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 24px;
  font-weight: 700;
}

.metric-card small {
  color: var(--blue-strong);
}

.metric-card.warn small {
  color: var(--amber);
}

.metric-card.good small {
  color: var(--green);
}

.search-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  padding: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: #f5f5f7;
  box-shadow: none;
  padding: 0 14px;
}

.search-box span {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.mobile-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.mobile-filter-button,
.quick-sort-row,
.filter-panel-head,
.filter-apply-button,
.filter-backdrop {
  display: none;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

select {
  min-width: 120px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: #1f2937;
  padding: 0 10px;
  font-size: 13px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.filter-tags span,
.chip-cloud span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
}

.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #ededf0;
  padding: 3px;
  margin-bottom: 12px;
}

.tab {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab.active {
  background: #fff;
  color: var(--blue-strong);
  transform: translateY(-1px);
}

.tab span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #dde8f7;
  margin-left: 6px;
  color: #4770b8;
  font-size: 11px;
}

.ai-brief {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d6eaff;
  border-radius: var(--radius-md);
  background: #f2f7ff;
  margin: 0 0 12px;
  padding: 12px 14px;
}

.ai-brief strong {
  display: block;
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 14px;
}

.ai-brief span {
  display: block;
  color: #475467;
}

.ai-brief small {
  display: block;
  margin-top: 5px;
  color: #1769e0;
  font-size: 12px;
  line-height: 1.45;
}

.brief-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.brief-actions .secondary-button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 12px;
}

.ops-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.ops-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  padding: 12px 14px;
}

.ops-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.ops-card span {
  color: var(--muted);
}

.queue-card {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.queue-card:hover {
  border-color: #9ec5ff;
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.1);
  transform: translateY(-1px);
}

.source-dots {
  display: flex;
  gap: 6px;
}

.source-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.source-dots i.wait {
  background: var(--amber);
}

.compact-button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.bid-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  background: var(--panel);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 2px 0;
}

.pagination button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: #344054;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bid-list-note {
  border-bottom: 1px solid #ececf0;
  background: #fbfbfd;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12px;
}

.bid-table-head,
.bid-card {
  display: grid;
  grid-template-columns: minmax(112px, 0.7fr) minmax(280px, 2.25fr) minmax(66px, 0.38fr) minmax(104px, 0.58fr) minmax(54px, 0.32fr) minmax(72px, 0.4fr) minmax(58px, 0.34fr) minmax(128px, 0.68fr);
  gap: 12px;
  align-items: center;
}

.bid-table-head {
  min-height: 48px;
  background: #f8fafc;
  color: #667085;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
}

.sortable-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.sortable-head span {
  color: var(--blue);
  font-size: 10px;
  line-height: 1;
}

.sortable-head:hover {
  color: var(--blue-strong);
}

.bid-card {
  min-height: 72px;
  border-bottom: 1px solid #ececf0;
  padding: 12px 16px;
  transition: background 160ms ease;
}

.bid-card:hover {
  background: #fbfbfd;
}

.bid-card.is-closed {
  background: #fafafa;
}

.bid-card:last-child {
  border-bottom: 0;
}

.bid-code,
.bid-region,
.bid-industry {
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.bid-industry-content {
  min-width: 0;
}

.business-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.business-tag-list span {
  border-radius: 4px;
  background: #eaf3ff;
  color: #1769e0;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.business-tag-list span.medium {
  background: #fff4e5;
  color: #b54708;
}

.bid-main {
  min-width: 0;
}

.bid-title {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.42;
}

.bid-title:hover {
  color: var(--blue-strong);
}

.bid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.bid-meta-primary span {
  min-width: 0;
}

.bid-deadline-row,
.bid-score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
  min-height: 24px;
}

.bid-deadline-cell {
  display: grid;
  gap: 3px;
  align-content: center;
}

.deadline-label {
  color: var(--muted);
  font-size: 12px;
}

.bid-deadline-row strong,
.bid-deadline-cell strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.deadline-pill,
.muted-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.deadline-pill.open {
  background: #ecfdf3;
  color: #047857;
}

.deadline-pill.soon {
  background: #eff6ff;
  color: #1d4ed8;
}

.deadline-pill.urgent {
  background: #fff7ed;
  color: #c2410c;
}

.deadline-pill.closed-recent {
  background: #fef2f2;
  color: #b91c1c;
}

.deadline-pill.closed,
.deadline-pill.neutral,
.muted-pill {
  background: #f1f5f9;
  color: #64748b;
}

.match-cell {
  display: grid;
  justify-items: start;
}

.match-badge {
  display: inline-grid;
  min-width: 50px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #dbeafe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.match-badge.high {
  background: #dcfce7;
  color: #16a34a;
}

.bid-score-row {
  gap: 12px;
}

.score-block {
  display: grid;
  grid-template-columns: auto minmax(90px, 132px);
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.score-block b {
  font-weight: 700;
}

.score-block i {
  display: block;
  width: 132px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.score-block em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #34c759);
}

.opportunity-score em {
  background: linear-gradient(90deg, #64748b, #0a84ff);
}

.match {
  color: var(--green);
  font-weight: 650;
}

.quality {
  color: #1d4ed8;
  font-weight: 650;
}

.danger {
  color: var(--red);
  font-weight: 700;
}

.amount {
  color: var(--blue-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.star {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
}

.star.active {
  color: #f59e0b;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.row-actions button {
  flex: 0 0 auto;
  min-width: 40px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #344054;
  font-size: 11px;
  font-weight: 600;
  padding: 0 7px;
  white-space: nowrap;
}

.row-actions button.primary-row {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.row-actions button.active {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #087443;
}

.row-actions button.ignored {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.row-actions .star {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.dashboard-overview {
  display: grid;
  gap: 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-row .metric-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 104px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.metric-row .metric-card.blue {
  border-color: #cfe2ff;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.metric-row .metric-card.green {
  border-color: #cfeedd;
  background: linear-gradient(180deg, #ffffff, #f7fdf9);
}

.metric-row .metric-card.orange {
  border-color: #fde2b8;
  background: linear-gradient(180deg, #ffffff, #fffaf2);
}

.metric-row .metric-card.purple {
  border-color: #e5d4ff;
  background: linear-gradient(180deg, #ffffff, #fbf8ff);
}

.metric-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 16px;
  font-weight: 900;
}

.metric-card.green .metric-icon {
  background: #eaf8ef;
  color: var(--green);
}

.metric-card.orange .metric-icon {
  background: #fff3dc;
  color: var(--amber);
}

.metric-card.purple .metric-icon {
  background: #f2e8ff;
  color: #7c3aed;
}

.metric-row .metric-card span,
.metric-row .metric-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.metric-row .metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.metric-row .metric-card em {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
}

.recommendation-panel {
  padding: 20px 22px 24px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title-row h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
}

.panel-title-row > span {
  color: var(--muted);
  font-size: 13px;
}

.title-dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #2f7df4;
  border-radius: 50%;
  color: #2f7df4;
  font-size: 10px;
  font-weight: 900;
}

.dashboard-recommend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-recommend-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px 18px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-recommend-card:hover,
.dashboard-recommend-card:focus-visible,
.recommend-card:hover {
  border-color: #9ec5ff;
  box-shadow: 0 10px 26px rgba(0, 113, 227, 0.12);
  transform: translateY(-1px);
}

.dashboard-recommend-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-recommend-card span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: #475467;
  font-weight: 650;
}

.dashboard-recommend-card i {
  width: 1px;
  height: 14px;
  background: #cbd5e1;
}

.dashboard-recommend-card b {
  border-radius: var(--radius-sm);
  background: #dcfce7;
  color: #0f9f55;
  padding: 6px 10px;
  font-size: 13px;
}

.dashboard-recommend-card b::after {
  content: " ›";
  font-weight: 900;
}

.dashboard-grid,
.profile-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) repeat(2, minmax(260px, 0.8fr));
  gap: 14px;
}

#view-overview {
  padding-top: 14px;
}

#view-overview .section-heading {
  margin-bottom: 10px;
}

#view-overview .dashboard-overview {
  gap: 10px;
}

#view-overview .metric-row {
  gap: 10px;
}

#view-overview .metric-row .metric-card {
  min-height: 76px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}

#view-overview .metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

#view-overview .metric-row .metric-card strong {
  font-size: 22px;
}

#view-overview .metric-row .metric-card em {
  margin-top: 4px;
}

#view-overview .recommendation-panel {
  padding: 12px 14px;
}

#view-overview .panel-title-row {
  margin-bottom: 10px;
}

#view-overview .panel-title-row h3 {
  font-size: 16px;
}

#view-overview .dashboard-recommend-list {
  gap: 10px;
}

#view-overview .dashboard-recommend-card {
  min-height: 58px;
  padding: 10px 12px;
}

#view-overview .dashboard-recommend-card span {
  margin-top: 6px;
}

#view-overview .dashboard-grid {
  grid-template-columns: minmax(320px, 1.15fr) repeat(2, minmax(220px, 0.85fr));
  gap: 10px;
}

#view-overview .panel {
  padding: 10px;
}

#view-overview .panel.wide {
  grid-row: span 2;
}

#view-overview h3 {
  margin-bottom: 8px;
  font-size: 14px;
}

#view-overview .bar-list {
  gap: 3px;
}

#view-overview .bar-row {
  min-height: 22px;
  padding: 1px 4px;
  font-size: 12px;
}

#view-overview .donut {
  width: 82px;
  height: 82px;
  margin: 0 auto 6px;
}

#view-overview .donut span {
  width: 52px;
  height: 52px;
  font-size: 10px;
}

#view-overview .industry-legend,
#view-overview .risk-stack,
#view-overview .budget-stack,
#view-overview .funnel {
  gap: 4px;
}

#view-overview .risk-stack button,
#view-overview .budget-stack button,
#view-overview .funnel-stage {
  padding: 6px 8px;
}

#view-overview .funnel-stage strong {
  font-size: 14px;
}

.profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 12px;
}

.panel.wide {
  grid-row: span 3;
}

.funnel-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  margin-top: 12px;
  padding: 14px;
}

.funnel {
  display: grid;
  gap: 6px;
}

.funnel-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 8px 10px;
}

.funnel-stage span {
  color: var(--muted);
}

.funnel-stage strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.funnel-stage i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #0071e3;
  margin-top: 8px;
}

.bar-list {
  display: grid;
  gap: 5px;
}

.bar-row {
  display: grid;
  grid-template-columns: 82px 1fr 36px;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #475467;
  padding: 2px 4px;
  text-align: left;
}

.bar-row:hover {
  background: #f6f9ff;
}

.bar-track {
  height: 5px;
  overflow: hidden;
  border-radius: 20px;
  background: #edf2f7;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0071e3;
}

.donut {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#245eea 0 42%, #14b8a6 42% 64%, #f59e0b 64% 79%, #e5e7eb 79%);
  margin: 4px auto 10px;
}

.donut span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
  text-align: center;
  font-size: 11px;
}

.risk-stack,
.budget-stack,
.keyword-list,
.message-list,
.recommend-list {
  display: grid;
  gap: 6px;
}

.risk-stack button,
.budget-stack button,
.keyword-list span,
.message-card,
.recommend-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  padding: 8px 10px;
}

.risk-stack button,
.budget-stack button,
.legend-link,
.bar-row {
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.risk-stack button:hover,
.budget-stack button:hover,
.legend-link:hover,
.bar-row:hover {
  border-color: #9ec5ff;
  background: #f6f9ff;
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.08);
}

.risk-stack b {
  color: var(--red);
  font-size: 15px;
}

.industry-breakdown {
  display: grid;
  gap: 8px;
}

.industry-legend {
  display: grid;
  gap: 5px;
}

.industry-legend span,
.legend-link {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #475467;
  font-size: 12px;
  padding: 3px 4px;
  text-align: left;
}

.industry-legend i,
.legend-link i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.industry-legend b,
.legend-link b {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.industry-legend em,
.legend-link em {
  color: var(--muted);
  font-style: normal;
}

.budget-stack button {
  display: grid;
  grid-template-columns: 82px 58px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  width: 100%;
  text-align: left;
}

.budget-stack b {
  color: var(--text);
}

.budget-stack em {
  color: var(--muted);
  font-style: normal;
}

.budget-stack i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.budget-stack u {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.diagnostic-chip {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
}

.diagnostic-chip b {
  color: var(--muted);
  font-size: 11px;
}

.diagnostic-chip strong {
  color: var(--ink);
  font-size: 13px;
}

.diagnostic-chip em {
  color: #475467;
  font-size: 12px;
  font-style: normal;
}

.diagnostic-chip.hit {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.diagnostic-chip.risk {
  border-color: #fed7aa;
  background: #fff7ed;
}

.diagnostic-chip.miss {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.quality-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
  margin: 12px 0;
}

.quality-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #34c759);
}

.quality-audit {
  display: grid;
  gap: 12px;
}

.audit-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.audit-metrics span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 12px;
}

.audit-metrics b {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.keyword-list span {
  display: flex;
  justify-content: space-between;
}

.summary-text {
  color: #475467;
  line-height: 1.6;
}

.message-card,
.recommend-card {
  display: grid;
  gap: 6px;
}

.recommend-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.detail-source-summary {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.detail-source-summary span {
  line-height: 1.65;
}

.detail-source-summary strong {
  color: var(--blue-strong);
}

.detail-source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.recommend-card strong {
  color: var(--blue-strong);
}

.model-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.model-strip span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 10px;
  color: var(--muted);
}

.model-strip b {
  display: block;
  color: var(--blue-strong);
  margin-bottom: 4px;
}

.message-card strong,
.recommend-card strong {
  font-size: 14px;
}

.follow-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.follow-item {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 10px;
}

.follow-item b {
  color: var(--blue-strong);
}

.etl-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.etl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.rule-list,
.run-log {
  display: grid;
  gap: 8px;
}

.rule-list span,
.run-log span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 8px 10px;
  color: #475467;
}

.rule-list b {
  color: var(--blue-strong);
}

.etl-table > div {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.8fr 1.8fr;
  gap: 10px;
  border-bottom: 1px solid #edf0f5;
  padding: 10px 14px;
}

.etl-table > div:last-child {
  border-bottom: 0;
}

.etl-head {
  background: #f4f7fb;
  color: #475467;
  font-weight: 800;
}

.status {
  font-weight: 900;
}

.status.ok {
  color: var(--green);
}

.status.wait {
  color: var(--amber);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 18px;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.22);
  padding: 22px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 20px;
}

.modal h2 {
  padding-right: 40px;
  font-size: 20px;
}

.modal-section {
  margin-top: 16px;
}

.detail-load-status {
  margin: 8px 0 12px;
  border-radius: 6px;
  background: #eaf3ff;
  color: #1769e0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 650;
}

.detail-load-status.fallback {
  background: #fff4e5;
  color: #b54708;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.detail-grid span,
.form-grid label {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 10px;
}

.form-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #475467;
  font-weight: 800;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-width: 0;
  height: 36px;
  font-size: 14px;
}

.choice-section {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.choice-section strong {
  font-size: 15px;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  padding: 0 12px;
  font-weight: 700;
}

.choice-chip.selected {
  border-color: var(--blue-strong);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.detail-grid em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.brief-table {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.brief-table div {
  display: grid;
  grid-template-columns: 1fr 110px 110px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  max-width: 360px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  padding: 13px 16px;
  font-weight: 600;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .brand {
    padding: 0 0 20px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    font-size: 13px;
  }

  .workspace {
    padding: 18px;
    max-width: none;
  }

  .metric-grid,
  .metric-row,
  .trial-status,
  .profile-grid,
  .dashboard-grid,
  .dashboard-recommend-list,
  .ops-grid,
  .etl-grid,
  .funnel,
  .model-strip {
    grid-template-columns: 1fr 1fr;
  }

  .ai-brief {
    align-items: stretch;
    flex-direction: column;
  }

  .trial-status {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-screen {
    padding: 12px;
  }

  .login-card {
    gap: 12px;
    border-radius: 14px;
    padding: 22px 18px;
  }

  .login-card h1 {
    font-size: 22px;
  }

  .section-heading,
  .heading-line,
  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    margin-left: auto;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: fixed;
    z-index: 80;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(62px + env(safe-area-inset-bottom));
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
  }

  .brand,
  .app-shell.sidebar-collapsed .brand {
    display: none;
  }

  .nav {
    display: flex;
    gap: 2px;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 3px 2px;
    font-size: 10px;
    text-align: center;
  }

  .nav-icon,
  .app-shell.sidebar-collapsed .nav-icon {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .app-shell.sidebar-collapsed .nav-label {
    display: inline;
  }

  .topbar {
    min-height: 48px;
    border-radius: 10px;
    padding: 6px 9px;
  }

  .topbar h1 {
    margin-left: 0;
    font-size: 15px;
  }

  #menuToggle,
  #themeToggle {
    display: none;
  }

  .top-actions {
    gap: 4px;
  }

  .top-actions .icon-button,
  .top-actions .user-button,
  .top-actions .compact-button {
    min-width: 42px;
    min-height: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .metric-row,
  .trial-metrics,
  .profile-grid,
  .dashboard-grid,
  .dashboard-recommend-list,
  .tabs {
    grid-template-columns: 1fr;
  }

  .workspace,
  .app-shell.sidebar-collapsed .workspace {
    max-width: none;
    padding: 10px 10px calc(82px + env(safe-area-inset-bottom));
  }

  .view {
    padding-top: 16px;
  }

  .section-heading {
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
  }

  .metric-card {
    min-height: 94px;
    padding: 12px;
  }

  .metric-card strong {
    margin-top: 4px;
    font-size: 22px;
  }

  .metric-card small {
    display: block;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ai-brief-primary {
    margin-bottom: 10px;
    padding: 12px;
  }

  .ai-brief-primary .brief-actions {
    display: flex;
    flex-direction: row;
  }

  .ai-brief-primary #exportBtn {
    display: none;
  }

  .ai-brief-primary #briefBtn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .search-panel {
    gap: 9px;
    margin-bottom: 10px;
    padding: 9px;
  }

  .mobile-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 70px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel);
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-filter-button span {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-strong);
    color: #fff;
    font-size: 10px;
  }

  .quick-sort-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-sort-row::-webkit-scrollbar {
    display: none;
  }

  .quick-sort-chip {
    flex: 0 0 auto;
    min-height: 30px;
    border: 1px solid #d7dee8;
    border-radius: 15px;
    background: #fff;
    color: #475467;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 600;
  }

  .quick-sort-chip.active {
    border-color: #9fc5ff;
    background: #eaf3ff;
    color: #1769e0;
  }

  .filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    background: rgba(15, 23, 42, 0.34);
  }

  .filter-backdrop[hidden] {
    display: none;
  }

  .filter-row {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: min(78vh, 620px);
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    background: #fff;
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    box-shadow: 0 -16px 42px rgba(15, 23, 42, 0.18);
    transform: translateY(105%);
    transition: transform 180ms ease;
  }

  body.filter-panel-open {
    overflow: hidden;
  }

  body.filter-panel-open .filter-row {
    transform: translateY(0);
  }

  .filter-panel-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
  }

  .filter-panel-head strong {
    font-size: 16px;
  }

  .filter-panel-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #344054;
    font-size: 22px;
    line-height: 1;
  }

  .filter-row select,
  .filter-row button {
    width: 100%;
  }

  .filter-row select {
    min-width: 0;
    height: 42px;
  }

  .filter-row #sortFilter {
    grid-column: 1 / -1;
  }

  .filter-apply-button {
    display: block;
  }

  .filter-tags {
    min-height: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .filter-tags:empty {
    display: none;
  }

  .filter-tags span {
    flex: 0 0 auto;
  }

  .tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    margin-bottom: 10px;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 108px;
    padding: 0 10px;
  }

  .metric-row .metric-card {
    min-height: 96px;
    padding: 16px;
  }

  .recommendation-panel {
    padding: 18px 16px;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-recommend-card {
    grid-template-columns: 1fr;
  }

  .dashboard-recommend-card b {
    justify-self: start;
  }

  .bar-row {
    grid-template-columns: 82px 1fr 36px;
  }

  .budget-stack span {
    grid-template-columns: 90px 64px 1fr;
  }

  .trial-status {
    padding: 12px;
  }

  .trial-primary strong {
    font-size: 22px;
  }

  .trial-metrics span {
    min-height: 64px;
  }

  .bid-card {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 14px;
  }

  .bid-table-head {
    display: none;
  }

  .bid-code,
  .bid-main,
  .amount,
  .bid-deadline-cell,
  .bid-region,
  .bid-industry,
  .match-cell,
  .row-actions {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .bid-code::before,
  .bid-main::before,
  .amount::before,
  .bid-deadline-cell::before,
  .bid-region::before,
  .bid-industry::before,
  .match-cell::before,
  .row-actions::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .bid-score-row,
  .score-block {
    width: 100%;
  }

  .score-block {
    grid-template-columns: minmax(96px, auto) minmax(120px, 1fr);
  }

  .score-block i {
    width: 100%;
  }

  .row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .row-actions button {
    width: auto;
    min-width: 42px;
  }

  .row-actions::before {
    grid-row: 1 / span 4;
  }

  .bid-main .bid-meta,
  .bid-deadline-cell .deadline-pill {
    grid-column: 2;
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .etl-grid {
    grid-template-columns: 1fr;
  }

  .funnel,
  .model-strip {
    grid-template-columns: 1fr;
  }

  .brief-actions {
    flex-direction: column;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .primary-button,
  .modal-actions .secondary-button {
    width: 100%;
  }

  .brief-table div {
    grid-template-columns: 1fr;
  }

  .amount {
    white-space: normal;
  }

  .topbar h1 {
    margin-left: 0;
  }

  .etl-table > div {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
