:root {
  --bg: #ffffff;
  --panel: #fff;
  --text: #101828;
  --muted: #667085;
  --line: #e6e8ef;
  --soft: #f2f4f7;
  --accent: #d63a3a;
  --accent-dark: #b92f2f;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-sm: 0 6px 18px rgba(16, 24, 40, 0.06);
  --focus: 0 0 0 4px rgba(214, 58, 58, 0.16);
}

* {
  box-sizing: border-box;
}

body.health-check-page {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: #ffffff;
  line-height: 1.35;
}

/* Hero */
.health-hero {
  background: #ffffff;
}

.health-hero h1 {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #111;
  text-align: center;
}

.health-hero p {
  max-width: 42rem;
  margin: 0.9rem auto 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #4b5563;
  text-align: center;
}

/* Main layout
   Uses shared site width from styles.css .container */
.health-main {
  padding-top: 0.25rem;
  padding-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
}

@media (max-width: 980px) {
  .health-main {
    grid-template-columns: 1fr;
  }
}

.health-main.results-mode {
  grid-template-columns: 1fr;
}

.health-main #resultsCard {
  grid-column: 1 / -1;
}

/* Cards */
.health-main .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.health-main .card-h {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.health-main .card-h .title {
  font-weight: 900;
  font-size: 14px;
  margin: 0;
}

.health-main .card-h .desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.health-main .card-b {
  padding: 14px 16px 16px;
}

/* Form elements */
.health-main label.small {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
  margin-bottom: 6px;
  display: block;
}

.health-main select,
.health-main input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
  font-weight: 650;
}

.health-main select:focus,
.health-main input[type="email"]:focus {
  box-shadow: var(--focus);
  border-color: rgba(214, 58, 58, 0.55);
}

.health-main .row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Badges */
.health-main .badge {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.health-main .badge.good {
  border-color: rgba(18, 183, 106, 0.25);
  background: rgba(18, 183, 106, 0.1);
  color: #067647;
}

.health-main .badge.warn {
  border-color: rgba(247, 144, 9, 0.25);
  background: rgba(247, 144, 9, 0.1);
  color: #b54708;
}

.health-main .badge.bad {
  border-color: rgba(240, 68, 56, 0.25);
  background: rgba(240, 68, 56, 0.1);
  color: #b42318;
}

/* Progress */
.health-main .progress {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.health-main .status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.health-main .bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.health-main .bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(214, 58, 58, 0.95), rgba(240, 107, 107, 0.95));
}

/* Survey sections */
.health-main .sections {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.health-main .section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.health-main .section-h {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.health-main .section-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

.health-main .section-h p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  max-width: 85ch;
}

.health-main .q {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.health-main .q:last-child {
  border-bottom: none;
}

.health-main .q-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #1f2937;
}

.health-main .opts {
  display: grid;
  gap: 10px;
}

.health-main .opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.health-main .opt:hover {
  border-color: rgba(214, 58, 58, 0.35);
  background: rgba(214, 58, 58, 0.03);
}

.health-main input[type="radio"] {
  margin-top: 2px;
  transform: scale(1.05);
  accent-color: var(--accent);
}

.health-main .opt span {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #374151;
}

/* Buttons */
.health-main button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, filter 0.12s ease;
}

.health-main button:hover {
  transform: translateY(-1px);
}

.health-main button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.health-main button.primary {
  border-color: rgba(214, 58, 58, 0.35);
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(214, 58, 58, 0.18);
}

/* Helpers */
.health-main .hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.health-main .hint ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.health-main .note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.health-main .callout {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(214, 58, 58, 0.06), rgba(255, 255, 255, 0));
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.health-main .footer-actions {
  padding: 0 16px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.health-main .submit-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.health-main .divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.health-main .muted {
  color: var(--muted);
  font-weight: 650;
}

/* Results */
.health-main .results {
  display: none;
}

.health-main .results-grid {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.health-main .kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.health-main .kpi h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.health-main .kpi p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.health-main .kpi .big {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.4px;
}

.health-main .compare {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.health-main .chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-weight: 850;
}

.health-main .chip.up {
  border-color: rgba(18, 183, 106, 0.25);
  background: rgba(18, 183, 106, 0.1);
  color: #067647;
}

.health-main .chip.down {
  border-color: rgba(240, 68, 56, 0.25);
  background: rgba(240, 68, 56, 0.1);
  color: #b42318;
}

.health-main .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.health-main .table th {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  font-weight: 850;
  padding: 0 8px;
}

.health-main .table td {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 10px;
  font-weight: 700;
  border-radius: 12px;
}

/* remove the extra empty space above each section title */
.health-main .section {
  padding-top: 0;
}

/* tighten the internal section header spacing */
.health-main .section-h {
  padding: 12px 14px 10px;
}

/* remove any extra top spacing before the first section block */
.health-main .sections {
  margin-top: 0;
  padding-top: 10px;
}

/* optional: slightly reduce top space inside the questionnaire card */
.health-main #surveyCard .card-b,
.health-main #surveyCard > .sections {
  padding-top: 10px;
}

/* Keep the results table stable on mobile */
@media (max-width: 560px) {
  .health-main #sectionTable {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 11px;
  }

  .health-main #sectionTable th:nth-child(1),
  .health-main #sectionTable td:nth-child(1) {
    width: 46%;
  }

  .health-main #sectionTable th:nth-child(2),
  .health-main #sectionTable td:nth-child(2) {
    width: 18%;
  }

  .health-main #sectionTable th:nth-child(3),
  .health-main #sectionTable td:nth-child(3) {
    width: 18%;
  }

  .health-main #sectionTable th:nth-child(4),
  .health-main #sectionTable td:nth-child(4) {
    width: 18%;
  }

  .health-main #sectionTable th,
  .health-main #sectionTable td {
    padding: 6px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .health-main #sectionTable td:nth-child(1) {
    white-space: normal;
    line-height: 1.15;
  }

  .health-main #sectionTable td:nth-child(2),
  .health-main #sectionTable td:nth-child(3),
  .health-main #sectionTable td:nth-child(4) {
    white-space: nowrap;
    text-align: center;
  }

  .health-main #sectionTable .chip {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media print {
  .health-main .footer-actions,
  .health-main button {
    display: none !important;
  }

  body.health-check-page {
    background: #fff;
  }

  .health-main {
    grid-template-columns: 1fr;
  }

  .health-main .card {
    box-shadow: none;
  }

  .health-main .bar {
    display: none;
  }
}