/* Bani24 — one stylesheet, one self-hosted typeface, nothing external.
   Design rules (operator, 2026-09): light and spacious, a single accent, no
   shadows, no gradients, no decoration; big right-aligned figures; one obvious
   converter. Colours are checked for WCAG AA contrast in both themes. */

/* Inter, SIL OFL 1.1 (fonts/OFL.txt). url() is rewritten to the hashed asset
   name at start-up (internal/web/assets.go). latin-ext is fetched only when a
   page uses its characters: Romanian ă, ș, ț. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/inter-latin-ext.34b9c504ca.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/inter-latin.3100e775e8.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial reshaped to Inter's metrics, so the swap does not move the layout. */
@font-face {
  font-family: "Inter Fallback"; src: local("Arial");
  size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.48%; line-gap-override: 0%;
}

:root {
  --bg: #ffffff;
  --soft: #f4f6f7;
  --field: #ffffff;
  --field-border: #7a8992; /* >= 3:1 on --soft and on --field (WCAG 1.4.11) */
  --text: #0e1a21;
  --muted: #52616b;
  --border: #e4e9ec;
  --accent: #0b5d5e;
  --btn-bg: #0b5d5e;
  --btn-bg-hover: #0c6667;
  --btn-ink: #ffffff;
  --up: #0a6b35;
  --down: #b3261e;
  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1315;
    --soft: #151d21;
    --field: #0d1315;
    --field-border: #64788a;
    --text: #e9eff2;
    --muted: #a3b2bc;
    --border: #232f36;
    --accent: #5ecbc0;
    /* the accent tint is for links and marks; as a button fill it would be
       the brightest thing on the page, louder than the figures */
    --btn-bg: #1f7a73;
    --btn-bg-hover: #1a6b65;
    --btn-ink: #ffffff;
    --up: #62d991;
    --down: #ff8f85;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 100%, not 16px: everything follows the visitor's default font size */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.55 var(--font);
  font-feature-settings: "cv11", "ss03";
}

h1, h2, p, ul, fieldset, legend { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 12px; top: -64px; z-index: 10; padding: 12px 18px; background: var(--text); color: var(--bg); border-radius: 10px; }
.skip-link:focus { top: 12px; }

/* controls that only work with the script keep their place while it loads,
   so nothing jumps when they appear */
.needs-js { visibility: hidden; }
.js .needs-js { visibility: visible; }

/* header */
.site-header { border-bottom: 1px solid var(--border); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1875rem; letter-spacing: -.02em; }
.brand-mark rect { fill: var(--btn-bg); }
.brand-mark path { stroke: var(--btn-ink); }
.brand-name b { font-weight: 700; color: var(--accent); }
.lang { display: flex; gap: 2px; }
.lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .9375rem; }
.lang a:hover { color: var(--text); text-decoration: underline; }
.lang a[aria-current] { color: var(--text); font-weight: 600; }

/* page title: the one headline of the page */
.page-head { padding: 56px 0 40px; }
.page-head h1 { font-size: clamp(2rem, 1.45rem + 2.4vw, 3rem); line-height: 1.1; font-weight: 750; letter-spacing: -.035em; }
.page-head .lead { margin-top: 12px; color: var(--muted); font-size: 1.0625rem; max-width: 44rem; }
.page-head-solo { padding: 96px 0 120px; }
.page-head-solo .btn { width: fit-content; margin-top: 28px; padding-inline: 28px; }

h2 { font-size: 1.375rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }

/* two columns on desktop: the converter stays in view, the table scrolls.
   minmax(0, …): an auto column would grow with the table and push the page
   sideways instead of letting .table-wrap scroll */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }

/* converter: the only tinted surface on the page */
.converter { background: var(--soft); border-radius: 20px; padding: 24px 28px 22px; }
.conv-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.converter h2 { flex: 1 1 0; font-size: 1.0625rem; font-weight: 650; letter-spacing: -.01em; padding-top: 2px; }
.conv-date { display: grid; justify-items: end; gap: 2px; margin-left: auto; }
.conv-date label { font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.conv-date input[type="date"] { width: 10.25rem; min-height: 44px; padding: 6px 10px; font-size: .9375rem; }

.conv-out { min-height: 10.4rem; margin-top: 4px; }
.conv-eq { color: var(--muted); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.conv-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; line-height: 1.1; margin-top: 2px; }
.conv-value { font-size: clamp(2.375rem, 1.7rem + 3vw, 3.25rem); font-weight: 750; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* set by the server and by converter.js from the figure's length (valueSize) */
.conv-value.len-m { font-size: min(2.25rem, 8.4vw); }
.conv-value.len-l { font-size: min(1.75rem, 6.4vw); }
.conv-value.len-xl { font-size: min(1.25rem, 4.2vw); white-space: normal; overflow-wrap: anywhere; }
.conv-cur { font-size: 1.375rem; font-weight: 650; color: var(--muted); }
.conv-rate { margin-top: 8px; font-variant-numeric: tabular-nums; font-weight: 550; }
.conv-basis { color: var(--muted); font-size: .9375rem; }
.conv-error { color: var(--down); font-weight: 600; }

.conv-actions { display: flex; gap: 20px; }
.text-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; border: 0; background: none;
  font: inherit; font-size: .9375rem; font-weight: 600; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
.text-btn:hover { text-decoration-color: currentColor; }
.text-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

.field { display: grid; gap: 6px; min-width: 0; margin-top: 12px; }
.field label, .vat-rate label { font-size: .875rem; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="date"], select {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit; font-size: 1.0625rem; color: var(--text);
  background: var(--field); border: 1px solid var(--field-border); border-radius: 12px;
}
input[type="text"] { font-variant-numeric: tabular-nums; }
input.input-lg { min-height: 60px; font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; }
select { text-overflow: ellipsis; }
input[aria-invalid="true"] { border-color: var(--down); border-width: 2px; }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0 8px; align-items: end; }
.swap {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 52px;
  color: var(--accent); background: var(--field); border: 1px solid var(--field-border); border-radius: 12px;
}
.swap:hover { border-color: var(--accent); }

.vat { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.vat-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.vat-rate label { flex: 1 1 0; font-size: .9375rem; color: var(--text); font-weight: 650; }
.vat-input { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-weight: 600; color: var(--muted); }
.vat-input input[type="text"] { width: 4.75rem; min-height: 44px; padding: 8px 10px; text-align: right; font-weight: 600; }
.vat-presets { display: flex; gap: 6px; }
.chip { min-height: 44px; min-width: 52px; padding: 0 10px; font: inherit; font-size: .875rem; font-weight: 600; color: var(--text); background: var(--field); border: 1px solid var(--field-border); border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.vat-out { min-height: 5.6rem; margin-top: 6px; }
.vat-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 14px; align-items: center; min-height: 44px; }
.vat-line + .vat-line { border-top: 1px solid var(--border); }
.vat-label { color: var(--muted); font-size: .9375rem; }
.vat-num { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.vat-cur { color: var(--muted); font-weight: 600; }
.hint { margin-top: 6px; color: var(--muted); font-size: .8125rem; }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 18px; padding: 0 22px;
  font: inherit; font-size: 1.0625rem; font-weight: 650; color: var(--btn-ink); background: var(--btn-bg);
  border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--btn-bg-hover); }
/* with the script every change converts at once; the button is only needed
   without it, or when the script could not fetch the chosen date's rates
   (.conv-stuck): then the plain GET form, which always works, takes over. It
   sits far below the first screen, so removing it shifts nothing visible. */
.js form:not(.conv-stuck) .conv-submit { display: none; }

.conv-options { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0 22px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* rates table: hairlines, big right-aligned figures, colour only beside the arrow */
.rates h2 { margin-top: 4px; }
.source-line { margin-top: 8px; color: var(--muted); font-size: .9375rem; }
.table-wrap { position: relative; overflow-x: auto; margin-top: 12px; }
.rates-table, .preset { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rates-table th, .rates-table td, .preset th, .preset td { padding: 15px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: baseline; }
.rates-table th:first-child, .preset th:first-child, .preset td:first-child { padding-left: 0; }
.rates-table th:last-child, .rates-table td:last-child, .preset th:last-child, .preset td:last-child { padding-right: 0; }
.rates-table thead th, .preset thead th { padding-block: 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rates-table tbody th { font-weight: 400; }
.num { text-align: right !important; }
.rates-table .rate { font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; }
.rates-table .col-abs, .rates-table .col-units { color: var(--muted); }
.rates-table .code { display: inline-block; min-width: 3.2em; font-weight: 700; }
.rates-table .name { color: var(--muted); }
.units-inline, .abs-inline { display: none; color: var(--muted); font-size: .8125rem; }
@media (hover: hover) { .rates-table tbody tr:hover, .preset tbody tr:hover { background: var(--soft); } }

/* change indicators: arrow shape + sign + colour, never colour alone */
.chg { white-space: nowrap; font-weight: 550; }
.chg-up { color: var(--up); }
.chg-down { color: var(--down); }
.chg-flat, .chg-new { color: var(--muted); }
.arrow { display: inline-block; width: 0; height: 0; margin-right: 6px; vertical-align: middle; border-inline: 5px solid transparent; }
.chg-up .arrow { border-bottom: 8px solid currentColor; margin-bottom: 3px; }
.chg-down .arrow { border-top: 8px solid currentColor; margin-top: 1px; }
.chg-flat .arrow { width: 10px; border: 0; border-top: 2px solid currentColor; }

/* preset amounts, links, about */
.presets, .page-links, .about { margin-top: 88px; }
.presets h2, .page-links h2, .about h2 { max-width: 37.5rem; }
.preset-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 20px; }
.preset td:last-child { font-weight: 650; }
.preset th:first-child, .preset td:first-child { width: 42%; }
.page-links ul { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; }
.page-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.about p { margin-top: 12px; max-width: 45rem; color: var(--muted); }

/* footer */
.site-footer { margin-top: 112px; border-top: 1px solid var(--border); padding: 32px 0 56px; color: var(--muted); font-size: .9375rem; }
.site-footer p + p { margin-top: 8px; }
.site-footer p { max-width: 50rem; }
.site-footer .source { color: var(--text); font-weight: 600; }

@media (min-width: 720px) {
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 72px; }
}

@media (min-width: 1000px) {
  .layout { grid-template-columns: 440px minmax(0, 1fr); gap: 64px; align-items: start; }
}
/* sticky at every desktop height. When the panel is taller than the window it
   scrolls inside itself, so its lower controls (VAT, options) stay reachable.
   No overscroll containment: the page must keep scrolling under the pointer. */
@media (min-width: 1000px) {
  .converter { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
}
/* narrow desktop: the table gives up two columns, as on phones, instead of
   wrapping currency names under their codes */
@media (min-width: 1000px) and (max-width: 1199px) {
  .layout { gap: 48px; }
  .rates-table .col-units, .rates-table .col-abs { display: none; }
  .rates-table .units-inline, .rates-table .abs-inline { display: block; }
  .rates-table .abs-inline { font-weight: 400; }
}
/* a name that does wrap hangs under itself, not under the code */
@media (min-width: 561px) {
  .rates-table tbody th:first-child { padding-left: 3.5em; text-indent: -3.5em; }
  .rates-table .code, .rates-table .units-inline { text-indent: 0; }
}

@media (max-width: 560px) {
  .wrap { width: min(1180px, 100% - 32px); }
  .page-head { padding: 28px 0 22px; }
  .page-head .lead { margin-top: 8px; font-size: 1rem; }
  .layout { gap: 44px; }
  .converter { margin-inline: -8px; padding: 20px 20px 18px; border-radius: 18px; }
  .conv-out { min-height: 9.5rem; }
  .page-head-solo .btn { width: 100%; }
  /* full-width lists show the whole currency name; the swap button sits beside them */
  .pair { grid-template-columns: minmax(0, 1fr) 48px; gap: 0 8px; align-items: center; }
  .pair .field { grid-column: 1; }
  .pair .swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 30px; width: 48px; height: 56px; }
  .pair .swap svg { transform: rotate(90deg); }
  .vat-line { grid-template-columns: minmax(0, 1fr) auto; }
  .vat-line .vat-label { grid-column: 1 / -1; padding-top: 8px; }
  .vat-num { text-align: left; }

  .col-abs, .col-units { display: none; }
  .rates-table th, .rates-table td { padding: 12px 4px; line-height: 1.3; }
  .rates-table thead th { white-space: normal; letter-spacing: .02em; line-height: 1.25; vertical-align: bottom; }
  .rates-table tbody th { width: 100%; }
  .rates-table .name { display: block; font-size: .8125rem; }
  .units-inline, .abs-inline { display: block; }
  .abs-inline { font-weight: 400; }
  .presets, .page-links, .about { margin-top: 64px; }
  .site-footer { margin-top: 72px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .swap, .chip, .text-btn { transition: filter .15s, background-color .15s, border-color .15s, text-decoration-color .15s; }
}

/* Windows contrast themes repaint borders: keep the triangles triangles */
@media (forced-colors: active) {
  .arrow { forced-color-adjust: none; }
  .chg-up .arrow { border-bottom-color: CanvasText; }
  .chg-down .arrow, .chg-flat .arrow { border-top-color: CanvasText; }
  .converter { border: 1px solid CanvasText; }
}

@media print {
  .site-header, .skip-link, .conv-actions, #conv-form, .conv-options { display: none; }
  .converter { background: none; padding: 0; }
  .page-head { padding: 0 0 16px; }
}
