/* ------------------------------------------------------------------
   Article formatting pilot — presentation components (v2).
   Scoped to `.fmt` (added on the article body wrapper) so nothing here
   touches live articles. Colors are the site's existing tokens; the only
   additions are an amber tint (warnings, caps) and a green tint
   (eligibility, success) used inside callouts and checklist markers.
   v2: every block is a real card (tinted fill + rounded border), data
   tables live inside cards instead of drawing their own grid, callouts
   carry an unmistakable state color, and sections are separated by rules.
   ------------------------------------------------------------------ */
.fmt {
  --fmt-ok: #6fd39a;
  --fmt-ok-bg: rgba(111, 211, 154, 0.13);
  --fmt-ok-line: rgba(111, 211, 154, 0.45);
  --fmt-warn: #f2b84b;
  --fmt-warn-bg: rgba(242, 184, 75, 0.13);
  --fmt-warn-line: rgba(242, 184, 75, 0.5);
  --fmt-info-bg: rgba(126, 232, 250, 0.10);
  --fmt-accent-line: rgba(126, 232, 250, 0.38);
  --fmt-card-bg: rgba(255, 255, 255, 0.045);
  --fmt-card-line: rgba(255, 255, 255, 0.12);
  --fmt-hairline: rgba(255, 255, 255, 0.08);
  --fmt-radius: 14px;
}

/* Section rhythm: each h2 opens a new section with a rule above it. */
.fmt h2 { margin: 34px 0 12px; padding-top: 22px; border-top: 1px solid var(--fmt-hairline); }
.fmt > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.fmt h3 { margin: 22px 0 10px; }
.fmt .fmt-muted { color: var(--text-muted); font-size: 13px; }

/* ---- Callouts: state carried by fill, border, label color and a glyph. ---- */
.fmt .fmt-callout {
  position: relative;
  border: 1px solid var(--fmt-accent-line);
  border-left-width: 4px;
  background: var(--fmt-info-bg);
  border-radius: var(--fmt-radius);
  padding: 16px 18px 16px 20px;
  margin: 0 0 20px;
}
.fmt .fmt-callout > :last-child { margin-bottom: 0; }
.fmt .fmt-callout--warn { border-color: var(--fmt-warn-line); border-left-color: var(--fmt-warn); background: var(--fmt-warn-bg); }
.fmt .fmt-callout--ok { border-color: var(--fmt-ok-line); border-left-color: var(--fmt-ok); background: var(--fmt-ok-bg); }
.fmt .fmt-callout--info { border-left-color: var(--accent); }
.fmt .fmt-callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.fmt .fmt-callout-label::before {
  content: "i";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent-text);
  background: var(--accent);
}
.fmt .fmt-callout--warn .fmt-callout-label { color: var(--fmt-warn); }
.fmt .fmt-callout--warn .fmt-callout-label::before { content: "!"; background: var(--fmt-warn); color: #1a1200; }
.fmt .fmt-callout--ok .fmt-callout-label { color: var(--fmt-ok); }
.fmt .fmt-callout--ok .fmt-callout-label::before { content: "\2713"; background: var(--fmt-ok); color: #06200f; }
.fmt .fmt-callout p { color: var(--text); }
.fmt .fmt-callout-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.05;
  color: var(--text);
  margin: 4px 0 12px;
  font-variant-numeric: tabular-nums;
}

/* ---- Card wrapper for data tables (tier tables, lookups). ---- */
.fmt .fmt-block {
  background: var(--fmt-card-bg);
  border: 1px solid var(--fmt-card-line);
  border-radius: var(--fmt-radius);
  margin: 0 0 20px;
  overflow: hidden;
}
.fmt .fmt-block-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  padding: 14px 18px 0;
}
.fmt .fmt-block-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 2px 18px 0;
}
.fmt .fmt-block-title + table,
.fmt .fmt-block-sub + table { margin-top: 10px; }
.fmt .fmt-block--inner { margin: 12px 0 4px; }

/* Tables inside any card: no outer grid, hairline rows, quiet header,
   right-aligned tabular figures. Overrides the site's bordered table look. */
.fmt .fmt-block table,
.fmt .fmt-example table {
  display: table;
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.fmt .fmt-block table th,
.fmt .fmt-block table td,
.fmt .fmt-example table th,
.fmt .fmt-example table td {
  border: 0;
  border-bottom: 1px solid var(--fmt-hairline);
  padding: 11px 18px;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
}
.fmt .fmt-block table th,
.fmt .fmt-example table th {
  color: var(--text-muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.fmt .fmt-block table td:first-child,
.fmt .fmt-example table td:first-child { color: var(--text); }
.fmt .fmt-block table td:not(:first-child),
.fmt .fmt-block table th:not(:first-child),
.fmt .fmt-example table td:not(:first-child),
.fmt .fmt-example table th:not(:first-child) { text-align: right; }
.fmt .fmt-block table tbody tr:last-child td,
.fmt .fmt-example table tbody tr:last-child td { border-bottom: 0; }
.fmt .fmt-block table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.fmt .fmt-block table tr.fmt-row--cap td { color: var(--fmt-warn); font-weight: 600; }
.fmt .fmt-block table tr.fmt-row--cap td:first-child { color: var(--fmt-warn); }

/* ---- Numbered steps (sequences) and numbered checklists (conditions). ---- */
.fmt .fmt-steps,
.fmt .fmt-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  counter-reset: fmt;
  display: grid;
  gap: 10px;
}
.fmt .fmt-steps > li,
.fmt .fmt-checklist > li {
  counter-increment: fmt;
  position: relative;
  margin: 0;
  padding: 14px 16px 14px 58px;
  border: 1px solid var(--fmt-card-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card-bg);
  line-height: 1.55;
  color: var(--text-muted);
}
.fmt .fmt-steps > li::before,
.fmt .fmt-checklist > li::before {
  content: counter(fmt);
  position: absolute;
  left: 16px;
  top: 13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-text);
  background: var(--accent);
}
.fmt .fmt-checklist > li::before {
  background: var(--fmt-ok-bg);
  color: var(--fmt-ok);
  border: 1px solid var(--fmt-ok-line);
}
.fmt .fmt-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Side-by-side comparison: ONE card whose sides are split by a divider,
   so the pairing reads as a single object rather than loose tiles. Border a
   touch stronger than the other cards; the highlighted side (the default or
   base option) carries the accent tint and accent label/value. ---- */
.fmt .fmt-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  margin: 0 0 18px;
  background: var(--fmt-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--fmt-radius);
  overflow: hidden;
}
.fmt .fmt-card {
  position: relative;
  border: 0;
  background: transparent;
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fmt .fmt-card + .fmt-card { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.fmt .fmt-card--highlight { background: var(--fmt-info-bg); }
.fmt .fmt-card-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.fmt .fmt-card--highlight .fmt-card-label { color: var(--accent); }
.fmt .fmt-card-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.12;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}
.fmt .fmt-card--highlight .fmt-card-value { color: var(--accent); }
.fmt .fmt-card-value--sm { font-size: 19px; }
.fmt .fmt-card p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
@media (max-width: 560px) {
  .fmt .fmt-compare { grid-template-columns: 1fr; }
  .fmt .fmt-card + .fmt-card { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
}

/* ---- Tier strip: many small tiers, one number each. ---- */
.fmt .fmt-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
/* Keep tier rows even: never one tile orphaned on its own row. */
@media (max-width: 720px) { .fmt .fmt-tiers { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .fmt .fmt-tiers { grid-template-columns: repeat(2, 1fr); } }
.fmt .fmt-tier {
  border: 1px solid var(--fmt-card-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card-bg);
  padding: 14px 10px 12px;
  text-align: center;
}
.fmt .fmt-tier-size {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.fmt .fmt-tier-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--accent);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ---- Boxed worked example: header band, inputs table, arithmetic, result. ---- */
.fmt .fmt-example {
  border: 1px solid var(--fmt-accent-line);
  border-radius: var(--fmt-radius);
  margin: 0 0 20px;
  background: var(--fmt-card-bg);
  overflow: hidden;
}
.fmt .fmt-example-head {
  padding: 12px 18px 11px;
  background: var(--fmt-info-bg);
  border-bottom: 1px solid var(--fmt-accent-line);
}
.fmt .fmt-example-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.fmt .fmt-example-sub {
  font-size: 11.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.fmt .fmt-example-body { padding: 4px 0 16px; }
.fmt .fmt-example-body > p { padding: 0 18px; }
.fmt .fmt-example-body > table { margin-bottom: 12px; }
.fmt .fmt-calc {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--fmt-card-line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 18px;
  overflow-x: auto;
  text-align: center;
}
.fmt .fmt-result { color: var(--accent); font-weight: 500; margin-bottom: 0; }
.fmt .fmt-example-body > p:last-child { margin-bottom: 0; }

/* ---- Formula and definitions. ---- */
.fmt .fmt-formula {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--fmt-accent-line);
  background: var(--fmt-info-bg);
  border-radius: var(--fmt-radius);
  padding: 16px 18px;
  margin: 0 0 16px;
  text-align: center;
  overflow-x: auto;
}
.fmt .fmt-defs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 18px;
  margin: 0 0 20px;
  font-size: 14px;
  border: 1px solid var(--fmt-card-line);
  border-radius: var(--fmt-radius);
  background: var(--fmt-card-bg);
  padding: 6px 18px;
}
.fmt .fmt-defs dt,
.fmt .fmt-defs dd { padding: 9px 0; border-bottom: 1px solid var(--fmt-hairline); }
.fmt .fmt-defs dt:nth-last-of-type(1),
.fmt .fmt-defs dd:nth-last-of-type(1) { border-bottom: 0; }
.fmt .fmt-defs dt { color: var(--text); font-weight: 600; }
.fmt .fmt-defs dd { margin: 0; color: var(--text-muted); }
.fmt .fmt-benefits li { margin-bottom: 8px; }

@media (max-width: 560px) {
  .fmt .fmt-defs { grid-template-columns: 1fr; }
  .fmt .fmt-defs dt { border-bottom: 0; padding-bottom: 0; }
}

/* ---- Batch 1 additions (2-Step Pro V2 rollout). ---- */
/* Text tables (Rule / Details, Term / Meaning): every column left-aligned. */
.fmt .fmt-block table.fmt-table--text td:not(:first-child),
.fmt .fmt-block table.fmt-table--text th:not(:first-child) { text-align: left; }
/* Lists inside cards, callouts and examples. */
.fmt .fmt-card ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.fmt .fmt-card li { margin-bottom: 4px; }
.fmt .fmt-card p + ul { margin-top: 2px; }
.fmt .fmt-callout li { color: var(--text); }
.fmt .fmt-example-body > ul { margin: 6px 0 0; padding: 0 18px 0 38px; }
.fmt .fmt-example-body > ul li { margin-bottom: 4px; }
.fmt .fmt-example-body > ul + table,
.fmt .fmt-example-body > p + table { margin-top: 10px; }
.fmt .fmt-example-body > .fmt-calc + table { margin-top: 4px; }
/* A side that carries a restriction or failure state. */
.fmt .fmt-card--restricted { background: var(--fmt-warn-bg); }
.fmt .fmt-card--restricted .fmt-card-label,
.fmt .fmt-card--restricted .fmt-card-value { color: var(--fmt-warn); }
/* Three-way comparison: fixed three columns so no side is orphaned. */
.fmt .fmt-compare--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .fmt .fmt-compare--3 { grid-template-columns: 1fr; } }
/* Value chips (e.g. the list of available account sizes). */
.fmt .fmt-chips { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.fmt .fmt-chips li {
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--fmt-card-line);
  background: var(--fmt-card-bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
/* Steps that carry a screenshot. */
.fmt .fmt-steps img {
  display: block;
  max-width: 100%;
  margin: 12px 0 2px;
  border-radius: 10px;
  border: 1px solid var(--fmt-card-line);
}
.fmt .fmt-example-head .fmt-example-title:only-child { margin: 0; }

/* ---- Batch 2 additions (Account Types Overview). ---- */
/* Chips carrying words rather than values (e.g. a list of countries). */
.fmt .fmt-chips--text li { font-family: var(--font-body); font-weight: 500; font-size: 13.5px; }

/* ---- Tier strip: optional name line under the value (Loyalty levels). ---- */
.fmt .fmt-tier-name {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Matrix table: one label column plus several equal value columns
   (benefits by Level). The block scrolls sideways when it cannot fit. ---- */
.fmt .fmt-block--scroll { overflow-x: auto; }
.fmt .fmt-block table.fmt-table--matrix { font-size: 13.5px; }
.fmt .fmt-block table.fmt-table--matrix th:not(:first-child),
.fmt .fmt-block table.fmt-table--matrix td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}
.fmt .fmt-block table.fmt-table--matrix td:first-child { min-width: 150px; }
.fmt .fmt-block table.fmt-table--matrix th small {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.85;
}

/* ---- Button-styled in-article links (the source used Intercom buttons). ---- */
.fmt .fmt-button {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
}
.fmt .fmt-button:hover { background: var(--fmt-info-bg); text-decoration: none; }
.fmt .fmt-defs dd ul { margin: 4px 0 0; padding-left: 18px; }
.fmt .fmt-defs dd li + li { margin-top: 4px; }
