/* feeless.money/exchange – mobile first, no external resources */
/* Colour tokens. Every text/background pair is checked in CI (tests/test_contrast.py):
   body and muted text >= 7:1 (WCAG AAA), everything else >= 4.5:1 (AA), borders >= 3:1.
   Colours are defined ONLY here; the rest of the file uses var(--...). */
:root {
  --bg: #fafaf7; --fg: #111214; --muted: #3b3e43; --line: #82868c; --card: #ffffff;
  --accent: #0a4796; --on-accent: #ffffff; --good: #0b5527; --good-bg: #e2f2e7;
  --warn: #5e3600; --warn-bg: #fff0d1; --bad: #8c1a13; --stale: #45484d; --nano: #0a6aa8;
  --focus: #0a4796;
  --radius: 10px; --gap: 12px;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* night: explicit choice ... */
:root[data-theme="dark"] {
  --bg: #0d0f12; --fg: #f3f3f1; --muted: #cdd1d6; --line: #7a8089; --card: #171a1f;
  --accent: #a6c8ff; --on-accent: #0d0f12; --good: #96e3ae; --good-bg: #0f2618;
  --warn: #ffd685; --warn-bg: #2b220e; --bad: #ffb0a8; --stale: #c2c6cc; --nano: #5cbcf5;
  --focus: #ffd685;
  color-scheme: dark;
}
/* ... or system setting when nothing was chosen (same values as above) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12; --fg: #f3f3f1; --muted: #cdd1d6; --line: #7a8089; --card: #171a1f;
    --accent: #a6c8ff; --on-accent: #0d0f12; --good: #96e3ae; --good-bg: #0f2618;
    --warn: #ffd685; --warn-bg: #2b220e; --bad: #ffb0a8; --stale: #c2c6cc; --nano: #5cbcf5;
    --focus: #ffd685;
    color-scheme: dark;
  }
}
/* base font 18 px, five steps via the A-/A+ buttons (web/prefs.js) */
html { font-size: 18px; }
html[data-fs="1"] { font-size: 20px; }
html[data-fs="2"] { font-size: 22px; }
html[data-fs="3"] { font-size: 25px; }
html[data-fs="4"] { font-size: 28px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; }
.xc { max-width: 1100px; margin: 0 auto; padding: 16px; overflow-wrap: anywhere; }
a { color: var(--accent); }
h1 { font-size: 1.45rem; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.xc-lead { margin: 0 0 6px; color: var(--muted); }
.xc-message { margin: 0 0 8px; font-weight: 600; }
.xc-lang { display: flex; gap: 10px; font-size: .9rem; }
.xc-lang a[aria-current="true"] { font-weight: 700; text-decoration: none; color: var(--fg); }

/* form */
.xc-form { display: grid; grid-template-columns: 1fr; gap: 8px var(--gap); align-items: end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 14px 0; }
.xc-f { display: flex; flex-direction: column; gap: 3px; font-size: 0.9rem; color: var(--muted); min-width: 0; }
.xc-amount, .xc-f:has(#payout), .xc-go { grid-column: 1 / -1; }
.xc-form input, .xc-form select { font: inherit; font-size: 1rem; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; }
.xc-swap { justify-self: center; font-size: 1.3rem; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); cursor: pointer; }
.xc-go { font: inherit; font-weight: 600; padding: 11px; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); cursor: pointer; }
@media (min-width: 720px) {
  .xc-form { grid-template-columns: 1fr 1.2fr auto 1.2fr 1fr auto; }
  .xc-amount, .xc-f:has(#payout), .xc-go { grid-column: auto; }
}

/* notices */
.xc-nano { border-left: 4px solid var(--nano); background: var(--card); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.xc-nano strong { display: block; margin-bottom: 4px; }
.xc-market { font-size: .9rem; color: var(--muted); margin: 8px 0; }
.xc-filters { border: 0; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; }
.xc-filters legend { font-weight: 600; float: left; margin-right: 8px; padding: 0; }
.xc-note, .xc-hint { font-size: 0.9rem; color: var(--muted); }
.xc-warn { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 4px 8px; font-size: 0.9rem; margin: 4px 0; }

/* sort bar is the mobile replacement for clickable headers */
.xc-sortbar { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin: 6px 0 10px; flex-wrap: wrap; }
.xc-sortbar select { font: inherit; padding: 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); max-width: 100%; }
.xc-btn-small, .xc-btn { font: inherit; font-size: 0.9rem; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; }
.xc-btn-aff { border-color: var(--nano); }

/* route table: cards on phones, table from 720 px */
.xc-table { width: 100%; border-collapse: collapse; }
.xc-table caption { text-align: left; font-size: 0.9rem; color: var(--muted); padding-bottom: 4px; }
.xc-table thead { display: none; }
.xc-table tr.xc-row { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 10px 12px; }
.xc-table td { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border: 0; text-align: right; }
.xc-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.9rem; text-align: left; flex: 0 0 auto; }
.xc-table td.c-route { display: block; text-align: left; }
.xc-table td.c-route::before { content: none; }
.xc-table td.c-final { font-size: 1.15rem; font-weight: 700; }
.xc-row.is-stale { border-style: dashed; }
.xc-row.is-stale td.c-final { color: var(--stale); }
@media (min-width: 720px) {
  .xc-sortbar { display: none; }
  .xc-table thead { display: table-header-group; }
  .xc-table tr.xc-row { display: table-row; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
  .xc-table td, .xc-table th { display: table-cell; padding: 8px 6px; vertical-align: top; text-align: right; }
  .xc-table td::before { content: none; }
  .xc-table th { font-size: 0.9rem; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid var(--line); }
  .xc-table th.c-route, .xc-table td.c-route { text-align: left; }
  .xc-table td.c-final { font-size: 1rem; }
  .xc-table th button { all: unset; cursor: pointer; }
  .xc-table th button:focus-visible { outline: 2px solid var(--accent); }
  .xc-table th[aria-sort="ascending"] button::after { content: " ▲"; }
  .xc-table th[aria-sort="descending"] button::after { content: " ▼"; }
}
.c-route .xc-short { font-weight: 600; }
.xc-gain { color: var(--good); background: var(--good-bg); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.xc-small { font-size: 0.9rem; color: var(--muted); }
.xc-badge { display: inline-block; font-size: 0.9rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin: 1px 2px; white-space: nowrap; color: var(--muted); }
.xc-badge.k-executable { border-color: var(--good); color: var(--good); }
.xc-badge.k-manual { border-color: var(--warn); color: var(--warn); }
.xc-badge.f-stale, .xc-badge.f-manual_old, .xc-badge.f-unverified { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.xc-badge.f-expired, .xc-badge.f-nodata { background: none; color: var(--bad); border-color: var(--bad); }
.xc-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }

/* step details */
.xc-steps summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); margin-top: 4px; }
.xc-steps ol { margin: 6px 0 0; padding-left: 20px; font-size: 0.9rem; }
.xc-steps li { margin-bottom: 8px; }
.xc-steps dl { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; margin: 2px 0; }
.xc-steps dt { color: var(--muted); }
.xc-steps dd { margin: 0; }

/* simple tables (buy, sources, intermediates) -> stacked on phones */
.xc-simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
.xc-simple th, .xc-simple td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.xc-simple th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
@media (max-width: 719px) {
  .xc-simple thead { display: none; }
  .xc-simple tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; padding: 6px 10px; background: var(--card); }
  .xc-simple td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 2px 0; text-align: right; }
  .xc-simple td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: 0 0 auto; white-space: nowrap; }
  .xc-simple td:empty { display: none; }
}

.xc-unranked { margin-top: 10px; }
.xc-unranked summary { cursor: pointer; font-weight: 600; }
.xc-unranked .xc-table tr.xc-row { border-style: dashed; }

/* ads */
.xc-ad { margin: 16px 0; }
.xc-ad:empty { display: none; }
.xc-ad-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; text-align: center; font-size: .9rem; color: var(--muted); }
.xc-ad-box img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.xc-ad-label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.xc-faq details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.xc-faq summary { cursor: pointer; font-weight: 600; }
.xc-foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.xc-error { color: var(--bad); font-weight: 600; }
.xc-spend-group ul { padding-left: 18px; }
.xc-spend-group li { margin-bottom: 6px; }
.xc-center { justify-content: center; }
/* stats viewer */
.xc-form-stats { grid-template-columns: 1fr; }
.xc-wide { grid-column: 1 / -1; }
.xc-scroll { overflow-x: auto; }
.xc-stats td, .xc-stats th { white-space: nowrap; }
.xc-keys code { word-break: break-all; }
.xc-stats { border-collapse: collapse; font-size: 0.9rem; }
.xc-stats th, .xc-stats td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.xc-stats th[scope="row"] { text-align: left; color: var(--muted); font-weight: 600; }
.xc-chain { font-size: 0.9rem; color: var(--muted); margin-top: 2px; }
.xc-missing { font-size: 0.9rem; color: var(--warn); margin-top: 2px; }

/* day/night + font size toolbar */
.xc-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.xc-tools button { font: inherit; font-size: 1rem; font-weight: 600; min-height: 44px; min-width: 44px; padding: 6px 14px;
  border-radius: 8px; border: 2px solid var(--fg); background: var(--card); color: var(--fg); cursor: pointer; }
.xc-tools button:disabled { border-style: dashed; cursor: default; }
.xc-tools .xc-theme { border-color: var(--accent); color: var(--accent); }
input[type="checkbox"] { width: 1.25em; height: 1.25em; accent-color: var(--accent); vertical-align: -0.2em; }

/* Embedded in NanoTracker (?embed=1): theme comes from the parent page, so no own theme button */
:root[data-embed="1"] .xc-tools .xc-theme { display: none; }

/* Land (von/nach) */
.xc-land { display: grid; grid-template-columns: 1fr; gap: 8px var(--gap); margin: 8px 0 0; }
@media (min-width: 720px) { .xc-land { grid-template-columns: 1fr 1fr; max-width: 640px; } }
.xc-land select { font: inherit; font-size: 1rem; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.xc-landtax { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }

/* feeless.money-Kopfleiste (eingesetzt von /opt/feeless/navigation.py zwischen <!--LEISTE--> … <!--/LEISTE-->) */
.kopf { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.kopfin { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 6px 16px; }
.kopf .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 600; }
.kopf .logo img { width: 36px; height: 36px; border-radius: 8px; background: var(--card); }
.kopf .logo b { color: var(--accent); }
.kopf .mnchk { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kopf .mnbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; color: var(--fg); }
.kopf .mnchk:focus-visible + .mnbtn { outline: 2px solid var(--focus); outline-offset: 2px; }
.kopf .hauptnav { display: none; flex-basis: 100%; }
.kopf .mnchk:checked ~ .hauptnav { display: block; }
.kopf .hauptnav ul { list-style: none; margin: 0; padding: 0 0 8px; display: flex; flex-direction: column; }
.kopf .hauptnav a { display: block; padding: 10px 8px; color: var(--fg); text-decoration: none; border-radius: 6px; }
.kopf .hauptnav a:hover, .kopf .hauptnav a:focus-visible { text-decoration: underline; }
.kopf .hauptnav a.hier { font-weight: 700; text-decoration: underline; }
.fussleiste { max-width: 1100px; margin: 24px auto 0; padding: 16px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.fussleiste { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 4px; }
.fussleiste a { color: var(--accent); }
.fussleiste p { margin: 8px 0 0; flex-basis: 100%; }

/* Markierung statt Ausblenden, Laenderhinweise (Klapptext), Pruefung vor Umsetzung, Frei-Ansicht (25.10.2026) */
.xc-restricted { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 6px; background: var(--card); }
.xc-restricted p { margin: 6px 0 0; }
.xc-landnotes { margin: 8px 0 0; }
.xc-landbox { margin: 6px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.xc-landbox > summary { cursor: pointer; font-weight: 600; }
.xc-note-item { margin: 8px 0 0 8px; padding: 4px 0 4px 10px; border-left: 3px solid var(--line); }
.xc-note-item > summary { cursor: pointer; }
.xc-note-item p { margin: 6px 0 0; }
.xc-badge.f-restricted { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.xc-stand { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.xc-good { background: var(--good-bg); color: var(--good); border-radius: 6px; padding: 4px 8px; font-size: 0.9rem; margin: 4px 0; }
.xc-verify { margin: 12px 0; padding: 12px 14px; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--card); }
.xc-verify h2 { margin: 0 0 6px; font-size: 1.1rem; }
.xc-free h2 { font-size: 1.15rem; margin: 18px 0 6px; }
.xc-readlist { padding-left: 1.3em; }
.xc-readlist li { margin: 4px 0; }
.xc-probox { margin: 18px 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--nano); border-radius: 6px; background: var(--card); }
.xc-probox h2 { margin-top: 0; }
.xc-btn-verify { cursor: pointer; }

/* Layout 25.10.2026 (Johannes, Rueckgabe toKI): Desktop zweispaltig (Eingaben links, Ergebnis rechts), Handy gestapelt;
   Tabellenkopf fixiert; Hinweise als Aufklapper; Pro-Hinweis oben. */
:root { --sticky-top: 0px; }
body:has(header.kopf) { --sticky-top: 50px; }   /* feeless.money-Kopfleiste ist selbst sticky */
.xc-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
.xc-col-in, .xc-col-out { min-width: 0; }
@media (min-width: 800px) {
  .xc-cols { grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
  .xc:has(.xc-cols) { max-width: 1400px; }   /* two columns need the room the table had before (about 1090 px) */
  .xc-cols .xc-form { grid-template-columns: 1fr auto 1fr; margin-top: 0; }
  .xc-cols .xc-amount, .xc-cols .xc-f:has(#payout), .xc-cols .xc-go { grid-column: 1 / -1; }
  .xc-cols .xc-land { grid-template-columns: 1fr; max-width: none; }
  .xc-col-out .xc-results { margin-top: 0; }
}
@media (min-width: 720px) {
  .xc-table thead th { position: sticky; top: var(--sticky-top); background: var(--bg); z-index: 2; }
}
.xc-restricted > summary { cursor: pointer; font-weight: 600; }
.xc-restricted > summary::marker { color: var(--warn); }
.xc-restricted .xc-body { margin-top: 6px; }
.xc-probox-top { margin: 10px 0 18px; border: 2px solid var(--nano); border-left-width: 6px; }
.xc-probox-top .xc-btn-aff { font-weight: 700; font-size: 1rem; border-width: 2px; }
.xc-badge.f-usdt { background: var(--warn-bg); color: var(--warn); border-color: transparent; cursor: help; }
#f-nousdt-n:empty { display: none; }
@media (min-width: 720px) {
  /* the route column must keep room next to the narrow number columns (two-column layout) */
  .xc-table td.c-route { display: table-cell; }   /* the phone rule (display: block) won by specificity before: route column was squeezed */
  .xc-table th.c-route, .xc-table td.c-route { width: 42%; min-width: 230px; }
  .xc-table td.c-final { overflow-wrap: normal; }
  .xc-table td.c-cost, .xc-table td.c-gain, .xc-table td.c-dur, .xc-table td.c-steps, .xc-table td.c-kyc { overflow-wrap: normal; }   /* wrap at spaces, never inside a number */
  .xc-cols .xc-table th { white-space: normal; overflow-wrap: normal; }
}
/* two columns from 800 px (Johannes 25.10.2026): between 800 and 1099 px the table needs more room than is left next to the inputs,
   so the result column scrolls sideways there instead of being cut off (the sticky header only works above 1100 px) */
@media (min-width: 800px) and (max-width: 1099px) {
  .xc-cols { grid-template-columns: 250px minmax(0, 1fr); gap: 14px; }
  .xc-col-out { overflow-x: auto; }
}

/* 01.11.2026: kurze erste Spalte, Details hinter Klick, Hinweis einmal als Fussnote; oben Geld senden / unten Nano kaufen */
.xc-details > summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); margin-top: 4px; }
.xc-details .xc-short-path { font-weight: 400; font-size: 0.9rem; margin-top: 6px; }
.xc-info { text-decoration: none; color: var(--warn); font-weight: 400; }
.xc-routenotes { margin-top: 10px; }
.xc-jump { margin: 6px 0; font-size: .76rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.xc-jump a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 36px; padding: 0 1px; text-decoration: none; font-weight: 600; overflow-wrap: normal; }
.xc-jump a:hover, .xc-jump a:focus-visible { text-decoration: underline; }
.xc-jump a[aria-current="page"] { border-bottom: 3px solid currentColor; }
/* Eingebettet (?embed=1): Menue und Fusszeile bleiben (Anbieterkennzeichnung erreichbar), nur die Sprungleiste entfaellt */
html[data-embed="1"] .xc-jump { display: none !important; }
.xc-send > h2, .xc-buy > h2 { margin-top: 18px; }
.xc-buy { border-top: 2px solid var(--line); margin-top: 28px; padding-top: 4px; }
.xc-table td.c-route { overflow-wrap: anywhere; }

/* v2.1 (Johannes 01.11. 12:31): Von und Nach untereinander in voller Breite, Tauschknopf dazwischen - die gewaehlte Zeile ("USD – US-Dollar") bleibt komplett lesbar, kein Kuerzel-Abschneiden */
.xc-form, .xc-cols .xc-form { grid-template-columns: minmax(0, 1fr); }
.xc-amount, .xc-f:has(#payout), .xc-go, .xc-form .xc-f { grid-column: 1 / -1; }
.xc-form select { width: 100%; text-overflow: clip; }
.xc-swap { justify-self: center; margin: -2px 0; }

/* Anzeige (nur sichtbar, wenn ein Anbieter promoted: true hat) */
.xc-row.is-promoted { box-shadow: inset 3px 0 0 var(--nano); }
.xc-badge.xc-promoted { border-color: var(--nano); color: var(--fg, inherit); }

.xc-projekte { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.nt-link { border: 1px solid var(--line, #ccc); border-left: 4px solid #2a6; border-radius: 6px; padding: 10px 12px; margin: .8em 0; }
