* {
  box-sizing: border-box;
}

:root {
  --bg-color: #f3f4f6; /* Pale gray */
  --header-bg: #ffffff;
  --text-main: #374151; /* Dark gray for main text */
  --text-muted: #6b7280;
  --heading-color: #111827; /* Dark navy */
  --accent-red: #dc2626; /* Restrained red */
  --accent-red-hover: #b91c1c;
  --callout-bg: #fef2f2; /* Pale red */
  --callout-border: #fecaca;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --btn-secondary-bg: #f3f4f6;
  --btn-secondary-hover: #e5e7eb;
  --btn-secondary-border: #d1d5db;
}

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

.topbar {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
}

.topbar-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 140px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--border-color);
  margin: 0 4px;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--heading-color);
  white-space: nowrap;
}

.content {
  max-width: 800px;
  margin: 32px auto 48px;
  padding: 0 24px;
}

.simple-header {
  max-width: 800px;
  margin: 0 auto 28px;
  padding: 0 24px;
}

.simple-header img {
  display: block;
  width: 156px;
  height: auto;
}

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

.search-row {
  flex-wrap: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn.primary {
  background: var(--accent-red);
  color: #ffffff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-red-hover);
}

.btn.secondary {
  background: var(--btn-secondary-bg);
  color: var(--heading-color);
  border-color: var(--btn-secondary-border);
}

.btn.secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
}

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

.btn.large {
  padding: 12px 24px;
  font-size: 16px;
}

.error {
  color: var(--accent-red);
}

.hero-callout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  margin-bottom: 28px;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: 8px;
  color: var(--accent-red-hover);
}

.hero-callout h2 {
  margin: 0 0 6px;
  color: #991b1b;
  font-size: 20px;
  line-height: 1.3;
}

.hero-callout p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(127, 29, 29, 0.08);
}

.hero-icon span {
  display: block;
  width: 2px;
  height: 19px;
  border-radius: 2px;
  background: var(--accent-red);
  position: relative;
}

.hero-icon span:first-child::before,
.hero-icon span:last-child::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--accent-red);
  border-right: 2px solid var(--accent-red);
}

.hero-icon span:first-child::before {
  top: -1px;
  left: -2px;
  transform: rotate(-45deg);
}

.hero-icon span:last-child::after {
  bottom: -1px;
  right: -2px;
  transform: rotate(135deg);
}

input[type=text] {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  max-width: 360px;
  outline: none;
  transition: border-color 0.2s ease;
  flex-grow: 1;
}

input[type=text]:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Accordion Stepper */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accordion-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.accordion-item.is-locked {
  background: #f9fafb;
}

.accordion-item.is-active {
  border-color: var(--accent-red);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}

.accordion-header {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  outline: none;
}

.accordion-header:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.accordion-header:focus-visible {
  background-color: #f9fafb;
}

.step-marker {
  background: var(--border-color);
  color: var(--text-muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.is-active .step-marker,
.is-completed .step-marker {
  background: var(--accent-red);
  color: #fff;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading-color);
  flex-grow: 1;
}

.step-summary {
  font-size: 14px;
  color: var(--text-muted);
  text-align: right;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.accordion-header[aria-expanded="true"] .step-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.accordion-content {
  border-top: 1px solid var(--border-color);
  padding: 0;
}

.accordion-content[hidden] {
  display: none;
}

.accordion-body {
  padding: 24px;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.list-item.selected {
  border-color: var(--accent-red);
  background: var(--callout-bg);
}

.list-item strong {
  color: var(--heading-color);
  display: block;
  margin-bottom: 2px;
}

.list-item .muted {
  font-size: 13px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

iframe {
  width: 100%;
  height: 360px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 8px;
  background: #fff;
}

/* Callout */
.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: 8px;
  padding: 20px;
}

.callout-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.callout h2 {
  font-size: 15px;
  margin: 0;
  color: var(--heading-color);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.badge.red {
  background: var(--accent-red);
}

.callout p {
  margin: 0 0 12px;
  font-size: 14px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout ul {
  margin: 0 0 16px;
  padding-left: 24px;
  font-size: 14px;
}

.callout li {
  margin-bottom: 4px;
}

.link {
  color: var(--accent-red);
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--callout-border);
  padding: 8px 12px;
  text-align: left;
}

.data-table th {
  background: rgba(254, 202, 202, 0.2); /* very light pale red */
  font-weight: 600;
  color: var(--heading-color);
}

.data-table td {
  background: #fff;
}

/* Breakdown specific tables */
h4 {
  margin: 24px 0 12px;
  font-size: 14px;
  color: var(--heading-color);
}

.breakdown-table th,
.breakdown-table td {
  border: 1px solid var(--border-color);
}
.breakdown-table th {
  background: #f9fafb;
}

/* Action Areas */
.action-area {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.final-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.status {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.report-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.report-header img {
  width: 140px;
  height: auto;
}

.report-header .brand-divider {
  display: inline-block;
}

.report-header h1 {
  margin: 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.report-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.report-topbar .topbar-inner {
  max-width: 1040px;
}

.report-back-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.report-content {
  width: 100%;
  max-width: 1040px;
  min-width: 0;
  margin: 0 auto;
  padding: 42px 24px 56px;
}

.report-hero {
  margin-bottom: 22px;
}

.report-hero .eyebrow {
  color: var(--accent-red-hover);
}

.report-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
}

.report-meta .privacy {
  margin: 0;
}

.report-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.report-page .badge.on {
  background: #287d45;
}

.report-page .badge.off {
  background: var(--accent-red);
}

.report-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 24px;
  margin: 0 0 22px;
}

.report-card .toolbar {
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-card .toolbar-actions {
  justify-content: flex-end;
}

.section-heading {
  margin: 0;
  color: var(--heading-color);
  font-size: 22px;
  line-height: 1.2;
}

.report-card > h2 {
  margin: 0 0 20px;
  color: var(--heading-color);
  font-size: 22px;
}

.report-card h3 {
  margin: 28px 0 10px;
  color: var(--heading-color);
  font-size: 15px;
}

.report-card h3:first-child {
  margin-top: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.metric {
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 16px;
  background: #fbfcfd;
}

.report-metric {
  border-top: 3px solid var(--accent-red);
}

.metric-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 5px;
  color: var(--heading-color);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.report-table-wrap,
.campaign-table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.report-table {
  width: 100%;
  min-width: 650px;
  margin: 0;
  border-collapse: collapse;
  background: var(--card-bg);
}

.report-table th,
.report-table td {
  border: 1px solid var(--border-color);
  padding: 11px 12px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.report-table th {
  background: #fff6f5;
  color: var(--heading-color);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-table tbody tr.campaign-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.report-table tbody tr.campaign-row:hover {
  background: #fff8f7;
}

.report-table tbody tr.campaign-row.selected {
  background: var(--callout-bg);
}

.report-table td.subject {
  min-width: 260px;
  color: var(--heading-color);
  font-weight: 650;
}

.report-table td.number,
.report-table th.number {
  text-align: right;
  white-space: nowrap;
}

.report-table .check-cell {
  width: 42px;
  text-align: center;
}

.report-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-red);
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--callout-border);
  border-radius: 7px;
  color: var(--text-muted);
  background: #fffafa;
  text-align: center;
}

.individual {
  margin-top: 0;
}

.report-footer-action {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.landing-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 22px 24px 50px;
}

.landing-hero {
  padding: 52px 0 42px;
  text-align: center;
}

.landing-hero h1 {
  margin: 0;
  color: var(--heading-color);
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.landing-hero h1 span {
  color: var(--accent-red);
}

.landing-lede {
  max-width: 620px;
  margin: 20px auto 0;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.6;
}

.landing-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.landing-callout {
  margin-bottom: 20px;
}

.landing-status {
  padding: 18px 20px;
}

.landing-status .status {
  margin-bottom: 4px;
  color: var(--heading-color);
  font-weight: 650;
  text-align: left;
}

.landing-status .muted {
  margin: 0;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 34px;
}

.landing-feature {
  padding-top: 16px;
  border-top: 2px solid var(--accent-red);
}

.feature-number {
  display: block;
  margin-bottom: 12px;
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.landing-feature h2 {
  margin: 0 0 8px;
  color: var(--heading-color);
  font-size: 16px;
}

.landing-feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .topbar {
    padding: 14px 16px;
  }

  .topbar-inner {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-lockup {
    flex-wrap: wrap;
    gap: 7px;
  }

  .brand-logo {
    width: 126px;
  }

  .brand-divider {
    display: none;
  }

  .topbar-inner > .row {
    justify-content: flex-end;
  }

  .topbar-inner > .row #who {
    display: none;
  }

  .hero-callout {
    padding: 20px;
  }

  .hero-callout h2 {
    font-size: 18px;
  }

  .accordion-header {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 12px;
    padding: 16px;
  }

  .step-marker {
    grid-column: 1;
    grid-row: 1;
  }

  .step-title {
    grid-column: 2;
    grid-row: 1;
  }

  .step-chevron {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
  }

  .step-summary {
    grid-column: 2 / 4;
    grid-row: 2;
    width: auto;
    text-align: left;
    padding-left: 0;
    margin-top: -8px;
    max-width: none;
  }

  .report-content {
    padding: 28px 16px 44px;
  }

  .report-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .report-card {
    padding: 18px;
  }

  .report-card .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-card .toolbar-actions {
    justify-content: flex-start;
  }

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

  .landing-page {
    padding: 0 16px 38px;
  }

  .landing-hero {
    padding: 34px 0 30px;
  }

  .landing-lede {
    font-size: 15px;
  }

  .landing-actions,
  .landing-actions .btn {
    width: 100%;
  }

  .landing-features {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: 28px;
  }

  .search-row {
    flex-wrap: wrap;
  }
  .search-row input[type=text] {
    max-width: 100%;
  }
}