@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;600;700&display=swap");

:root {
  --bg: #1e1e1e;
  --panel: #1f2428;
  --panel-2: #262a31;
  --text: #e6e6e6;
  --muted: #9aa5b1;
  --accent: #007acc;
  --up: #3aa8ff;
  --down: #f87171;
  --line: #2f343d;
  --focus: #3794ff;
}

.account-card {
  flex: 1.1;
  background: #1c212b;
  border: 1px solid #2b3242;
  border-radius: 16px;
  padding: 28px;
  color: var(--text);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.account-shell {
  width: min(980px, 94vw);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.account-visual {
  border-radius: 16px;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(122, 92, 255, 0.45), transparent 55%),
    linear-gradient(135deg, #2d2f3d, #1b1f2a);
  border: 1px solid #2a3040;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.account-logo {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.4px;
}

.account-tagline {
  font-size: 18px;
  font-weight: 600;
}

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

.account-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.account-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.account-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.account-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #232938;
  background: #0f141c;
  color: var(--text);
  margin-bottom: 12px;
}

.account-error {
  min-height: 16px;
  color: #ff6b6b;
  font-size: 12px;
  margin-bottom: 10px;
}

.account-actions {
  display: flex;
  gap: 10px;
}

.account-grid {
  display: grid;
  gap: 12px;
}

.account-btn {
  flex: 1;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #2a3244;
  background: #1a2130;
  color: var(--text);
  cursor: pointer;
}

.account-btn.primary {
  background: #2b6fe8;
  border-color: #2b6fe8;
  color: #fff;
}

.account-btn.ghost {
  background: transparent;
  border-color: #2a3244;
  color: var(--muted);
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-info.hidden {
  display: none;
}

.account-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.account-row strong {
  color: var(--text);
}

.account-row .success {
  color: #22c55e;
}

.account-alt {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.account-social {
  flex: 1;
  border-radius: 8px;
  border: 1px solid #2a3244;
  background: #111621;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

.account-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.account-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: radial-gradient(circle at 30% 20%, rgba(94, 80, 191, 0.25), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(60, 120, 200, 0.18), transparent 60%);
}

@media (min-width: 960px) {
  .account-shell {
    grid-template-columns: 1fr 1.2fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.app-shell { display: grid; grid-template-columns: 64px 300px 1fr; min-height: 100vh; }

.rail {
  background: #232830;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 18px;
}
.rail-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-avatar { width: 40px; height: 40px; border-radius: 12px; background: #2b90ff; display: grid; place-items: center; font-weight: 700; }
.rail-collapse { background: transparent; border: none; color: var(--muted); cursor: pointer; }
.rail-nav, .rail-bottom { display: flex; flex-direction: column; gap: 10px; }
.rail-item {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}
.rail-item.active { background: #1b1f24; color: var(--text); border-color: var(--line); }
.rail.collapsed { width: 48px; }

.sidebar { background: #1b1f24; border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 16px; height: 100vh; overflow: hidden; }
.sidebar.hidden { display: none; }
.brand.compact { padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.market-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.market-tab { background: #22272e; border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.market-tab.active { color: var(--text); border-color: var(--focus); }
.market-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; overflow: auto; }
.market-card { background: #22272e; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.market-name { font-size: 12px; color: var(--muted); }
.market-value { font-size: 18px; font-weight: 700; }
.market-change { font-size: 12px; }
.watchlist { position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #007acc, #3794ff);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b1b2b;
  font-family: "JetBrains Mono", monospace;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
}

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

.section-title { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.add-row {
  display: flex;
  gap: 8px;
}

.add-row input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.add-row button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #f0f6ff;
  font-weight: 600;
  cursor: pointer;
}

.list-row { display: flex; gap: 8px; }

.list-row select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.list-actions { display: flex; gap: 8px; margin-top: 6px; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost.danger { color: var(--red); border-color: rgba(248, 113, 113, 0.3); }

.watchlist-header { display: flex; justify-content: space-between; align-items: center; }
.watchlist-title { font-size: 22px; font-weight: 700; }
.watchlist-actions { display: flex; gap: 6px; }
.icon-btn { background: #22272e; border: 1px solid var(--line); color: var(--text); padding: 6px 8px; border-radius: 8px; cursor: pointer; }

.watchlist-tabs { display: flex; gap: 8px; margin-top: 10px; }
.tab { padding: 6px 10px; border-radius: 8px; background: #22272e; border: 1px solid var(--line); color: var(--text); cursor: pointer; font-weight: 600; }
.tab.active { background: #28303a; border-color: var(--focus); }

.watchlist-dropdown { position: absolute; top: 70px; right: 0; width: 220px; background: #1d2228; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: none; z-index: 10; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.watchlist-dropdown.show { display: block; }
.dropdown-section { display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 6px; }
.dropdown-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.dropdown-item { background: transparent; border: none; color: var(--text); text-align: left; padding: 6px 6px; cursor: pointer; }

.watchlist-filters { display: flex; gap: 8px; margin-top: 10px; }
.pill { padding: 6px 10px; border-radius: 8px; background: #22272e; border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.pill.active { background: #2a313b; border-color: var(--focus); }

.watchlist-head { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 12px; padding: 0 4px 8px; border-bottom: 1px solid var(--line); }

.watchlist-items { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; }

.watch-card { position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid transparent; cursor: pointer; }
.watch-remove { position: absolute; top: 6px; right: 6px; background: transparent; border: none; color: var(--muted); font-size: 14px; cursor: pointer; opacity: 0.6; }
.watch-card:hover .watch-remove { opacity: 1; }
.watch-card.active { border-color: var(--focus); box-shadow: 0 0 0 1px rgba(55, 148, 255, 0.4); }
.watch-symbol { font-size: 14px; font-weight: 700; }
.watch-name { font-size: 11px; color: var(--muted); margin-top: 2px; }
.watch-price { font-size: 14px; font-weight: 700; text-align: right; }
.watch-price.up { color: var(--up); }
.watch-price.down { color: var(--down); }
.watch-price-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.watch-meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.watch-change-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.watch-change { font-size: 13px; font-weight: 700; text-align: right; }
.watch-change.up { color: var(--up); }
.watch-change.down { color: var(--down); }
.sparkline { width: 70px; height: 20px; }
.sparkline svg { width: 100%; height: 100%; }
.tag { display: inline-block; padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line); font-size: 10px; margin-left: 4px; }

.watchlist-add { display: flex; gap: 8px; margin-top: 10px; }
.watchlist-add input { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.watchlist-add button { padding: 8px 12px; border-radius: 8px; border: none; background: var(--accent); color: #f0f6ff; font-weight: 600; cursor: pointer; }

.up { color: var(--up); }
.down { color: var(--down); }

.controls .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.controls select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.main { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.page-content { display: flex; flex-direction: column; height: 100%; }
.page-content.hidden { display: none; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); background: #1b1f24; }
.ticker-block { display: flex; align-items: baseline; gap: 14px; }
.ticker-price { font-size: 20px; font-weight: 700; color: var(--down); }
.ticker-change { font-size: 16px; font-weight: 700; color: var(--down); }
.top-tabs { display: flex; gap: 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: #1b1f24; }
.top-tab { background: transparent; border: none; color: var(--text); font-weight: 600; padding: 6px 4px; cursor: pointer; }
.top-tab.active { border-bottom: 2px solid var(--accent); }

.ticker-title {
  font-size: 28px;
  font-weight: 700;
}

.ticker-sub {
  color: var(--muted);
  font-size: 13px;
}

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

.content { display: grid; grid-template-columns: 1fr 320px; gap: 16px; padding: 16px 22px 24px; flex: 1 1 auto; min-height: 0; overflow: hidden; }

.chart-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; height: 100%; }
.chart-toolbar { display: flex; gap: 8px; align-items: center; padding: 6px 2px 10px; }
.tool-btn { background: #22272e; border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.chart-controls { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.control-group { display: flex; gap: 8px; }
.control-btn { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.control-btn.active { color: var(--text); border-color: var(--line); background: #22272e; }

.chart { flex: 1 1 auto; min-height: 0; }

.side-panel { display: flex; flex-direction: column; gap: 12px; overflow: auto; }

.fund-card { background: #1b1f24; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fund-header { display: flex; justify-content: space-between; align-items: center; }
.fund-ticker { font-size: 18px; font-weight: 700; }
.fund-name { font-size: 14px; color: var(--muted); margin-top: 4px; }
.fund-actions { display: flex; gap: 8px; }
.fund-price-row { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.fund-price { font-size: 32px; font-weight: 800; color: var(--down); }
.fund-change { font-size: 18px; font-weight: 700; color: var(--down); }
.fund-prev { color: var(--muted); margin-top: 6px; }
.fund-badges { display: flex; gap: 6px; margin: 8px 0 12px; }
.badge { background: #22272e; border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 11px; }
.fund-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.fund-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.fund-row strong { color: var(--text); font-weight: 600; }

.fund-tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 4px 4px; }
.fund-tab { background: transparent; border: none; color: var(--text); font-weight: 600; padding: 6px 2px; cursor: pointer; }
.fund-tab.active { border-bottom: 2px solid var(--accent); }
.fund-tab-body { padding: 12px 4px; color: var(--muted); }
.fund-panel { padding: 6px 0; }
.analysis-title { font-weight: 700; margin-bottom: 8px; }
.analysis-metrics { display: flex; flex-direction: column; gap: 8px; }
.analysis-metrics div { display: flex; justify-content: space-between; }
.analysis-metrics strong { color: var(--text); }
.news-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.news-tab { background: #22272e; border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.news-tab.active { color: var(--text); border-color: var(--focus); }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.news-title { color: var(--text); font-weight: 600; text-decoration: none; }
.news-title:hover { text-decoration: underline; }
.news-meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 6px; align-items: center; }


.indicator-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: #1b1f24;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px rgba(0,0,0,0.35);
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 30;
}
.indicator-drawer.open { display: flex; }
.indicator-header { display: flex; justify-content: space-between; align-items: center; }
.indicator-title { font-size: 20px; font-weight: 700; }
.indicator-actions { display: flex; gap: 8px; }
.indicator-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #22272e;
  color: var(--text);
}
.indicator-tags { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tag-btn {
  background: #22272e;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.tag-btn.active { color: var(--text); border-color: var(--focus); }
.indicator-section-title { margin-top: 6px; font-weight: 700; }
.indicator-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.indicator-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #22272e;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}
.indicator-toggle {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1b1f24;
}

.market-top-tabs { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 22px; border-bottom: 1px solid var(--line); }
.market-overview { padding: 16px 22px 24px; overflow: auto; }
.market-index-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.index-card { background: #22272e; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.index-card.up { background: linear-gradient(135deg, #1f2f2a, #1b1f24); }
.index-card.down { background: linear-gradient(135deg, #2f1f22, #1b1f24); }
.index-name { font-size: 12px; color: var(--muted); }
.index-value { font-size: 20px; font-weight: 700; margin-top: 6px; }
.index-change { font-size: 12px; margin-top: 4px; }

.market-main-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.market-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.market-list { background: #1b1f24; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.list-header { font-weight: 600; margin-bottom: 8px; }
.list-table { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.list-table > div { display: grid; grid-template-columns: 70px 1fr 70px 70px; gap: 6px; }
.market-heatmap { background: #1b1f24; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.heatmap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.heat-block { padding: 12px; border-radius: 8px; text-align: center; font-size: 12px; }
.heat-block.up { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); }
.heat-block.down { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3); }

.metric { background: var(--panel-2); border-radius: 10px; padding: 10px; border: 1px solid var(--line); }

.metric .label {
  font-size: 11px;
  color: var(--muted);
}

.metric .value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.side-panel { display: flex; flex-direction: column; gap: 12px; overflow: auto; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }

.card-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.prob { font-size: 32px; font-weight: 700; color: var(--up); }

.row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: none;
}

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

.snapshot {
  font-size: 12px;
  color: var(--muted);
  max-height: 220px;
  overflow: auto;
}

.snapshot table {
  width: 100%;
  border-collapse: collapse;
}

.snapshot th,
.snapshot td {
  padding: 4px 6px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}

.snapshot th:first-child,
.snapshot td:first-child {
  text-align: left;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .content {
    grid-template-columns: 1fr;
  }
}
