/* ==========================================================================
   Financity — стилі, специфічні лише для currency.html
   Винесено зі спільного style.css (2025-09-02): перевірено скриптом
   usage-аналізу по всіх .html/.js файлах сайту — жоден клас із цього файлу
   не зустрічається поза currency.html / js/currency.js. Мета — не тягнути
   ці ~600 рядків на інші 70+ сторінок, яким вони не потрібні.
   Підключати ПІСЛЯ style.css.
   ========================================================================== */

/* ==========================================================================
   18. КУРСИ ВАЛЮТ, КРИПТИ ТА МЕТАЛІВ
   ========================================================================== */
.rate-cards{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.rate-card{
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 18px;
}
.rate-card .rc-top{ display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rate-card .rc-code{ font-family: var(--display); font-weight: 700; font-size: 14px; }
.rate-card .rc-flag{ font-size: 19px; line-height: 1; }
.rate-card .rc-rate{ font-family: var(--stat-font); font-size: 22px; font-weight: 700; margin-top: 8px; }
.rate-card .rc-label{ font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }

.table-card{
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 6px 6px 4px;
  overflow-x: auto;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
table.rate-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 520px;
}
table.rate-table th{
  text-align: left;
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 14px 16px 10px;
  white-space: nowrap;
}
table.rate-table td{
  padding: 13px 16px;
  border-top: 1px solid var(--glass-border);
  color: var(--ink-soft);
  vertical-align: middle;
}
table.rate-table tbody tr:hover td{ background: var(--glass); }
table.rate-table td.num{ font-family: var(--stat-font); font-weight: 700; color: var(--ink); white-space: nowrap; }
table.rate-table td.asset{ color: var(--ink); font-weight: 600; }
.asset-line{ display: flex; align-items: center; gap: 10px; }
/* --- іконки активів: прапор, логотип монети або текстовий бейдж --- */
.asset-ico{
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.asset-ico svg{ width: 22px; height: 22px; }
.ico-img{
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}
.ico-img.round{ width: 22px; height: 22px; border-radius: 50%; object-fit: contain; }
.ico-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(255,255,255,0.92);
  color: #14161f;
  font-family: var(--display);
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.ico-badge.wide{ font-size: 8.5px; padding: 0 5px; }

/* пара прапорів для валютних пар Forex */
.pair-ico{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 30px;
  position: relative;
}
.pair-ico .ico-img,
.pair-ico .ico-badge{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px rgba(10,11,16,0.9);
}
.pair-ico > :first-child{ left: 0; z-index: 2; }
.pair-ico > :last-child{ left: 16px; z-index: 1; }
.asset-sub{ display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-faint); margin-top: 1px; }
/* .delta — у style.css (розділ HERO/головна): renderStrip() у js/currency.js
   малює ним стрілку BTC на index.html, не тільки на currency.html. */

/* сітка банків-партнерів під таблицею курсів:
   у кожній картці — перемикач «Дебетова / Кредитна» зі своїми умовами */
.bank-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}
.bank-card{
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: border-color .18s ease, transform .18s ease;
}
.bank-card:hover{ border-color: rgba(255,255,255,0.26); transform: translateY(-2px); }
.bank-head{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.bank-logo{
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.94);
  color: #14161f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: -0.02em;
  overflow: hidden;
}
.bank-logo img{ width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.bank-logo-fallback{
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: -0.02em;
}
.bank-name{
  min-width: 0;
  font-size: 13.6px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;   /* довгі назви переносяться, а не лізуть на кнопки */
}

/* сегментований перемикач типу картки */
.bank-switch{
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  margin-bottom: 12px;
}
.bs-btn{
  flex: 1;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 100px;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.bs-btn:hover{ color: var(--ink); background: var(--glass-strong); }
.bs-btn.is-active{
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--purple));
  box-shadow: 0 6px 14px rgba(91,124,250,0.26);
}
.bs-btn[data-type="credit"].is-active{
  color: #16110A;
  background: linear-gradient(135deg, var(--accent), #E88F2A);
  box-shadow: 0 6px 14px rgba(242,179,61,0.26);
}

.bank-pane{ display: none; flex-direction: column; flex: 1; }
.bank-pane.is-active{ display: flex; animation: tabIn .2s ease; }
.bank-terms{
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  flex: 1;
}
.bank-terms li{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--glass-border);
  font-size: 12.4px;
  color: var(--ink-faint);
}
.bank-terms li:last-child{ border-bottom: 0; }
.bank-terms li b{
  font-family: var(--stat-font);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.bank-terms li b.accent{ color: var(--accent); }
.bank-terms li b.teal{ color: var(--teal); }
.bank-pane .btn{ width: 100%; padding: 11px 16px; font-size: 13px; }
.bank-pane .bank-note{
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 8px;
}

/* компактні партнерські кнопки в комірці таблиці */
.cell-cta{ display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn{
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 100px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--purple));
  box-shadow: 0 6px 14px rgba(91,124,250,0.24);
  transition: transform .16s ease, filter .16s ease;
}
.mini-btn.gold{
  background: linear-gradient(135deg, var(--accent), #E88F2A);
  color: #16110A;
  box-shadow: 0 6px 14px rgba(242,179,61,0.24);
}
.mini-btn:hover{ transform: translateY(-1px); filter: brightness(1.06); }

/* .rates-meta — у style.css (розділ HERO/головна): цей клас використовує
   і index.html (#rateStripMeta), не тільки currency.html. */
.btn-refresh{
  font-family: var(--body);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 7px 14px;
  cursor: pointer;
}
.btn-refresh:hover{ color: var(--ink); background: var(--glass-strong); }

.skeleton-row td{ color: var(--ink-faint); }
.skeleton-bar{
  display: block;
  height: 11px;
  width: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer{ from{ background-position: 200% 0; } to{ background-position: -200% 0; } }

/* конвертер валют */
.converter{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}
.conv-field label{ display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 7px; }
.conv-row{ display: flex; gap: 8px; }
.conv-input,
.conv-select{
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
}
.conv-input:focus,
.conv-select:focus{ border-color: rgba(91,124,250,0.6); }
.conv-select{ width: 118px; flex-shrink: 0; cursor: pointer; }
.conv-select option{ background: #14161f; color: var(--ink); }
.conv-swap{
  width: 44px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.conv-swap:hover{ color: var(--ink); background: var(--glass-strong); }
.conv-swap svg{ width: 18px; height: 18px; }

/* стилізований випадаючий список валют конвертера (заміна голого <select>) */
.conv-row{ position: relative; }
.cur-select-native{ display: none; }
.cur-select{ position: relative; flex-shrink: 0; width: 136px; }
.cur-select-btn{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cur-select-btn:hover{ background: rgba(255,255,255,0.13); }
.cur-select.is-open .cur-select-btn{
  border-color: rgba(91,124,250,0.6);
  box-shadow: 0 0 0 3px rgba(91,124,250,0.16);
}
.cur-select-btn svg{ width: 12px; height: 12px; margin-left: auto; flex-shrink: 0; opacity: .7; transition: transform .18s ease; }
.cur-select.is-open .cur-select-btn svg{ transform: rotate(180deg); }
.cur-select-flag{ display: inline-flex; flex-shrink: 0; }
.cur-select-flag .ico-img{ width: 20px; height: 14px; border-radius: 3px; }
.cur-select-code{ font-family: var(--stat-font); letter-spacing: 0.02em; }

.cur-select-panel{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  max-width: 82vw;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(16,17,24,0.98);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-hover);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 40;
}
.cur-select.is-open .cur-select-panel{ opacity: 1; visibility: visible; transform: translateY(0); }
.cur-select-item{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  transition: background .14s ease, color .14s ease;
}
.cur-select-item:hover{ background: var(--glass-strong); color: var(--ink); }
.cur-select-item.is-active{ background: rgba(91,124,250,0.16); color: var(--ink); }
.cur-select-name{ font-family: var(--stat-font); font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; }
.cur-select-name small{ font-family: var(--body); font-weight: 500; font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
@media (max-width: 420px){
  .cur-select{ width: 112px; }
  .cur-select-btn{ padding: 11px 9px; font-size: 13.5px; }
}

/* ---- 18.x пошук монети + пагінація "Наступні 20" (crypto tab) ---- */
.crypto-toolbar{ display: flex; justify-content: flex-end; padding: 10px 10px 4px; }
.crypto-search{
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 9px 12px;
  transition: border-color .18s ease;
}
.crypto-search:focus-within{ border-color: rgba(91,124,250,0.6); }
.crypto-search svg{ width: 16px; height: 16px; color: var(--ink-faint); flex-shrink: 0; }
.crypto-search input{
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 600;
}
.crypto-search input::placeholder{ color: var(--ink-faint); font-weight: 500; }

.crypto-pager{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 16px;
  margin-top: 16px;
}
.crypto-pager.is-hidden{ display: none; }
.crypto-pager .pager-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, opacity .18s ease;
}
.crypto-pager .pager-btn svg{ width: 14px; height: 14px; }
.crypto-pager .pager-btn:hover:not(:disabled){ background: var(--glass-strong); color: var(--ink); }
.crypto-pager .pager-btn:disabled{ opacity: .4; cursor: default; }
.crypto-pager .pager-label{ font-size: 12px; color: var(--ink-faint); min-width: 82px; text-align: center; }

@media (max-width: 560px){
  .crypto-toolbar{ justify-content: stretch; }
  .crypto-search{ max-width: none; }
  /* На вузьких екранах "← Попередні / 21–40 / Наступні 20 →" в звичайних
     розмірах не влазять в один рядок і переносяться — виглядає як кнопка
     "з'їхала" окремим рядком з великим відступом. Стискаємо, щоб трійка
     завжди лишалась в один рядок. */
  .crypto-pager{ gap: 8px 10px; }
  .crypto-pager .pager-btn{ padding: 8px 11px; font-size: 11.5px; }
  .crypto-pager .pager-label{ min-width: 0; font-size: 11px; }
}

/* ---- 18.x спарклайн у таблиці крипти + модалка деталей монети ---- */
.coin-row{ cursor: pointer; }
.coin-row:focus-visible{ outline: 2px solid var(--accent-2); outline-offset: -2px; }
.spark-cell{ width: 76px; }
.spark-svg{ display: block; }
.spark-empty{ color: var(--ink-faint); font-size: 12px; }

.coin-modal{
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 84px 16px 24px;
  background: rgba(6,7,11,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}
.coin-modal.is-open{ display: flex; }
.coin-modal-panel{
  position: relative;
  width: 100%;
  max-width: 560px;
  background: rgba(16,17,24,0.98);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  padding: 26px 24px 22px;
  animation: searchIn .2s ease;
}
.coin-modal-close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
}
.coin-modal-close:hover{ color: var(--ink); background: var(--glass-strong); }
.coin-modal-close svg{ width: 16px; height: 16px; }

.coin-modal-head{ display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.cm-ico{
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cm-ico .ico-img.round{ width: 36px; height: 36px; }
.cm-ico .ico-badge{ min-width: 36px; height: 30px; font-size: 13px; }
.cm-name{ font-family: var(--display); font-weight: 700; font-size: 18px; }
.cm-symbol{ font-size: 12px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; }
.cm-price{ font-family: var(--stat-font); font-size: 15px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 8px; color: var(--ink); }

.coin-modal-chart{
  position: relative;
  margin-top: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
}
.coin-modal-chart svg{ width: 100%; height: auto; display: block; }
.chart-svg{ cursor: crosshair; touch-action: none; }
.chart-guide-line{ stroke: var(--ink-faint); stroke-width: 1; opacity: 0; transition: opacity .1s ease; pointer-events: none; }
.chart-guide-dot{ opacity: 0; stroke: rgba(10,11,16,0.9); stroke-width: 2; transition: opacity .1s ease; pointer-events: none; }
.chart-tip{
  position: absolute;
  top: 10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(10,11,16,0.94);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: var(--stat-font);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .1s ease;
  z-index: 2;
}
.chart-tip b{ color: var(--ink); font-size: 13px; font-weight: 700; }
.chart-tip span{ color: var(--ink-faint); font-size: 10.5px; }
.cm-chart-label{ font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; text-align: right; }

.coin-modal-stats{ margin-top: 16px; margin-bottom: 0; }
.coin-modal-note{ font-size: 11.5px; color: var(--ink-faint); line-height: 1.55; margin-top: 14px; }

@media (max-width: 560px){
  .coin-modal{ padding: 60px 10px 16px; }
  .coin-modal-panel{ padding: 22px 16px 18px; }
}

/* Мобільні правила конвертера мають жити САМЕ ТУТ, а не в style.css.
   page-currency.css підключається після style.css, а медіа-запит не додає
   специфічності — тому копії цих правил у мобільному блоці style.css
   перебиваються базовими .converter/.conv-swap з цього файлу і не діють.
   Наслідок було видно на телефоні: сітка лишалась у три колонки, поле суми
   стискалось до 30px, а правий блок їхав за екран. */
@media (max-width: 720px){
  .converter{ grid-template-columns: 1fr; }
  .conv-swap{ width: 46px; }
}
