* {
  box-sizing: border-box;
  font-family: 'Orbitron', sans-serif;
}

body {
  margin: 0;
  background: black;
  color: #00f0ff;
  overflow: hidden;
}

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
  background-size: cover;
  background-position: center;
  position: relative;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* ----- Input Area (Screen 1) ----- */
.input-container {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 320px;
  text-align: center;
}

#wallet {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  text-align: center;
  margin-bottom: 6px;
}

.neon-btn {
  width: 80%;
  padding: 10px;
  font-size: 14px;
  color: #00f0ff;
  background: transparent;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 10px #00f0ff;
  transition: 0.3s;
  text-transform: uppercase;
}

.neon-btn:hover:enabled {
  background: rgba(0, 240, 255, 0.1);
  transform: scale(1.03);
}

.neon-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.error-message {
  color: #ff4c4c;
  font-size: 11px;
  height: 14px;
  margin-bottom: 6px;
}

/* ------ Spinner (Screen 2) ------ */
.spinner-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #00f0ff;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.loading-text {
  color: #00f0ff;
  font-size: 14px;
  margin: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------ Menu (Screen 3) ------ */
.menu {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menu-btn {
  width: 100%;
  margin-bottom: 0;
  padding: 14px 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 2px solid #00f0ff;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s;
}

.menu-btn:hover {
  background: rgba(0, 240, 255, 0.08);
  transform: scale(1.01);
}

.back-btn {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: 20px;
  padding: 12px 24px;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #00f0ff;
  cursor: pointer;
  transition: 0.2s;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.back-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

/* ------ Content Containers (Screens 4-8) ------ */
.content-container {
  position: relative; top: 16%; left: 50%; transform: translateX(-50%); width: 90%; max-width: 360px; height: 60%; overflow-y: auto; padding: 10px;
}

.content-container h2 {
  text-align: center;
  color: #00f0ff;
  margin: 0 0 20px 0;
  font-size: 16px;
  text-shadow: 0 0 10px #00f0ff;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.menu-btn-fixed {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: 20px;
  z-index: 1000;
  padding: 12px 24px;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #00f0ff;
  cursor: pointer;
  transition: 0.2s;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* ------ Portfolio Styles ------ */
.total-value {
  font-size: 28px;
  color: #00ff00;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 0 15px #00ff00;
  font-weight: 700;
}

.tokens-list {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.token-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #333;
}

.token-item:last-child {
  border-bottom: none;
}

.token-info {
  display: flex;
  flex-direction: column;
}

.token-symbol {
  font-weight: 700;
  color: #00f0ff;
  font-size: 16px;
}

.token-name {
  color: #888;
  font-size: 12px;
}

.token-values {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.token-value {
  color: #00ff00;
  font-weight: 700;
  font-size: 14px;
}

.token-percentage {
  color: #888;
  font-size: 12px;
}

/* ------ DeFi Tools Styles ------ */
.stats-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  color: #888;
  font-size: 12px;
  margin-bottom: 5px;
}

.stat-value {
  color: #00ff00;
  font-weight: 700;
  font-size: 16px;
}

.protocols-list {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.protocol-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.protocol-item:last-child {
  border-bottom: none;
}

.protocol-info {
  display: flex;
  flex-direction: column;
}

.protocol-name {
  font-weight: 700;
  color: #00f0ff;
  font-size: 14px;
}

.protocol-category {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
}

.protocol-values {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.protocol-tvl {
  color: #00ff00;
  font-weight: 700;
  font-size: 13px;
}

.protocol-change {
  font-size: 11px;
}

.protocol-change.positive {
  color: #00ff00;
}

.protocol-change.negative {
  color: #ff4c4c;
}

/* ------ AI Insights Styles ------ */
.ai-insights {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 20px;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
  margin-bottom: 20px;
  max-height: 350px;
  overflow-y: auto;
}

.ai-pools {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}
.ai-pools table { width: 100%; border-collapse: collapse; }
.ai-pools th, .ai-pools td { font-size: 12px; padding: 6px 8px; border-bottom: 1px solid #222; color: #ccc; }
.ai-pools th { color: #00f0ff; text-align: left; }

.small-btn { padding: 8px 12px; width: auto; }

.controls-row { display: grid; grid-template-columns: repeat(4, auto); gap: 8px; align-items: center; margin-bottom: 8px; }
.menu-btn.compact { padding: 10px 14px; font-size: 14px; }

/* SSE streaming styles */
.streaming-status {
    background: linear-gradient(90deg, #4a90e2, #7b68ee);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 8px 0;
    animation: pulse 2s infinite;
}

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

.ai-analysis-brief, .ai-analysis-detailed {
    margin: 10px 0;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
}

.ai-analysis-brief {
    background: rgba(74, 144, 226, 0.1);
}

.ai-analysis-detailed {
    background: rgba(123, 104, 238, 0.1);
    border-left-color: #7b68ee;
}

.sentiment-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    background: rgba(74, 144, 226, 0.2);
    margin-top: 5px;
}

/* Risk metrics styles */
.risk-section {
    margin-bottom: 12px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.risk-section h5 {
    color: #00f0ff;
    margin: 0 0 6px 0;
    font-size: 13px;
}

.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 8px;
    margin: 2px 0;
    font-size: 11px;
}

.risk-value {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
}

.risk-value.low-risk {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.risk-value.medium-risk {
    background: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.risk-value.high-risk {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* ------ Technical Analysis Styles ------ */

/* Compact Technical Controls */
.tech-controls-compact {
  margin-bottom: 12px;
}

.controls-row-mobile {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 6px;
  align-items: center;
}

.select-compact {
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  color: #00f0ff;
  font-size: 10px;
}

.btn-compact {
  padding: 4px 8px;
  background: linear-gradient(45deg, #00f0ff, #0080ff);
  border: none;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 32px;
}

.btn-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.3);
}

@media (max-width: 768px) {
  .controls-row-mobile {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  
  .select-compact {
    font-size: 9px;
    padding: 3px 4px;
  }
  
  .btn-compact {
    font-size: 10px;
    padding: 3px 6px;
    grid-column: 1 / -1;
    margin-top: 4px;
  }
}

/* ------ Technical Analysis Styles ------ */
.technical-list {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  max-height: 350px;
  overflow-y: auto;
}

.technical-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.technical-item:last-child {
  border-bottom: none;
}

.indicator-info {
  display: flex;
  flex-direction: column;
}

.indicator-name {
  font-weight: 700;
  color: #00f0ff;
  font-size: 14px;
}

.indicator-signal {
  font-size: 11px;
  text-transform: uppercase;
}

.indicator-signal.no-data {
  color: #888;
}

.indicator-signal.active {
  color: #00ff00;
}

.indicator-values {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 11px;
  color: #888;
}

/* ------ Settings Styles ------ */
.settings-list {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #333;
}

.setting-item:last-child {
  border-bottom: none;
}

.status-indicator {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
}

.status-indicator.ready {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
}

.status-indicator.connected {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
}

.status-indicator.error {
  background: rgba(255, 0, 0, 0.2);
  color: #ff4c4c;
}

/* ------ Loading Placeholder ------ */
.loading-placeholder {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px;
}

/* ------ Scrollbar Styling ------ */
.content-container::-webkit-scrollbar,
.protocols-list::-webkit-scrollbar,
.ai-insights::-webkit-scrollbar,
.technical-list::-webkit-scrollbar {
  width: 4px;
}

.content-container::-webkit-scrollbar-track,
.protocols-list::-webkit-scrollbar-track,
.ai-insights::-webkit-scrollbar-track,
.technical-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.content-container::-webkit-scrollbar-thumb,
.protocols-list::-webkit-scrollbar-thumb,
.ai-insights::-webkit-scrollbar-thumb,
.technical-list::-webkit-scrollbar-thumb {
  background: #00f0ff;
  border-radius: 2px;
}

/* ------ Responsive Design ------ */
@media (max-width: 360px) {
  .content-container {
    width: 95%;
    padding: 5px;
    top: 20%;
    height: 60%;
  }

  .input-container {
    width: 95%;
  }

  .menu {
    width: 95%;
  }
}

/* --- Mobile iOS/Android adjustments: убрать наложения заголовков и меню --- */
@media (max-width: 480px) {
  /* учитываем safe-area (iOS) и поднимаем базовую точку ниже логотипа на фоне */
  .menu {
    top: calc(28% + env(safe-area-inset-top, 0px));
    gap: 8px;
  }
  .menu-btn {
    padding: 12px 8px;
    font-size: 13px;
  }
  .content-container {
    top: calc(22% + env(safe-area-inset-top, 0px));
    height: 56%;
    max-width: 340px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
  .content-container h2 {
    margin: 0 0 12px 0;
    font-size: 14px;
  }
  .total-value { font-size: 24px; }
}

/* Fallback for older iOS Safari constant() syntax */
@supports (padding-top: constant(safe-area-inset-top)) {
  @media (max-width: 480px) {
    .menu { top: calc(28% + constant(safe-area-inset-top)); }
    .content-container { top: calc(22% + constant(safe-area-inset-top)); height: 56%; padding-bottom: calc(120px + constant(safe-area-inset-bottom)); }
  }
}

/* Дополнительные брейкпоинты по высоте для разных iPhone */
@media (max-width: 480px) and (max-height: 900px) {
  .menu { top: calc(26% + env(safe-area-inset-top, 0px)); }
  .content-container { top: calc(21% + env(safe-area-inset-top, 0px)); height: 56%; }
}
@media (max-width: 480px) and (max-height: 812px) {
  .menu { top: calc(26% + env(safe-area-inset-top, 0px)); }
  .content-container { top: calc(21% + env(safe-area-inset-top, 0px)); height: 56%; }
}
@media (max-width: 480px) and (max-height: 736px) {
  .menu { top: calc(27% + env(safe-area-inset-top, 0px)); }
  .content-container { top: calc(22% + env(safe-area-inset-top, 0px)); height: 56%; }
}

/* Специальная правка только для экрана меню (#screen3): опустить блок кнопок ниже логотипа */
@media (max-width: 480px) {
  #screen3 .menu { top: calc(34% + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 480px) and (max-height: 812px) {
  #screen3 .menu { top: calc(36% + env(safe-area-inset-top, 0px)); }
}
@supports (padding-top: constant(safe-area-inset-top)) {
  @media (max-width: 480px) { #screen3 .menu { top: calc(34% + constant(safe-area-inset-top)); } }
  @media (max-width: 480px) and (max-height: 812px) { #screen3 .menu { top: calc(36% + constant(safe-area-inset-top)); } }
}


/* ----- Chain Selector Styles ----- */
.chain-selector-container {
  margin: 15px 0;
}

.chain-selector-label {
  font-size: 12px;
  color: #ccc;
  text-align: left;
  margin-bottom: 8px;
}

.chain-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chain-option {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.chain-option img {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.chain-option span {
  font-size: 12px;
  color: #ccc;
}

.chain-option.selected {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.chain-option.mantle-chain {
  border-color: #0099cc;
  background: rgba(0, 153, 204, 0.1);
}

.chain-option.mantle-chain.selected {
  background: rgba(0, 153, 204, 0.2);
  box-shadow: 0 0 15px rgba(0, 153, 204, 0.5);
}

.chain-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(90deg, #0066cc, #0099ff);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* ----- Chain Selector Styles ----- */
.chain-selector-container {
  margin: 10px 0 15px;
}

.chain-selector-label {
  font-size: 11px;
  color: #ccc;
  text-align: left;
  margin-bottom: 5px;
}

.chain-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chain-option {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chain-option img {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.chain-option span {
  font-size: 11px;
  color: #ccc;
}

.chain-option.selected {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.chain-option.mantle-chain {
  border-color: #0099cc;
}

.chain-option.mantle-chain.selected {
  background: rgba(0, 153, 204, 0.2);
  box-shadow: 0 0 10px rgba(0, 153, 204, 0.5);
}

/* Дополнительные стили для веб-версии */
@media (min-width: 768px) {
  body {
    background: black url('assets/screen1-bg.jpg') no-repeat center center;
    background-size: cover;
    height: 100vh;
  }
  
  .screen {
    max-width: 420px;
    margin: 0 auto;
    background: none !important;
  }
}

/* Mantle Hub Button */
.mantle-btn {
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.3), rgba(0, 153, 255, 0.3));
  border-color: #0099cc;
}

.mantle-btn:hover {
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.5), rgba(0, 153, 255, 0.5));
  box-shadow: 0 0 15px rgba(0, 153, 255, 0.4);
}

/* Mantle Hub Styles */
.mantle-text {
  background: linear-gradient(90deg, #0099cc, #66ccff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.section-container {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00f0ff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.section-title {
  color: #00f0ff;
  font-size: 14px;
  text-align: center;
  margin: 0 0 15px 0;
  text-shadow: 0 0 8px #00f0ff;
}

/* Gas Comparison */
.gas-comparison {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.network-item {
  flex: 1;
  background: rgba(40, 40, 40, 0.6);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.network-item.mantle {
  background: rgba(0, 102, 204, 0.2);
  border: 1px solid rgba(0, 153, 255, 0.3);
}

.network-name {
  font-size: 12px;
  font-weight: 700;
  color: #ccc;
  margin-bottom: 5px;
}

.network-value {
  font-size: 14px;
  color: #00ff00;
  font-weight: 700;
}

.savings-row {
  background: rgba(0, 102, 204, 0.2);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.savings-text {
  color: #0099ff;
  font-weight: 700;
  font-size: 12px;
}

/* Bridge Options */
.bridge-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bridge-option {
  display: flex;
  flex-direction: column;
  background: rgba(40, 40, 40, 0.6);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.bridge-option:hover {
  background: rgba(0, 102, 204, 0.2);
  transform: translateY(-2px);
}

.bridge-name {
  color: #00f0ff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 5px;
}

.bridge-detail {
  color: #ccc;
  font-size: 11px;
}

/* Mantle Protocols */
.mantle-protocols {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.protocol-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(40, 40, 40, 0.6);
  border-radius: 8px;
}

.protocol-name {
  color: #00f0ff;
  font-weight: 700;
  font-size: 13px;
}

.protocol-tvl {
  color: #00ff00;
  font-weight: 700;
  font-size: 13px;
}
.chain-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: #0052ff;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 10px;
  margin-right: 6px;
}
.chain-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: #0052ff;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 10px;
  margin-right: 6px;
}
/* Обеспечение единого размера для всех логотипов сетей */
.chain-option img {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  object-fit: contain;
  margin-right: 6px;
}

/* Pools Table Styles */
.pools-section {
  margin-top: 16px;
}

.pools-controls {
  margin-bottom: 12px;
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.export-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.filter-select, .filter-input {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}

.filter-input::-webkit-outer-spin-button,
.filter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-input[type=number] {
  -moz-appearance: textfield;
}

.export-btn, .clear-btn {
  padding: 6px 12px;
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  color: #00f0ff;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover, .clear-btn:hover {
  background: rgba(0, 240, 255, 0.3);
  border-color: #00f0ff;
}

.pools-table-container {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pools-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pools-table th {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  color: #00f0ff;
}

.pools-table td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.pools-table tr:hover {
  background: rgba(0, 240, 255, 0.05);
}

.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.sortable:hover {
  background: rgba(0, 240, 255, 0.1);
}

.sort-arrow {
  font-size: 10px;
  opacity: 0.5;
  margin-left: 4px;
}

.sortable.asc .sort-arrow::before {
  content: '↑';
  opacity: 1;
}

.sortable.desc .sort-arrow::before {
  content: '↓';
  opacity: 1;
}

.risk-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-low {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.risk-medium {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.4);
}

.risk-high {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 10px;
}

.chain-logo {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pool-actions {
  display: flex;
  gap: 4px;
}

.action-btn {
  padding: 2px 6px;
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 3px;
  color: #00f0ff;
  font-size: 9px;
  cursor: pointer;
  text-decoration: none;
}

.action-btn:hover {
  background: rgba(0, 240, 255, 0.3);
}

.pools-summary {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.pools-count strong {
  color: #00f0ff;
}

/* Rebalance Cards Styles */
.rebalance-section {
  margin-top: 16px;
}

.rebalance-summary {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
}

.summary-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.summary-stat strong {
  color: #00f0ff;
  font-size: 14px;
  display: block;
}

.rebalance-cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.rebalance-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  position: relative;
}

.rebalance-card.priority-high {
  border-color: rgba(231, 76, 60, 0.6);
  background: rgba(231, 76, 60, 0.05);
}

.rebalance-card.priority-medium {
  border-color: rgba(241, 196, 15, 0.6);
  background: rgba(241, 196, 15, 0.05);
}

.rebalance-card.priority-low {
  border-color: rgba(46, 204, 113, 0.4);
  background: rgba(46, 204, 113, 0.03);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.asset-info {
  flex: 1;
}

.asset-symbol {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.asset-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.asset-value {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.priority-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.priority-medium {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.4);
}

.priority-low {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.action-recommendation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.action-icon {
  font-size: 16px;
}

.action-hold .action-icon { color: #95a5a6; }
.action-reduce .action-icon { color: #e74c3c; }
.action-increase .action-icon { color: #2ecc71; }

.action-text {
  flex: 1;
  font-size: 12px;
}

.action-label {
  font-weight: 600;
  text-transform: uppercase;
}

.action-hold .action-label { color: #95a5a6; }
.action-reduce .action-label { color: #e74c3c; }
.action-increase .action-label { color: #2ecc71; }

.weight-change {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.reasoning-text {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  margin: 8px 0;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid rgba(0, 240, 255, 0.4);
}

.card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.metric-item {
  font-size: 10px;
  text-align: center;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.metric-label {
  color: rgba(255, 255, 255, 0.6);
  display: block;
  margin-bottom: 2px;
}

.metric-value {
  color: #fff;
  font-weight: 600;
}

.metric-rsi.overbought .metric-value { color: #e74c3c; }
.metric-rsi.oversold .metric-value { color: #2ecc71; }
.metric-rsi.neutral .metric-value { color: #f39c12; }

.opportunities {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.opportunities-title {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.opportunity-item {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
  margin: 2px 0;
  padding: 2px 4px;
  background: rgba(0, 240, 255, 0.05);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .summary-stats {
    flex-direction: column;
    gap: 4px;
  }
  
  .summary-stat {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .rebalance-cards-container {
    max-height: 300px;
  }
  
  .card-metrics {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  
  .action-recommendation {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Watchlist Styles */
.watchlist-add-section {
  margin-bottom: 16px;
}

.add-token-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.add-token-form input,
.add-token-form select {
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  color: #00f0ff;
  font-size: 10px;
}

.add-token-form input::placeholder {
  color: rgba(0, 240, 255, 0.5);
}

.add-token-btn {
  grid-column: 1 / -1;
  padding: 8px;
  background: linear-gradient(45deg, #00f0ff, #0080ff);
  border: none;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-token-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.3);
}

.watchlist-section {
  margin-top: 16px;
}

.watchlist-controls {
  display: flex;
  gap: 8px;
}

.watchlist-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
  padding: 8px 12px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  font-size: 11px;
}

.watchlist-summary strong {
  color: #00f0ff;
}

.watchlist-table-container {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.watchlist-table th {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  padding: 4px 3px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 240, 255, 0.3);
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 8px;
}

.watchlist-table td {
  padding: 4px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.watchlist-table tr:hover {
  background: rgba(0, 240, 255, 0.1);
}

.token-symbol {
  font-weight: bold;
  color: #00f0ff;
}

.token-chain {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.price-change {
  font-weight: bold;
}

.price-change.positive {
  color: #4caf50;
}

.price-change.negative {
  color: #f44336;
}

.price-change.neutral {
  color: #ffa726;
}

.alert-status {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
}

.alert-status.triggered {
  background: #f44336;
  color: #fff;
}

.alert-status.watching {
  background: #4caf50;
  color: #fff;
}

.alert-status.error {
  background: #ffa726;
  color: #000;
}

.watchlist-actions {
  display: flex;
  gap: 4px;
}

.alerts-section {
  margin-top: 16px;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.alert-item {
  padding: 12px;
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 6px;
  border-left: 4px solid #f44336;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.alert-symbol {
  font-weight: bold;
  color: #f44336;
  font-size: 12px;
}

.alert-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.alert-message {
  font-size: 11px;
  color: #fff;
}

.alert-details {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile adjustments for Watchlist */
@media (max-width: 768px) {
  .add-token-form {
    grid-template-columns: 1fr;
  }
  
  .watchlist-summary {
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
  }
  
  .watchlist-table {
    font-size: 8px;
  }
  
  .watchlist-table th,
  .watchlist-table td {
    padding: 2px 1px;
  }
  
  .watchlist-controls {
    flex-direction: row;
    gap: 4px;
  }
  
  .menu {
    top: 15%;
    width: 95%;
  }
  
  .menu-btn {
    padding: 8px 4px;
    font-size: 11px;
  }
}
