:root {
  /* ink */
  --ink-primary: #020617;
  --ink-secondary: #1e293b;
  --ink-muted: #475569;

  /* surfaces */
  --surface-base: #ffffff;
  --surface-soft: #f8fafc;

  /* borders */
  --border-default: #cbd5e1;

  /* section colours */
  --genetic-accent: #a01b16;
  --genetic-soft: #f5fef5;
  --genetic-tech: #ecf2fd;

  --evidence-accent: #2f4356;
  --evidence-soft: #f0fdec;
  --evidence-tech: #ecf2fd;

  /* semantic status */
  --status-yes-bg: #e6f4ea;
  --status-yes-text: #1b5e20;
  --status-yes-border: #1b5e20;

  --status-no-bg: #fdecea;
  --status-no-text: #b71c1c;
  --status-no-border: #b71c1c;

  /* semantic results */
  --result-positive-bg: #e8f1fb;
  --result-positive-border: #2563eb;
  --result-positive-text: #1e3a8a;

  --result-negative-bg: #e6f4ea;
  --result-negative-border: #1b5e20;
  --result-negative-text: #1b5e20;
}

/* base */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-primary);
  background: var(--surface-base);
  line-height: 1.45;
}

.report {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* section frame */

.section-frame {
  margin: 3rem 0;
  border: 2px solid;
  border-radius: 10px;
  overflow: hidden;
}

.section-frame.genetic {
  border-color: var(--genetic-accent);
}

.section-frame.evidence {
  border-color: var(--evidence-accent);
}

/* section header band */

.section-header {
  padding: 1.25rem 1.5rem;
  color: #ffffff;
}

.section-header h2 {
  margin: 0 0 0.25rem;
}

.section-header p {
  margin: 0;
}

.section-header.genetic {
  background: var(--genetic-accent);
}

.section-header.evidence {
  background: var(--evidence-accent);
}

/* box roles */

.box {
  margin: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-default);
}

.basic-report {
  background: var(--surface-base);
}

.explainer-section.genetic {
  background: var(--genetic-soft);
}

.explainer-section.evidence {
  background: var(--evidence-soft);
}

.technical-details.genetic {
  background: var(--genetic-tech);
}

.technical-details.evidence {
  background: var(--evidence-tech);
}

/* headings */

h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

/* result header alignment */

.result-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}


/* tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  vertical-align: top;
}

thead th {
  border-bottom: 1px solid var(--border-default);
}

tbody tr:not(:last-child) td {
  border-bottom: 1px solid #e5e7eb;
}

/* pills */

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-soft);
  border: 1px solid var(--border-default);
}

.pill-bright {
  background: #ffda9c;
  border-color: #ffab1c;
  color: #123d7a;
}

/* gold hierarchy only */

.pill-gold {
  background: #fff7d6;
  border-color: #d6b24c;
  color: #5f4b00;
}

/* yes / no status */


/* yes / no status */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid;
}

.status-yes {
  background: var(--status-yes-bg);
  color: var(--status-yes-text);
  border-color: var(--status-yes-border);
}

.status-no {
  background: var(--status-no-bg);
  color: var(--status-no-text);
  border-color: var(--status-no-border);
}

/* result badges */

.result-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid;
  font-size: 0.8rem;
}

.result-positive {
  background: var(--result-positive-bg);
  border-color: var(--result-positive-border);
  color: var(--result-positive-text);
}

.result-negative {
  background: var(--result-negative-bg);
  border-color: var(--result-negative-border);
  color: var(--result-negative-text);
}

/* main finding flag */

.result-flag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f4b00;
  background: linear-gradient(180deg, #fff4c2 0%, #f1d87a 100%);
  border: 1px solid #c9a63a;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
  white-space: nowrap;
  margin-left: auto;
}

/* links */

a {
  color: #1d4ed8;
  text-decoration: underline;
}

/* cover split boxes */

.report-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0 1.5rem;
}

/* .report-split-item { */
/*   padding: 1.0rem 1.7rem  0rem; */
/*   border-radius: 12px; */
/*   border: 2px solid #000000; */
/*   color: #ffffff; */
/* } */

/* fix report-split top spacing artefact */
.report .report-split-item {
  padding: 1.25rem 1.7rem 1.25rem;
  box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid #000000;
}

/* ensure no hidden margin above first heading */
.report .report-split-item > h3:first-child {
  margin-top: 0;
}

.report-split-item.genetic {
  background: var(--genetic-accent);
}

.report-split-item.evidence {
  background: var(--evidence-accent);
}

@media (max-width: 720px) {
  .report-split {
    grid-template-columns: 1fr;
  }
}


/* disclosure (read more) */

/* reset default details behaviour */
details {
  padding: 0;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* summary row */
.disclosure-summary {
  cursor: pointer;
  padding: 0.9rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* single arrow on the left */
.disclosure-summary::before {
  content: "▸";
  /* font-size: 1.0rem; */
  line-height: 1.0;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

/* rotate arrow when open */
details[open] .disclosure-summary::before {
  transform: rotate(90deg);
}

/* keep title text tight, no centring */
.disclosure-summary span,
.disclosure-summary strong {
  display: inline;
}

/* right aligned read more */
.disclosure-hint {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

/* collapsed box should not be tall */
details:not([open]) .disclosure-content {
  display: none;
}

/* content padding only when open */
.disclosure-content {
  padding: 0 1.5rem 1.5rem;
}



/* informational outcome context */

.outcome-context {
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.outcome-context-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.outcome-context ul {
  margin: 0;
  padding-left: 1.1rem;
}

.outcome-context li {
  margin-bottom: 0.4rem;
}

/* pre-report notice (appears before H1) */

.report-notice {
  max-width: 820px;
  margin: 2rem auto 1.5rem;
  padding: 1rem 1.3rem;
  background: #f8fafc;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--ink-secondary);
  /* font-size: 1rem; */
}

.report-notice h3 {
  margin: 0 0 0.4rem;
  /* font-size: 0.9rem; */
  font-weight: 600;
  color: var(--ink-primary);
}

.report-notice p {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.report-notice a {
  font-weight: 600;
}




/* call to action button */

.cta-button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  background: var(--evidence-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--evidence-accent);
  transition: background 0.15s ease, transform 0.05s ease;
}

.cta-button:hover {
  background: #3a556f;
  /* transform: translateY(-1px); */
}

.cta-button:active {
  transform: translateY(0);
}




/* result flag mobile wrapping fix */
@media (max-width: 720px) {

  .result-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .result-flag {
    margin-left: 0;
    margin-top: 0.4rem;
    white-space: normal;
    line-height: 1.2;
  }

}


/* reduce outer box padding for disclosure sections on mobile */
@media (max-width: 720px) {

  details.box {
    margin: 0.8rem;
    padding: 0;
  }

  details.box .disclosure-summary {
    padding: 0.7rem 1rem;
  }

  details.box .disclosure-content {
    padding: 0 1rem 1rem;
  }

}


/* prevent gene pills and tables from overflowing parent on mobile */
@media (max-width: 720px) {

  .disclosure-content,
  .disclosure-content * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .pill {
    white-space: normal;
    word-break: break-word;
  }

  details table,
  details table tr {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }

}


/* single, canonical mobile table stacking */
@media (max-width: 720px) {

  table {
    border: 0;
  }

  table thead {
    display: none;
  }

  table tbody,
  table tr {
    display: block;
    width: 100%;
  }

  table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    background: var(--surface-base);
  }

  table td,
  table th {
    display: block;
    width: 100%;
    padding: 0.35rem 0;
    border: none;
    box-sizing: border-box;
  }

  table td::before,
  table th::before {
    content: none;
  }

  table th {
    font-weight: 600;
    color: var(--ink-primary);
  }

}




.survey-frame {
  margin: 3rem auto;
  width: 100%;
  max-width: 900px;
}

.survey-frame iframe {
  width: 100%;
  height: 1200px;
  border: 0;
}

#limesurvey-wrapper {
  isolation: isolate;
}


/* limesurvey breaks our css */
/* harden section header titles against external CSS */
.report .section-header h2 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

/* harden report h3 headings */
.report h3 {
  color: var(--ink-primary);
  font-size: 1.05rem;
  font-weight: 600;
}

.report .box h3,
.report .result-header h3 {
  color: var(--ink-primary);
  font-size: 1.25rem;
  font-weight: 600;
}

/* enforce white text in cover split boxes */
.report .report-split-item,
.report .report-split-item h3,
.report .report-split-item p,
.report .report-split-item span {
  color: #ffffff;
}


/* ensure single-page scrolling for LimeSurvey embed */
#limesurvey-container {
  height: auto;
  overflow: visible;
}


/* visual separation between rule groups */
tbody tr.rule-group-end td {
  border-bottom-width: 3px;
  border-bottom-color: var(--border-default);
}

