/* Sales Library — operational page styles */
/* Prefix: ji- (legacy) + sl- (new) */

.ji-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.ji-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.ji-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ji-header-stat {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 6px;
}
.ji-header-stat strong {
  color: var(--accent);
}

/* Sales Library: search + pagination toolbars */
.sl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sl-search-input {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.sl-search-input::placeholder {
  color: var(--text-muted);
}
.sl-page-size-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-page-size-select {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}
.sl-pager {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.sl-pager-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.sl-pager-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-pager-btn {
  font-size: 11px !important;
  padding: 4px 12px !important;
}
.sl-pager-num {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Tabs */
.ji-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 0;
}
.ji-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.ji-tab:hover { color: var(--text-primary); }
.ji-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.ji-panel { display: none; padding: 24px; }
.ji-panel.active { display: block; }

/* Stats grid */
.ji-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ji-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.ji-stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.ji-stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Section blocks */
.ji-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.ji-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ji-section-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.ji-section-body {
  padding: 18px;
}

/* Ingest area */
.ji-ingest-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
.ji-json-input {
  width: 100%;
  min-height: 400px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
  tab-size: 2;
}
.ji-json-input:focus {
  outline: none;
  border-color: var(--accent);
}
.ji-ingest-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ji-ingest-result {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  max-height: 300px;
  overflow-y: auto;
}
.ji-ingest-result.success { border-color: var(--success); }
.ji-ingest-result.error { border-color: var(--error); }

/* Table */
.ji-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ji-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
}
.ji-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ji-table tr:hover td {
  background: var(--bg-secondary);
}
.ji-table .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Sortable column headers */
.ji-table th.sl-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}
.ji-table th.sl-th-sortable:hover {
  color: var(--text);
  background: var(--bg-tertiary, var(--bg-secondary));
}
.ji-table th.sl-th-sortable::after {
  content: ' \2195';        /* up-down arrow when not sorted */
  opacity: 0.35;
  font-size: 10px;
  margin-left: 4px;
}
.ji-table th.sl-th-sortable.sl-th-active {
  color: var(--accent);
}
.ji-table th.sl-th-sortable.sl-th-active::after {
  opacity: 1;
}
.ji-table th.sl-th-sortable.sl-th-active.sl-th-desc::after {
  content: ' \2193';        /* ↓ */
}
.ji-table th.sl-th-sortable.sl-th-active.sl-th-asc::after {
  content: ' \2191';        /* ↑ */
}

/* Badges */
.ji-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.ji-badge-state { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.ji-badge-city { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.ji-badge-county { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

/* Needs tag pills */
.ji-need-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Category bar chart */
.ji-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ji-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 200px;
  flex-shrink: 0;
  text-align: right;
}
.ji-bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}
.ji-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.ji-bar-count {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  width: 40px;
  flex-shrink: 0;
}

/* Detail modal / drawer */
.ji-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 560px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.ji-drawer.open { transform: translateX(0); }
.ji-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  display: none;
}
.ji-drawer-overlay.open { display: block; }
.ji-drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ji-drawer-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.ji-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.ji-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

/* Empty state */
.ji-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.ji-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.ji-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Sub-tabs (within a main tab) */
.sl-sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sl-sub-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.sl-sub-tab:hover { color: var(--text-primary); }
.sl-sub-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.sl-sub-panel { display: none; }
.sl-sub-panel.active { display: block; }

/* Deep Research sub-tabs (Sales Library — states / company / custom) */
.dr-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dr-sub-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.dr-sub-tab:hover { color: var(--text-primary); }
.dr-sub-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.dr-sub-panel { display: none; }
.dr-sub-panel.active { display: block; }
.dr-prompt-textarea {
  width: 100%;
  min-height: 200px;
  box-sizing: border-box;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Status badges for brief cache status */
.sl-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.sl-status-ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}
.sl-status-none {
  color: var(--text-muted);
}

/* Email body display in drawer */
.sl-email-body {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-primary);
  white-space: pre-wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .ji-ingest-area { grid-template-columns: 1fr; }
  .ji-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Additional Research tab ─────────────────────────────────────── */
.ji-ar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* 50-state grid: 10 cols × 5 rows */
.ji-ar-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.ji-ar-state-card {
  /* Was aspect-ratio: 1 — kept the grid pretty but hid per-research
     metrics inside a tooltip. Switched to min-height + padding so a
     "model · cites · date" line can render below the code without
     breaking the 10-col grid. Cards still align to the tallest row. */
  min-height: 56px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  padding: 6px 4px;
  min-width: 0;
  text-align: center;
}
.ji-ar-state-card:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: scale(1.05);
  z-index: 2;
}
.ji-ar-state-card.cached {
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.07);
}
.ji-ar-state-card.stale {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.05);
}
.ji-ar-state-card.running {
  border-color: var(--accent);
  background: rgba(59,130,246,0.12);
  animation: ji-pulse 1.5s ease-in-out infinite;
}
@keyframes ji-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.ji-ar-state-code {
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  line-height: 1;
}
.ji-ar-state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--border);
}
.ji-ar-state-card.cached  .ji-ar-state-dot { background: var(--accent); }
.ji-ar-state-card.stale   .ji-ar-state-dot { background: var(--warning); }
.ji-ar-state-card.running .ji-ar-state-dot { background: var(--accent); animation: ji-pulse 1s ease-in-out infinite; }

/* Per-research metrics line shown under the state code on cached
   cards. Compact font + ellipsis so the 10-col grid keeps its
   shape even when the model name is long. */
.ji-ar-state-meta {
  font-size: 9px;
  line-height: 1.25;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 2px;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* Research drawer — wider than profile drawer */
.ji-research-drawer .ji-drawer {
  width: 720px;
}

/* Markdown-style research content in drawer */
.ji-research-content {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-primary);
}
.ji-research-content h1,
.ji-research-content h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text-primary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.ji-research-content h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--accent);
}
.ji-research-content p {
  margin: 0 0 10px;
}
.ji-research-content ul,
.ji-research-content ol {
  margin: 0 0 10px 20px;
}
.ji-research-content li {
  margin-bottom: 4px;
}
.ji-research-content strong {
  font-weight: 600;
  color: var(--text-primary);
}
.ji-research-content a {
  color: var(--accent);
  text-decoration: none;
}
.ji-research-content a:hover { text-decoration: underline; }
.ji-research-content code {
  background: var(--bg-secondary);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.ji-research-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 10px 0;
  padding: 6px 12px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: 0 4px 4px 0;
}

/* Research meta bar in drawer */
.ji-research-meta-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  align-items: center;
}
.ji-research-meta-pill {
  font-size: 11px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 10px;
  color: var(--text-muted);
}

/* Vendor callout panel */
.ji-vendor-callouts {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.ji-vendor-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ji-vendor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ji-vendor-chip {
  font-size: 11px;
  font-weight: 600;
  background: rgba(99,102,241,.12);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: default;
}
.ji-research-meta-pill strong {
  color: var(--text-secondary);
}

/* Job progress item */
.ji-ar-job-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.ji-ar-job-row:last-child { border-bottom: none; }
.ji-ar-job-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ji-ar-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

/* Trigger result box */
.ji-ar-result {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.ji-ar-result.success { border-color: var(--success); color: var(--success); }
.ji-ar-result.error   { border-color: var(--error);   color: var(--error); }
.ji-ar-result.info    { border-color: var(--accent);  color: var(--text-secondary); }

/* Wider drawer when showing research */
.ji-drawer.wide {
  width: 720px;
}

/* ── Industry cluster cards ──────────────────────────────────────── */
.dr-ind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.dr-ind-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.dr-ind-card:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.dr-ind-card.cached {
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.05);
}
.dr-ind-card.stale {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.04);
}
.dr-ind-card.running {
  border-color: var(--accent);
  background: rgba(59,130,246,0.10);
  animation: ji-pulse 1.5s ease-in-out infinite;
}

.dr-ind-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dr-ind-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.dr-ind-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  background: var(--border);
}
.dr-ind-status.cached { background: var(--accent); }
.dr-ind-status.stale { background: var(--warning); }
.dr-ind-status.running { background: var(--accent); animation: ji-pulse 1s ease-in-out infinite; }

.dr-ind-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.dr-ind-tag {
  font-size: 10px;
  font-weight: 500;
  background: rgba(99,102,241,0.10);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.20);
  border-radius: 8px;
  padding: 1px 8px;
}
.dr-ind-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Per-research metrics row on Industry cards — mirrors the
   "<model> · N cites · DATE" line on Region cards so all four
   research-type tabs read the same way at a glance. */
.dr-ind-card-metrics {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-ind-card.cached .dr-ind-card-metrics { color: var(--accent); }
.dr-ind-card.stale .dr-ind-card-metrics { color: var(--warning); }
.dr-ind-card.running .dr-ind-card-metrics { color: var(--accent); }

@media (max-width: 1100px) {
  .ji-ar-layout { grid-template-columns: 1fr; }
  .ji-ar-grid { grid-template-columns: repeat(7, 1fr); }
  .dr-ind-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 700px) {
  .ji-ar-grid { grid-template-columns: repeat(5, 1fr); }
  .dr-ind-grid { grid-template-columns: 1fr; }
}

/* ── Teams Push ───────────────────────────────────────────────────── */
.sl-teams-push-btn {
  color: #7b83eb !important;
  border-color: rgba(98,100,167,.3) !important;
}
.sl-teams-push-btn:hover {
  background: rgba(98,100,167,.12) !important;
  border-color: #7b83eb !important;
}

.sl-teams-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.5);
  align-items: center;
  justify-content: center;
}
.sl-teams-picker-overlay.open {
  display: flex;
}
.sl-teams-picker-card {
  background: var(--bg-card, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 12px;
  padding: 20px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.sl-teams-picker-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #fff);
  margin-bottom: 12px;
}
.sl-teams-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}
.sl-teams-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  transition: background .15s;
}
.sl-teams-picker-item:hover {
  background: rgba(98,100,167,.15);
  color: #7b83eb;
}

/* ── Waterfall Compare panel + drawer ─────────────────────────────
   Side-by-side cloud vs waterfall research view. Lives in the
   Compare sub-tab of the Deep Research panel (see
   templates/jurisdiction_intelligence.html); the JS is in
   static/js/waterfall_compare.js. */

.wf-compare-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.wf-compare-intro code {
  background: var(--bg-primary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

.wf-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.wf-compare-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wf-compare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.wf-compare-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-transform: capitalize;
}
.wf-compare-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.wf-compare-badge--promoted {
  background: rgba(107, 142, 96, .15);
  color: var(--accent);
  border: 1px solid rgba(107, 142, 96, .35);
}
.wf-compare-badge--cloud {
  background: rgba(59, 130, 246, .12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, .3);
}
.wf-compare-card-counts > div {
  position: relative;
  padding: 5px 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
}
.wf-compare-card-counts > div:last-child {
  border-bottom: none;
}
.wf-compare-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
}
.wf-compare-bar--cloud { background: rgba(59, 130, 246, .55); }
.wf-compare-bar--waterfall { background: rgba(107, 142, 96, .65); }
.wf-compare-count-label {
  color: var(--text-muted);
  min-width: 80px;
}
.wf-compare-count {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
}
.wf-compare-overlap {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.wf-compare-overlap strong {
  color: var(--text-primary);
}
.wf-compare-card-foot {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.wf-compare-card-foot code {
  background: var(--bg-primary);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
}
.wf-compare-card-foot .btn {
  margin-left: auto;
}
.wf-compare-arrow {
  color: var(--text-muted);
}

/* List rows */
.wf-compare-pill {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 2px;
  font-weight: 500;
}
.wf-compare-pill--cloud {
  background: rgba(59, 130, 246, .12);
  color: #3b82f6;
}
.wf-compare-pill--local {
  background: rgba(107, 142, 96, .15);
  color: var(--accent);
}
.wf-compare-pill--wfcloud {
  background: rgba(180, 142, 96, .15);
  color: #b48e60;
}
.wf-compare-pill--stale {
  background: rgba(239, 68, 68, .15);
  color: #ef4444;
}
.wf-compare-pill--promoted {
  background: rgba(107, 142, 96, .2);
  color: var(--accent);
  font-weight: 700;
}

/* Side-by-side drawer */
.wf-compare-drawer {
  width: min(1200px, 95vw) !important;
}
.wf-compare-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.wf-compare-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.wf-compare-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.wf-compare-stat-vals {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}
.wf-compare-stat-cloud { color: #3b82f6; }
.wf-compare-stat-waterfall { color: var(--accent); }
.wf-compare-stat-vs {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 500;
}
.wf-compare-warnings {
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
}
.wf-compare-warning {
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.5;
}
.wf-compare-entities {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 12px;
}
.wf-compare-entities-row {
  padding: 4px 0;
  line-height: 1.6;
}
.wf-compare-entities-row em {
  color: var(--text-muted);
  font-style: italic;
}
.wf-compare-chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  margin: 2px 3px 2px 0;
}
.wf-compare-chip--overlap {
  background: rgba(107, 142, 96, .15);
  color: var(--accent);
}
.wf-compare-chip--cloud {
  background: rgba(59, 130, 246, .12);
  color: #3b82f6;
}
.wf-compare-chip--waterfall {
  background: rgba(180, 142, 96, .15);
  color: #b48e60;
}

.wf-compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px) {
  .wf-compare-cols { grid-template-columns: 1fr; }
  .wf-compare-stats-bar { grid-template-columns: repeat(2, 1fr); }
}
.wf-compare-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.wf-compare-col-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wf-compare-col-head--cloud {
  background: rgba(59, 130, 246, .08);
  color: #3b82f6;
}
.wf-compare-col-head--waterfall {
  background: rgba(107, 142, 96, .08);
  color: var(--accent);
}
.wf-compare-col-sub {
  font-weight: 400;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: lowercase;
}
.wf-compare-doc {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-primary);
}
.wf-compare-doc-head {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.wf-compare-doc-head strong {
  color: var(--text-primary);
}
.wf-compare-tldr {
  font-style: italic;
  color: var(--text-secondary);
  padding: 6px 8px;
  background: var(--bg-primary);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.wf-compare-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
.wf-compare-signals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wf-compare-signal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.wf-compare-signal-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.wf-compare-signal-head strong {
  font-size: 12px;
  color: var(--text-primary);
}
.wf-compare-mini {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.wf-compare-signal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}
.wf-compare-quote {
  font-size: 11px;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  margin: 6px 0;
  padding: 2px 8px;
}
.wf-compare-cite a {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.wf-compare-cite a:hover {
  text-decoration: underline;
}
.wf-compare-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}
.wf-compare-extra {
  margin-top: 12px;
}
.wf-compare-extra-list {
  margin: 4px 0 0 0;
  padding-left: 18px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.wf-compare-extra-list strong {
  color: var(--text-primary);
}

