/*
 * Traffic IQ application styles
 */

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

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

a:hover {
  color: var(--color-primary-hover);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 1280px;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.flash.notice {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.flash.alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.page-subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

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

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-group .field-section-intro {
  margin: 0.375rem 0 0;
}

.field_with_errors input,
.field_with_errors textarea {
  border-color: var(--color-danger);
}

.error-messages {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-muted);
}

.account-switcher select {
  width: auto;
  min-width: 200px;
}

.auth-card {
  max-width: 420px;
  margin: 4rem auto;
}

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

.detail-item dt {
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-item dd {
  margin: 0.25rem 0 0;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.account-form {
  position: relative;
}

.form-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(2px);
}

.form-loading-overlay[hidden] {
  display: none !important;
}

.form-loading-overlay__panel {
  max-width: 22rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.form-loading-overlay__spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1rem;
  border: 3px solid #dbeafe;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: form-loading-spin 0.8s linear infinite;
}

.form-loading-overlay__message {
  margin: 0;
  font-weight: 600;
}

.form-loading-overlay__hint {
  margin: 0.5rem 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

@keyframes form-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.contact-show-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
  align-items: start;
}

.contact-show-main {
  min-width: 0;
}

.contact-show-sidebar {
  position: sticky;
  top: 1rem;
}

.path-timeline-card {
  padding: 0;
}

.path-timeline-card .path-timeline__steps {
  margin: 0;
}

.path-timeline__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.path-timeline h2 {
  margin: 0;
  font-size: 1rem;
}

.path-timeline__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.path-timeline__badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.path-timeline__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.path-timeline__step {
  position: relative;
  padding: 0 0 0.75rem 1.75rem;
}

.path-timeline__step:last-child {
  padding-bottom: 0;
}

.path-timeline__step::before {
  content: "";
  position: absolute;
  left: 0.5625rem;
  top: 1.375rem;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.path-timeline__step:last-child::before {
  display: none;
}

.path-timeline__index {
  position: absolute;
  left: 0;
  top: 0.125rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  border: 2px solid var(--color-surface);
}

.path-timeline__link {
  display: block;
  min-width: 0;
  padding: 0.375rem 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.path-timeline__link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--color-primary-hover);
}

@media (max-width: 900px) {
  .contact-show-layout {
    grid-template-columns: 1fr;
  }

  .contact-show-sidebar {
    position: static;
    order: -1;
  }
}

.prospects-table td {
  vertical-align: middle;
}

.prospects-table th {
  white-space: nowrap;
}

.prospects-table__row:hover {
  background: #f8fafc;
}

.card--table {
  padding: 0;
  overflow: hidden;
}

.contact-filters {
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}

.contact-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.contact-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 10rem;
}

.contact-filters__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-filters__select {
  min-width: 10rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 0.875rem;
  color: var(--color-text);
}

.contact-filters__actions {
  display: flex;
  align-items: center;
  padding-bottom: 0.125rem;
}

.contacts-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-preparation-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.dashboard-preparation-banner[hidden] {
  display: none !important;
}

.dashboard-preparation-banner__spinner {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #dbeafe;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: form-loading-spin 0.8s linear infinite;
}

.dashboard-preparation-banner__message {
  margin: 0;
  color: #1e3a8a;
  font-size: 0.875rem;
  font-weight: 500;
}

.dashboard-preparation-banner__message[data-state="error"] {
  color: #92400e;
}

.dashboard-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

.dashboard-hero__topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-hero__dot {
  color: #94a3b8;
}

.dashboard-hero__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dashboard-hero__title {
  margin: 0 0 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.dashboard-hero__intro {
  margin: 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #334155;
}

.dashboard-ai-summary {
  max-width: 42rem;
  margin: 0;
  padding: 0.875rem 1rem;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6);
}

.dashboard-ai-summary__tag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 999px;
  background: #ddd6fe;
  color: #5b21b6;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-ai-summary__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4c1d95;
}

.recommendations-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recommendations-subsection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recommendations-subsection__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
}

.compliance-gate {
  padding: 1rem 1.125rem;
  border-color: #fde68a;
  background: #fffbeb;
}

.compliance-gate__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  color: #92400e;
}

.compliance-gate__copy {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #78350f;
}

.intent-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.intent-badge--high {
  background: #dcfce7;
  color: #166534;
}

.intent-badge--low {
  background: #f1f5f9;
  color: #475569;
}

.intent-badge--none {
  background: #f8fafc;
  color: #94a3b8;
}

.prospect-email--masked {
  color: #94a3b8;
  font-style: italic;
}

.contact-raw-data-section .contact-raw-data__note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.contact-raw-data {
  margin: 0;
  padding: 0.875rem;
  max-height: 24rem;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-cards__section--tier-2 .dashboard-cards__section-title {
  color: #475569;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.dashboard-stat {
  margin: 0;
  padding: 0.75rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
}

.dashboard-stat dt {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.dashboard-stat dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.dashboard-section-heading {
  margin-bottom: 1rem;
}

.dashboard-section-heading h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-section-heading p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.dashboard-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-cards__section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-cards__section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
}

.dashboard-cards__section--tier-1 .dashboard-cards__section-title {
  color: #166534;
}

.dashboard-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
}

.recent-contact-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.recent-contact-card--tier-1 {
  border-color: #86efac;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.08);
}

.recent-contact-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.recent-contact-card--tier-1 .recent-contact-card__header {
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
}

.recent-contact-card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.recent-contact-card__updated {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.recent-contact-card__body {
  padding: 1rem 1rem 0.75rem;
  border-left: 4px solid transparent;
}

.recent-contact-card--tier-1 .recent-contact-card__body {
  border-left-color: #16a34a;
}

.recent-contact-card__name {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
  line-height: 1.3;
}

.recent-contact-card__name-link {
  color: var(--color-text);
  font-weight: 700;
}

.recent-contact-card__name-link:hover {
  color: var(--color-primary);
}

.recent-contact-card__subtitle {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  color: #475569;
}

.recent-contact-card__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem 1rem;
  margin: 0;
}

.recent-contact-card__detail dt {
  margin: 0 0 0.125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.recent-contact-card__detail dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-word;
}

.recent-contact-card__link {
  color: var(--color-primary);
}

.recent-contact-card__insight {
  margin: 0;
  padding: 0.875rem 1rem;
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #166534;
  line-height: 1.5;
}

.recent-contact-card--tier-1 .recent-contact-card__insight {
  background: #f0fdf4;
  border-top-color: #bbf7d0;
}

.recent-contact-card__rationale {
  margin: 0;
  padding: 0.625rem 1rem 0.875rem;
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.recent-contact-card__ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-account-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-account-card__header h2 {
  margin: 0 0 0.25rem;
}

.ai-account-card__brief,
.ai-account-card__profile {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.ai-account-card__brief h3,
.ai-account-card__profile h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.ai-account-card__profile h4 {
  margin: 1rem 0 0.5rem;
  font-size: 0.875rem;
}

.ai-account-card__empty {
  margin: 0;
  color: var(--color-muted);
}

.ai-account-card__meta {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.ai-account-card__suggestions {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius);
}

.dashboard-footer-cta {
  text-align: center;
}

.dashboard-footer-cta__link {
  font-size: 0.9375rem;
  font-weight: 600;
}

.dashboard-empty {
  padding: 0;
}

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

.card--table .prospects-table th:first-child,
.card--table .prospects-table td:first-child {
  padding-left: 1.5rem;
}

.card--table .prospects-table th:last-child,
.card--table .prospects-table td:last-child {
  padding-right: 1.5rem;
}

.card--table .empty-state {
  padding: 3rem 1.5rem;
}

.prospect-name {
  font-weight: 600;
  color: var(--color-text);
}

.prospect-name:hover {
  color: var(--color-primary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.tier-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  white-space: nowrap;
}

.tier-badge--1 {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.tier-badge--2 {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.tier-badge--pending {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.tier-badge--explained {
  cursor: help;
}

.record-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  cursor: help;
}

.record-type-badge--pte {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.record-type-badge--b2c {
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
}

.record-type-badge--b2b {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.record-type-badge--unknown {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.criteria-intro {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.criteria-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.criteria-table td {
  vertical-align: middle;
}

.signal-count {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  white-space: nowrap;
  line-height: 1.2;
}

.prospects-table__metric {
  white-space: nowrap;
}

.prospects-table td:has(.signal-count),
.prospects-table td:has(.tier-badge),
.prospects-table td:has(.record-type-badge),
.prospects-table td:has(.prospects-table__metric) {
  white-space: nowrap;
  width: 1%;
}

.signal-count--none {
  color: var(--color-muted);
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 400;
}

.signal-card {
  padding: 0;
}

.signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.signal-list__item {
  padding: 0.625rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
}

.signal-list__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e3a8a;
}

.signal-list__summary {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.signal-list__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

@media (max-width: 700px) {
  .criteria-form-grid {
    grid-template-columns: 1fr;
  }
}

.quickview-frame {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.quickview-frame:empty {
  display: none;
}

.quickview-frame:not(:empty) {
  pointer-events: auto;
}

.quickview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  cursor: default;
  z-index: 0;
  font-size: 0;
  line-height: 0;
  color: transparent;
  text-decoration: none;
}

.quickview-drawer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: min(640px, 100vw);
  height: 100%;
  background: #f1f5f9;
  border-left: 1px solid var(--color-border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  overflow: auto;
}

.contact-profile {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.contact-profile--page {
  max-width: 920px;
}

.contact-profile__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.contact-profile__identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.contact-profile__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-profile__name {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.3;
}

.contact-profile__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contact-profile__email {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--color-text);
  word-break: break-word;
}

.contact-profile__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.contact-profile__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.contact-profile__close:hover {
  background: #f8fafc;
  color: var(--color-text);
}

.contact-profile__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.125rem;
}

.contact-profile__card-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.contact-essentials-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-essentials-card__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-essentials-card__row:first-child {
  padding-top: 0;
}

.contact-essentials-card__label {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.contact-essentials-card__value {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: right;
}

.contact-essentials-card__link {
  color: var(--color-primary);
  word-break: break-all;
}

.contact-profile__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-metrics-list {
  margin: 0;
}

.contact-attribute-list {
  margin: 0;
}

.contact-attribute-list__item {
  padding: 0.625rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.contact-attribute-list__item:first-child {
  padding-top: 0;
}

.contact-attribute-list__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-attribute-list__item dt {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
}

.contact-attribute-list__item dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  word-break: break-word;
}

.contact-company-empty__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.contact-metrics-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.contact-metrics-list__item:last-child {
  border-bottom: 0;
}

.contact-metrics-list__item dt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 500;
}

.contact-metrics-list__item dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.path-timeline--compact .path-timeline__header {
  margin-bottom: 0.75rem;
}

.contact-profile__attributes .collapsible-section {
  margin-bottom: 0.75rem;
}

.contact-profile__attributes .collapsible-section__summary {
  padding: 0.875rem 1rem;
}

.contact-profile__attributes .collapsible-section__body {
  padding: 0 1rem 1rem;
}

.collapsible-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

.contact-attribute-section {
  background: var(--color-surface);
}

.contact-profile__footer {
  padding-top: 0.5rem;
}

.prospect-email {
  color: var(--color-text);
  word-break: break-all;
}

.prospect-email:hover {
  color: var(--color-primary);
}

@media (max-width: 700px) {
  .contact-profile__grid {
    grid-template-columns: 1fr;
  }
}

.collapsible-section--highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.collapsible-section--highlight .collapsible-section__title {
  color: #1e40af;
}

.collapsible-section {
  margin-bottom: 1rem;
  padding: 0;
  overflow: hidden;
}

.collapsible-section__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 1.25rem;
  user-select: none;
}

.collapsible-section__summary::-webkit-details-marker {
  display: none;
}

.collapsible-section__heading {
  min-width: 0;
}

.collapsible-section__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.collapsible-section__subtitle {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-muted);
}

.collapsible-section__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.collapsible-section__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-muted);
  transition: transform 0.15s ease;
  transform: rotate(0deg);
}

.collapsible-section[open] .collapsible-section__chevron {
  transform: rotate(90deg);
}

.collapsible-section__body {
  padding: 0 1.25rem 1.25rem;
}

.collapsible-section__body .detail-grid {
  margin-top: 0;
}

.grouped-fields-card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.detail-item--highlighted dd {
  color: #1e3a8a;
}

.display-settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.field-section {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}

.field-section legend {
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding: 0;
}

.field-section-intro {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.field-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0;
}

.field-checkbox input {
  width: auto;
}

@media (max-width: 900px) {
  .display-settings-layout {
    grid-template-columns: 1fr;
  }
}

.account-brief-wizard {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.account-brief-wizard__header h2 {
  margin: 0 0 0.25rem;
}

.account-brief-wizard__mode {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.account-brief-wizard__mode-label {
  width: 100%;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.account-brief-wizard__mode-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0;
}

.account-brief-wizard__mode-option input {
  width: auto;
}

.account-brief-wizard__sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.account-brief-wizard__lead {
  font-weight: 700;
}

.account-brief-wizard__text {
  color: var(--color-muted);
}

.account-brief-wizard__inline-input,
.account-brief-wizard__inline-select {
  width: auto;
  min-width: 10rem;
  max-width: 100%;
  flex: 1 1 12rem;
}

.account-brief-wizard__branch {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.account-brief-wizard__branch-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.ai-setup-questions-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-setup-questions-card__header h2 {
  margin: 0 0 0.25rem;
}

.ai-setup-questions-card__preview {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius);
}

.ai-setup-questions-card__preview h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.ai-setup-questions-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-setup-question {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0;
}

.ai-setup-question legend {
  font-weight: 600;
  padding: 0 0.25rem;
  margin-bottom: 0.75rem;
}

.ai-setup-question__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-setup-question__option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  margin: 0;
}

.ai-setup-question__option input {
  width: auto;
  margin-top: 0.2rem;
}

.ai-setup-chat-card {
  padding: 0;
}

.ai-setup-chat {
  padding: 1.25rem;
}

.ai-setup-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-setup-chat__header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
}

.ai-brief-summary__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-brief-summary__header h2 {
  margin: 0 0 0.25rem;
}

.ai-brief-summary__body {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.ai-brief-summary__interpretation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.ai-brief-summary__interpretation h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.ai-brief-summary__actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.ai-setup-chat__header h2 {
  margin: 0 0 0.25rem;
}

.ai-setup-chat__status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-setup-chat__status--ready {
  background: #dcfce7;
  color: #166534;
}

.ai-setup-chat__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
}

.ai-setup-chat__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 560px;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.ai-setup-chat__panel--thinking .ai-setup-chat__messages,
.ai-setup-chat__panel--thinking .ai-setup-chat__review-banner {
  opacity: 0.55;
}

.ai-setup-chat__panel--thinking .ai-setup-chat__composer textarea {
  background: #f1f5f9;
  color: var(--color-muted);
}

.ai-setup-chat__panel--thinking .ai-setup-chat__composer .btn {
  opacity: 0.72;
  cursor: wait;
}

.ai-setup-chat__thinking-status {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.ai-setup-chat__panel--thinking .ai-setup-chat__thinking-status {
  color: var(--color-text);
}

.ai-setup-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
}

.ai-setup-chat__message {
  display: flex;
}

.ai-setup-chat__message--user {
  justify-content: flex-end;
}

.ai-setup-chat__bubble {
  max-width: 85%;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.ai-setup-chat__message--assistant .ai-setup-chat__bubble {
  background: #fff;
  border: 1px solid var(--color-border);
  border-top-left-radius: 0.25rem;
}

.ai-setup-chat__message--user .ai-setup-chat__bubble {
  background: #dbeafe;
  border-top-right-radius: 0.25rem;
}

.ai-setup-chat__bubble p {
  margin: 0;
}

.ai-setup-chat__bubble p + p {
  margin-top: 0.5rem;
}

.ai-setup-chat__composer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.ai-setup-chat__composer textarea {
  min-height: 5rem;
  resize: vertical;
}

.ai-setup-chat__composer-actions {
  display: flex;
  justify-content: flex-end;
}

.ai-setup-chat__brief-column {
  display: flex;
  flex-direction: column;
  height: 420px;
  min-height: 0;
}

.ai-setup-chat__brief-header {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}

.ai-setup-chat__brief-header h3 {
  margin: 0 0 0.25rem;
}

.ai-setup-chat__brief-intro {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.ai-setup-chat__brief-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.ai-setup-chat__brief-body {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.ai-setup-chat__brief-empty {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.ai-setup-chat__interpretation h4 {
  margin: 0 0 0.5rem;
}

.ai-setup-chat__interpretation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.ai-setup-chat__review-banner {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: #fffbeb;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-setup-chat__review-banner--finish {
  border-color: #86efac;
  background: #f0fdf4;
}

.ai-setup-chat__review-banner strong {
  display: block;
  margin-bottom: 0.25rem;
}

.ai-setup-chat__status--review {
  background: #fef3c7;
  color: #92400e;
}

.ai-setup-chat__suggestion {
  padding: 1rem;
  margin: -1rem -1rem 1rem;
  border-bottom: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: var(--radius) var(--radius) 0 0;
}

.ai-setup-chat__brief-body--suggested {
  margin-bottom: 1rem;
}

.ai-setup-chat__brief-actions,
.ai-setup-chat__finish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ai-setup-chat__finish-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.ai-setup-chat__finish-intro {
  margin: 0 0 0.75rem;
  width: 100%;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.ai-setup-chat__saved-brief--with-suggestion {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .ai-setup-chat__layout {
    grid-template-columns: 1fr;
  }
}
