/**
 * Benchmarking tool — Product light theme + Goal Market data density.
 * Pairs with pfy-design-system.css. Layout unchanged; visual reskin only.
 */

:root {
  --bm-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bm-panel-border: #e4e7ee;
  --bm-panel-bg: var(--pfy-color-surface);
  --bm-hero-gradient: linear-gradient(to bottom, #f8faff, var(--pfy-color-bg));
}

/* ---- Breadcrumb ---- */

.bm-breadcrumb {
  background: var(--pfy-color-surface);
  padding: 10px 0;
  border-bottom: 1px solid var(--pfy-color-border-light);
}

.bm-breadcrumb .breadcrumb-list {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--pfy-color-text-muted);
}

.bm-breadcrumb .breadcrumb-item a {
  color: var(--pfy-color-primary);
  text-decoration: none;
}

.bm-breadcrumb .breadcrumb-separator {
  margin: 0 8px;
  color: #999;
}

/* ---- Page shell ---- */

.dashboard {
  max-width: var(--pfy-container-max);
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* ---- Hero band (Product gradient) ---- */

.bm-hero {
  background: var(--bm-hero-gradient);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  padding: 36px 32px 28px;
  margin: 24px 0 20px;
  box-shadow: var(--pfy-shadow-card);
  text-align: center;
}

.bm-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--pfy-color-heading);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.bm-lede {
  color: var(--pfy-color-text-muted);
  font-size: 17px;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Primary controls row */

.bm-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding: 18px 20px;
  background: var(--pfy-color-surface);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--pfy-shadow-header);
}

.bm-controls-bar .control-group {
  flex: 1 1 200px;
  min-width: 180px;
}

.bm-controls-bar .control-group--your-company {
  flex: 1 1 240px;
}

.bm-auth-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--pfy-color-text-muted);
  line-height: 1.4;
}

.bm-auth-hint a {
  color: var(--pfy-color-primary);
  font-weight: 600;
  text-decoration: none;
}

.bm-auth-hint a:hover {
  text-decoration: underline;
}

#yourCompanySelect optgroup {
  font-weight: 600;
  font-size: 11px;
  color: var(--pfy-color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#yourCompanySelect option {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--pfy-color-text);
}

.bm-controls-bar select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: var(--pfy-radius-md);
  font-size: 14px;
  background: var(--pfy-color-surface);
  color: var(--pfy-color-text);
  font-family: inherit;
  width: 100%;
  min-width: 0;
}

.bm-btn-primary {
  padding: 10px 18px;
  background: var(--pfy-color-primary);
  color: #fff;
  border: none;
  border-radius: var(--pfy-radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.bm-btn-primary:hover {
  background: #1557b0;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.bm-stat-pillar {
  font-size: 18px !important;
}

.bm-percentile-suffix {
  font-size: 16px;
  color: var(--pfy-color-text-muted);
}

.bm-state-row {
  text-align: center;
  padding: 32px 20px !important;
  color: var(--pfy-color-text-muted);
  font-size: 14px;
}

.bm-state-row--error {
  color: #c5221f;
}

.peer-comparison-notice {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.peer-comparison-notice--info {
  background: #e8f0fe;
  color: #174ea6;
}

.peer-comparison-notice--warn {
  background: #fef7e0;
  color: #b06000;
}

.peer-comparison-notice--error {
  background: #fce8e6;
  color: #c5221f;
}

.bm-skeleton {
  display: inline-block;
  animation: bm-pulse 1.4s ease-in-out infinite;
}

@keyframes bm-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.bm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bm-radar-empty[hidden] {
  display: none;
}

.bm-radar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  color: var(--pfy-color-text-muted);
  font-size: 14px;
  background: #f8f9fc;
  border-radius: var(--pfy-radius-md);
  border: 1px dashed var(--bm-panel-border);
}

.bm-survey-preview {
  margin-top: 28px;
  background: var(--bm-panel-bg);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  padding: 0 20px 8px;
  opacity: 0.92;
}

.bm-survey-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bm-preview-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.bm-survey-preview-note {
  font-size: 13px;
  color: var(--pfy-color-text-muted);
  margin: 0 0 16px 48px;
  line-height: 1.5;
}

.bm-survey-sections .category-section {
  margin-top: 12px;
}

.comparison-subtitle {
  font-size: 14px;
  color: var(--pfy-color-text-muted);
  margin: 4px 0 0;
  width: 100%;
}

.companies-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.companies-table th.sortable:hover {
  color: var(--pfy-color-primary);
}

.companies-table th.sortable.sort-asc::after {
  content: " ↑";
  font-size: 11px;
  color: var(--pfy-color-primary);
}

.companies-table th.sortable.sort-desc::after {
  content: " ↓";
  font-size: 11px;
  color: var(--pfy-color-primary);
}

/* Peer grade ticker — removed from IA; keep rules for reference */

.bm-ticker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 28px;
  padding: 12px 18px;
  background: var(--pfy-color-surface);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  margin: 0 auto 22px;
  max-width: 900px;
  font-family: var(--bm-font-mono);
  font-size: 13px;
}

.bm-ticker .ticker-name {
  color: var(--pfy-color-text-subtle);
  font-weight: 500;
}

.bm-ticker .ticker-grade {
  color: var(--pfy-color-heading);
  font-weight: 700;
}

.bm-ticker .ticker-you {
  color: var(--pfy-color-primary);
}

/* Filter command bar */

.bm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  justify-content: center;
  padding: 16px 18px;
  background: var(--pfy-color-surface);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  margin-top: 4px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.control-group label {
  font-weight: 600;
  color: var(--pfy-color-text-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-group select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: var(--pfy-radius-md);
  font-size: 14px;
  background: var(--pfy-color-surface);
  color: var(--pfy-color-text);
  font-family: inherit;
  min-width: 160px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group select:focus {
  outline: none;
  border-color: var(--pfy-color-primary);
  box-shadow: 0 0 0 3px var(--pfy-color-primary-soft);
}

.control-group input[type="checkbox"] {
  accent-color: var(--pfy-color-primary);
}

.control-group--checkbox label {
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* ---- KPI stat row ---- */

.bm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.bm-stat-card {
  background: var(--bm-panel-bg);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  padding: 16px 18px;
  box-shadow: var(--pfy-shadow-header);
  transition: box-shadow 0.2s, transform 0.2s;
}

.bm-stat-card:hover {
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.1);
  transform: translateY(-1px);
}

.bm-stat-card .label {
  color: var(--pfy-color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.bm-stat-card .value {
  font-family: var(--bm-font-mono);
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
  color: var(--pfy-color-heading);
}

.bm-stat-card .sub {
  color: var(--pfy-color-text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.bm-stat-card .delta-up {
  color: var(--pfy-color-success);
  font-weight: 600;
}

.bm-stat-card .delta-down {
  color: var(--pfy-color-danger);
  font-weight: 600;
}

/* ---- Shared panel sections ---- */

.bm-panel {
  background: var(--bm-panel-bg);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--pfy-shadow-card);
  transition: box-shadow 0.2s ease;
}

.bm-panel:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.07);
}

.bm-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pfy-color-border-light);
}

.bm-panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pfy-color-primary);
  margin-bottom: 4px;
}

.bm-panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pfy-color-heading);
  margin: 0;
}

.bm-panel-subtitle {
  color: var(--pfy-color-text-muted);
  font-size: 14px;
  margin: 6px 0 0;
}

/* Radar section */

.radar-section,
.company-comparison,
.category-section {
  background: var(--bm-panel-bg);
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--pfy-shadow-card);
}

.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.radar-header-content {
  text-align: center;
  flex: 1;
}

.radar-title,
.comparison-title,
.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pfy-color-heading);
  margin: 0;
}

.radar-subtitle {
  color: var(--pfy-color-text-muted);
  font-size: 14px;
  margin: 6px 0 0;
}

.radar-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.radar-mode-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
}

.radar-mode-badge[hidden],
.radar-pillar-explainer[hidden] {
  display: none;
}

.radar-mode-badge--survey {
  background: #ede9fe;
  color: #5b21b6;
}

.radar-mode-badge--trm {
  background: #dbeafe;
  color: #1d4ed8;
}

.grade-hint {
  font-size: 0.75em;
  color: #888;
  margin-top: 4px;
}

.grade-signal-hints {
  font-size: 0.7em;
  color: #6b7280;
  margin-top: 2px;
}

.grade-signal-hints .grade-hint {
  font-size: inherit;
  margin-top: 0;
}

.grade-hint-icon {
  font-size: 0.9em;
  opacity: 0.65;
  margin-left: 1px;
  background: none;
  border: none;
  padding: 0 2px;
  color: inherit;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}

.grade-hint-icon:hover,
.grade-hint-icon:focus-visible {
  opacity: 1;
}

.grade-hint-popover {
  position: absolute;
  z-index: 1000;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  text-align: left;
}

.radar-pillar-explainer {
  margin-top: 4px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #475569;
}

.radar-pillar-explainer p {
  margin: 0;
}

.radar-pillar-explainer p + p {
  margin-top: 6px;
}

.radar-pillar-explainer .radar-legend-note strong {
  color: #334155;
}

.radar-container {
  position: relative;
  height: 400px;
  margin-bottom: 16px;
}

.overall-score {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--pfy-color-heading);
  color: white;
  padding: 12px 22px;
  border-radius: var(--pfy-radius-md);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}

.score-number {
  font-family: var(--bm-font-mono);
  font-size: 1.75rem;
  font-weight: 700;
}

.grade-a { background: #34a853 !important; }
.grade-b { background: #4285f4 !important; }
.grade-c { background: #e6a817 !important; color: #1a1a1a !important; }
.grade-d { background: #ea4335 !important; }
.grade-f { background: #c62828 !important; }

/* Category sections */

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pfy-color-border-light);
}

.category-score {
  font-family: var(--bm-font-mono);
  background: var(--pfy-color-heading);
  color: white;
  padding: 8px 16px;
  border-radius: var(--pfy-radius-md);
  font-size: 1rem;
  font-weight: 700;
}

.questions-grid {
  display: grid;
  gap: 18px;
}

.question-card {
  background: #f8f9fc;
  border-radius: var(--pfy-radius-md);
  padding: 22px;
  border: 1px solid var(--bm-panel-border);
  border-left: 3px solid var(--pfy-color-primary);
}

.question-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pfy-color-heading);
  margin-bottom: 14px;
  line-height: 1.4;
}

.your-answer {
  background: var(--pfy-color-primary);
  color: white;
  padding: 10px 16px;
  border-radius: var(--pfy-radius-md);
  margin-bottom: 16px;
  font-weight: 600;
  position: relative;
  font-size: 14px;
}

.your-answer::before {
  content: "Your Answer";
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--pfy-color-primary);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.benchmark-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pfy-color-text-muted);
  margin-bottom: 12px;
}

.response-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--pfy-color-border-light);
  gap: 10px;
}

.response-option:last-child {
  border-bottom: none;
}

.response-text {
  flex: 1;
  font-size: 13px;
  color: var(--pfy-color-text-subtle);
  line-height: 1.35;
}

.response-bar {
  width: 160px;
  height: 8px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.response-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pfy-color-primary), #5b9bf5);
  border-radius: 999px;
  transition: width 0.8s ease;
}

.response-fill.your-choice {
  background: linear-gradient(90deg, #1565c0, var(--pfy-color-primary));
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.25);
}

.response-percentage {
  font-family: var(--bm-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--pfy-color-heading);
  min-width: 42px;
  text-align: right;
}

/* Semantic insight cards */

.insights-box {
  border-radius: var(--pfy-radius-md);
  padding: 14px 16px;
  margin-top: 16px;
  border-left: 3px solid var(--pfy-color-primary);
  background: #e8f4fd;
}

.insights-box.insight {
  background: #e8f4fd;
  border-left-color: #1565c0;
}

.insights-box.strength {
  background: #e3f5e5;
  border-left-color: #2e7d32;
}

.insights-box.opportunity {
  background: #fff3e0;
  border-left-color: #e65100;
}

.insights-box.good {
  background: #e8f4fd;
  border-left-color: var(--pfy-color-primary);
}

.insights-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.insights-box.insight .insights-title,
.insights-box.good .insights-title { color: #1565c0; }
.insights-box.strength .insights-title { color: #2e7d32; }
.insights-box.opportunity .insights-title { color: #e65100; }

.insights-text {
  color: var(--pfy-color-text-subtle);
  font-size: 13px;
  line-height: 1.45;
}

/* Expand / collapse */

.section-toggle {
  background: var(--pfy-color-primary-soft);
  border: 1px solid var(--pfy-color-primary-border);
  font-size: 1rem;
  cursor: pointer;
  color: var(--pfy-color-primary);
  padding: 8px;
  border-radius: var(--pfy-radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.section-toggle:hover {
  background: rgba(26, 115, 232, 0.14);
}

.section-toggle.collapsed {
  transform: rotate(-90deg);
}

.section-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
}

/* Company comparison */

.comparison-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pfy-color-border-light);
}

.comparison-controls {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.comparison-controls select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: var(--pfy-radius-md);
  font-size: 14px;
  background: var(--pfy-color-surface);
  min-width: 220px;
  cursor: pointer;
  font-family: inherit;
}

.comparison-controls select:focus {
  outline: none;
  border-color: var(--pfy-color-primary);
  box-shadow: 0 0 0 3px var(--pfy-color-primary-soft);
}

.comparison-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  background: #f8f9fc;
  border: 1px solid var(--bm-panel-border);
  border-radius: var(--pfy-radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--pfy-color-text-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--pfy-color-primary);
  border-color: var(--pfy-color-primary);
  color: white;
}

#createPeerGroupBtn {
  padding: 9px 14px;
  background: var(--pfy-color-primary);
  color: white;
  border: none;
  border-radius: var(--pfy-radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  font-family: inherit;
}

#createPeerGroupBtn:hover {
  background: var(--pfy-color-primary-hover);
}

.companies-table {
  width: 100%;
  border-collapse: collapse;
}

.companies-table th {
  background: #f7f9fc;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--pfy-color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--bm-panel-border);
  position: sticky;
  top: 0;
}

.companies-table td {
  padding: 14px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
  font-size: 14px;
}

.companies-table tr:hover td {
  background: rgba(26, 115, 232, 0.04);
}

.company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--pfy-radius-md);
  background: #fff;
  border: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pfy-color-heading);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.company-logo--placeholder {
  background: var(--pfy-color-primary);
  border-color: transparent;
  color: white;
}

.company-logo:has(img) {
  background: #fff;
  border-color: #e8eaed;
}

.company-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.company-name {
  font-weight: 600;
  color: var(--pfy-color-heading);
  font-size: 14px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: var(--pfy-radius-md);
  font-family: var(--bm-font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: white;
}

.grade-badge.grade-a { background: #34a853; }
.grade-badge.grade-b { background: #4285f4; }
.grade-badge.grade-c { background: #e6a817; color: #1a1a1a; }
.grade-badge.grade-d { background: #ea4335; }
.grade-badge.grade-f { background: #c62828; }

.grade-cell-with-source {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.grade-source-chip {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

.grade-source-chip--ai {
  background: #e8f0fe;
  color: #1a73e8;
}

.grade-source-chip--human {
  background: #e6f4ea;
  color: #137333;
}

.grade-source-chip--review {
  background: #fef7e0;
  color: #b06000;
}

.market-cap {
  font-family: var(--bm-font-mono);
  font-weight: 600;
  color: var(--pfy-color-text-muted);
  font-size: 13px;
}

.location-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pfy-color-text-muted);
  font-size: 13px;
}

.highlight-row td {
  background: linear-gradient(90deg, rgba(26, 115, 232, 0.06), rgba(26, 115, 232, 0.02));
}

.highlight-row .company-name {
  color: var(--pfy-color-primary);
}

.practice-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 5px;
  margin-bottom: 4px;
}

.practice-tag.strength {
  background: #d4edda;
  color: #155724;
}

.practice-tag.opportunity {
  background: #fff3cd;
  color: #856404;
}

/* TRM grades */

.trm-grade-cell {
  text-align: center;
  font-weight: bold;
  padding: 10px;
}

.trm-grade-letter {
  display: block;
  font-family: var(--bm-font-mono);
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 4px;
}

.trm-grade-percentile {
  display: block;
  font-size: 0.75em;
  font-weight: 400;
  color: #888;
}

.trm-grade-A { color: #2e7d32; }
.trm-grade-B { color: #558b2f; }
.trm-grade-C { color: #e6a817; }
.trm-grade-D { color: #ef6c00; }
.trm-grade-F { color: #c62828; }
.trm-grade-missing { color: #888; }

/* Peer group modal */

.company-checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.company-checkbox-item:hover {
  background: #f5f7fa;
}

.company-checkbox-item:last-child {
  border-bottom: none;
}

.company-checkbox-item input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: var(--pfy-color-primary);
}

.company-checkbox-item label {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-checkbox-name {
  font-weight: 600;
  color: var(--pfy-color-heading);
  font-size: 14px;
  margin-bottom: 4px;
}

.company-checkbox-details {
  font-size: 13px;
  color: var(--pfy-color-text-muted);
}

.company-checkbox-ticker {
  display: inline-block;
  font-family: var(--bm-font-mono);
  background: #e9ecef;
  color: #495057;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}

#savePeerGroupBtn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-primary {
  padding: 10px 20px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: #1557b0;
}

.peer-group-form-hint {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: #ea4335;
  min-height: 1.25em;
}

.peer-group-signin-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #856404;
}

.peer-group-signin-hint a {
  color: #1a73e8;
  font-weight: 600;
}

.peer-group-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 0;
}

.peer-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #c6dafc;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.peer-group-chip:hover {
  background: #d2e3fc;
}

.peer-group-companies-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 10px;
}

.peer-group-list-empty {
  text-align: center;
  padding: 40px;
  color: #888;
}

.peer-group-list-empty--error {
  color: #ea4335;
}

.peer-group-picker-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  padding: 10px 8px 6px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 4px;
}

.peer-group-picker-section + .peer-group-picker-section {
  margin-top: 12px;
}

.peer-grade-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.peer-grade-badge--trm {
  background: #e8f5e9;
  color: #2e7d32;
}

.peer-grade-badge--survey {
  background: #e3f2fd;
  color: #1565c0;
}

.peer-grade-badge--pending {
  background: #fff3e0;
  color: #e65100;
}

.peer-group-add-ticker {
  margin-top: 12px;
}

.peer-group-add-ticker-btn {
  width: 100%;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px dashed #c6c9cc;
  border-radius: 6px;
  color: #1a73e8;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.peer-group-add-ticker-btn:hover {
  background: #e8f0fe;
  border-color: #1a73e8;
}

/* Animations */

.loading-animation {
  opacity: 0;
  animation: bmFadeInUp 0.55s ease forwards;
}

@keyframes bmFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

@media (max-width: 900px) {
  .bm-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bm-hero,
  .radar-section,
  .company-comparison,
  .category-section,
  .bm-controls-bar {
    padding: 20px 16px;
  }

  .bm-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .bm-btn-primary {
    width: 100%;
  }

  .bm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group select {
    width: 100%;
    min-width: unset;
  }

  .bm-stats {
    grid-template-columns: 1fr;
  }

  .comparison-header {
    flex-direction: column;
  }

  .response-bar {
    width: 90px;
  }

  .radar-container {
    height: 280px;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
