:root {
    --bg: #08080a;
	--panel: #0f0f0f;
    --muted: #9ea1ab;
    --accent: #fbbf24;
    --positive: #3ecf8e;
    --negative: #ff5f56;
    --border: #1e1e1e;
    --table-header: #202430;
    --card: #161a22;
    --text: #fff;
    --text-secondary: #d0d3e1;
}

:root[data-theme="light"] {
    --bg: #fff;
    --panel: #ffffff;
    --muted: #6b7280;
    --accent: #f59e0b;
    --positive: #10b981;
    --negative: #ef4444;
    --border: #e5e7eb;
    --table-header: #f9fafb;
    --card: #ffffff;
    --text: #111827;
    --text-secondary: #4b5563;
}
:root[data-theme="light"] header::before {
  display: none;
}
:root[data-theme="light"] .table-container::before {
  display: none;
}
:root[data-theme="light"] .table-container {
  box-shadow: none;
  border: none;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease, color 0.3s ease;
}

:root[data-theme="dark"] body {
  background:
      radial-gradient(circle farthest-side, rgba(197, 50, 255, 0.11), transparent 70%) right top no-repeat,
    radial-gradient(circle farthest-side, rgba(0, 255, 119, 0.12), transparent 70%) left top no-repeat,
    var(--bg);
  background-size: 900px 650px, 900px 650px, auto;
  background-position: 20% 0%, 80% 0%, 0 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}
@media (max-width: 768px) {
  .category-tab.active {
    background: #1f2430;
    color: #ffffff;
  }
}
.container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  position: sticky;
  top: 0;
  background: #0f0f0f00;
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* When header becomes sticky (user scrolled), use semi-transparent dark background with blur */
header.is-sticky {
  background: rgb(8 8 10 / 69%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

:root[data-theme="light"] header.is-sticky {
  /* Keep light theme panel background when sticky */
  background: var(--panel);
}

/* Keep checked (active) state using accent color */
.switch input:checked + .slider {
  background: var(--accent);
}

/* Light theme - blue active toggle */
:root[data-theme="light"] .switch input:checked + .slider {
  background: #0074ef;
}

/* Page transition animation */
body {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Radio-style navigation tabs */
.radio-inputs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  border-radius: 100px;
  box-sizing: border-box;
  padding: 0.25rem;
  font-size: 13px;
  margin-left: 20px;
}

:root[data-theme="light"] .radio-inputs {
  background-color: #EEE;
  box-shadow: 0 0 0px 1px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .radio-inputs {
  background-color: #171a21;
  box-shadow: 0 0 0px 1px rgba(255, 255, 255, 0.08);
}

.radio-inputs .radio {
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
}

.radio-inputs .radio input {
  display: none;
}

.radio-inputs .radio .name {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 100px;
  border: none;
  padding: 10px 24px;
  transition: all .15s ease-in-out;
  font-weight: 500;
  white-space: nowrap;
}

:root[data-theme="light"] .radio-inputs .radio .name {
  color: rgba(51, 65, 85, 1);
}

:root[data-theme="dark"] .radio-inputs .radio .name {
  color: #fff;
}

:root[data-theme="light"] .radio-inputs .radio input:checked + .name,
:root[data-theme="light"] .radio-inputs .radio.active .name {
  background-color: #fff;
  font-weight: 500;
  color: rgba(51, 65, 85, 1);
}

:root[data-theme="dark"] .radio-inputs .radio input:checked + .name,
:root[data-theme="dark"] .radio-inputs .radio.active .name {
  background-color: #2f3442;
  font-weight: 500;
  color: #ffffff;
}

/* Hide radio navigation on mobile */
@media (max-width: 768px) {
  .radio-inputs {
    display: none;
  }
}

header .container {
  position: relative;
  z-index: 1;
}


.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

/* Left section: brand + tabs */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 2;
}

/* Right section: actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

.brand-logo-mobile {
  display: none;
  height: 22px;
  width: auto;
}

/* Desktop logo link in header */
.brand-logo-link {
  display: flex;
  align-items: center;
  margin-right: 16px;
}

.brand-logo-desktop {
  height: 22px;
  width: auto;
  transition: opacity 0.2s;
}

.brand-logo-desktop:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .brand-logo-link {
    display: none;
  }
}

.brand-title {
  display: block;
}

@media (max-width: 768px) {
  .brand-logo-mobile {
    display: block;
  }
  
  .brand-title {
    display: none;
  }
}

.brand-logo {
  height: 20px;
  width: 40px;
  transition: opacity 0.3s ease;
}

.brand-text {
  height: 20px;
  width: auto;
  margin-top: 5px;
  transition: opacity 0.3s ease;
}

.exchange-icon {
  width: 13px !important;
  height: 13px important;
  border-radius: 3px;
  object-fit: contain;
}
.brand-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 14px;
}

nav {
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--muted);
  font-weight: 600;
  padding: 15px 22px;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13px;
  transform: scale(1);
}

/* Dark theme: nav links should be white */
:root[data-theme="dark"] nav a {
  color: #ffffff;
}

nav a.active {
    color: var(--text);
	font-weight: 600;
    /* box-shadow: inset 0 0 0 1px var(--border);
    background: var(--panel); */
}

:root[data-theme="dark"] nav a.active {
    /* box-shadow: inset 0 0 0 1px rgb(38 67 129 / 75%);
    background: radial-gradient(ellipse at bottom, rgb(32 106 183 / 29%) 0%, rgb(15 18 20 / 0%) 45%); */
}

nav a:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
  background: var(--panel);
  transform: scale(1.05);
}

:root[data-theme="dark"] nav a:hover {
  box-shadow: inset 0 0 0 1px rgb(38 67 129 / 75%);
  background: radial-gradient(ellipse at bottom, rgb(32 106 183 / 29%) 0%, rgb(15 18 20 / 0%) 45%);
}

nav:hover a.active:not(:hover) {
  box-shadow: none;
  background: transparent;
  transform: scale(0.98);
  opacity: 0.7;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* Remove borders for header action buttons (notifications + theme toggle) */
.topbar .btn,
.topbar .theme-toggle {
  border: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 400;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn.primary {
    background: #fff;
    color: #000;
    border: none;
	font-weight: 550;
    box-shadow: 0 6px 16px rgba(51, 162, 195, 0.25);
    transition: 0.25s 
ease;
}

.btn.primary:hover {
  opacity: 0.9;
  box-shadow: 0 8px 20px rgba(51, 162, 195, 0.35);
}

.btn-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 22px;
  border-radius: 999px;
  background: #00000000;
  color: #fff;
  border: none;
  font-weight: 550;
  font-size: 13px;
  cursor: pointer;
  transition: 0.25s ease;
}

.btn-signin:hover {
  opacity: 0.9;
}
td:first-child,
th:first-child {
  padding-left: 18px;
}
td:last-child,
th:last-child {
  padding-right: 18px;
}
.btn-signup {
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  position: relative;
  font-weight: 500;
  background: linear-gradient(90deg, #5bfcc4, #f593e4, #71a4f0);
  border-radius: 8px;
  color: #fff;
  transition: all 0.3s ease;
  box-shadow:
    inset 0px 0px 5px #ffffffa9,
    inset 0px 35px 30px #000,
    0px 5px 10px #000000cc;
  text-shadow: 1px 1px 1px #000;
}

.btn-signup:hover {
  opacity: 0.9;
  box-shadow:
    inset 0px 0px 5px #ffffffa9,
    inset 0px 35px 30px #000;  transform: translateY(-1px);
}

:root[data-theme="dark"] .btn, :root[data-theme="dark"] .theme-toggle {
    background: #0b151e00;
    border: 1px solid #323851;
}

:root[data-theme="light"] .btn-signin {
  background: #fff;
  color: #000;
}

:root[data-theme="light"] .btn-signin:hover {
  box-shadow: 0 8px 20px rgba(51, 162, 195, 0.35);
}

:root[data-theme="light"] .btn-signup {
    background: linear-gradient(135deg, #0074ef 0%, #0074ef 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
  text-shadow: none;
}

:root[data-theme="light"] .btn-signup:hover {
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

main {
  padding: 20px 0 20px;
}

h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
}

.subtext {
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 920px;
  line-height: 1.5;
  font-size: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.card-title {
  color: var(--text);
  font-size: 13px;
  padding-bottom: 10px;
  font-weight: 400;
}

.card-value {
  font-size: 22px;
  font-weight: 700;
}

.card-change {
  color: var(--positive);
  font-weight: 700;
  font-size: 13px;
}

.tab-links {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  margin-top: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  padding-right: 23px;
}

.tab-links::-webkit-scrollbar {
  display: none;
}

/* Wrapper for tabs so arrow can be positioned relative to visible area */
.tabs-wrap {
  position: relative;
}

/* Filter section: holds tabs and filter button */
.filter-section {
  position: relative; 
  display: flex;
  align-items: center;
  gap: 8px; /* reduced gap so button is closer */
  margin-bottom: 0px;
  position: relative; /* ensure popup can be positioned relative to this container */
  overflow: visible; /* allow popup to overflow without being clipped */
  z-index: 20;
  flex-wrap: wrap; /* добавь это */
}

/* Category Tabs Row - contains tabs and filter button */
.category-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category Tabs */
.category-tabs {
  display: inline-flex;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

/* Filter button in category-tabs-row - hidden on desktop, shown on mobile */
.category-tabs-row > .filter-btn {
  display: none;
}

/* Medium screens - smaller category tabs */
@media (max-width: 1368px) and (min-width: 769px) {
  .category-tab {
    padding: 8px 12px;
    font-size: 12px;
    gap: 4px;
  }
  
  .category-tab svg {
    width: 12px;
    height: 12px;
  }
  
  .category-tabs {
    padding: 3px;
    gap: 3px;
  }
}

@media (max-width: 768px) {
  .category-tabs-row {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
  }
  
  /* Scrollable tabs container */
  .category-tabs {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
    padding-right: 20px;
  }
  
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  
  /* Show filter-btn in category-tabs-row on mobile */
  .category-tabs-row > .filter-btn {
    display: flex;
    flex-shrink: 0;
  }
  
  /* Hide filter-wrapper on mobile */
  .filter-wrapper .filter-btn {
    display: none;
  }
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space:nowrap;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.category-tab svg {
  opacity: 0.7;
}

.category-tab.active svg {
  opacity: 1;
}

.category-tab .material-symbols-rounded {
  font-size: 16px;
  opacity: 0.7;
}

.category-tab.active .material-symbols-rounded {
  opacity: 1;
}

/* Stats Info - compact version */
.stats-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.stats-info-count {
  color: var(--positive);
  font-weight: 500;
}

.stats-info-divider {
  opacity: 0.5;
}

.stats-info-update {
  color: var(--muted);
}

/* Stats Bar - replaces tabs */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 280px;
  gap: 16px;
}

.stats-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.stats-bar-mode {
  font-weight: 600;
  color: var(--text);
}

.stats-bar-divider {
  color: var(--border);
}

.stats-bar-count {
  color: var(--positive);
  font-weight: 500;
}

.stats-bar-update {
  color: var(--muted);
  font-size: 12px;
}

.stats-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(0, 116, 239, 0.15);
  border: 1px solid rgba(0, 116, 239, 0.3);
  border-radius: 12px;
  font-size: 11px;
  color: #0074ef;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  background: rgba(0, 116, 239, 0.25);
}

.filter-tag .remove-tag {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.filter-tag .remove-tag:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .stats-bar {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }
  
  .stats-bar-left {
    flex-wrap: wrap;
  }
  
  .stats-bar-right {
    width: 100%;
  }
  
  .active-filters {
    width: 100%;
  }
}

/* Timeframe selector (sits between tabs and filter button) */
.timeframe-wrapper {
  display: inline-flex;
  align-items: center;
  margin-top: 15px;
  gap: 8px;
  margin-left: auto; /* прижать таймфреймы + фильтр вправо */
  flex-shrink: 0;
}

/* Hide timeframe wrapper on mobile and tablets */
@media (max-width: 1024px) {
  .timeframe-wrapper {
    display: none !important;
  }
}

/* separator removed (was breaking layout) */

.mydict div {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  justify-content: center;

}

.mydict input[type="checkbox"] {
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.mydict input[type="checkbox"]:checked + span {
  box-shadow: none !important; /* remove outline so we can draw edges explicitly */
  background-color: #393f4f69;
  z-index: 1;
  color: var(--text);
}

.mydict div {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  justify-content: center;
  gap: 4px;
}

.mydict label span {
  display: block;
  cursor: pointer;
  background-color: transparent;
  padding: 6px 15px;
  margin-bottom: 0.697em;
  position: relative;
  box-shadow: none;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
  transition: all 0.25s ease;
  font-size: 12px;
  border-radius: 8px;
  /* Reserve a transparent border to avoid layout shift when toggling */
  border: 1px solid transparent;
}

.mydict label:first-child span {
  border-radius: 8px;
}

.mydict label:last-child span {
  border-radius: 8px;
}

/* Grouping styles for adjacent checked items - applied via JS on desktop only */
.mydict label.group-start span {
  border-radius: 8px 0 0 8px;
  margin-right: 0 !important;
  border-right: none !important;
}

.mydict label.group-middle span {
  border-radius: 0;
  margin-left: -4px !important;
  margin-right: 0 !important;
  border-left: none !important;
  border-right: none !important;
}

.mydict label.group-end span {
  border-radius: 0 8px 8px 0;
  margin-left: -4px !important;
  border-left: none !important;
}

.mydict label.group-single span {
  border-radius: 8px;
}

.mydict label.group-start span {
  border-left: 1px solid transparent !important;
  border-top: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
}

.mydict label.group-end span {
  border-right: 1px solid transparent !important;
  border-top: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
}

:root[data-theme="dark"] .mydict label.group-start span,
:root[data-theme="dark"] .mydict label.group-end span {
  border-color: #6b7280 !important;
}

:root[data-theme="light"] .mydict label.group-start span,
:root[data-theme="light"] .mydict label.group-end span {
  border-color: #005eff !important;
}

:root[data-theme="dark"] .mydict label.group-middle span {
  border-top-color: #6b7280 !important;
  border-bottom-color: #6b7280 !important;
}

:root[data-theme="light"] .mydict label.group-middle span {
  border-top-color: #005eff !important;
  border-bottom-color: #005eff !important;
}

:root[data-theme="light"] .mydict label.group-single input[type="checkbox"]:checked + span {
  border-color: #005eff !important;
  box-shadow: none !important;
  color: #004cff !important;
}

:root[data-theme="dark"] .mydict label.group-single input[type="checkbox"]:checked + span {
  border-color: #6b7280 !important;
  box-shadow: none !important;
  color: #fff !important;
}

/* Focus styles scoped to timeframe control */
:root[data-theme="dark"] .mydict :focus {
  outline: 0;
  border-color: #4d82ff;
  box-shadow: 0 0 0 4px #2a4a8f;
}

:root[data-theme="light"] .mydict :focus {
  outline: 0;
  border-color: #2260ff;
  box-shadow: 0 0 0 4px #b5c9fc;
}

/* Theme-specific tweaks for timeframe chips */
:root[data-theme="dark"] .mydict label span {
  background-color: transparent;
  color: #9ea1ab;
  box-shadow: none;
}

:root[data-theme="dark"] .mydict input[type="checkbox"]:checked + span {
  box-shadow: 0 0 0 1px #6b7280;
  background-color: #393f4f69;
  z-index: 1;
  color: #fff;
}

:root[data-theme="light"] .mydict label span {
  background-color: transparent;
  color: #6b7280;
  box-shadow: none;
}

:root[data-theme="light"] .mydict input[type="checkbox"]:checked + span {
  box-shadow: 0 0 0 1px #005eff;
  background-color: #dddddd1f;
  z-index: 1;
  color: #004cff;
}

/* Wrapper around the filter button + popup so popup can be positioned
   relative to this wrapper instead of the flex container */
.filter-wrapper {
  position: relative;
  margin-top: 14px; /* match timeframe-wrapper */
  margin-left: 12px; /* отступ от таймфреймов */
  display: flex;
  align-items: center;
  gap: 12px;
}
@media (max-width: 768px) {
  .filter-wrapper {
    margin-top: 0;
    display: none; /* скрыть на мобильных - там используется filter-btn в category-tabs-row */
  }
}
/* Filter tabs above table */
/* REMOVED - Not needed */

/* Timeframes in modal */
.filter-modal-timeframes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

:root[data-theme="light"] .filter-modal-timeframes {
  background: #e5e7eb;
}

.filter-modal-timeframe {
  display: inline-flex;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.filter-modal-timeframe input[type="radio"],
.filter-modal-timeframe input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-modal-timeframe span {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.filter-modal-timeframe input[type="radio"]:checked + span,
.filter-modal-timeframe input[type="checkbox"]:checked + span {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.filter-modal-timeframe:hover span {
  opacity: 0.8;
}

:root[data-theme="light"] .filter-modal-timeframe input[type="radio"]:checked + span,
:root[data-theme="light"] .filter-modal-timeframe input[type="checkbox"]:checked + span {
  background: #fff;
  color: var(--text);
}

/* Modal overlay */
.filter-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9998;
}

.filter-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal window */
.filter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* Medium screens adaptation */
@media (max-width: 900px) {
  .filter-modal {
    max-width: 90%;
    max-height: 80vh;
  }
  
  .filter-modal-body {
    padding: 16px;
  }
  
  .filter-modal-checkboxes {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .filter-modal {
    max-width: 95%;
    max-height: 85vh;
    border-radius: 12px;
  }
  
  .filter-modal-header {
    padding: 16px;
  }
  
  .filter-modal-header h2 {
    font-size: 18px;
  }
  
  .filter-modal-body {
    padding: 12px;
  }
  
  .filter-modal-checkboxes {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .filter-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
  }
}

.filter-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

:root[data-theme="dark"] .filter-modal {
  background: #1a1d26;
  border: 1px solid #2a2e3a;
}

:root[data-theme="light"] .filter-modal {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Modal header */
.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.filter-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.filter-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.filter-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.close-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 24px;
}

/* Modal body */
.filter-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4b #1a1d26;
}

.filter-modal-body::-webkit-scrollbar {
  width: 8px;
}

.filter-modal-body::-webkit-scrollbar-track {
  background: #1a1d26;
  border-radius: 4px;
}

.filter-modal-body::-webkit-scrollbar-thumb {
  background: #3a3f4b;
  border-radius: 4px;
}

.filter-modal-body::-webkit-scrollbar-thumb:hover {
  background: #4a4f5b;
}

.filter-modal-section {
  margin-bottom: 28px;
}

.filter-modal-section:last-child {
  margin-bottom: 0;
}

.filter-modal-section h3 {
  margin: 0 0 16px 0;
  font-size: 11px;
  font-weight: 600;
  color: #9292a4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Checkboxes in modal */
.filter-modal-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* Inline checkboxes - в одну строку */
.filter-modal-checkboxes.filter-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

@media (max-width: 640px) {
  .filter-modal-checkboxes {
    grid-template-columns: 1fr 1fr;
  }
  
  .filter-modal-checkboxes.filter-inline {
    display: flex;
  }
}

.filter-modal-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.filter-modal-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  margin-right: 10px;
  cursor: pointer;
  flex-shrink: 0;
  border: 1.5px solid #6b7280;
  border-radius: 3px;
  background: transparent;
  transition: all 0.2s ease;
  position: relative;
}

.filter-modal-checkbox input[type="checkbox"]:hover {
  border-color: #fff;
}

.filter-modal-checkbox input[type="checkbox"]:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.filter-modal-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-modal-checkbox span {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.filter-modal-checkbox.active {
  color: #3b82f6;
  font-weight: 600;
}

/* Keywords section */
.filter-modal-keywords {
  margin-bottom: 16px;
}

.filter-modal-keywords label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-keyword-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s ease;
}

.filter-keyword-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

:root[data-theme="dark"] .filter-keyword-input {
  background: #0f0f0f;
}

:root[data-theme="light"] .filter-keyword-input {
  background: #f9fafb;
}

/* Modal footer */
.filter-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.filter-modal-btn-secondary,
.filter-modal-btn-primary {
  flex: 1;
  padding: 12px 104px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-modal-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.filter-modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-modal-btn-primary {
  background: #104fcc;
  color: #fff;
  box-shadow: 
    0 0 20px rgba(16, 79, 204, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.filter-modal-btn-primary:hover {
  background: #0d45b8;
  box-shadow: 
    0 0 28px rgba(16, 79, 204, 0.6),
    0 6px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

/* Mobile only section - hide on desktop */
.mobile-only-section {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only-section {
    display: block;
  }
}

/* .tabs-wrap is a simple wrapper for positioning if needed */
.tabs-wrap {
  flex: 1;
  min-width: 0; /* добавь это */
  overflow: hidden; /* добавь это */
}


/* Filter button */
.filter-btn {
  display: inline-flex;
  padding: 0.4em 0.75em;
  border: 1px solid #333952; /* dark theme base border (will be adapted per theme below) */
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  margin-bottom: 5px;
  z-index: 6;
  align-items: center;
  gap: 6px; /* bring text closer to icon */
}

.filter-btn:hover {
  opacity: 0.8;
}

/* Theme-specific filter button background */
:root[data-theme="dark"] .filter-btn {
  background: #171a21;
  color: var(--text);
}

:root[data-theme="light"] .filter-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Style the filter icon and hide text on small screens */
.filter-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 16px;
  line-height: 1;
  margin-right: 4px; /* smaller gap to text */
}

.filter-text {
  display: inline-block;
}

@media (max-width: 768px) {
  .filter-text { display: none; }
  .filter-btn {padding-left: 7px;padding-right: 11px;width: 34px;height: 32px;border-radius: 8px; margin-right: 4px;}
  .filter-icon { font-size: 18px; margin-right: 0; }
}

/* Filter popup */
.filter-popup {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  overflow: hidden; 
}
[data-theme="light"] {
  --card-bg: #ffffff; 
}

[data-theme="dark"] .filter-popup::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1e3a8a 0%, #0c1e3d 50%, transparent 100%);
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

.filter-content {
  position: relative;
  z-index: 1;
}
.filter-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


.filter-content {
  padding: 8px 0;
  /* show initially 8 filters (approx 8 * 44px = 352px) */
  max-height: 352px;
  overflow-y: auto;
}

/* Dark theme: make popup background slightly darker, per request */
:root[data-theme="dark"] .filter-popup {
  background: #171a20;
  border: 1px solid #333952; 
}

/* Collapsible filter group styles */
.filter-group {
  padding: 0 8px 4px 8px;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}

.filter-group-header:focus {
  outline: none;
}

.group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.group-controls {
  display: inline-flex;
  align-items: center;
  gap: 12px; /* more space so caret doesn't touch the switch */
  flex-shrink: 0;
}

.group-toggle-icon {
  display: inline-block;
  font-size: 14px; /* slightly larger for clarity */
  line-height: 1;
  transition: transform 0.18s ease;
  color: var(--muted);
  width: 18px;
  text-align: center;
}

.filter-group-body {
  padding: 0 4px 8px 4px;
  transition: max-height 0.22s ease, opacity 0.18s ease;
  overflow: hidden;
  max-height: 2000px; /* large value to allow content */
}

.filter-group.collapsed .filter-group-body {
  max-height: 0;
  opacity: 0;
  padding: 0 4px;
}

.filter-group.collapsed .group-toggle-icon {
  transform: rotate(-90deg);
}

/* Hide any remaining caret icons */
.group-toggle-icon {
  display: none !important;
}

/* Restore original (translucent white) track for switches by default */
.switch .slider {
  background: rgba(255,255,255,0.08);
}

/* Light theme - grey background for inactive toggles */
:root[data-theme="light"] .switch .slider {
  background: rgba(0,0,0,0.1);
}

/* Keep checked (active) state using accent color */
.switch input:checked + .slider {
  background: var(--accent);
}

.filter-content::-webkit-scrollbar {
  width: 6px;
}

.filter-content::-webkit-scrollbar-track {
  background: transparent;
}

.filter-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Filter toggle (checkbox + label) */

.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.filter-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.toggle-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
}

/* iOS-style switch */
.switch {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 40px; /* slightly smaller */
  height: 22px; /* slightly smaller */
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: auto; /* <- важно */
}

.switch .slider {
  position: relative;
  display: block;
  pointer-events: auto; 
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  transition: background 0.18s ease;
}

.switch .slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::after {
  transform: translateX(16px);
  background: #fff;
}

/* Filter divider */
.filter-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.tab-link {
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 0 0 15px;
  cursor: pointer;
  opacity: 0.9;
  position: relative;
  transition: opacity 0.2s ease, color 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-link:hover {
  opacity: 1;
  color: var(--text); /* transitions to white in dark theme */
}
.tab-link.active {
  opacity: 1;
}

.tab-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #3b82f6;
  border-radius: 999px;
}

.table-container {
  background: #0f1015;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
  width: 100%;
  transition: box-shadow 0.3s ease;
  position: relative;
}

.table-container::before {
  content: '';
  position: absolute;
  inset: 0;
  /* background: radial-gradient(ellipse 80% 60% at 50% 0%, #1e3a8a 0%, #0c1e3d 50%, transparent 100%); */
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}
.table-scroll {
  position: relative;
  z-index: 1;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

/* Watchlist column (1st) - compact */
td:nth-child(1),
th:nth-child(1) {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
}

/* Index column (2nd) - compact */
td:nth-child(2),
th:nth-child(2) {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
}

/* Asset column (3rd) */
td:nth-child(3),
th:nth-child(3) {
  width: auto;
  max-width: 100px !important;
}

/* Event/Bias column (4th) */
td:nth-child(4),
th:nth-child(4) {
  width: auto;
}

th {
  text-align: left;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

/* Increase left/right padding for table edges */
/* Left padding on watchlist column (first) */
th:first-child,
td:first-child {
  padding-left: 16px;
}
/* Special padding for watchlist-col */
th.watchlist-col,
td.watchlist-col {
  padding: 0 4px 0 16px !important;
}
/* Index column padding */
th.index-col,
td.index-col {
  padding-left: 39px !important;
  padding-right: 25px !important;
}

/* Medium screens: remove left padding */
@media (max-width: 1368px) and (min-width: 769px) {
  th.index-col,
  td.index-col {
    padding-left: 10px !important;
  }
}
th:last-child,
td:last-child {
  padding-right: 24px;
}

/* Ensure tbody has minimum height when empty or loading */
tbody {
  min-height: 100px;
}

/* Fix for mobile: ensure single-cell rows (loading, no data, error) are visible */
tbody tr:only-child td:only-child,
tbody tr td[colspan] {
  display: table-cell !important;
  min-height: 100px;
  height: auto;
}

tbody tr {
  border-top: 1px solid var(--border);
  transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

td {
  padding: 13px 24px;
  vertical-align: middle;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}
td:last-child {
  width:1%;
  white-space: nowrap;
}

.signal-time {
  color: #fffd;
  font-weight: 500;
  font-size: 13px;
}
.smart-money-table td:nth-child(4),
.smart-money-table th:nth-child(4) {
  width: 150px;
  padding-left: 75px !important;

}

/* ========================================
   TAB-SPECIFIC TABLE STYLES
   ======================================== */

/* ========================================
   UNIFIED MARKET SCAN TABLES
   Applies to: levels, rsi, volume, candle, formations, trends
   ======================================== */

/* Common styles for all Market Scan tables */
.levels-table,
.rsi-table,
.volume-table,
.candle-table,
.formations-table,
.trends-table {
  table-layout: auto !important;
}

/* Column 1: Watchlist star (28px) */
.levels-table td:nth-child(1), .levels-table th:nth-child(1),
.rsi-table td:nth-child(1), .rsi-table th:nth-child(1),
.volume-table td:nth-child(1), .volume-table th:nth-child(1),
.candle-table td:nth-child(1), .candle-table th:nth-child(1),
.formations-table td:nth-child(1), .formations-table th:nth-child(1),
.trends-table td:nth-child(1), .trends-table th:nth-child(1) {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
}

/* Column 2: Index number (32px) */
.levels-table td:nth-child(2), .levels-table th:nth-child(2),
.rsi-table td:nth-child(2), .rsi-table th:nth-child(2),
.volume-table td:nth-child(2), .volume-table th:nth-child(2),
.candle-table td:nth-child(2), .candle-table th:nth-child(2),
.formations-table td:nth-child(2), .formations-table th:nth-child(2),
.trends-table td:nth-child(2), .trends-table th:nth-child(2) {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
}

/* Column 3: Asset (auto, min 180px) */
.levels-table td:nth-child(3), .levels-table th:nth-child(3),
.rsi-table td:nth-child(3), .rsi-table th:nth-child(3),
.volume-table td:nth-child(3), .volume-table th:nth-child(3),
.candle-table td:nth-child(3), .candle-table th:nth-child(3),
.formations-table td:nth-child(3), .formations-table th:nth-child(3),
.trends-table td:nth-child(3), .trends-table th:nth-child(3) {
  width: auto;
  min-width: 180px;
}

/* Column 4: Event (auto with left padding) */
.levels-table td:nth-child(4), .levels-table th:nth-child(4),
.rsi-table td:nth-child(4), .rsi-table th:nth-child(4),
.volume-table td:nth-child(4), .volume-table th:nth-child(4),
.candle-table td:nth-child(4), .candle-table th:nth-child(4),
.formations-table td:nth-child(4), .formations-table th:nth-child(4),
.trends-table td:nth-child(4), .trends-table th:nth-child(4) {
  width: auto;
  padding-left: 30px;
}

/* Columns 5-9: Auto width */
.levels-table td:nth-child(n+5), .levels-table th:nth-child(n+5),
.rsi-table td:nth-child(n+5), .rsi-table th:nth-child(n+5),
.volume-table td:nth-child(n+5), .volume-table th:nth-child(n+5),
.candle-table td:nth-child(n+5), .candle-table th:nth-child(n+5),
.formations-table td:nth-child(n+5), .formations-table th:nth-child(n+5),
.trends-table td:nth-child(n+5), .trends-table th:nth-child(n+5) {
  width: auto;
}

/* Mobile styles for Market Scan tables */
@media (max-width: 768px) {
  /* Hide watchlist and index columns - but NOT cells with colspan (like "No data available") */
  .levels-table td:nth-child(1):not([colspan]), .levels-table th:nth-child(1),
  .levels-table td:nth-child(2):not([colspan]), .levels-table th:nth-child(2),
  .rsi-table td:nth-child(1):not([colspan]), .rsi-table th:nth-child(1),
  .rsi-table td:nth-child(2):not([colspan]), .rsi-table th:nth-child(2),
  .volume-table td:nth-child(1):not([colspan]), .volume-table th:nth-child(1),
  .volume-table td:nth-child(2):not([colspan]), .volume-table th:nth-child(2),
  .candle-table td:nth-child(1):not([colspan]), .candle-table th:nth-child(1),
  .candle-table td:nth-child(2):not([colspan]), .candle-table th:nth-child(2),
  .formations-table td:nth-child(1):not([colspan]), .formations-table th:nth-child(1),
  .formations-table td:nth-child(2):not([colspan]), .formations-table th:nth-child(2),
  .trends-table td:nth-child(1):not([colspan]), .trends-table th:nth-child(1),
  .trends-table td:nth-child(2):not([colspan]), .trends-table th:nth-child(2) {
    display: none !important;
  }
  
  /* Ensure colspan cells are always visible */
  td[colspan] {
    display: table-cell !important;
  }
  
  /* Asset column (3rd) - sticky */
  .levels-table td:nth-child(3), .levels-table th:nth-child(3),
  .rsi-table td:nth-child(3), .rsi-table th:nth-child(3),
  .volume-table td:nth-child(3), .volume-table th:nth-child(3),
  .candle-table td:nth-child(3), .candle-table th:nth-child(3),
  .formations-table td:nth-child(3), .formations-table th:nth-child(3),
  .trends-table td:nth-child(3), .trends-table th:nth-child(3) {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: #000 !important;
    min-width: 160px !important;
    padding-left: 12px !important;
  }
  
  /* Event column (4th) - reset padding */
  .levels-table td:nth-child(4), .levels-table th:nth-child(4),
  .rsi-table td:nth-child(4), .rsi-table th:nth-child(4),
  .volume-table td:nth-child(4), .volume-table th:nth-child(4),
  .candle-table td:nth-child(4), .candle-table th:nth-child(4),
  .formations-table td:nth-child(4), .formations-table th:nth-child(4),
  .trends-table td:nth-child(4), .trends-table th:nth-child(4) {
    padding-left: 12px !important;
    min-width: 120px;
  }
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Clickable asset cell */
.asset-cell.asset-clickable {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  margin: -4px;
}

/* Sparkline column - align chart and header to right */
th.sparkline {
  text-align: right;
  padding-right: 25px;
}

.sparkline-cell {
  text-align: right;
  padding-right: 25px;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.sparkline-cell svg {
  display: inline-block;
  vertical-align: middle;
}

/* Clickable sparkline */
.sparkline-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sparkline-clickable:hover {
  transform: scale(1.05);
}

.asset-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Price cell with change */
.price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-value {
  font-size: 14px;
  font-weight: 500;
}

/* Medium screens - smaller price */
@media (max-width: 1399px) {
  .price-value {
    font-size: 13px;
  }
}

.price-change-inline {
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.price-change-inline.positive {
  color: #22c55e;
}

.price-change-inline.negative {
  color: #ef4444;
}

/* WebSocket price flash animations */
.price-value {
  transition: color 0.15s ease;
}

.price-value.flash-up {
  color: #22c55e !important;
}

.price-value.flash-down {
  color: #ef4444 !important;
}

@keyframes price-flash-up {
  0% { background-color: rgba(34, 197, 94, 0.3); }
  100% { background-color: transparent; }
}

@keyframes price-flash-down {
  0% { background-color: rgba(239, 68, 68, 0.3); }
  100% { background-color: transparent; }
}

.asset-symbol {
  font-size: 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.asset-symbol .base {
  font-weight: 600;
  max-width: 65px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-symbol .quote {
  font-weight: 400;
  color: #828998;
}

.asset-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel);
}

.asset-icon-placeholder {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Fix signal age position when icon is placeholder */
@media (max-width: 768px) {
  .asset-cell .asset-icon-placeholder {
    width: 29px;
    height: 29px;
    min-width: 29px;
    min-height: 29px;
    margin-top: 16px;
    align-self: flex-start;
    font-size: 12px;
  }
  

}

.exchange-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.exchange-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: contain;
}

.exchange-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.price,
.volume {
  font-weight: 400;
  font-size: 14px;
}

/* Volume cell styling */
.volume-cell {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 1368px) and (min-width: 769px) {
  .volume-cell {
    font-size: 11px;
  }
}
.volume-cell .volume-value {
  color: var(--text-muted);
}
.volume-cell.volume-high .volume-value {
  color: var(--success);
}
.volume-cell.volume-medium .volume-value {
  color: var(--warning);
}

/* Watchlist and Index columns (like CoinMarketCap) */
.watchlist-col {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  text-align: center;
  padding: 0 4px 0 16px !important;
}
.watchlist-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s, transform 0.15s;
  border-radius: 4px;
}
.watchlist-star:hover {
  color: #fbbf24;
  transform: scale(1.1);
}
.watchlist-star.active {
  color: #fbbf24;
}
.watchlist-star .material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: 'FILL' 0;
}
.watchlist-star.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1;
}

.index-col {
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding: 0 8px !important;
}

/* Watchlist count badge */
.watchlist-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left:2px;
  margin-top: -1px;
  background: #2c3252;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
}


/* Hide watchlist and index columns on mobile */
@media (max-width: 768px) {
  .watchlist-col,
  .index-col {
    display: none !important;
  }
}

.event,
.timeframe
 {
  white-space: normal;
  font-size: 13.8px;
}
.signal-time {
  white-space: nowrap;
  font-size: 13px;
}
:root[data-theme="light"] .event {
  font-weight: 500;
}
:root[data-theme="light"] .tab-link.active {
  color: #3b82f6;
  font-weight: 500;
}
/* Dark theme: adjust tab link appearance per request */
:root[data-theme="dark"] .tab-link {
  color: #b6c2d7;
  font-size: 14px;
  font-weight: 500;
}

/* уменьшенный голубой iOS-style переключатель */
.theme-toggle-wrapper {
  display: inline-block;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* скрытый, но кликабельный input */
.theme-toggle-wrapper input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
  pointer-events: auto;
}

/* Дорожка */
.theme-toggle-wrapper .toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
  transition: background .18s cubic-bezier(.2,.9,.2,1), box-shadow .18s;
  position: relative;
  z-index: 1;
}

/* Ползунок */
.theme-toggle-wrapper .toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
  transition: transform .18s cubic-bezier(.2,.9,.2,1);
}

/* ВКЛЮЧЕНО — синий */
.theme-toggle-wrapper input[type="checkbox"]:checked + .toggle-track {
  background: linear-gradient(90deg, #0a84ff, #007aff);
}

/* Сдвиг ползунка вправо */
.theme-toggle-wrapper input[type="checkbox"]:checked + .toggle-track .toggle-thumb {
  transform: translateY(-50%) translateX(18px);
}

/* Фокус (аккуратная синяя подсветка) */
.theme-toggle-wrapper input[type="checkbox"]:focus + .toggle-track {
  box-shadow: 0 0 0 4px rgba(10,132,255,0.20);
}


:root[data-theme="dark"] .tab-link.active {
  opacity: 1;
  color: #ffffff;
}
/* Ensure hover forces full white in dark theme (higher specificity by using :hover) */
:root[data-theme="dark"] .tab-link:hover {
  color: #ffffff;
  opacity: 1;
}
.event-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 4px;
}

.event-icon.support {
  color: #25a750;
}

.event-icon.resistance {
  color: #ca3f64;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border-radius: 6px;
  font-weight: 400;
  font-size: 12px;
  white-space: nowrap;
  width: fit-content;
  background: transparent;
  border: none;
}

.level-badge svg {
  width: 100px;
  height: 40px;
}

.level-badge.support svg path.line {
  stroke: #25a750;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-badge.support svg path.area {
  stroke: none;
}

.level-badge.resistance svg path.line {
  stroke: #ca3f64;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-badge.resistance svg path.area {
  stroke: none;
}

.symbol {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.change.positive {
  color: var(--positive);
  font-weight: 700;
}

.change.negative {
  color: var(--negative);
  font-weight: 700;
}

.spark {
  width: 90px;
  height: 32px;
  background: linear-gradient(180deg, #30405f, #1b2030);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.spark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  border: 2px solid #7ea5ff33;
  opacity: 0.7;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.growth-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.growth-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.growth-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.growth-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel);
}

.growth-symbol {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.growth-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.growth-arrow {
  font-family: 'Material Symbols Rounded';
  font-size: 18px;
  color: var(--positive);
  line-height: 1;
}

.growth-percent {
  font-size: 14px;
  font-weight: 500;
  color: var(--positive);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.news-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 400;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}

.theme-toggle:hover {
  opacity: 0.8;
}

.theme-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 18px;
  line-height: 1;
}
@media (max-width: 1399px) {
  .table-container {
    overflow-x: auto;
    border: none;
    border-radius: 0px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0);
  }

  .table-scroll {
    overflow-x: visible;
  }

  table {
    font-size: 12px;
    min-width: 0;
    width: 100%;
    table-layout: auto;
  }

  .signal-time {
    font-size: 12px;
  }

  td,
  th {
    font-size: 12px;
    padding: 14px 8px;
    white-space: nowrap;
  }

  /* Compact column widths for medium screens */
  td:nth-child(1), th:nth-child(1) { width: auto; min-width: 50px; }
  td:nth-child(2), th:nth-child(2) { width: auto; min-width: 40px; }
  td:nth-child(3), th:nth-child(3) { width: auto; min-width: 140px; }
  td:nth-child(4), th:nth-child(4) { width: auto; min-width: 60px; }
  td:nth-child(5), th:nth-child(5) { width: auto; }
  td:nth-child(6), th:nth-child(6) { width: auto; }
  td:nth-child(7), th:nth-child(7) { width: auto; }
  td:nth-child(8), th:nth-child(8) { width: auto; }

  .asset-symbol,
  .timeframe,
  .event
 
   {
    font-size: 12.8px;
  }
  .exchange-name,
  .volume,  
  .price
    {
      font-size: 12px;
    }
  /* Hide less important columns on medium screens */
  td:nth-child(5), th:nth-child(5),
  td:nth-child(6), th:nth-child(6) {
    display: table-cell;
  }
}
@media (max-width: 1399px) {
  .table-scroll {
    overflow-x: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .table-scroll::-webkit-scrollbar {
    display: none;
  }
}
@media (max-width: 1400px) {
  nav {
    display: none;
  }

  .actions {
    margin-left: auto;
  }
  
  .hero {
    margin-top: 40px;
  }
  
  .cards {
    grid-template-columns: 1fr;
  }
  
  main {
    padding-bottom: 40px;
  }

  .page-bottom-spacer {
    height: 1vh;

  }
}

/* Гамбургер меню */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.mobile-menu-btn:hover {
  opacity: 0.8;
}

.mobile-menu-btn .menu-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 24px;
  color: var(--text);
  line-height: 1;
}

:root[data-theme="dark"] .mobile-menu-btn {
    background: #0b151e00;
    border: 1px solid #03091900;
}

/* Мобильное меню на весь экран */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-menu.active {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

:root[data-theme="light"] .mobile-menu-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.mobile-menu-close:hover {
  background: var(--border);
}

.mobile-menu-close .close-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 24px;
  color: var(--text);
  line-height: 1;
}

.mobile-menu-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px;
}

/* Mobile menu tab boxes */
.mobile-menu-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-tab:hover,
.mobile-menu-tab.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.mobile-menu-tab .tab-icon {
  font-family: 'Material Symbols Rounded';
  font-size: 28px;
  color: var(--text);
  line-height: 1;
}

.mobile-menu-tab .tab-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mobile-menu-tab .tab-desc {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

/* Mobile menu footer links */
.mobile-menu-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-footer a {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-footer a:hover {
  color: var(--text);
}

/* Оверлей убираем, т.к. меню на весь экран */
.mobile-menu-overlay {
  display: none;
}

/* Мобильная версия - исправления для header */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .topbar {
    padding: 12px 0;
    gap: 12px;
  }

  /* Показываем гамбургер меню */
  .mobile-menu-btn {
    display: flex;
    border: none;
    order: -1;
  }

  /* Скрываем десктопное меню */
  nav {
    display: none;
  }

  /* Скрываем текстовое лого на мобильных */
  .brand-text {
    display: none;
  }

  /* Уменьшаем размер логотипа */
  .brand-logo {
    height: 20px;
    width: 40px;
  }

  /* Скрываем лишние элементы в actions */
  .actions .small,
  .actions .theme-toggle,
  .actions .btn,
  .btn-signup {
    display: none;
  }

  /* Кнопка Sign in как БОЛЬШАЯ иконка профиля */
  .btn-signin {
    padding: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    font-size: 0;
    color: transparent;
    overflow: hidden;
    text-indent: -9999px;
  }

  .btn-signin::before {
    content: '\e853';
    font-family: 'Material Symbols Rounded';
    font-size: 32px;
    color: var(--text);
    line-height: 1;
    text-indent: 0;
    position: absolute;
  }

  :root[data-theme="dark"] .btn-signin {
    border: none;
  }

  :root[data-theme="light"] .btn-signin {
    background: var(--panel);
    border: none;
    color: var(--text);
  }

  /* Компактный header */
  .actions {
    gap: 10px;
  }

  /* Табы - горизонтальный скролл с стрелкой */
  .tab-links {
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
  }

  .tab-link {
    font-size: 13px;
    padding: 0 0 12px;
  }

  /* Show filter button on mobile */
  .filter-btn {
    display: inline-flex;
    align-items: center;

    /* No scroll buttons — keep native horizontal scrolling */

    z-index: 9999; /* ensure it sits above table content */
  }

  table {
    min-width: 800px;
  }

  th {
    background: var(--card);
  }

  /* Watchlist column (1st) - hidden on mobile */
  td:nth-child(1),
  th:nth-child(1) {
    display: none !important;
  }
  
  /* Index column (2nd) - hidden on mobile */
  td:nth-child(2),
  th:nth-child(2) {
    display: none !important;
  }

  /* Asset column (3rd) - sticky on mobile */
  td:nth-child(3),
  th:nth-child(3) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--card);
    min-width: 130px;
    padding-left: 12px;
    padding-right: 6px;
  }
  
  /* Event column (4th) */
  td:nth-child(4),
  th:nth-child(4) {
    width: 120px;
    padding-left: 6px;
    padding-right: 12px;
  }

  td:nth-child(5),
  th:nth-child(5) {
    width: 140px;
    padding-left: 18px;
    padding-right: 8px;
  }

/* Shadow for sticky column when scrolled */
td:nth-child(3)::after,
th:nth-child(3)::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, rgb(0 0 0 / 72%), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Показываем тень только при скролле - только для td (не для th в шапке) */
.table-scroll.scrolled td:nth-child(3)::after {
  opacity: 1;
}

/* Убираем тень в шапке таблицы */
.table-scroll.scrolled th:nth-child(3)::after {
  opacity: 0;
}

:root[data-theme="light"] td:nth-child(2)::after,
:root[data-theme="light"] th:nth-child(2)::after {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent);
}

  td, th {
    font-size: 13px;
    padding: 5px 8px;
  }

  .signal-time {
    font-size: 12px;
  }

  .asset-symbol {
    font-size: 12px;
  }

  .asset-icon {
    width: 18px;
    height: 18px;
  }

  .event {
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.3;
  }

  .event-icon {
    font-size: 14px;
    margin-right: 2px;
  }

  /* Остальные колонки */
  td:nth-child(3),
  th:nth-child(3),
  td:nth-child(4),
  th:nth-child(4),
  td:nth-child(5),
  th:nth-child(5),
  td:nth-child(6),
  th:nth-child(6),
  td:nth-child(7),
  th:nth-child(7),
  td:nth-child(8),
  th:nth-child(8) {
    width: auto;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }
  
  .hero h1 {
    font-size: 22px;
  }
  
  .subtext {
    font-size: 13px;
  }

  /* Дополнительная оптимизация для очень маленьких экранов */
  .topbar {
    padding: 10px 0;
  }

  .brand-logo {
    height: 18px;
    width: 36px;
  }

  .btn-signin {
    width: 40px;
    height: 40px;
  }

  .btn-signin::before {
    font-size: 32px;
  }
}

.card {
  position: relative;
}

.card .points_wrapper {
  overflow: hidden;
  width: 100%;
  height: 100%;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 14px;
}

.card .points_wrapper .point {
  bottom: -10px;
  position: absolute;
  animation: floating-points infinite ease-in-out;
  pointer-events: none;
  width: 3px;
  height: 3px;
  background-color: #fff;
  border-radius: 9999px;
  opacity: 0.4;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes floating-points {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  85% {
    opacity: 0;
  }
  100% {
    transform: translateY(-120px);
    opacity: 0;
  }
}

.card .points_wrapper .point:nth-child(1) {
  left: 10%;
  animation-duration: 6s;
  animation-delay: 0.2s;
}
.card .points_wrapper .point:nth-child(2) {
  left: 30%;
  animation-duration: 7s;
  animation-delay: 0.5s;
}
.card .points_wrapper .point:nth-child(3) {
  left: 25%;
  animation-duration: 6.5s;
  animation-delay: 0.1s;
}
.card .points_wrapper .point:nth-child(4) {
  left: 44%;
  animation-duration: 6.8s;
}
.card .points_wrapper .point:nth-child(5) {
  left: 50%;
  animation-duration: 5.5s;
}
.card .points_wrapper .point:nth-child(6) {
  left: 75%;
  animation-duration: 7.5s;
  animation-delay: 1.5s;
}
.card .points_wrapper .point:nth-child(7) {
  left: 88%;
  animation-duration: 6.3s;
  animation-delay: 0.2s;
}
.card .points_wrapper .point:nth-child(8) {
  left: 58%;
  animation-duration: 6.2s;
  animation-delay: 0.2s;
}
.card .points_wrapper .point:nth-child(9) {
  left: 98%;
  animation-duration: 7.2s;
  animation-delay: 0.1s;
}
.card .points_wrapper .point:nth-child(10) {
  left: 65%;
  animation-duration: 6.7s;
  animation-delay: 0.2s;
}

.news-list,
.news-item,
.news-title,
.news-time {
  position: relative;
  z-index: 2;
}

/* Footer build info */
.site-footer {
  background: transparent;
  margin-top: 20px;
  margin-bottom: 50px;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.build-info {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  margin: 0;
}
.footer-disclaimer {
  color: var(--text-muted, #666);
  font-size: 10px;
  padding-left: 12px;
  padding-right: 12px;
  font-weight: 400;
  opacity: 0.6;
  margin: 0;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
  font-size: 11px;
}

.footer-links a {
  color: var(--text-secondary, #a1a1aa);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-color, #176fff);
}

.footer-copyright {
  color: var(--text-muted, #666);
  font-size: 10px;
  opacity: 0.5;
  margin: 4px 0 0;
}
/* 2. Градиенты фона на мобильных - усиленные и выше */
@media (max-width: 768px) {
  /* Dark theme: show enhanced gradients on mobile */
  :root[data-theme="dark"] body {
    background:
      radial-gradient(circle farthest-side, rgba(197, 50, 255, 0.2), transparent 90%) no-repeat,
      radial-gradient(circle farthest-side, rgba(0, 255, 119, 0.2), transparent 90%) no-repeat,
      #000000 !important;
    background-size: 600px 600px, 600px 600px, auto !important;
    background-position: 100% 0, 0% 0, 0 0 !important;
  }

  /* Make the entire table area pure black on mobile (no zebra, no pseudo-gradients)
     and ensure sticky/pinned columns also use black so there is no visible seam. */
  /* :root[data-theme="dark"] .table-container {
    background: #000000 !important;
    border: none !important;
    box-shadow: none !important;
  }

  :root[data-theme="dark"] .table-container::before {
    display: none !important;
  } */

  :root[data-theme="dark"] .table-container,
  :root[data-theme="dark"] .table-container table,
  :root[data-theme="dark"] .table-container thead,
  :root[data-theme="dark"] .table-container tbody,
  :root[data-theme="dark"] .table-container tr,
  :root[data-theme="dark"] .table-container td,
  :root[data-theme="dark"] .table-container th {
    background: #000000 !important;
    border-color: transparent !important;
    /* min-width: 155px;   */
    box-shadow: none !important;
  }

  /* Remove zebra stripes on mobile in dark theme */
  :root[data-theme="dark"] tbody tr:nth-child(even) {
    background: transparent !important;
  }

  /* Ensure sticky/pinned columns match black background to avoid seams */
  :root[data-theme="dark"] td:first-child,
  :root[data-theme="dark"] th:first-child,
  :root[data-theme="dark"] td:nth-child(2),
  :root[data-theme="dark"] th:nth-child(2) {
    background: #000000 !important;
  }

  /* Border for sticky column only - use inset box-shadow so it doesn't get covered */
  /* :root[data-theme="dark"] .table-container tbody td:nth-child(2) {
    box-shadow: inset 0 1px 0 0 #262626 !important;
  } */
}

/* Tabs More Button - Base styles */
.tabs-more-wrapper {
  display: none;
}

.tabs-more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  margin-top: -1px;
  color: #4d8df5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.tabs-more-btn:hover {
  opacity: 0.8;
}

.tabs-more-btn .material-symbols-rounded {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.tabs-more-btn.active .material-symbols-rounded {
  transform: rotate(180deg);
}

/* More Dropdown */
.tabs-more-dropdown {
  position: absolute;
  top: calc(100% - 10px);
  left: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] .tabs-more-dropdown {
  background: #1a1d26;
  border-color: #333952;
}

.tabs-more-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tabs-more-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tabs-more-item:hover {
  background: rgba(77, 141, 245, 0.1);
}

.tabs-more-item.active {
  color: #4d8df5;
  background: rgba(77, 141, 245, 0.1);
}

/* Medium screens - tablets and small laptops */
@media (max-width: 1400px) and (min-width: 769px) {
  /* Auth buttons smaller on medium screens */
  .btn-signin,
  .btn-signup {
    font-size: 13px;
  }

  .tabs-wrap {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .tab-links {
    overflow-x: visible;
    scrollbar-width: none;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .tab-links::-webkit-scrollbar {
    display: none;
  }

  /* Smaller tabs on medium screens */
  .tab-link,
  :root[data-theme="dark"] .tab-link,
  :root[data-theme="light"] .tab-link {
    font-size: 13px !important;
    padding: 0 0 12px;
  }

  /* Hide overflow tabs on medium screens */
  .tab-links .tab-link-overflow {
    display: none;
  }

  /* Show More button on medium screens */
  .tabs-more-wrapper {
    display: block;
    position: relative;
    margin-top: 40px;
  }

  .tabs-more-btn {
    font-size: 13px;
  }

  .tabs-more-item {
    font-size: 13px;
    padding: 8px 14px;
  }

  /* filter button slightly smaller on medium screens */
  .filter-btn {
    font-size: 13px;
  }

  .timeframe-wrapper {
    padding-left: 40px;
  }
}

@media (max-width: 768px) {
  .tabs-wrap {
    position: relative;
    overflow: visible;
  }

  .tab-links {
    mask-image: linear-gradient(to right, black 0%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0%, black 80%, transparent 100%);
  }

  .tab-links.scrolled-end {
    mask-image: none;
    -webkit-mask-image: none;
  }
}

@media (max-width: 768px) {
  /* Убираем отступы контейнера */
  .container {
    padding: 0;
  }

  /* Таблица на всю ширину */
  .table-container {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    margin-bottom: 20px;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Убираем псевдо-градиент */
  .table-container::before {
    display: none !important;
  }

  /* Подгоняем отступы ячеек */
  td:first-child,
  th:first-child {
    padding-left: 12px;
  }
  td:last-child,
  th:last-child {
    padding-right: 12px;
  }
}
@media (max-width: 768px) {
  .filter-section {
    padding-left: 13px;
    padding-right: 13px;
  }
}

/* Footer Social Links */
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;                    /* Было: 4px */
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 2px;            /* Было: 2px 4px */
  border-radius: 4px;
}

.footer-social-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .footer-social-link:hover {
  background: rgba(0, 0, 0, 0.05);
}
/* Footer Social Links */
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 2px;
  border-radius: 4px;
  vertical-align: middle;      /* ✅ Добавлено */
}

/* Footer Icons */
.footer-icon {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;      /* ✅ Добавлено */
}

/* Footer Divider */
.footer-divider {
  margin: 0 4px;
  opacity: 0.5;
  vertical-align: middle;      /* ✅ Добавлено */
}

/* Footer Version */
.footer-version {
  opacity: 0.7;
  vertical-align: middle;      /* ✅ Добавлено */
}

.build-info {
  display: flex;
  align-items: center;         /* ✅ Добавлено для выравнивания */
  justify-content: center;
  gap: 0;                      /* ✅ Убрать gap, использовать margin в divider */
}

/* Zebra Stripes - каждая вторая строка */
/* tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

:root[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
} */

/* Градиент для thead (заголовки таблицы) */
thead {
  background: linear-gradient(180deg, 
    rgba(59, 130, 246, 0.04) 0%, 
    rgba(59, 130, 246, 0.01) 100%
  );
  border-bottom: none;
}

:root[data-theme="light"] thead {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 2px solid #e5e7eb;
}


/* Dark-theme only: ensure mobile table header is #0a0a0a and overrides other mobile table bg rules */

@media (max-width: 768px) {
  :root[data-theme="dark"] .table-container thead,
  :root[data-theme="dark"] .table-container thead th {
    background: #141518 !important;
    color: var(--text) !important;
    border-bottom: none !important;
  }

  /* Also ensure sticky header cells keep that background on mobile */
  :root[data-theme="dark"] th {
    background: #141518  !important;
  }

  /* Hide watchlist and index columns on mobile */
  td:nth-child(1),
  th:nth-child(1),
  td:nth-child(2),
  th:nth-child(2) {
    display: none !important;
  }

  /* Make Asset column (3rd column) sticky on mobile */
  td:nth-child(3),
  th:nth-child(3) {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: #000 !important;
    min-width:200px !important;
    padding-left: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  :root[data-theme="dark"] td:nth-child(3),
  :root[data-theme="dark"] th:nth-child(3) {
    background: #000 !important;
  }

  :root[data-theme="light"] td:nth-child(3),
  :root[data-theme="light"] th:nth-child(3) {
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
  }

  /* Allow horizontal scroll but hide scrollbar visually */
  .table-container {
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .table-scroll {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  table {
    overflow: visible !important;
  }

  /* Hide scrollbar visually but keep scroll functionality */
  .table-container::-webkit-scrollbar,
  .table-scroll::-webkit-scrollbar {
    height: 0 !important;
    display: none;
  }

  .table-container,
  .table-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  /* Signal age under asset name on mobile */
  .asset-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .asset-cell .asset-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .asset-cell .asset-symbol {
    font-size: 15px;
    margin-bottom: 0;
    max-width: 100%;
  }

  .asset-cell .asset-symbol .base {
    max-width: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: baseline;
  }

  .asset-cell .asset-icon {
    width: 29px;
    height: 29px;
    margin-bottom: 0;
    margin-top: 16px;
    align-self: flex-start;
  }
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 0px;
  padding-left: 16px;
  padding-bottom: 16px;
  
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--border);
  border-color: #1463ff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination-page:hover {
  background: var(--border);
  border-color: #1463ff;
}

.pagination-page.active {
  background: #1463ff;
  border-color: #1463ff;
  color: #fff;
}

.pagination-dots {
  color: var(--muted);
  padding: 0 4px;
}

.pagination-info {
  margin-left: 16px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .pagination-container {
    flex-wrap: nowrap;
    gap: 4px;
    padding: 12px 8px;
    justify-content: center;
  }
  
  .pagination-page {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 12px;
  }
  
  .pagination-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  
  .pagination-dots {
    padding: 0 2px;
    font-size: 12px;
  }
  
  .pagination-info {
    display: none;
  }
  
  .pagination-row {
    flex-wrap: nowrap;
    gap: 3px;
  }
}

/* Asset icon placeholder */
.asset-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

/* Exchange link styles */
.exchange-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.exchange-link:hover {
  opacity: 0.8;
}

/* Table Loader Animation */
.table-loader {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto;
}

.table-loader:before,
.table-loader:after {
  content: '';
  border-radius: 50%;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  box-shadow: 0 0 10px 2px rgba(0, 76, 255, 0.2) inset;
}

.table-loader:after {
  box-shadow: 0 2px 0 #004CFF inset;
  -webkit-animation: loaderSpin 2s linear infinite;
  animation: loaderSpin 2s linear infinite;
}

@-webkit-keyframes loaderSpin {
  0% { -webkit-transform: rotate(0); transform: rotate(0); }
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes loaderSpin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* =============================================
   NEW SIGNAL HIGHLIGHT & PAUSE FEATURE
   (Easy to remove - just delete this section)
   ============================================= */

/* New signal row highlight - handled by JS for smooth animation */

/* Paused indicator button */
.paused-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(59, 131, 246, 0.226);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #4d8aeb;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.paused-indicator.active {
  display: inline-flex;
}

.paused-indicator svg {
  width: 12px;
  height: 12px;
}

/* Hide pause feature on mobile */
@media (max-width: 768px) {
  .paused-indicator {
    display: none !important;
  }
}

/* ==========================================
   COOKIE CONSENT BANNER
   ========================================== */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 400px;
  display: none;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-content {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.cookie-icon {
  color: #a1a1aa;
  flex-shrink: 0;
}

.cookie-text {
  flex: 1;
}

.cookie-text p {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.cookie-link {
  font-size: 13px;
  color: #176fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.cookie-link:hover {
  color: #4d94ff;
  text-decoration: underline;
}

.cookie-accept {
  padding: 10px 20px;
  background: #176fff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-accept:hover {
  background: #1565e0;
}

@media (max-width: 480px) {
  .cookie-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
  
  .cookie-content {
    padding: 16px;
  }
  
  
  .cookie-icon {
    display: none;
  }
}

/* ========================================
   MOBILE FIX: Ensure table body is visible 
   when empty, loading, or showing messages
   ======================================== */
@media (max-width: 768px) {
  /* Force tbody to have height */
  #table-body {
    display: table-row-group !important;
    min-height: 100px;
  }
  
  /* Force visibility of single-row messages (loading, no data, error) */
  #table-body tr:only-child {
    display: table-row !important;
  }
  
  #table-body tr:only-child td {
    display: table-cell !important;
    padding: 40px 16px !important;
    /* Fix: position relative to viewport, not table width */
    position: sticky !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    text-align: center !important;
    background: #000 !important;
  }
  
  /* Loader should always be visible and centered on screen */
  .table-loader {
    display: inline-block !important;
    margin: 0 auto !important;
  }
}

