/* ---------------------------------------------------------------------------
   Components.

   Deliberately absent: pills, eyebrow chips, feature-card grids, rounded icon
   tiles, gradients, glass, glows, box shadows, and check marks. Each is either
   ruled against in the app's own design language or listed as a tell of
   generic landing-page design.
   --------------------------------------------------------------------------- */

/* --- language switch ------------------------------------------------------- */

/* Two links, not a listbox. Fully keyboard accessible, works with no
   JavaScript, and cannot end up with incomplete ARIA semantics. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: var(--stroke-hairline) solid var(--hairline);
  border-radius: var(--radius-tile);
  overflow: hidden;
}

.lang-switch__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding-inline: var(--space-label);
  color: var(--text-secondary);
  font-size: var(--fs-sub);
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color var(--dur-quick) var(--ease-standard),
    color var(--dur-quick) var(--ease-standard);
}

.lang-switch__link + .lang-switch__link {
  border-left: var(--stroke-hairline) solid var(--hairline);
}

.lang-switch__link:hover {
  color: var(--ink);
}

/* The current language is marked by weight and surface as well as colour, so
   the state is never carried by colour alone. */
.lang-switch__link[aria-current="true"] {
  background-color: var(--inset);
  color: var(--ink);
  font-weight: 600;
}

/* --- product proof row ----------------------------------------------------- */

/* Plain text separated by rules. Not pills, not cards, not a grid of icons. */
.proof {
  list-style: none;
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.proof__item {
  padding-block: var(--space-group);
  border-bottom: var(--stroke-hairline) solid var(--hairline);
  color: var(--ink);
  font-size: var(--fs-sub);
}

/* Four short facts do not need four full-width rows on a phone. Two columns
   read as one row of pairs and halve what the row costs. */
@media (max-width: 47.99rem) {
  .proof {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-section);
  }
}

@media (min-width: 48rem) {
  .proof {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: var(--stroke-hairline) solid var(--hairline);
  }

  .proof__item {
    padding-inline: var(--space-section);
    border-bottom: 0;
    font-size: var(--fs-sub);
  }

  .proof__item:first-child {
    padding-left: 0;
  }

  .proof__item + .proof__item {
    border-left: var(--stroke-hairline) solid var(--hairline);
  }
}

/* --- how it works ---------------------------------------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  gap: var(--space-label);
  padding-block: var(--space-block-sm);
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.step:last-child {
  border-bottom: var(--stroke-hairline) solid var(--hairline);
}

/* The numeral is the one place besides links and the primary action where the
   accent appears. It is a functional index, not decoration.

   `--link`, not `--accent`: in dark mode `--accent` is tuned to CARRY a light
   label (it clears 4.5:1 against --on-accent), not to BE text, and it measures
   only 3.58:1 as ink on the dark canvas. `--link` is the app's own answer to
   the same problem. In light mode the two values are identical. */
.step__index {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--link);
}

.step__body {
  max-width: var(--measure);
  color: var(--text-secondary);
}

.step__title {
  margin-bottom: var(--space-label);
}

@media (min-width: 48rem) {
  .step {
    grid-template-columns: 4rem minmax(0, 1fr);
    column-gap: var(--space-block);
  }

  .step__index {
    padding-top: 0.35em;
  }
}

/* --- figures --------------------------------------------------------------- */

/* Every figure on this site is an editorial diagram drawn in the site's own
   type, on the site's own surfaces. None of them is a screenshot, and none
   pretends to be one. See docs/landing/design-direction.md. */

.figure {
  margin: 0;
}

.figure__frame {
  background-color: var(--paper);
  border: var(--stroke-hairline) solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.figure__caption {
  margin-top: var(--space-label);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.figure__stage {
  padding: var(--space-group) var(--space-section);
}

.figure__stage + .figure__stage {
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.figure__stage-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-related);
  margin-bottom: var(--space-label);
  color: var(--text-secondary);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
}

/* `--link` for the same reason as `.step__index`: accent-as-ink needs the
   link tone in dark mode. */
.figure__stage-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--link);
}

/* --- the sample slip ------------------------------------------------------- */

/* Fully synthetic. No real account number, no real person, and nothing taken
   from the repository's slip fixtures, which hold real personal data. */
.slip {
  padding: var(--space-group);
  background-color: var(--inset);
  border: var(--stroke-hairline) solid var(--hairline);
  border-radius: var(--radius-tile);
}

.slip__head {
  padding-bottom: var(--space-label);
  margin-bottom: var(--space-label);
  border-bottom: var(--stroke-hairline) solid var(--hairline);
}

.slip__status {
  font-size: var(--fs-sub);
  font-weight: 600;
  color: var(--ink);
}

.slip__status-sub {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}

.slip__rows {
  display: grid;
  gap: var(--space-related);
  margin: 0;
}

.slip__row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: var(--space-label);
  align-items: baseline;
}

/* --text-secondary, not --text-muted: muted measures 2.73:1 on --inset, which
   is below both AA and the 3:1 graphical floor. The token's own rule binds it
   to --paper only, and this key sits on the inset slip surface. */
.slip__key {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.slip__val {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-caption);
  /* `break-word`, not `anywhere`: a masked account number must wrap as a whole
     token rather than splitting into "xxx-x-" and "x1234". */
  overflow-wrap: break-word;
}

/* Keeps a masked account, a reference, or an amount from breaking mid-token. */
.nowrap {
  white-space: nowrap;
}

.slip__val--amount {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* --- detected fields ------------------------------------------------------- */

.fields {
  display: grid;
  gap: 0;
  margin: 0;
}

.fields__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-label);
  padding-block: var(--space-related);
}

.fields__row + .fields__row {
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.fields__key {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.fields__val {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-caption);
  font-weight: 500;
  text-align: right;
}

.fields__val--mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-variant-numeric: tabular-nums;
}

/* --- a saved ledger row ---------------------------------------------------- */

.record {
  display: flex;
  align-items: center;
  gap: var(--space-label);
}

/* The category identity mark. 40pt in the app (sizeV2.markTile); the same
   object, scaled for the web. A rounded square, never a circle. */
.record__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-tile);
  background-color: var(--cat-neutral);
  color: var(--on-category);
}

.record__mark--food {
  background-color: var(--cat-food);
}

.record__mark svg {
  width: 20px;
  height: 20px;
}

.record__body {
  min-width: 0;
  flex: 1 1 auto;
}

.record__name {
  display: block;
  color: var(--ink);
  font-size: var(--fs-sub);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record__meta {
  display: block;
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.record__amount {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
}

/* --- the month figure ------------------------------------------------------ */

.month__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-label);
  margin-bottom: var(--space-section);
}

.month__label {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.month__total {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink);
}

.month__delta {
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

.month__rows {
  display: grid;
  gap: var(--space-label);
  margin: 0;
}

.month__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-tight) var(--space-label);
  align-items: baseline;
}

.month__name {
  color: var(--ink);
  font-size: var(--fs-caption);
}

.month__value {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* The bar carries the same hue as the category mark, so the figure reads as
   one system. The number beside it carries the same information, so nothing
   depends on colour. */
.month__track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: var(--radius-viz);
  background-color: var(--inset);
  overflow: hidden;
}

.month__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background-color: var(--cat-neutral);
}

.month__bar--food {
  background-color: var(--cat-food);
}

.month__bar--grocery {
  background-color: var(--cat-grocery);
}

.month__bar--transport {
  background-color: var(--cat-transport);
}

.month__bar--bills {
  background-color: var(--cat-bills);
}

/* A real explanatory sentence, so it takes the AA tone rather than the ~3.1:1
   footnote tone. Nothing on a public page should ship sub-AA body text. */
.month__note {
  margin-top: var(--space-section);
  padding-top: var(--space-label);
  border-top: var(--stroke-hairline) solid var(--hairline);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
}

/* --- reviewed field list (product evidence) -------------------------------- */

.checklist {
  list-style: none;
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.checklist li {
  padding-block: var(--space-label);
  border-bottom: var(--stroke-hairline) solid var(--hairline);
  color: var(--ink);
  font-size: var(--fs-sub);
}

/* Seven short values do not need seven full-width rows. Below the wide
   breakpoint they pair up, which is also how the app itself lists them. */
@media (max-width: 61.99rem) {
  .checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-section);
  }

  /* An odd count leaves a gap in the second column, so the last row keeps its
     rule across the full width instead of stopping halfway. */
  .checklist li:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* --- privacy --------------------------------------------------------------- */

.privacy__statement {
  max-width: var(--measure);
  color: var(--text-secondary);
}

.flow-table-wrap {
  margin-top: var(--space-block-sm);
  /* Wide content scrolls inside its own container. The page body never does. */
  overflow-x: auto;
  border: var(--stroke-hairline) solid var(--hairline);
  border-radius: var(--radius-card);
  background-color: var(--paper);
}

.flow-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: var(--fs-sub);
}

.flow-table caption {
  padding: var(--space-group) var(--space-section);
  border-bottom: var(--stroke-hairline) solid var(--hairline);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  text-align: left;
}

.flow-table th,
.flow-table td {
  padding: var(--space-label) var(--space-section);
  text-align: left;
  vertical-align: top;
}

.flow-table thead th {
  background-color: var(--privacy-tint);
  color: var(--privacy-ink);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  white-space: nowrap;
}

.flow-table tbody tr + tr th,
.flow-table tbody tr + tr td {
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.flow-table tbody th {
  font-weight: 500;
  color: var(--ink);
}

.flow-table tbody td {
  color: var(--text-secondary);
}

/* --- FAQ ------------------------------------------------------------------- */

.faq {
  border-top: var(--stroke-hairline) solid var(--hairline);
}

.faq__item {
  border-bottom: var(--stroke-hairline) solid var(--hairline);
}

.faq__item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-group);
  min-height: 3.5rem;
  padding-block: var(--space-label);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-card-title);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq__item > summary:hover {
  color: var(--link);
}

/* A plus that becomes a minus. Rotation only, no colour-only signalling, and
   the open state is also exposed natively by <details>. */
.faq__sign {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.faq__sign::before,
.faq__sign::after {
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1.5px;
  background-color: currentColor;
  content: "";
}

.faq__sign::after {
  transform: rotate(90deg);
  transition: transform var(--dur-standard) var(--ease-standard);
}

.faq__item[open] .faq__sign::after {
  transform: rotate(0deg);
}

.faq__answer {
  max-width: var(--measure);
  padding-bottom: var(--space-section);
  color: var(--text-secondary);
}

.faq__answer > * + * {
  margin-top: var(--space-label);
}

/* --- language hint --------------------------------------------------------- */

/* Shown only when a stored preference differs from the page being read. It
   offers, it never redirects, and it is real markup in the HTML rather than a
   sentence invented by script. */
.lang-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-label);
  padding-block: var(--space-label);
  border-bottom: var(--stroke-hairline) solid var(--hairline);
  color: var(--text-secondary);
  font-size: var(--fs-sub);
}

.lang-hint[hidden] {
  display: none;
}

.lang-hint__dismiss {
  min-height: var(--tap-min);
  padding: 0 var(--space-related);
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.lang-hint__dismiss:hover {
  color: var(--ink);
}

/* --- placeholder ----------------------------------------------------------- */

/* A field that still needs a real value. Marked in text as well as in tone, so
   it is never invisible to a reader who cannot see the colour difference. */
.placeholder {
  padding: 0.1em 0.3em;
  background-color: var(--privacy-tint);
  border-radius: var(--radius-chip);
  color: var(--privacy-ink);
  font-family: var(--font-mono);
  font-size: 0.9em;
  white-space: nowrap;
}
