@font-face {
    font-family: 'Pixel';
    src: url('/supaset/fonts/Pixel.eot');
    src: url('/supaset/fonts/Pixel.eot?#iefix') format('embedded-opentype'),
        url('/supaset/fonts/Pixel.woff2') format('woff2'),
        url('/supaset/fonts/Pixel.woff') format('woff'),
        url('/supaset/fonts/Pixel.svg#Pixel') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


:root {
  --bg: #0b0e11;
  --bg-2: #0e1116;
  --text: #eaecef;
  --muted: #9aa4af;
  --card: #13161c;
  --accent: #f0b90b; /* Binance yellow */
  --accent-2: #c89600;
  --line: #1f2329;
  --shadow: rgba(0,0,0,.3);
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f7f8fa;
  --text: #0b0e11;
  --muted: #5e6b7b;
  --card: #ffffff;
  --accent: #c99400;
  --accent-2: #a87900;
  --line: #e6e8ec;
  --shadow: rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

h1 {
font-family: 'Pixel';
    font-weight: normal;
    font-style: normal;
}

.container { max-width: 1440px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: fixed; top:0; left:0; right:0; height:50px; z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display:flex; align-items:center; justify-content:space-between; height:50px; gap:10px;
}
.logo { display:flex; align-items:center; gap:.5rem; text-decoration:none; color:var(--text); font-weight:700; }
.logo-dot { width:12px; height:12px; border-radius:50%; background:var(--accent); display:inline-block; }
.logo-text { letter-spacing:.3px; }
.logo img {height: 40px;}
.topnav { display:flex; gap:1rem; }
.nav-link {    color: var(--text);
    text-decoration: none;
    opacity: .88;
    padding: 6px 8px;
    border-radius: 8px;
    font-family: 'Pixel';
    font-weight: normal;
    font-style: normal;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-link:hover { background: #3abd7f40; }

.theme-switcher { display:flex; align-items:center; }
.theme-toggle-label { cursor:pointer; display:flex; align-items:center; gap:.5rem; }
.theme-toggle-label .sun, .theme-toggle-label .moon {
  width:18px; height:18px; display:inline-block; border-radius:50%;
  border:2px solid var(--muted);
}
.theme-toggle-label .sun { box-shadow: inset 0 0 0 4px var(--accent); border-color: var(--accent-2); }
.theme-toggle-label .moon { box-shadow: inset -6px 0 0 0 var(--muted); }

#themeToggle { display:none; }

/* Burger */
.burger { display:none; background:none; border:none; padding:6px; cursor:pointer; }
.burger-line { display:block; width:22px; height:2px; background:var(--text); margin:4px 0; transition:transform .25s, opacity .2s; }
.burger.active .burger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.active .burger-line:nth-child(2) { opacity:0; }
.burger.active .burger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Sidemenu */
.sidemenu {
  position: fixed; top:50px; left:0; bottom:0; width:280px; background:var(--bg);
  border-right:1px solid var(--line); transform: translateX(-100%); transition: transform .25s ease;
  z-index: 999;
}
.sidemenu.open { transform: translateX(0); }
.sidemenu-nav { display:flex; flex-direction:column; padding:16px; gap:8px; }
.side-link { color:var(--text); text-decoration:none; padding:10px 12px; border-radius:8px;     font-family: 'Pixel';
    font-weight: normal;
    font-style: normal;
    font-size: 12px;}
.side-link:hover {background: #3abd7f40;}
.overlay {
  position: fixed; inset:0; background: rgba(0,0,0,.4); backdrop-filter: blur(1px); z-index: 998;
}

/* Page */
.page { padding-top: 50px; min-height: calc(100dvh - 50px - 60px); }

/* Cards & UI */
.card { background: var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; box-shadow: 0 4px 14px var(--shadow); }
.btn { background: var(--accent); color:#111; border:none; border-radius:10px; padding:8px 12px; font-weight:600; cursor:pointer; }
.btn:hover { filter: brightness(.95); }
.input, .select { width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:transparent; color:var(--text); }
.input::placeholder { color:var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

/* Hero & grids */
.hero { display:grid; gap:1rem; margin-top:1rem; }
.features-grid { display:grid; gap:1rem; grid-template-columns: repeat(3, 1fr); }
.feature-card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }

/* Tables */
.table-tools { display:flex; gap:.5rem; align-items:center; margin: 1rem 0; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
.tbl { width:100%; border-collapse:collapse; font-size:.95rem; text-align: center;}
.tbl th, .tbl td { padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
.tbl thead th { position:sticky; top:0; background:var(--bg); z-index:1; }
.col-filter { width:100%; margin-top:6px; padding:6px 8px; border-radius:8px; border:1px solid var(--line); background:transparent; color:var(--text); }

/* Toolbar grid-template-columns: 1.2fr 1fr 1fr auto;*/
.toolbar { display:grid; gap:12px;  align-items:end; margin-bottom:12px; }
.toolbar-group { display:grid; gap:6px; }

/* Chips */
.chips { display:flex; flex-wrap:wrap; gap:8px; margin: 8px 0 16px; }
.chip { background: var(--card); border:1px solid var(--line); border-radius:999px; padding:6px 10px; cursor:pointer; display:flex; gap:6px; align-items:center; }
.chip .dot { width:8px; height:8px; border-radius:50%; background: var(--accent); }

/* Terminal */
.terminal-grid { display:grid; gap:12px; grid-template-columns: repeat(3, 1fr); }
.term-card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; }
.term-toolbar { display:grid; grid-template-columns: 1fr 1fr 1fr auto; gap:8px; align-items:center; margin-bottom:8px; }

/* Modal */
.modal { position: fixed; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,.4); z-index: 1001; }
.modal[hidden] { display:none; }
.modal-dialog { width:min(900px, 96vw); background:var(--bg); border:1px solid var(--line); border-radius:12px; box-shadow: 0 10px 30px var(--shadow); }
.modal-header, .modal-footer { padding:12px 16px; border-bottom:1px solid var(--line); }
.modal-footer { border-top:1px solid var(--line); border-bottom:none; display:flex; justify-content:flex-end; gap:8px; }
.modal-body { padding:12px 16px; }
.modal-close { background:none; color:var(--text); border:none; font-size:24px; cursor:pointer; }

.news-list { display:grid; gap:12px; }
.news-item { padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--card); }

/* Footer */
.site-footer { margin-top: 24px; border-top:1px solid var(--line); background: var(--bg); }
.footer-inner { height:60px; display:flex; align-items:center; justify-content:space-between; }
.social { color: var(--text); text-decoration:none; margin-left:16px; opacity:.88; }
.social:hover { color: var(--accent); }

.logo-login {width: 400px;}
/* Responsive */
@media (max-width: 599px) {
  .logo-login {width: 100%;}
  .topnav { display:none; }
  .burger { display:block; }
  .features-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .terminal-grid { grid-template-columns: 1fr; }
  .term-toolbar { grid-template-columns: 1fr; }
}

@media (min-width: 600px) and (max-width: 899px) {
  .logo-login {width: 100%;}
  .topnav { display:none; }
  .burger { display:block; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .terminal-grid { grid-template-columns: repeat(2, 1fr); }
  .term-toolbar { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .terminal-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) and (max-width: 1599px) { }

@media (min-width: 1600px) { }

/* megaChart */
/* Стили select2 под тёмную тему */
.select2-container--classic .select2-selection--single,
.select2-container--classic .select2-selection--multiple {
  background-color: var(--bg);
  color: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
}
.select2-container--classic .select2-results__option {
  background: var(--bg);
  color: var(--text);
}
.select2-container--classic .select2-results__option--highlighted {
  background: var(--accent);
  color: #111;
}

/* Стакан */
.orderbook { width: 260px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.orderbook-header { padding: 8px; border-bottom: 1px solid var(--line); }
.orderbook-body { display: flex; flex-direction: column-reverse; height: 460px; overflow: auto; }
.ask, .bid { display: flex; justify-content: space-between; font-family: monospace; padding: 2px 8px; }
.ask { color: #ff6b6b; }
.bid { color: #32cd32; }

@media (max-width: 900px){
  .chart-container { flex-direction: column; }
  .orderbook { width: 100%; height: auto; }
}
/* /megaChart */

.chart-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 10px 0 15px;
}

.chart-tools .chart-type,
.chart-tools .book-position {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-tools label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.btn-type, .btn-book {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-type:hover, .btn-book:hover {
  background: var(--accent);
  color: #111;
}
.btn-type.active, .btn-book.active {
  background: var(--accent);
  color: #111;
  font-weight: 600;
}

.draw-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-draw {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-draw.active {
  background: var(--accent);
  color: #111;
  font-weight: 600;
}




.chart-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}

.chart-main {
  flex: 1;
  min-height: 500px;
}

#chart {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

#orderBook {
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  padding: 10px;
  overflow-y: auto;
}

#orderAsks, #orderBids {
  font-family: monospace;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#orderAsks .ask span:first-child { color: #ef5350; }
#orderBids .bid span:first-child { color: #26a69a; }

/* --- мобильные устройства --- */
@media (max-width: 899px) {
  .chart-wrapper {
    flex-direction: column;
  }
  #orderBook {
    flex: 0 0 auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 8px;
  }
}


/* ========= ТЕМЫ (если ещё не заведены) ========= */

/* ========= ТЕМЫ ЧЕРЕЗ data-theme ========= */

/* Темная тема */
:root[data-theme="dark"] {
    --fs-bg-color: #050510;
    --fs-card-bg: #101322;
    --fs-border-color: #23263a;
    --fs-text-color: #f5f5f7;
    --fs-muted-color: #9ca3af;
    --fs-accent-color: #22c55e;
    --fs-danger-color: #ef4444;
    --fs-header-bg: #111827;
}

/* Светлая тема */
:root[data-theme="light"] {
    --fs-bg-color: #ffffff;
    --fs-card-bg: #f3f4f6;
    --fs-border-color: #d1d5db;
    --fs-text-color: #111827;
    --fs-muted-color: #6b7280;
    --fs-accent-color: #059669;
    --fs-danger-color: #dc2626;
    --fs-header-bg: #e5e7eb;
}


/* ========= Страница спредов ========= */

.fs-page {
    background-color: var(--fs-bg-color);
    min-height: 100vh;
    padding: 1rem 0 2rem;
    color: var(--fs-text-color);
}

.fs-page .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
}

.fs-page-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.fs-page-subtitle {
    font-size: 0.85rem;
    color: var(--fs-muted-color);
    margin-bottom: 0.75rem;
}

.fs-card {
    background-color: var(--fs-card-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--fs-border-color);
    padding: 0.75rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

/* ========= Тулбар ========= */

.fs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.fs-toolbar-left,
.fs-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--fs-muted-color);
}

.fs-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--fs-accent-color);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

/* ========= Таблица ========= */

.fs-table-wrapper {
    position: relative;
    max-height: 80vh;
    min-height: 80vh;
    overflow: auto;
}

.fs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
    font-size: 0.8rem;
    color: var(--fs-text-color);
}

.fs-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.fs-table thead th {
    position: sticky;
    top: 0;
    background-color: var(--fs-header-bg);
    color: var(--fs-muted-color);
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--fs-border-color);
    font-weight: 500;
    white-space: nowrap;
}

.fs-table tbody tr:nth-child(odd) {
    background-color: rgba(15, 23, 42, 0.7);
}

.fs-table tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.4);
}

.theme-light .fs-table tbody tr:nth-child(odd) {
    background-color: rgba(243, 244, 246, 0.9);
}

.theme-light .fs-table tbody tr:nth-child(even) {
    background-color: rgba(229, 231, 235, 0.8);
}

.fs-table tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.7);
}

.theme-light .fs-table tbody tr:hover {
    background-color: rgba(209, 213, 219, 0.9);
}

.fs-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(31, 41, 55, 0.7);
}

/* ========= Колонки ========= */

.fs-cell-symbol {
    min-width: 120px;
}

.fs-symbol-main {
    font-weight: 600;
    font-size: 0.9rem;
}

.fs-symbol-sub {
    font-size: 0.75rem;
    color: var(--fs-muted-color);
}

.fs-cell-top-spread {
    min-width: 160px;
}

.fs-cell-exchange {
    min-width: 160px;
}

/* ========= Логотипы ========= */

.fs-ex-head-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.fs-ex-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ========= Топ-спред ========= */

.fs-top-spread-pair {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.fs-pair-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.fs-pair-separator {
    margin: 0 0.15rem;
}

.fs-price-value {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
}

.fs-spread-line {
    font-size: 0.75rem;
}

.fs-spread-label {
    color: var(--fs-muted-color);
    margin-right: 0.25rem;
}

.fs-spread-value {
    font-weight: 600;
    color: var(--fs-accent-color);
}

/* ========= Ячейки бирж ========= */

.fs-ex-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
}

.fs-ex-header {
    font-weight: 500;
    color: var(--fs-muted-color);
    margin-bottom: 0.3rem;
}

.fs-ex-name-link {
    color: var(--fs-accent-color, #22c55e);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.fs-ex-name-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.fs-ex-price strong {
    color: #fefce8;
}

.theme-light .fs-ex-price strong {
    color: #1f2937;
}

.fs-ex-funding,
.fs-ex-next {
    color: var(--fs-muted-color);
}

.fs-mono {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.fs-na {
    color: #4b5563;
    font-size: 0.75rem;
}

/* ========= Адаптив ========= */

@media (max-width: 599px) {
    .fs-page .container {
        padding: 0 0.5rem;
    }

    .fs-card {
        padding: 0.5rem;
    }

    .fs-table {
        font-size: 0.72rem;
        min-width: 700px;
    }

    .fs-table thead th,
    .fs-table td {
        padding: 0.3rem 0.3rem;
    }

    .fs-cell-exchange {
        min-width: 140px;
    }

    .fs-page-title {
        font-size: 1rem;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .fs-table {
        font-size: 0.76rem;
    }
}

@media (min-width: 900px) {
    .fs-page-title {
        font-size: 1.4rem;
    }
}


/* нормальное состояние */
.fs-next-funding {
    font-weight: 600;
    color: var(--fs-accent-color);
}

/* <1 часа — желтый */
.fs-next-funding.fs-soon {
    color: #facc15; /* желтый */
}

/* <5 минут — красный */
.fs-next-funding.fs-urgent {
    color: #ef4444;
}

/* мигание */
.fs-blink {
    animation: fs-blink-anim 1s infinite;
}

@keyframes fs-blink-anim {
    0%   { opacity: 1; }
    50%  { opacity: 0.25; }
    100% { opacity: 1; }
}


.fs-next-funding.fs-normal {
    color: var(--fs-accent-color);
    font-weight: 600;
}

.fs-next-funding.fs-soon {
    color: #facc15; /* желтый */
    font-weight: 700;
}

.fs-next-funding.fs-urgent {
    color: #ef4444; /* красный */
    font-weight: 700;
}

.fs-next-funding.fs-na {
    color: #9ca3af;
}



/* ====== Выпадающее меню (ДЕСКТОП + МОБИЛЬНОЕ) ====== */

.dropdown,
.side-dropdown {
  position: relative;
}

/* Кнопка */
.dropdown-btn,
.side-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-family: 'Pixel';
  font-weight: normal;
  font-style: normal;
  font-size:12px;
}
.dropdown-btn:hover {
    background: #3abd7f40;
    border-radius: 8px;
}

/* Стрелка ▼ */
.triangle {
  display: inline-block;
  transition: transform 0.3s ease;
}

/* Поворот стрелки */
.dropdown-menu.open ~ .triangle,
.open .triangle {
  transform: rotate(180deg);
}

/* Блок меню */
.dropdown-menu,
.side-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg, #111);
  border-radius: 10px;
  min-width: 190px;
  display: flex;
  flex-direction: column;

  /* Анимация */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: all 0.28s ease;
  z-index: 1000;
}

/* Открытие меню */
.dropdown-menu.open,
.side-dropdown-menu.open {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
}

/* Пункты меню */
.dropdown-item,
.side-dropdown-item {
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text, #fff);
  transition: 0.2s;
}

/* Ховер */
.dropdown-item:hover,
.side-dropdown-item:hover {
  background: var(--hover, rgba(255,255,255,0.08));
}

/* Активный пункт */
.dropdown-item.active,
.side-dropdown-item.active {
  background: var(--active, rgba(255,255,255,0.15));
  font-weight: 600;
}


.funding-green { color: #00ff99; }
.funding-yellow { color: #ffcc00; }
.funding-red { color: #ff3333; font-weight: bold; }
.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.gap-row {
    border: 1px solid #ffd900 !important;
    position: relative;
}

.gap-label {
    position: absolute;
    right: 2px;
    top: 0;
    font-size: 9px;
    color: #ffd900;
    z-index: 3;
    background: rgba(20,20,20,0.7);
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-window {
    background: #0f1215;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 6px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    width: 60%;
}

@media (max-width: 1199px) {
    .modal-window { width: 80%; }
}

@media (max-width: 600px) {
    .modal-window { width: 90%; }
}

/* Крестик */
.modal-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #bbb;
}

.modal-close:hover {
    color: #fff;
}



.fs-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.fs-table th {
    position: sticky;
    top: 0;
    background: var(--fs-header-bg);
    padding: 8px;
}

.fs-table td {
    padding: 8px;
    border-bottom: 1px solid var(--fs-border-color);
}

.ex-head-logo {
    width: 20px; height: 20px;
    margin-right: 4px;
}

.fs-value { font-weight: 600; }

.fs-pair-line {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fs-pair-separator { opacity: 0.5; }

.fs-spread-value {
    font-weight: 700;
    color: var(--fs-accent-color);
}

.fs-next-funding.fs-soon {
    color: #facc15;
}

.fs-next-funding.fs-urgent {
    color: #ef4444;
}

.fs-next-funding.fs-normal {
    color: var(--fs-accent-color);
}


/* Темы через data-theme уже есть у тебя, тут только использовать переменные:
   --fs-bg-color, --fs-card-bg, --fs-border-color, --fs-text-color, --fs-muted-color, --fs-accent-color
*/

.fs-page {
    background-color: var(--fs-bg-color, #050510);
    min-height: 100vh;
    padding: 1rem 0 2rem;
    color: var(--fs-text-color, #f5f5f7);
}

.fs-page .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
}

.fs-page-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.fs-page-subtitle {
    font-size: 0.85rem;
    color: var(--fs-muted-color, #9ca3af);
    margin-bottom: 0.75rem;
}

.fs-card {
    background-color: var(--fs-card-bg, #101322);
    border-radius: 0.75rem;
    border: 1px solid var(--fs-border-color, #23263a);
    padding: 0.75rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

/* toolbar */
.fs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.fs-toolbar-left,
.fs-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--fs-muted-color, #9ca3af);
}

.fs-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--fs-accent-color, #22c55e);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

/* table */

.fs-table-wrapper {
    max-height: 80vh;
    overflow: auto;
}

.fs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
    font-size: 0.8rem;
    color: var(--fs-text-color, #f5f5f7);
}

.fs-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--fs-header-bg, #111827);
    color: var(--fs-muted-color, #9ca3af);
    padding: 0.5rem;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.fs-table tbody tr:nth-child(odd) {
    background-color: rgba(15, 23, 42, 0.7);
}

.fs-table tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.4);
}

:root[data-theme="light"] .fs-table tbody tr:nth-child(odd) {
    background-color: rgba(243, 244, 246, 0.9);
}
:root[data-theme="light"] .fs-table tbody tr:nth-child(even) {
    background-color: rgba(229, 231, 235, 0.8);
}
:root[data-theme="light"] .fs-table tbody tr:hover {
    background-color: rgba(209, 213, 219, 0.9);
}

.fs-table tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.7);
}

.fs-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.7);
    vertical-align: top;
}

.fs-cell-symbol {
    min-width: 120px;
}
.fs-symbol-main {
    font-weight: 600;
    font-size: 0.9rem;
}
.fs-symbol-main a,
.fs-symbol-link {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}
.fs-symbol-main a:hover,
.fs-symbol-link:hover {
    color: #d1d5db;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}
.fs-symbol-sub {
    font-size: 0.75rem;
    color: var(--fs-muted-color, #9ca3af);
}

.fs-cell-top-spread {
    min-width: 220px;
}

/* шапочные логотипы */
.ex-head-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 0.35rem;
}

/* топ-спред */
.fs-top-spread-pair {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fs-funding-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.fs-top-ex-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.fs-ex-link {
    color: var(--fs-accent-color, #22c55e);
    text-decoration: none;
    font-weight: 600;
}
.fs-ex-link:hover {
    text-decoration: underline;
}

.fs-funding-value {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.fs-spread-line {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
}
.fs-spread-value {
    font-weight: 700;
    color: var(--fs-accent-color, #22c55e);
}

/* Стрелки для ТОП спреда */
.fs-arrow-long {
    color: #22c55e;
    font-size: 0.9rem;
    margin-right: 0.25rem;
    display: inline-block;
}

.fs-arrow-short {
    color: #ef4444;
    font-size: 0.9rem;
    margin-right: 0.25rem;
    display: inline-block;
}

/* Кружки для ТОП спреда (spot) */
.fs-circle-long {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #22c55e;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.fs-circle-short {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef4444;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Блоки с сетями для ввода/вывода */
.fs-networks-block {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fs-network-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fs-network-name {
    font-size: 0.75rem;
    color: var(--text, #eaecef);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.mdx-mexc-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mdx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    line-height: 1.2;
}

.mdx-net {
    border-color: rgba(34, 197, 94, 0.35);
}

.mdx-ok {
    border-color: rgba(34, 197, 94, 0.35);
    color: #22c55e;
}

.mdx-bad {
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

/* Ссылки на биржи */
.fs-ex-icon a,
.fs-ex-label a {
    color: var(--fs-accent-color, #22c55e);
    text-decoration: none;
    transition: opacity 0.2s;
}

.fs-ex-icon a:hover,
.fs-ex-label a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Иконка истории фандинга/спредов */
.funding-history-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.7;
    vertical-align: middle;
    transition: opacity 0.2s;
}

.funding-history-icon:hover {
    opacity: 1;
}

.funding-history-icon svg {
    width: 100%;
    height: 100%;
    fill: #fff !important;
    color: #fff !important;
}

.funding-history-icon:hover svg {
    fill: #fff !important;
    color: #fff !important;
}

.funding-history-icon svg path {
    fill: #fff !important;
    stroke: #fff !important;
}
.fs-price-spread {
    font-weight: 600;
}

/* биржи */
.fs-cell-exchange {
    min-width: 170px;
}

.fs-ex-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.78rem;
}

.fs-ex-line {
    margin: 1px 0;
}

.fs-value {
    font-weight: 600;
}

.fs-na {
    color: #6b7280;
    font-size: 0.75rem;
}

/* время фандинга */

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-overlay:not([style*="display: none"]) {
    display: flex;
}

.modal-window {
    background: #0f1215;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 6px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    width: 60%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.modal-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #333;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #bbb;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #fff;
}

.funding-chart-body {
    overflow: visible;
}

.funding-chart-wrapper {
    position: relative;
    width: 100%;
}

@media (max-width: 1199px) {
    .modal-window {
        width: 80%;
    }
}

@media (max-width: 600px) {
    .modal-window {
        width: 90%;
    }
    
    #spreadHistoryModal.modal-window {
        max-width: 100vw;
        width: 95%;
    }
}

/* График истории спредов на мобильных */
@media (max-width: 899px) {
    /* Разрешаем прокрутку для modal-body с графиком спредов */
    #spreadHistoryModal .modal-body.funding-chart-body {
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    
    #spreadHistoryModal .funding-chart-wrapper {
        min-width: 800px;
        position: relative;
        /* Высота динамическая - будет рассчитываться в JS чтобы были видны временные метки */
    }
    
    #spreadHistoryModal #spreadHistoryCanvas {
        min-width: 800px !important;
        width: 800px !important;
        height: auto !important;
        /* Высота будет устанавливаться динамически в JS */
    }
    
    /* Стилизация прокрутки для графика на мобильных */
    #spreadHistoryModal .modal-body.funding-chart-body::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    #spreadHistoryModal .modal-body.funding-chart-body::-webkit-scrollbar-track {
        background: #1e1e1e;
    }
    
    #spreadHistoryModal .modal-body.funding-chart-body::-webkit-scrollbar-thumb {
        background-color: #555;
        border-radius: 4px;
    }
    
    #spreadHistoryModal .modal-body.funding-chart-body::-webkit-scrollbar-thumb:hover {
        background-color: #777;
    }
    
    #spreadHistoryModal .modal-body.funding-chart-body {
        scrollbar-width: thin;
        scrollbar-color: #555 #1e1e1e;
    }
}

/* На мобильных для модального окна с графиком спредов разрешаем прокрутку */
@media (max-width: 899px) {
    /* Модальное окно не должно обрезать контент */
    #spreadHistoryModal.modal-window {
        overflow: visible;
    }
    
    #spreadHistoryModal .modal-body.funding-chart-body {
        overflow-x: auto !important;
        overflow-y: auto !important;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        position: relative;
    }
    
    /* Убеждаемся, что wrapper не обрезается и имеет правильную ширину */
    #spreadHistoryModal .funding-chart-wrapper {
        flex-shrink: 0;
        width: max-content;
        min-width: 800px;
        position: relative;
    }
    
    /* Canvas должен иметь фиксированную ширину для корректной прокрутки */
    #spreadHistoryModal #spreadHistoryCanvas {
        display: block;
        flex-shrink: 0;
    }
}

/* Общие стили для canvas графика спредов (как в графике фандинга) */
#spreadHistoryCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}
.fs-next-funding {
    font-weight: 600;
    font-size: 0.78rem;
}
.fs-next-normal {
    color: var(--fs-accent-color, #22c55e);
}
.fs-next-soon {
    color: #facc15;
}
.fs-next-urgent {
    color: #ef4444;
}
.fs-next-na {
    color: #6b7280;
}

/* пустая таблица */
.fs-empty-row {
    text-align: center;
    padding: 1.2rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fs-muted-color, #9ca3af);
}

/* адаптив */
@media (max-width: 599px) {
    .fs-page .container {
        padding: 0 0.5rem;
    }
    .fs-card {
        padding: 0.5rem;
    }
    .fs-table {
        font-size: 0.72rem;
        min-width: 700px;
    }
}


.table-scroll-xy {
  overflow: auto;         /* включает обе прокрутки при необходимости */
}

/* ===== WebKit: Chrome, Edge, Opera, Safari ===== */

/* Общие параметры */
.table-scroll-xy::-webkit-scrollbar {
  width: 8px;             /* вертикальная */
  height: 8px;            /* горизонтальная */
}

/* Дорожка */
.table-scroll-xy::-webkit-scrollbar-track {
  background: #1e1e1e;
}

/* Ползунок */
.table-scroll-xy::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #1e1e1e;
}

/* Hover */
.table-scroll-xy::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

/* ===== Firefox ===== */
.table-scroll-xy {
  scrollbar-width: thin;                /* auto | thin | none */
  scrollbar-color: #555 #1e1e1e;        /* thumb | track */
}


/* =========================
   MEXC-DEX section (mdx-*)
   ========================= */

.mdx-page {
  background: var(--fs-bg-color, #050510);
  color: var(--fs-text-color, #f5f5f7);
  min-height: 100vh;
  padding: 1rem 0 2rem;
}

.mdx-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 .4rem 0;
}

.mdx-subtitle {
  font-size: .85rem;
  color: var(--fs-muted-color, #9ca3af);
  margin: 0 0 .8rem 0;
}

.mdx-card {
  background: var(--fs-card-bg, #101322);
  border: 1px solid var(--fs-border-color, #23263a);
  border-radius: .9rem;
  padding: .8rem;
  box-shadow: 0 15px 40px rgba(0,0,0,.6);
}

.mdx-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .82rem;
  margin-bottom: .6rem;
}

.mdx-toolbar-left, .mdx-toolbar-right {
  display: flex;
  gap: .4rem;
  align-items: center;
  color: var(--fs-muted-color, #9ca3af);
}

.mdx-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--fs-accent-color, #22c55e);
  box-shadow: 0 0 8px rgba(34,197,94,.8);
}

.mdx-table-wrap {
  max-height: 82vh;
  overflow: auto;
  position: relative;
}

.mdx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px;
  font-size: .82rem;
}

.mdx-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--fs-header-bg, #111827);
  color: var(--fs-muted-color, #9ca3af);
  text-align: left;
  padding: .55rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--fs-border-color, #23263a);
}

.mdx-table td {
  padding: .55rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(31,41,55,.7);
}

.mdx-table tbody tr:nth-child(odd) { background: rgba(15,23,42,.55); }
.mdx-table tbody tr:nth-child(even) { background: rgba(15,23,42,.35); }

:root[data-theme="light"] .mdx-table tbody tr:nth-child(odd) { background: rgba(243,244,246,.95); }
:root[data-theme="light"] .mdx-table tbody tr:nth-child(even) { background: rgba(229,231,235,.85); }

.mdx-cell-coin { min-width: 160px; }
.mdx-cell-top { min-width: 140px; }
.mdx-cell-mexc { min-width: 220px; }
.mdx-cell-dex { min-width: 520px; }

.mdx-coin-main { font-weight: 700; font-size: .95rem; }
.mdx-coin-main .mdx-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.2s;
}
.mdx-coin-main .mdx-link:hover {
  color: var(--fs-accent-color, #22c55e);
  text-decoration: underline;
}
.mdx-coin-sub { margin-top: .15rem; font-size: .75rem; color: var(--fs-muted-color, #9ca3af); }

.mdx-top-value { font-weight: 800; font-size: 1rem; }
.mdx-top-sub { margin-top: .25rem; color: var(--fs-muted-color, #9ca3af); font-size: .78rem; }

.mdx-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  font-size: .75rem;
  line-height: 1.2;
}

.mdx-net { border-color: rgba(34,197,94,.35); }
.mdx-ok { border-color: rgba(34,197,94,.35); color: #22c55e; }
.mdx-bad { border-color: rgba(239,68,68,.35); color: #ef4444; }

.mdx-link {
  color: var(--fs-accent-color, #22c55e);
  text-decoration: none;
  font-weight: 700;
}
.mdx-link:hover { text-decoration: underline; }

.mdx-k { color: var(--fs-muted-color, #9ca3af); }
.mdx-v { font-weight: 700; }
.mdx-mono { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.mdx-na { color: #6b7280; }

.mdx-dex-head {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .45rem;
}

.mdx-spread {
  margin-left: auto;
  font-weight: 800;
}
.mdx-spread-low { color: var(--fs-accent-color, #22c55e); }
.mdx-spread-mid { color: #facc15; }
.mdx-spread-high { color: #ef4444; }

.mdx-dex-table-wrap { overflow: auto; }
.mdx-dex-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: .6rem;
}
:root[data-theme="light"] .mdx-dex-table {
  background: rgba(17,24,39,.02);
  border-color: rgba(17,24,39,.10);
}

.mdx-dex-table th {
  width: 220px;
  text-align: left;
  padding: .35rem .45rem;
  font-size: .78rem;
  color: var(--fs-muted-color, #9ca3af);
  border-bottom: 1px solid rgba(255,255,255,.08);
  vertical-align: top;
}
.mdx-dex-table td {
  padding: .35rem .45rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.mdx-break { word-break: break-all; }

.mdx-vol-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: .25rem .6rem;
}
.mdx-vol-k { color: var(--fs-muted-color, #9ca3af); margin-right: .35rem; }
.mdx-vol-v { font-weight: 700; }

.mdx-empty-row {
  text-align: center;
  padding: 1.2rem .6rem;
  font-weight: 700;
  color: var(--fs-muted-color, #9ca3af);
}

@media (max-width: 599px) {
  .mdx-card { padding: .55rem; }
  .mdx-table { min-width: 900px; font-size: .75rem; }
  .mdx-table-wrap { max-height: 75vh; }
}

/* Скролл для таблицы */
.mdx-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.mdx-table-wrap::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.mdx-table-wrap::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #1e1e1e;
}

.mdx-table-wrap::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

.mdx-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #555 #1e1e1e;
}

