/* ============================================================
   TOPRAIL — Design System
   "Know before you pitch."
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES — Light Mode
   ============================================================ */
:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F5;
  --bg-card: #FFFFFF;
  --border: #E8E8E4;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --accent: #5C49E0;
  --accent-hover: #4A39C8;
  --accent-soft: #F0EEFF;
  --success: #0FAF73;
  --warning: #F5A623;
  --danger: #E8394D;
  --score-high: #0FAF73;
  --score-mid: #F5A623;
  --score-low: #E8394D;

  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 22px;
  --font-size-2xl: 28px;
  --font-size-3xl: 38px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-base: 1.6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  --max-width: 1100px;
  --sidebar-width: 240px;
  --nav-height: 60px;
}

/* ============================================================
   CSS VARIABLES — Dark Mode
   ============================================================ */
[data-theme="dark"] {
  --bg-primary: #0F0F0F;
  --bg-secondary: #1A1A1A;
  --bg-card: #1E1E1E;
  --border: #2A2A2A;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #606060;
  --accent: #7B6CF0;
  --accent-hover: #6B5CE0;
  --accent-soft: #1E1A3A;
  --success: #0FAF73;
  --warning: #F5A623;
  --danger: #E8394D;
  --score-high: #0FAF73;
  --score-mid: #F5A623;
  --score-low: #E8394D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

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

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  padding-top: calc(var(--nav-height) + 32px);
  min-height: 100vh;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo svg {
  width: 22px;
  height: 22px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-theme-toggle svg { width: 16px; height: 16px; }

/* Hamburger — mobile only */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Mobile nav drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 999;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile.open { display: flex; }

.nav-mobile .nav-link {
  font-size: var(--font-size-base);
  padding: 10px 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

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

.btn-primary {
  background: #0F0F0F;
  color: #fff;
  border-color: #0F0F0F;
}
.btn-primary:hover:not(:disabled) {
  background: #2A2A2A;
  border-color: #2A2A2A;
  color: #fff;
}
[data-theme="dark"] .btn-primary {
  background: #F0F0F0;
  color: #0F0F0F;
  border-color: #F0F0F0;
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  background: #D8D8D8;
  border-color: #D8D8D8;
  color: #0F0F0F;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.btn-ghost {
  background: transparent;
  color: #666;
  border-color: transparent;
  font-weight: var(--font-weight-normal);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: transparent;
}
[data-theme="dark"] .btn-ghost { color: var(--text-secondary); }

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 13px 28px;
  font-size: var(--font-size-base);
  border-radius: var(--radius-md);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-pad {
  padding: 20px;
}

.card-no-hover:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

/* ============================================================
   SCORE BADGE
   ============================================================ */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: #fff;
  flex-shrink: 0;
}

.score-badge-sm {
  width: 32px;
  height: 32px;
  font-size: var(--font-size-sm);
}

.score-badge-lg {
  width: 72px;
  height: 72px;
  font-size: var(--font-size-2xl);
}

.score-badge-xl {
  width: 96px;
  height: 96px;
  font-size: var(--font-size-3xl);
}

.score-high { background: var(--score-high); }
.score-mid  { background: var(--score-mid); }
.score-low  { background: var(--score-low); }
.score-none { background: var(--text-muted); }

/* 5-tier score color system (used app-wide, 1–5 scale) */
.score-t1 { background: #0A8F5C; }  /* 4.5–5.0  deep green  */
.score-t2 { background: #34C785; }  /* 3.5–4.4  light green */
.score-t3 { background: #F5A623; }  /* 2.5–3.4  amber       */
.score-t4 { background: #F0C040; }  /* 1.5–2.4  yellow      */
.score-t5 { background: #E8394D; }  /* < 1.5    red         */

/* ============================================================
   SCORE BAR
   ============================================================ */
.score-bar-wrap {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ============================================================
   TAGS / PILLS
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.tag-stage { border-color: #C4B5FD; color: var(--accent); background: var(--accent-soft); }
.tag-sector { border-color: #6EE7B7; color: #047857; background: #ECFDF5; }
.tag-geo { border-color: #FCD34D; color: #92400E; background: #FFFBEB; }

[data-theme="dark"] .tag-sector { color: #6EE7B7; background: #064E3B22; border-color: #065F46; }
[data-theme="dark"] .tag-geo { color: #FCD34D; background: #78350F22; border-color: #92400E; }

.tag-verified {
  color: var(--success);
  background: #ECFDF5;
  border-color: #6EE7B7;
  gap: 4px;
}
[data-theme="dark"] .tag-verified { background: #064E3B22; border-color: #065F46; }

/* ============================================================
   FILTER PILLS
   ============================================================ */
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.filter-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: var(--font-weight-semibold);
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.input {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--font-size-base);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 0.5px solid #E8E6E0;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}
[data-theme="dark"] .input { border-color: var(--border); background: var(--bg-card); }

.input:focus {
  border-color: var(--text-primary);
  box-shadow: none;
}

.input-wrap {
  position: relative;
}

.input-wrap .input { padding-left: 40px; }
.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-item:hover,
.autocomplete-item.focused { background: var(--accent-soft); }
.autocomplete-item small { color: var(--text-muted); font-size: var(--font-size-xs); }

/* ============================================================
   RESPONSIVE GRID
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ============================================================
   SCORE DIMENSION ROW
   ============================================================ */
.dimension-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.dimension-row:last-child { border-bottom: none; }

.dimension-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex: 0 0 200px;
}

.dimension-bar { flex: 1; }
.dimension-score {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  flex: 0 0 40px;
  text-align: right;
}

/* ============================================================
   RATING BUTTONS (1-6)
   ============================================================ */
.rating-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.rating-row:last-child { border-bottom: none; }

.rating-question {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rating-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rating-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.rating-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.rating-na {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rating-na.selected {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* ============================================================
   STEP INDICATOR
   ============================================================ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step.active { color: var(--text-primary); font-weight: var(--font-weight-medium); }

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  max-width: 340px;
  pointer-events: all;
  animation: toast-in 0.25s ease;
  border-left: 3px solid var(--border);
}

.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--accent); }

.toast.hiding { animation: toast-out 0.2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.15s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #F5F4F1;
  border: 0.5px solid #E8E6E0;
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: scale-in 0.15s ease;
}
[data-theme="dark"] .modal { background: var(--bg-card); border-color: var(--border); }

@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-switch {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 8px;
}

.modal-switch a { color: var(--text-primary); cursor: pointer; text-decoration: none; }
.modal-switch a:hover { text-decoration: underline; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.4s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.skeleton-card {
  height: 220px;
  border-radius: var(--radius-lg);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 8px;
}

.empty-state p { font-size: var(--font-size-sm); }

/* ============================================================
   PAYWALL OVERLAY
   ============================================================ */
.paywall-blur-wrap {
  position: relative;
}

.paywall-blur { filter: blur(6px); pointer-events: none; user-select: none; }

.paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  z-index: 10;
}

[data-theme="dark"] .paywall-overlay { background: rgba(15,15,15,0.75); }

.paywall-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}

.paywall-card h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: 8px;
}

.paywall-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: var(--line-height-base);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-sub {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ============================================================
   CONFETTI (success state)
   ============================================================ */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   HORIZONTAL BAR CHART (value add)
   ============================================================ */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.bar-chart-label {
  flex: 0 0 180px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.bar-chart-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.bar-chart-score {
  flex: 0 0 36px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  text-align: right;
}

/* ============================================================
   SHOUTOUT PILLS
   ============================================================ */
.shoutout-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shoutout-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.shoutout-pill .shoutout-count {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--accent);
}

/* ============================================================
   RELATIONSHIP OPTION CARDS
   ============================================================ */
.rel-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.rel-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background: var(--bg-card);
}

.rel-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rel-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rel-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.rel-card h3 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.rel-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.p-16  { padding: 16px; }
.p-20  { padding: 20px; }
.p-24  { padding: 24px; }

.fw-bold    { font-weight: var(--font-weight-bold); }
.fw-semi    { font-weight: var(--font-weight-semibold); }
.fw-medium  { font-weight: var(--font-weight-medium); }

.fs-xs   { font-size: var(--font-size-xs); }
.fs-sm   { font-size: var(--font-size-sm); }
.fs-base { font-size: var(--font-size-base); }
.fs-lg   { font-size: var(--font-size-lg); }
.fs-xl   { font-size: var(--font-size-xl); }
.fs-2xl  { font-size: var(--font-size-2xl); }
.fs-3xl  { font-size: var(--font-size-3xl); }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* ============================================================
   MOST WANTED SIDEBAR WIDGET — shared across dashboard pages
   ============================================================ */
.db-wanted-row {
  display: flex; align-items: center; padding: 7px 0;
  border-bottom: 0.5px solid #F0EEE8;
}
.db-wanted-row:last-child { border-bottom: none; }
.db-wanted-info { flex: 1; min-width: 0; }
.db-wanted-name {
  font-size: 12px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; display: block;
}
.db-wanted-name:hover { text-decoration: underline; }
.db-wanted-count { font-size: 11px; color: #999; margin-top: 1px; }
.db-wanted-rate {
  font-size: 11px; color: var(--text-primary); flex-shrink: 0;
  text-decoration: none; margin-left: 8px; white-space: nowrap;
}
.db-wanted-rate:hover { text-decoration: underline; }

/* Ask for ratings button — discover & firm pages */
.disc-ask-btn {
  font-size: 12px; color: #666666; background: transparent;
  border: 0.5px solid #E8E6E0; border-radius: 999px;
  padding: 4px 10px; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s; white-space: nowrap;
  display: block;
}
.disc-ask-btn:hover { border-color: #0F0F0F; color: #0F0F0F; }
.disc-ask-btn.active { color: #3B6D11; border-color: #639922; }
.disc-ask-btn.active:hover { color: #2a4e0c; border-color: #3B6D11; }

/* ============================================================
   HERO GRID BACKGROUND
   ============================================================ */
.hero-bg {
  background-color: var(--bg-secondary);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 40px;
}

.stat-item:not(:last-child) {
  border-right: 1px solid var(--border);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ============================================================
   GP FIRM CARD
   ============================================================ */
.firm-card {
  cursor: pointer;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.firm-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.firm-card-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.firm-card-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.firm-card-score-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.firm-card-sub-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.firm-card-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.firm-card-sub-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.firm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.firm-card-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  font-weight: var(--font-weight-bold);
  color: var(--accent);
  font-size: var(--font-size-base);
}

.footer-copy {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ============================================================
   SECTION CHIP (rating form section headers)
   ============================================================ */
.section-chip {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-actions .btn { display: none; }
  .nav-actions .nav-theme-toggle { display: flex; }
  .nav-actions .btn:last-child { display: inline-flex; }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .stat-item { padding: 0 20px; }
  .stat-value { font-size: var(--font-size-xl); }

  .dimension-label { flex: 0 0 140px; }

  .rel-options { grid-template-columns: 1fr; }

  .bar-chart-label { flex: 0 0 120px; font-size: var(--font-size-xs); }

  .filter-pills-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .filter-pills-row::-webkit-scrollbar { height: 0; }

  .modal { padding: 24px 20px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-headline { font-size: var(--font-size-2xl) !important; }
  .stats-bar { flex-direction: column; gap: 16px; }
  .stat-item { border-right: none !important; border-bottom: 1px solid var(--border); padding: 12px 0; width: 100%; }
  .stat-item:last-child { border-bottom: none; }
  .firm-card-sub-scores { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   BADGE PROGRESS BAR — sidebar "Your impact" card
   ================================================================ */
.db-badge-progress {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid #F0EEE8;
}
[data-theme="dark"] .db-badge-progress { border-top-color: var(--border); }
.db-badge-progress-bar {
  height: 3px;
  background: #F0EEE8;
  border-radius: 2px;
  margin-bottom: 6px;
}
[data-theme="dark"] .db-badge-progress-bar { background: var(--border); }
.db-badge-progress-fill {
  height: 3px;
  background: #8B4513;
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}
.db-badge-progress-label {
  font-size: 11px;
  color: #999999;
}
