/* Extras for the five interior pages only. Loaded after pages.css on
   faq / how-it-works / returns / security / raise. Nothing here
   redefines ds.css or pages.css: it only adds the documentation
   scaffolding those pages need (page rail, mono numbering, spec rows,
   calculator and app-mock plates) out of the existing tokens. */

/* ---------- headings ----------
   QA: bare <h1>/<h2>/<h3> fall back to the UA bold (700) because the
   design system only sets 500 on the .h1/.h2 classes the home page uses.
   The interior pages therefore rendered every heading synthesized bold
   against the weight-500 brand voice. Restore 500 for doc headings. */
.doc-hero h1,
.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4 {
  font-weight: 500;
}

/* ---------- page rail: prose left, sticky index right ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22em;
  gap: 4em;
  align-items: start;
}
.doc-main {
  min-width: 0;
}
.doc-layout .doc-section {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding-block: 2.5em 3em;
}
.doc-layout .doc-section:first-of-type {
  border-top: 0;
}

/* hero */
.doc-body {
  padding-block: 2em 5em;
}
.doc-hero {
  position: relative;
  overflow: clip;
  padding-top: 10em;
  padding-bottom: 3.5em;
}
.doc-hero_inner {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  align-items: flex-start;
}
.doc-hero h1 {
  font-size: var(--size-h2);
  letter-spacing: -0.045em;
  line-height: 0.98;
  max-width: 26em;
}
.doc-hero_lede {
  color: var(--text-secondary);
  max-width: 40em;
}
.doc-hero_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
  margin-top: 0.5em;
}
.doc-hero_note {
  color: var(--white-40);
  max-width: 46em;
  line-height: 1.65;
}
.doc-hero_meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5em;
  margin-top: 1.5em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border-default);
  width: 100%;
  color: var(--white-40);
}

/* ---------- section head with mono numbering ---------- */
.doc-section_head {
  display: flex;
  align-items: baseline;
  gap: 1.5em;
  margin-bottom: 1.5em;
}
.doc-num {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  color: var(--blue);
  flex: none;
  padding-top: 0.5em;
}
.faq-item .doc-num {
  display: block;
  margin-bottom: 0.6em;
  /* QA: `.faq-item p` (0,1,1) beat `.doc-num` (0,1,0) and greyed every
     FAQ numeral; restore the accent used on the other four pages. */
  color: var(--blue);
}
.doc-section h2,
.doc-section h3 {
  scroll-margin-top: 7em;
}
.doc-section_note {
  color: var(--white-40);
  max-width: 46em;
  line-height: 1.6;
  margin-top: 1.5em;
}
.doc-section > .cta-button {
  justify-self: start;
}

/* ---------- index ---------- */
.doc-index_title {
  color: var(--white-50);
  padding-bottom: 0.75em;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 0.5em;
}
.doc-index a {
  display: grid;
  grid-template-columns: 2em 1fr;
  gap: 0.5em;
  padding-block: 0.45em;
  border-bottom: 1px solid #ffffff14;
  line-height: 1.35;
}
.doc-index a span:first-child {
  color: var(--blue);
}
.doc-index a:hover span:last-child {
  color: var(--white);
}

/* ---------- hairline rows (definition-style lists) ---------- */
.doc-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-default);
}
.doc-row {
  display: grid;
  grid-template-columns: 16em minmax(0, 1fr);
  gap: 2em;
  padding-block: 1.1em;
  border-bottom: 1px solid var(--border-default);
  align-items: baseline;
}
.doc-row h3 {
  font-size: var(--size-18);
  letter-spacing: -0.03em;
}
.doc-row p {
  color: var(--white-50);
  font-size: var(--size-16);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

/* ---------- numbered step rows ---------- */
.doc-steps {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-default);
  counter-reset: step;
}
.doc-step {
  display: grid;
  grid-template-columns: 2.5em minmax(0, 1fr);
  gap: 1.5em;
  padding-block: 1.5em;
  border-bottom: 1px solid var(--border-default);
}
.doc-step_num {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  color: var(--blue);
  padding-top: 0.35em;
}
.doc-step h2,
.doc-step h3 {
  font-size: var(--size-h4);
  letter-spacing: -0.04em;
  margin-bottom: 0.5em;
}
.doc-section_lede {
  color: var(--white-50);
  max-width: 40em;
  letter-spacing: -0.03em;
  line-height: 1.4;
}
.doc-step p {
  color: var(--white-50);
  font-size: var(--size-16);
  letter-spacing: -0.02em;
  line-height: 1.45;
  max-width: 38em;
}
.step-detail {
  margin-top: 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}
.step-detail_label {
  color: var(--white-40);
}
.step-detail ul {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}
.step-detail li {
  display: flex;
  gap: 0.6em;
  color: var(--white-50);
  font-size: var(--size-15);
  letter-spacing: -0.02em;
}
.step-detail li::before {
  content: "";
  flex: none;
  width: 0.35em;
  height: 0.35em;
  margin-top: 0.6em;
  background: var(--blue);
}

/* ---------- spec table ---------- */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.spec-num {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  color: var(--blue);
  width: 3em;
}
.spec-table th.spec-head {
  width: auto;
  font-family: TWKEverett, Arial, sans-serif;
  text-transform: none;
  font-size: var(--size-18);
  letter-spacing: -0.03em;
  color: var(--white);
}
.spec-table--who th.spec-head { padding-right: 2em; }
.spec-table--strong th {
  width: 20em;
  color: var(--white);
  text-transform: none;
  font-family: TWKEverett, Arial, sans-serif;
  font-size: var(--size-18);
  letter-spacing: -0.03em;
  padding-right: 2em;
}
.spec-table td.mono,
.spec-table .num {
  font-variant-numeric: tabular-nums;
}
.spec-figure {
  font-size: var(--size-h3);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ---------- blue calculator slab ---------- */
.calc {
  background: var(--blue);
  color: var(--white);
  padding: 2em;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  max-width: 44em;
}
.calc_label {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  color: #ffffffcc;
}
.calc_amount {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  justify-content: space-between;
  flex-wrap: wrap;
}
.calc_amount strong {
  font-size: clamp(2em, 4vw, 3em);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.calc input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: #ffffff59;
  border-radius: 2px;
  outline-offset: 8px;
}
.calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.1em;
  height: 1.1em;
  border-radius: 2px;
  background: var(--white);
  border: 0;
  cursor: pointer;
}
.calc input[type="range"]::-moz-range-thumb {
  width: 1.1em;
  height: 1.1em;
  border-radius: 2px;
  background: var(--white);
  border: 0;
  cursor: pointer;
}
.calc_terms {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
}
.calc_chip {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  padding: 0.7em 0.9em;
  border-radius: var(--radius);
  border: 1px solid #ffffff59;
  color: var(--white);
}
.calc_chip.is--on {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.calc_out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #ffffff40;
  border-top: 1px solid #ffffff40;
}
.calc_cell {
  background: var(--blue);
  padding-top: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}
.calc_cell strong {
  font-size: clamp(1.5em, 2.6vw, 2em);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.calc_cell span {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.688em;
  letter-spacing: 0.04em;
  color: #ffffffcc;
}
.calc_note {
  color: #ffffffd9;
  font-size: var(--size-15);
  letter-spacing: -0.02em;
  line-height: 1.45;
}

/* ---------- the bar figure ---------- */
.bar-plate {
  position: relative;
  border: 1px solid var(--border-default);
  padding: 3.25em 2em 2.5em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 34em;
  background: #080808;
}
.bar-plate_figure {
  font-size: clamp(3em, 6vw, 4.5em);
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--blue);
}
.bar-plate_title {
  font-size: var(--size-18);
  letter-spacing: -0.03em;
}
.bar-plate_body {
  color: var(--white-50);
  font-size: var(--size-16);
  letter-spacing: -0.02em;
  line-height: 1.45;
}

/* ---------- melora app mocks ---------- */
.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25em;
  margin-top: 2em;
}
.mock {
  position: relative;
  border: 1px solid var(--border-default);
  background: #080808;
  padding: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 0.9em;
  min-width: 0;
}
.mock--wide {
  grid-column: span 2;
}
.mock_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  color: var(--white-50);
}
.mock_title {
  font-size: var(--size-16);
  letter-spacing: -0.02em;
}
.mock .spec-table th {
  /* QA: at 9em/0.688em "ADVANCE, 75%" overflowed its cell and collided
     with the "$300,000" value at 1440. */
  width: 10.5em;
  padding-right: 0.75em;
  font-size: 0.688em;
}
.mock .spec-table td {
  font-size: var(--size-15);
  letter-spacing: -0.02em;
}
.mock_big {
  font-size: var(--size-21);
  letter-spacing: -0.03em;
}
.mock_small {
  color: var(--white-50);
  font-size: var(--size-15);
}
.mock_actions {
  display: flex;
  gap: 0.5em;
  margin-top: auto;
}
.mock_actions .cta-button {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.688em;
  letter-spacing: 0.04em;
  padding: 0.8em 1em;
  line-height: 1;
  margin: 0;
}
.bubble {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 0.75em;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  font-size: var(--size-15);
  letter-spacing: -0.02em;
  line-height: 1.4;
  max-width: 90%;
}
.bubble--me {
  align-self: flex-end;
  background: #ffffff0f;
}
.bubble--guide {
  align-self: flex-start;
  border-color: #1e6ef366;
  background: #1e6ef31a;
}
.bubble_who {
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.688em;
  letter-spacing: 0.04em;
  color: var(--white-40);
}
.mock_reserve {
  background: var(--blue);
  color: var(--white);
  border-radius: var(--radius);
  padding: 0.9em 1em;
  font-family: "TWK Everett Mono", ui-monospace, monospace;
  text-transform: uppercase;
  font-size: 0.688em;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: auto;
}

/* ---------- paper slab ---------- */
.doc-slab--paper {
  background: var(--white);
  border: 1px solid #ffffff26;
  color: var(--black);
  padding-inline: 2.5em;
  padding-block: 2.5em;
}
.doc-slab--paper .doc-num,
.doc-slab--paper .spec-num {
  color: var(--blue);
}
.doc-slab--paper .doc-section_lede,
.doc-slab--paper .doc-section_note,
.doc-slab--paper .doc-row p,
.doc-slab--paper .step-detail li,
.doc-slab--paper .doc-prose p,
.doc-slab--paper .doc-prose li {
  color: var(--black-50);
}
/* QA: 50% black on white is 3.98:1 — below AA for every size used here.
   58% black reaches 4.9:1 without changing the grey-labels treatment. */
.doc-slab--paper .doc-section_lede,
.doc-slab--paper .doc-section_note,
.doc-slab--paper .doc-row p,
.doc-slab--paper .step-detail li,
.doc-slab--paper .doc-prose p,
.doc-slab--paper .doc-prose li,
.doc-slab--paper .spec-table th,
.doc-slab--paper .timeline-row,
.doc-slab--paper .doc-row h3 {
  color: rgba(0, 0, 0, 0.58);
}
.doc-slab--paper .spec-table th,
.doc-slab--paper .spec-table td,
.doc-slab--paper .doc-row {
  border-bottom-color: #00000026;
}
.doc-slab--paper .spec-table th {
  color: rgba(0, 0, 0, 0.58);
}
.doc-slab--paper .spec-table th.spec-head {
  color: var(--black);
}
.doc-slab--paper .tag {
  border-color: #00000026;
}
.doc-slab--paper .timeline-row {
  border-top-color: #00000026;
  color: rgba(0, 0, 0, 0.58);
}
.doc-slab--paper .timeline-row.is--done {
  color: var(--black);
}
.doc-slab--paper .timeline-row:last-child {
  border-bottom-color: #00000026;
}
/* QA: mono micro-labels inside paper slabs still carried white-40 from
   ds.css (3.98:1 on white). Same correction, accent colours preserved. */
.doc-slab--paper .mono:not(.doc-num),
.doc-slab--paper .color-white-40,
.doc-slab--paper .color-white-50 {
  color: rgba(0, 0, 0, 0.58);
}
.doc-slab--paper .cta-button.is--ghost {
  color: var(--black);
  box-shadow: inset 0 0 0 1px #00000026;
}
.doc-slab--paper .cta-button.is--ghost:hover {
  background: #00000010;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5em;
  }
  .doc-index {
    position: static;
    order: 2;
    padding-top: 2em;
    border-top: 1px solid var(--border-default);
  }
  .doc-body {
    padding-block: 2.5em 5em;
  }
  .doc-row {
    grid-template-columns: 12em minmax(0, 1fr);
    gap: 1.5em;
  }
  .mock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mock--wide {
    grid-column: span 2;
  }
}
@media (max-width: 860px) {
  .doc-hero {
    /* QA: the bar is now a fixed .topbar (129px at 390); 8em left the
       eyebrow jammed under it and hid the corner tick behind it. */
    padding-top: 11.5em;
    padding-bottom: 2.5em;
  }
  /* QA: park the hero corner ticks in the clear band between the fixed
     bar and the eyebrow instead of cutting through the eyebrow. */
  .doc-hero .corner-plus.tl {
    inset: 9.5em auto auto var(--s16);
  }
  .doc-hero .corner-plus.tr {
    inset: 9.5em var(--s16) auto auto;
  }
  .doc-hero h1 {
    font-size: 2.25em;
  }
  .doc-hero_actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .doc-hero_actions .cta-button {
    width: 100%;
  }
  .doc-row,
  .doc-step,
  .calc_out {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-step {
    gap: 0.75em;
  }
  .doc-row {
    gap: 0.4em;
  }
  .calc {
    padding: 1.25em;
  }
  .mock-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .mock--wide {
    grid-column: span 1;
  }
  .spec-table--who th.spec-head { padding-right: 2em; }
.spec-table--strong th {
    width: 100%;
    padding-right: 0;
  }
  .spec-table--strong tr {
    display: block;
    padding-block: 0.9em;
    border-bottom: 1px solid var(--border-default);
  }
  .spec-table--strong th,
  .spec-table--strong td {
    display: block;
    border-bottom: 0;
    padding-block: 0;
  }
  .spec-table--strong td {
    padding-top: 0.4em;
  }
}

/* who-rows collapse on small screens */
@media (max-width: 860px) {
  .spec-table--who tr {
    display: block;
    padding-block: 0.9em;
    border-bottom: 1px solid var(--border-default);
  }
  .spec-table--who th,
  .spec-table--who td {
    display: block;
    border-bottom: 0;
    padding-block: 0;
  }
  .spec-table--who td.spec-num {
    padding-bottom: 0.35em;
  }
  .spec-table--who td:last-child {
    padding-top: 0.4em;
  }
}
/* paper slabs bleed across the index column so they read as full-width bands */
@media (min-width: 1101px) {
  .doc-layout .doc-slab--paper {
    margin-right: calc(-22em - 4em);
  }
}
/* ---------- qualification check ---------- */
.check-form {
  display: flex;
  flex-direction: column;
  gap: 2.5em;
  max-width: 46em;
}
.check-set {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.check-set legend {
  padding-bottom: 1em;
  width: 100%;
  border-bottom: 1px solid var(--border-default);
}
.check-q {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding-block: 1.25em;
  border-bottom: 1px solid #ffffff14;
}
.check-q.is--missing .check-q_text {
  color: var(--blue);
}
.check-q_text {
  font-size: var(--size-18);
  letter-spacing: -0.02em;
  max-width: 34em;
}
.check-q_opts {
  display: flex;
  gap: 0.5em;
}
.check-q_opts label {
  position: relative;
  display: inline-flex;
}
.check-q_opts input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.check-q_opts span {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 0.55em 1.25em;
  font-family: "TWK Everett Mono", monospace;
  text-transform: uppercase;
  font-size: 0.75em;
  letter-spacing: 0.04em;
  color: var(--white-50);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.check-q_opts input:hover + span {
  border-color: #3b4247;
}
.check-q_opts input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.check-q_opts input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.check-actions {
  flex-wrap: wrap;
}
.check-result {
  max-width: 44em;
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.check-result h2 {
  font-size: var(--size-h3);
  letter-spacing: -0.03em;
}
.check-gaps {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  border-top: 1px solid var(--border-default);
  padding-top: 1em;
}
.check-gaps li {
  display: flex;
  gap: 0.7em;
  font-size: var(--size-16);
  color: var(--white-50);
  letter-spacing: -0.02em;
}
.check-gaps li::before {
  content: "";
  flex: none;
  width: 0.4em;
  height: 0.4em;
  margin-top: 0.55em;
  background: var(--blue);
}