/* fxbyfox.com — banks mode (js/banks.js): a country on top, a card per currency with every bank of that country.
   Uses the app's tokens and card parts from app.css. */

/* the strip above the cards: two halves — units | banks (or back to the currencies) */
.strips { display: flex; gap: 8px; margin: 0 0 10px; }
.strips .u-strip { flex: 1 1 0; min-width: 0; margin: 0; }
/* the currency screen: units only; the banks are the bank square in the source bar. In the mode: back to the currencies */
body:not(.bank-mode) .strips .bk-strip { display: none; }
/* no arrow: the text gets the room; on phones a long one goes on a second, smaller line instead of being cut */
.strips .u-strip .go { display: none; }
body:not(.bank-mode) .strips .u-strip .go { display: block; }
/* the banks mode: units | currencies half and half; the units half is just its name (no group after it) */
body.bank-mode #uStripTx i { display: none; }
/* the banks mode's way back: an arrow and «Валюты» in the accent */
.bk-strip .ic.back { stroke-width: 2.4; }
body.bank-mode .bk-strip .tx { color: var(--accent); font-weight: 600; }
@media (max-width: 959px) {
  /* two halves (the banks mode) */
  body.bank-mode .strips .u-strip { padding: 0 10px 0 12px; gap: 8px; }
  body.bank-mode .strips .u-strip .tx { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; }
}

body.bank-mode #cards, body.bank-mode #hint, body.bank-mode #btnLayout { display: none; }
.bk-box[hidden] { display: none; }
.bk-box { display: flex; flex-direction: column; gap: 10px; }

/* the country: the flag, the name (a search over the countries), online | cash where the banks have both */
.bk-country {
  display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 10px 14px 10px 12px;
  background: var(--card); border-radius: var(--r-card);
}
.bk-cn-w { flex: 1; min-width: 0; display: flex; }
.bk-seg[hidden] { display: none; }
.bk-cn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 2px 0; }
.bk-cn .flag { width: 40px; height: 40px; }
.bk-cn-t { min-width: 0; display: flex; flex-direction: column; }
.bk-cn-t b { display: flex; align-items: center; gap: 4px; font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-cn-t small .ago::before { content: ' · '; }
.bk-cn-t small { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-box svg.chev { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--dim); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .bk-cn:hover b { color: var(--accent); } }

.bk-seg { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--key-fn); }
.bk-seg button { flex: 1; padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.bk-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }

/* phones: the country stays under the header and the strip (app.css: .strips) while the cards scroll (as the main currency card) */
@media (max-width: 959px) {
  .bk-country { position: sticky; top: calc(var(--sat) + max(40px, var(--hb)) + 74px); z-index: 5; will-change: transform; }
  .bk-country::before {
    content: ""; position: absolute; z-index: -2; pointer-events: none;
    left: calc(-1 * var(--pad) - 2px); right: calc(-1 * var(--pad) - 2px); top: -56px; bottom: -10px; background: var(--bg);
  }
  .bk-country::after { content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0; border-radius: inherit; background: var(--card); }
  .bk-country .bk-seg button { padding: 6px 8px; }
  /* a card typed: the strip slides away and the country moves up into its place (js/banks.js place()) */
  .strips { transition: opacity .2s, transform .22s var(--ease); }
  body.bk-typing .strips { opacity: 0; transform: translateY(-10px); pointer-events: none; }
  .bk-country { transition: top .22s var(--ease); }
  body.bk-typing .bk-country { top: calc(var(--sat) + max(40px, var(--hb)) + 26px); }
  body.bk-typing .bk-country::before { top: -8px; }
  /* next to online | cash: «3 банка» and the time each on its own line, the time never split */
  .bk-cn-t small { font-size: 12px; line-height: 1.25; }
  .bk-cn-t small .ago { display: block; }
  .bk-cn-t small .ago::before { content: none; }
}

/* ----- the card of one currency ----- */
.bk-cards { display: flex; flex-direction: column; gap: 10px; touch-action: pan-y; overflow-anchor: none; } /* js keeps the card in view */
.bk-li { position: relative; }
.bk-li .sc {
  position: relative; padding: 14px 16px 8px; background: var(--card); border-radius: var(--r-card);
  border: 1.5px solid transparent; transition: border-color .2s, background .2s;
}
.bk-li .sc.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--card-active); }
.bk-li.swiping .sc { z-index: 1; }
@media (min-width: 960px) { .bk-li:hover .del { display: grid; } .bk-li .cur[title] { cursor: pointer; } }

.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; cursor: pointer; }
.sc-head .amt { cursor: pointer; }
/* the analytics button left of «Продаю | Покупаю» */
.bk-segrow { display: flex; align-items: stretch; gap: 8px; margin-bottom: 2px; }
.bk-segrow .bk-seg { flex: 1; display: flex; min-width: 0; }
.bk-anb { flex: none; width: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--key-fn); color: var(--accent); transition: background .15s; }
.bk-anb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .bk-anb:hover { background: var(--accent-soft); } }
@media (min-width: 960px) { .bk-segrow { max-width: 392px; } }

/* a row per bank: logo + name | price of one unit | the card's amount in the country's money; all left-aligned */
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 14px; align-items: center; }
.bk-h { padding: 10px 0 4px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.bk-line { grid-column: 1 / -1; height: 1px; background: var(--line); opacity: .7; }
.bk-n { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 0; font-weight: 600; font-size: 15px; }
.bk-n svg, .bk-n img.tb { flex: none; width: 26px; height: 26px; }
.bk-n > span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.2; overflow-wrap: anywhere;
}
.bk-r { font-size: 14px; color: var(--dim); white-space: nowrap; }
.bk-t { white-space: nowrap; cursor: pointer; margin: 0 -6px; padding: 4px 6px; border-radius: 8px; transition: background .15s; }
/* the total typed the other way round on the keypad */
.bk-t.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
@media (hover: hover) { .bk-t:hover { background: var(--accent-soft); } }
.bk-t b { display: flex; align-items: center; font-size: 16px; font-weight: 600; }
.bk-t small { display: block; margin-top: 1px; font-size: 12px; color: var(--muted); }
.bk-t.best b { color: var(--up); }
.bk-t.best b::after { content: ''; flex: none; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--up); }
.bk-n.off, .bk-r.off { color: var(--muted); font-weight: 500; }
.bk-n.off svg, .bk-n.off img.tb { opacity: .45; }
.bk-n.ref { color: var(--dim); font-weight: 500; }
.bk-t.ref b { color: var(--dim); font-weight: 500; font-size: 14px; }
svg.bk-reflogo { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.bk-none { padding: 10px 0 4px; font-size: 13px; color: var(--dim); }
.bk-note { text-align: center; color: var(--dim); font-size: 14px; padding: 18px 0; }
.bk-note:empty { display: none; }
@media (max-width: 959px) {
  .bk-li .sc { padding: 12px 14px 6px; }
  .bk-grid { column-gap: 12px; }
  .bk-n { gap: 8px; font-size: 14px; }
  .bk-n svg, .bk-n img.tb { width: 24px; height: 24px; }
  .bk-t b { font-size: 15px; }
}

/* swipes: right = this currency's country on top, left = away (the colours of the currency cards' swipes) */
.bk-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  border-radius: var(--r-card); background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: background .15s, color .15s;
}
.bk-li.swiping .bk-bg { opacity: 1; }
.bk-bg span { display: flex; align-items: center; gap: 8px; }
.bk-bg em { font-style: normal; }
.bk-bg svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bk-bg .r { display: none; }
.bk-bg.to-del { background: rgba(255, 107, 107, .16); color: var(--danger); }
.bk-bg.to-del .l { display: none; }
.bk-bg.to-del .r { display: flex; margin-left: auto; }
.bk-bg.armed { background: var(--accent); color: var(--accent-ink); }
.bk-bg.to-del.armed { background: var(--danger); color: #fff; }

/* the country search: the currency picker's look */
.bk-pick .pk-item .t span { color: var(--dim); }

/* ----- analytics: the cheapest way to cash (tap a card's flag) ----- */
.bk-li .cur .flag { cursor: pointer; }
.an-bud { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-radius: 14px; background: var(--card); font-size: 15px; color: var(--dim); }
.an-bud { cursor: pointer; border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.an-bud.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--card-active); }
.an-in { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-bud span:last-child { color: var(--text); font-weight: 600; }
.an-sec { margin-top: 14px; }
.an-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 2px 6px; min-height: 24px; font-size: 16px; font-weight: 600; }
.an-sec h3 .flag { width: 24px; height: 24px; font-size: 9px; box-shadow: none; }
.an-sec h3 small { font-size: 13px; font-weight: 400; color: var(--dim); }
/* the block's direction the other way round: on the right of its head */
.an-sec h3:has(.an-flip) { margin: 4px 2px 10px; }
.an-flip { flex: none; margin: 0 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--card); color: var(--accent); }
.an-flip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .an-flip:hover { background: var(--accent-soft); } }
.an-flip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the head's text turns the block too */
.an-sec h3 span[data-flip] { cursor: pointer; border-radius: 6px; }
.an-sec h3 span[data-flip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-sec h3 + .an-bud { margin: 0 0 6px; }
.an-row { cursor: pointer; border: 1.5px solid transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); margin-bottom: 6px; }
.an-row.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--card-active); }
.an-row.best { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--up) 60%, transparent); }
.an-t { min-width: 0; }
.an-t b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.an-t small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--dim); }
.an-t p { margin: 0; }
.an-t p + p { margin-top: 6px; }
.an-t b, .an-t small { text-wrap: pretty; }
.an-v { flex: none; text-align: right; white-space: nowrap; }
.an-v b { display: block; font-size: 16px; font-weight: 600; }
.an-row.best .an-v b { color: var(--up); }
.an-v small { display: block; font-size: 12px; color: var(--muted); }
.an-none { padding: 6px 2px; font-size: 13px; color: var(--dim); }
.an-note { margin: 14px 2px 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.an-sec .an-bud { margin-top: 2px; height: 44px; }
.an-sec .an-in { font-size: 18px; }
.an-bud[hidden] { display: none; }
/* the analytics screen (js/banks.js anView; the route's .chain look) */
.bk-anv .cs-body > .an-bud { margin-top: 4px; }

/* computer: the country stays under the strip, as on phones */
@media (min-width: 960px) {
  .bk-country { position: sticky; top: calc(var(--barh, 64px) + 62px); z-index: 5; }
  .bk-country::before {
    content: ""; position: absolute; z-index: -2; pointer-events: none;
    left: -14px; right: -14px; top: -62px; bottom: -10px;
    --px: calc(var(--lx, 0px) + 14px); --py: calc(0px - var(--barh, 64px)); /* the page's background: app.css */
  }
  .bk-country::after { content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0; border-radius: inherit; background: var(--card); }
}

/* computer: the analytics takes the cards' column (js/banks.js anPlace), the header and the chart stay */
@media (min-width: 960px) {
  body.an-col.chain-open { overflow: visible; }
  body.an-col .col-list > :not(.bk-anv) { display: none; }
  body .bk-anv.in-col { position: static; inset: auto; z-index: auto; background: none; }
  .bk-anv.in-col .cs-head, .bk-anv.in-col .cs-body { max-width: none; margin: 0; }
  /* the title row sticks where it stands (the list's 14px top), as the strip does on the currency screen */
  .bk-anv.in-col .cs-head {
    position: sticky; top: calc(var(--barh, 64px) + 14px); z-index: 6; padding: 0 0 10px;
    --px: var(--lx, 0px); --py: calc(-14px - var(--barh, 64px));
  }
  .bk-anv.in-col .cs-head::before {
    content: ""; position: absolute; pointer-events: none; left: -14px; right: -14px; top: -14px; height: 14px;
    --px: calc(var(--lx, 0px) + 14px); --py: calc(0px - var(--barh, 64px));
  }
  .bk-anv.in-col .cs-body { flex: none; overflow: visible; padding: 0 0 32px; }
}
