:root {
  /* CryptoWay dark palette */
  --bg-main:       #050711;
  --bg-alt:        #0b0f1f;
  --bg-card:       #111524;
  --bg-card-soft:  #171b2b;
  --text-main:     #ffffff;
  --text-muted:    #a3a7c2;
  --accent:        #f7b0ff;       /* site accent — purple-pink */
  --accent-2:      #78c6ff;       /* site accent 2 — blue */
  --oi-accent:     #FFD700;       /* OI data color — gold */
  --green:         #00b050;
  --red:           #ff4d4f;
  --yellow:        #faad14;
  --border-soft:   rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.09);
  --shadow:           0 8px 32px rgba(0, 0, 0, 0.5);
  --radius:           12px;
  --nav-height:       72px;
  --container-width:  1200px;  /* matches cryptoway.pro */
  --container-max:    1600px;  /* main content area */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; }

body {
  font-family: "Unbounded", "Inter", system-ui, sans-serif;
  background: radial-gradient(ellipse at top, #141730 0%, #050711 50%, #020308 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* Ecosystem footer has its own slightly narrower/padded container */
.footer.footer-ecosystem .container {
  max-width: 1100px;
  padding-left: 24px;
  padding-right: 24px;
}

/* Page status bar */
.page-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.last-updated {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-indicator.online  { background: rgba(0,176,80,0.12); color: var(--green); border: 1px solid rgba(0,176,80,0.2); }
.status-indicator.offline { background: rgba(255,77,79,0.10); color: var(--red);   border: 1px solid rgba(255,77,79,0.15); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-indicator.online .status-dot { animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.mobile-status {
  padding: 8px 16px 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════ */
main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.hidden { display: none !important; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
}

#search {
  flex: 1;
  max-width: 360px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}
#search::placeholder { color: var(--text-muted); }
#search:focus { border-color: rgba(247,176,255,0.5); }

.filter-btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: rgba(247,176,255,0.4); color: var(--text-main); }

.filter-panel {
  position: absolute;
  top: 50px;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.filter-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.filter-panel label.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 12px;
}
.filter-panel input[type="number"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  background: var(--bg-alt);
  color: var(--text-main);
}

.filter-actions { display: flex; gap: 8px; }

.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.btn-secondary:hover { color: var(--text-main); border-color: rgba(255,255,255,0.18); }

/* ── Detail Section ── */
.detail-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  margin-bottom: 14px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-panel, .chart-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.close-btn:hover { color: var(--text-main); }

#detail-content { padding: 8px 0; }

/* ── Exchange panel header ── */
.exchange-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.02);
}
.exh-spacer { width: 20px; flex-shrink: 0; }
.exh-col {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.exh-col:nth-child(2) { flex: 1; }

.exchange-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.exchange-row:last-of-type { border-bottom: none; }
.exchange-row:hover { background: rgba(247,176,255,0.04); }

.exchange-icon {
  width: 20px; height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.exchange-icon-fallback {
  width: 20px; height: 20px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.exchange-name {
  flex: 1;
  font-weight: 500;
  font-size: 12px;
  text-transform: capitalize;
}
.exchange-oi     { font-size: 12px; color: var(--oi-accent); font-weight: 600; }
.exchange-volume { font-size: 12px; color: var(--green);     font-weight: 600; }

.detail-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 12px;
}
.total-row .accent { color: var(--oi-accent); font-weight: 700; font-size: 13px; }
.exchange-count   { color: var(--text-muted); font-size: 11px; }

/* ── OI Signal bar ── */
.oi-signal {
  font-size: 11px;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: 0.1px;
}
.sig-line {
  padding: 5px 14px;
  font-weight: 600;
}
.sig-line.signal-bull    { background: rgba(0,176,80,0.07);   color: #4ade80; }
.sig-line.signal-bear    { background: rgba(255,77,79,0.07);  color: #f87171; }
.sig-line.signal-neutral { background: rgba(250,173,20,0.07); color: #fbbf24; }
.sig-line.signal-flat    { background: rgba(255,255,255,0.02); color: var(--text-muted); }
.sig-period { font-weight: 400; opacity: 0.6; margin-right: 4px; }

/* ── Chart ── */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
  flex-wrap: wrap;
}

.chart-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#chart-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
}

.chart-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.chart-info-oi    { color: var(--oi-accent); font-weight: 600; }
.chart-info-price { color: var(--green);     font-weight: 600; }

.info-label { font-size: 10px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.info-sep   { color: rgba(255,255,255,0.18); font-size: 14px; line-height: 1; margin: 0 2px; }
.chart-hover-row {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  visibility: hidden;
}

.chart-delta {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  font-size: 10px;
  white-space: nowrap;
}
.delta-label { color: var(--text-muted); font-weight: 400; }
.delta-pos { color: var(--green); font-weight: 700; }
.delta-neg { color: var(--red);   font-weight: 700; }

.chart-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.timeframe-btns, .unit-toggle, .mode-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 2px;
}

.tf-btn, .unit-btn, .mode-btn {
  padding: 4px 9px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.tf-btn.active, .unit-btn.active, .mode-btn.active {
  background: rgba(247,176,255,0.12);
  color: var(--accent);
  font-weight: 600;
}
.tf-btn:hover:not(.active),
.unit-btn:hover:not(.active),
.mode-btn:hover:not(.active) { color: var(--text-main); }

.chart-fullscreen-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1;
  transition: all 0.15s;
}
.chart-fullscreen-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }

.charts-wrapper {
  display: flex;
  flex-direction: column;
  height: 430px;
}

.chart-pane-top    { flex: 65; min-height: 0; overflow: hidden; }
.chart-divider     { height: 1px; background: var(--border-soft); flex-shrink: 0; }
.chart-pane-bottom { flex: 35; min-height: 0; overflow: hidden; }

/* Fullscreen */
.chart-panel.fullscreen {
  position: fixed !important;
  inset: 0;
  z-index: 500;
  border-radius: 0;
}
.chart-panel.fullscreen .charts-wrapper { height: calc(100vh - 52px); }

/* ── Exchange Filter Bar ── */
.exchange-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.exchange-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.exchange-filter-btns {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.exchange-filter-btns::-webkit-scrollbar { display: none; }

.exf-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.exf-btn:hover:not(.active) {
  border-color: rgba(247,176,255,0.4);
  color: var(--text-main);
}
.exf-btn.active {
  background: rgba(247,176,255,0.12);
  border-color: rgba(247,176,255,0.5);
  color: var(--accent);
  font-weight: 600;
}

/* ── Table Section ── */
.table-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.table-wrapper { overflow-x: auto; }

#oi-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

#oi-table thead th {
  background: var(--bg-alt);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  user-select: none;
}

th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text-main); }
th.active-sort { color: var(--accent) !important; }
.sort-arrow { font-size: 10px; opacity: 0.4; }

#oi-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.12s;
}
#oi-table tbody tr:hover { background: rgba(247,176,255,0.04); }
#oi-table tbody tr.selected {
  background: rgba(247,176,255,0.07);
  border-left: 3px solid var(--accent);
}
#oi-table tbody tr:last-child { border-bottom: none; }

#oi-table td {
  padding: 10px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.col-star { width: 36px; text-align: center; }
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: rgba(255,255,255,0.18);
  padding: 0;
  line-height: 1;
  transition: color 0.15s, transform 0.1s;
}
.star-btn:hover  { color: var(--oi-accent); transform: scale(1.2); }
.star-btn.starred { color: var(--oi-accent); }

.token-symbol {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* Ratio badge */
.ratio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 26px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 700;
}
.ratio-green  { background: rgba(0,176,80,0.12);   color: var(--green); }
.ratio-yellow { background: rgba(250,173,20,0.12); color: #faad14; }
.ratio-red    { background: rgba(255,77,79,0.12);  color: var(--red); }

.col-oi { font-weight: 700; color: var(--oi-accent); }

.vol-value { color: var(--green); font-weight: 600; }

.circulate-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.circulate-over { background: rgba(255,77,79,0.12);  color: var(--red); }
.circulate-ok   { background: rgba(0,176,80,0.12);   color: var(--green); }
.circulate-na   { color: var(--text-muted); }

/* ── Footer (identical to cryptoway.pro footer-ecosystem) ── */
.footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 48px;
}

.footer.footer-ecosystem {
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cw-footer-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  padding: 24px 0 12px;
}

.cw-footer-brand a {
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #f7b0ff, #78c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.cw-footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px 36px;
  margin-left: auto;
  max-width: 860px;
}

.cw-footer-col { min-width: 170px; }

.cw-footer-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(74,79,106,0.95);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cw-footer-links-list {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cw-footer-links-list a {
  font-size: 13px;
  color: #a3a7c2;
  text-decoration: none;
  transition: color 0.2s ease;
}
.cw-footer-links-list a:hover { color: #ffffff; }
.cw-footer-links-list a.cw-link-premium { color: #78c6ff; font-weight: 500; }
.cw-footer-links-list a.cw-link-premium:hover { color: #ffffff; }

.cw-footer-bottom {
  margin-top: 10px;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
  color: rgba(74,79,106,0.8);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }

  .detail-section { grid-template-columns: 1fr; }
  main { padding: 12px 12px 32px; }

  .chart-header-right { gap: 4px; }
  .tf-btn, .unit-btn, .mode-btn { padding: 3px 7px; font-size: 10px; }

  .cw-footer-top {
    flex-direction: column;
    gap: 18px;
  }
  .cw-footer-grid {
    margin-left: 0;
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .footer.footer-ecosystem .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .cw-footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
