* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-2: rgba(30, 41, 59, 0.82);
  --text: #e5edf9;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --green: #34d399;
  --red: #fb7185;
  --blue: #60a5fa;
  --yellow: #facc15;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(59,130,246,.32), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(16,185,129,.18), transparent 28rem),
    var(--bg);
  color: var(--text);
}
a { color: inherit; }
.coin-link, .back-link { text-decoration: none; }
.coin-link:hover, .back-link:hover { color: var(--blue); }
.coin-symbol { color: var(--muted); font-size: .85rem; margin-left: .35rem; }
.app-shell {
  display: grid;
  grid-template-columns: 13.25rem minmax(0, 1fr);
  min-height: 100vh;
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .9rem .7rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(8, 17, 31, .94));
  box-shadow: 16px 0 44px rgba(0,0,0,.18);
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.55rem;
  padding: .3rem .38rem;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: .7rem;
  background: linear-gradient(135deg, rgba(96,165,250,.28), rgba(52,211,153,.20));
  border: 1px solid rgba(96,165,250,.35);
  color: #dbeafe;
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand strong,
.brand small { display: block; line-height: 1.05; }
.brand strong { font-size: .92rem; }
.brand small { color: var(--muted); font-size: .64rem; margin-top: .12rem; text-transform: uppercase; letter-spacing: .08em; }
.app-nav { display: grid; gap: .28rem; }
.app-nav a {
  display: flex;
  align-items: center;
  min-height: 2.15rem;
  padding: .44rem .55rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  color: #cbd5e1;
  background: transparent;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 750;
}
.app-nav a:hover { border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.10); color: var(--text); }
.app-nav a.active {
  color: #e0f2fe;
  border-color: rgba(96,165,250,.58);
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(52,211,153,.12));
  box-shadow: inset 3px 0 0 rgba(96,165,250,.95);
}
.sidebar-section { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line); }
.sidebar-section p { margin: 0 0 .45rem; padding: 0 .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; font-weight: 900; }
.app-nav-system a { color: var(--muted); font-size: .8rem; }
.app-workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 3.15rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .8rem;
  padding: .55rem clamp(1rem, 3vw, 1.4rem);
  border-bottom: 1px solid rgba(148, 163, 184, .12);
  background: rgba(8, 17, 31, .38);
  backdrop-filter: blur(12px);
}
.topbar > div,
.topbar-switcher {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding: .28rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15,23,42,.55);
}
.topbar-switcher {
  align-items: center;
}
.simulation-switcher {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
}
.simulation-switcher select {
  min-width: 12.5rem;
  max-width: 20rem;
  padding: .34rem .55rem;
  border-radius: .65rem;
  border: 1px solid rgba(148, 163, 184, .32);
  background: rgba(15, 23, 42, .92);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  outline: none;
}
.simulation-switcher select:focus {
  border-color: rgba(96, 165, 250, .68);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}
.context-label { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
.topbar strong { font-size: .78rem; color: var(--text); }
.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .85rem;
  padding: 1rem clamp(1rem, 3vw, 1.4rem) .85rem;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
}
.page-heading { max-width: 70rem; }
h1 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.25rem); letter-spacing: -0.055em; line-height: 1.02; }
.subtitle { color: var(--muted); max-width: 68rem; margin: .25rem 0 0; font-size: .9rem; line-height: 1.45; }
.page-actions,
.page-tools { min-width: 0; }
.hero-link { margin: 0; display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.button-link { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.1rem; padding: .48rem .8rem; border-radius: .7rem; background: linear-gradient(135deg, rgba(59,130,246,.20), rgba(34,197,94,.14)); border: 1px solid rgba(59,130,246,.40); color: var(--text); text-decoration: none; font-size: .82rem; font-weight: 800; line-height: 1; }
.button-link.secondary { background: rgba(15,23,42,.58); border-color: rgba(148,163,184,.28); color: #cbd5e1; }
.button-link.active { border-color: rgba(52,211,153,.58); background: rgba(52,211,153,.15); color: #d1fae5; }
.button-link:hover { border-color: var(--blue); transform: translateY(-1px); }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: .64rem; font-weight: 900; margin: 0 0 .22rem; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; padding: 0 clamp(1rem, 3vw, 1.25rem) .45rem; }
.stats div, .panel, .warning { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 28px rgba(0,0,0,.18); backdrop-filter: blur(14px); border-radius: .85rem; }
.stats div { padding: .42rem .56rem; }
.stats span { display: block; color: var(--muted); font-size: .62rem; margin-bottom: .16rem; text-transform: uppercase; letter-spacing: .06em; }
.stats strong { font-size: clamp(.82rem, 1.15vw, .95rem); word-break: break-word; line-height: 1.15; }
.warning { margin: 0 clamp(1rem, 3vw, 1.25rem) .45rem; padding: .55rem .72rem; border-color: rgba(250,204,21,.4); color: var(--yellow); font-size: .86rem; }
main { display: block; padding: 0 clamp(1rem, 3vw, 1.25rem) 1.45rem; }
.panel { overflow: hidden; }
.news { margin-top: .55rem; }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: .55rem; padding: .55rem .72rem .42rem; border-bottom: 1px solid var(--line); }
.panel-title h2 { margin: 0; letter-spacing: -.03em; font-size: .96rem; }
.panel-title span { color: var(--muted); font-size: .72rem; }
.table-wrap,
.trade-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 64vh;
  padding-right: .15rem;
  scrollbar-gutter: stable both-edges;
}
table { width: 100%; min-width: 1180px; border-collapse: collapse; table-layout: fixed; }
th { position: sticky; top: 0; background: #101827; color: var(--muted); text-align: left; font-size: .62rem; text-transform: uppercase; letter-spacing: .07em; z-index: 1; }
th, td { padding: .42rem .42rem; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.sort-btn { width: 100%; display: inline-flex; align-items: center; gap: .15rem; border: 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; padding: 0; cursor: pointer; }
.sort-btn:hover { color: var(--text); }
.sort-btn::after { content: '↕'; opacity: .35; font-size: .58rem; }
.sort-btn.sorted-asc::after { content: '↑'; opacity: 1; color: var(--green); }
.sort-btn.sorted-desc::after { content: '↓'; opacity: 1; color: var(--green); }
th:nth-child(1), td:nth-child(1) { width: 3%; }
th:nth-child(2), td:nth-child(2) { width: 16%; }
th:nth-child(3), td:nth-child(3) { width: 9%; }
th:nth-child(4), td:nth-child(4) { width: 6%; }
th:nth-child(5), td:nth-child(5) { width: 7%; }
th:nth-child(6), td:nth-child(6) { width: 6%; }
th:nth-child(7), td:nth-child(7) { width: 6%; }
th:nth-child(8), td:nth-child(8) { width: 7%; }
th:nth-child(9), td:nth-child(9) { width: 7%; }
th:nth-child(10), td:nth-child(10) { width: 5%; }
th:nth-child(11), td:nth-child(11) { width: 8%; }
th:nth-child(12), td:nth-child(12) { width: 8%; }
th:nth-child(13), td:nth-child(13) { width: 8%; padding-right: .6rem; }
#history-table { min-width: 1760px; }
#history-table th:nth-child(1),
#history-table td:nth-child(1) {
  width: 8.75rem;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
}
#history-table th:nth-child(2),
#history-table td:nth-child(2) { width: 6.1rem; }
#history-table th:nth-child(3),
#history-table td:nth-child(3) { width: 5rem; }
#history-table th:nth-child(4),
#history-table td:nth-child(4) { width: 4.8rem; }
#history-table th:nth-child(5),
#history-table td:nth-child(5) { width: 5rem; }
#history-table th:nth-child(6),
#history-table td:nth-child(6) { width: 4.8rem; }
#history-table th:nth-child(7),
#history-table td:nth-child(7) { width: 4.7rem; }
#history-table th:nth-child(8),
#history-table td:nth-child(8) { width: 5.6rem; }
#history-table th:nth-child(9),
#history-table td:nth-child(9) { width: 4.9rem; }
#history-table th:nth-child(10),
#history-table td:nth-child(10) { width: 4.6rem; }
#history-table th:nth-child(11),
#history-table td:nth-child(11) { width: 4.8rem; }
#history-table th:nth-child(12),
#history-table td:nth-child(12),
#history-table th:nth-child(13),
#history-table td:nth-child(13),
#history-table th:nth-child(14),
#history-table td:nth-child(14),
#history-table th:nth-child(15),
#history-table td:nth-child(15),
#history-table th:nth-child(16),
#history-table td:nth-child(16),
#history-table th:nth-child(17),
#history-table td:nth-child(17) { width: 4.95rem; }
#history-table th:nth-child(18),
#history-table td:nth-child(18) { width: 7.1rem; }
#history-table th:nth-child(19),
#history-table td:nth-child(19) { width: 6.5rem; }

.trade-table {
  width: 100%;
  min-width: 1360px;
  table-layout: fixed;
}
.trade-table th { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.12; }
.trade-table .sort-btn { white-space: normal; line-height: 1.12; }
.trade-table th,
.trade-table td {
  padding: .34rem .34rem;
  font-size: .74rem;
}
.trade-table th:nth-child(1),
.trade-table td:nth-child(1) {
  width: 9%;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
}
.trade-table th:nth-child(2),
.trade-table td:nth-child(2) { width: 14%; }
.trade-table th:nth-child(3),
.trade-table td:nth-child(3) { width: 10%; }
.trade-table th:nth-child(4),
.trade-table td:nth-child(4) { width: 6%; }
.trade-table th:nth-child(5),
.trade-table td:nth-child(5) {
  width: 15%;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.trade-table th:nth-child(6),
.trade-table td:nth-child(6) { width: 8%; }
.trade-table th:nth-child(7),
.trade-table td:nth-child(7) { width: 8%; }
.trade-table th:nth-child(8),
.trade-table td:nth-child(8) { width: 8%; }
.trade-table th:nth-child(9),
.trade-table td:nth-child(9) { width: 8%; }
.trade-table th:nth-child(10),
.trade-table td:nth-child(10) { width: 7%; }
.trade-table th:nth-child(11),
.trade-table td:nth-child(11) {
  width: 6%;
  text-overflow: clip;
}
.trade-table td:nth-child(6),
.trade-table td:nth-child(7),
.trade-table td:nth-child(8),
.trade-table td:nth-child(9),
.trade-table td:nth-child(10),
.trade-table td:nth-child(11) { font-variant-numeric: tabular-nums; text-align: right; }
.trade-table th:nth-child(4),
.trade-table td:nth-child(4) { text-align: center; }
.trade-table th:nth-child(5),
.trade-table td:nth-child(5) { text-align: right; }
.trade-table thead th { box-shadow: 0 1px 0 var(--line), 0 .35rem .8rem rgba(0,0,0,.18); }
tr:hover td { background: rgba(96, 165, 250, .07); }
.rank { color: var(--muted); }
.coin { display: flex; gap: .42rem; align-items: center; min-width: 0; }
.coin img { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; }
.coin div { min-width: 0; flex: 1 1 auto; }
.coin strong, .coin span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin span { display: block; color: var(--muted); font-size: .68rem; margin-top: .03rem; }
.up { color: var(--green); font-weight: 800; }
.down { color: var(--red); font-weight: 800; }
.flat { color: var(--muted); }
.compare-match {
  background: rgba(52, 211, 153, .16);
  color: #bbf7d0;
  font-weight: 800;
}
.compare-mismatch-up {
  background: rgba(250, 204, 21, .18);
  color: #fef3c7;
  font-weight: 800;
}
.compare-mismatch-down {
  background: rgba(251, 146, 60, .18);
  color: #ffedd5;
  font-weight: 800;
}
.compare-missing {
  background: rgba(148, 163, 184, .10);
  color: #cbd5e1;
}
.comparison-legend {
  display: flex;
  gap: .35rem .6rem;
  flex-wrap: wrap;
  padding: .45rem .72rem .1rem;
  color: var(--muted);
  font-size: .72rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .58);
}
.legend-item i {
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
.legend-item.compare-match i { background: rgba(52, 211, 153, .8); }
.legend-item.compare-mismatch-up i { background: rgba(250, 204, 21, .9); }
.legend-item.compare-mismatch-down i { background: rgba(251, 146, 60, .9); }
.legend-item.compare-missing i { background: rgba(148, 163, 184, .9); }
.score-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 3rem; border: 1px solid var(--line); background: rgba(15, 23, 42, .82); color: var(--text); border-radius: .75rem; padding: .35rem .55rem; font: inherit; font-weight: 800; line-height: 1; text-decoration: none; }
.score-btn.up { color: var(--green); }
.score-btn.down { color: var(--red); }
.score-btn.flat { color: var(--muted); }
.score-btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .78); backdrop-filter: blur(6px); }
.modal-card { position: relative; width: min(760px, 96vw); max-height: 86vh; overflow: auto; border: 1px solid var(--line); border-radius: 1.2rem; background: #0f172a; box-shadow: 0 30px 120px rgba(0,0,0,.55); padding: 1.25rem; }
.modal-card h2 { margin: .2rem 2.2rem 1rem 0; }
.modal-card pre { margin: 0; white-space: pre-wrap; color: var(--text); line-height: 1.5; font-family: inherit; }
.modal-close { position: absolute; right: 1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(30, 41, 59, .9); color: var(--text); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.modal-close:hover { border-color: var(--blue); }
.news { max-height: none; overflow: visible; }

.signals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: 0 clamp(1rem, 3vw, 1.25rem) 1.45rem; }
.signals-panel { display: flex; flex-direction: column; }
.signal-article { padding: .95rem 1.2rem; }
.signal-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.signal-coin { display: flex; gap: .42rem; align-items: center; min-width: 0; }
.signal-coin img { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); flex: 0 0 auto; }
.signal-coin div { min-width: 0; flex: 1 1 auto; }
.signal-coin strong, .signal-coin span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-coin span { color: var(--muted); font-size: .68rem; margin-top: .03rem; }
.signal-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.signal-tag { border: 1px solid var(--line); background: rgba(15, 23, 42, .58); color: var(--muted); border-radius: 999px; padding: .22rem .5rem; font-size: .72rem; }
.signal-tag.up { color: var(--green); }
.signal-tag.down { color: var(--red); }
.signal-summary { color: var(--muted); margin: .45rem 0 0; font-size: .9rem; line-height: 1.45; }
.signal-empty { padding: 1rem 1.2rem; color: var(--muted); }
.simulators-panel { margin-bottom: .75rem; }
.simulators-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: .75rem; padding: 0 0 .9rem; }
.simulator-card { padding: 1rem 1.05rem; display: flex; flex-direction: column; gap: .55rem; }
.simulator-card p { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.42; }
.simulator-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; margin-top: .65rem; }
.simulator-metrics span { padding: .42rem .52rem; border-radius: .65rem; background: rgba(15, 23, 42, .58); border: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.portfolio-summary { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); margin-top: .35rem; }
.portfolio-summary span { color: var(--text); background: rgba(34, 211, 238, .07); }
.portfolio-summary .score-btn { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.simulation-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .75rem; }
.simulation-kpi-grid span { display: grid; gap: .22rem; padding: .65rem .7rem; border: 1px solid rgba(96,165,250,.22); border-radius: .9rem; background: linear-gradient(180deg, rgba(34,211,238,.10), rgba(15,23,42,.62)); }
.simulation-kpi-grid small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.simulation-kpi-grid strong { font-size: 1rem; letter-spacing: -.03em; }
.simulation-kpi-grid .up { color: var(--green); }
.simulation-kpi-grid .down { color: var(--red); }
.split-actions .button-link:first-child { flex: 1 1 9rem; }
.button-link.danger { color: var(--red); border-color: rgba(248,113,113,.35); }
.compact-grid { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: .75rem; align-items: start; }
.mini-agent-card { padding: .85rem; }
.simulation-form,
.trade-toolbar,
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .75rem;
  align-items: end;
  padding: .85rem;
}
.simulation-form > label,
.trade-toolbar label,
.filters label {
  display: grid;
  gap: .32rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.simulation-form input[type='text'],
.simulation-form select,
.trade-toolbar input,
.trade-toolbar select,
.filters input,
.filters select {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid rgba(148,163,184,.24);
  background: rgba(8,17,31,.82);
  color: var(--text);
  border-radius: .7rem;
  padding: .56rem .68rem;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}
.simulation-form input:focus,
.simulation-form select:focus,
.trade-toolbar input:focus,
.trade-toolbar select:focus,
.filters input:focus,
.filters select:focus { outline: 2px solid rgba(96,165,250,.45); outline-offset: 1px; border-color: rgba(96,165,250,.55); }
.simulation-agent-picker { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; }
.agent-checkbox {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
  min-height: 4.1rem;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(15,23,42,.58);
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.agent-checkbox input { grid-row: 1 / span 2; margin-top: .12rem; accent-color: var(--blue); }
.agent-checkbox span { grid-column: 2; color: var(--text); font-weight: 850; }
.agent-checkbox small { grid-column: 2; color: var(--muted); line-height: 1.35; }
.simulator-agent-pills { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .2rem; }
.pill { display: inline-flex; align-items: center; min-height: 1.65rem; padding: .28rem .52rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(15,23,42,.64); color: #cbd5e1; font-size: .72rem; font-weight: 800; }
.simulator-log-wrap { margin-top: .75rem; }
.simulator-log { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .28rem; }
.simulator-log li { display: grid; grid-template-columns: 1.1fr .55fr .7fr .55fr .65fr; gap: .35rem; padding: .35rem .45rem; border-radius: .55rem; background: rgba(15, 23, 42, .55); border: 1px solid var(--line); font-size: .72rem; }
.simulator-card-actions { display: flex; gap: .35rem; margin-top: .75rem; flex-wrap: wrap; }
.simulator-decisions-list { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .35rem; }
.site-map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); gap: .75rem; align-items: start; }
.site-map-card { min-height: 100%; }
.site-map-list { list-style: none; margin: 0; padding: .75rem; display: grid; gap: .55rem; }
.site-map-list li { display: grid; gap: .18rem; padding: .62rem .68rem; border: 1px solid var(--line); border-radius: .75rem; background: rgba(15, 23, 42, .55); }
.site-map-list a { color: var(--text); text-decoration: none; font-weight: 850; }
.site-map-list a:hover { color: var(--blue); }
.site-map-list span { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.site-map-list code { color: #bfdbfe; font-size: .78rem; white-space: normal; overflow-wrap: anywhere; }
.site-map-card-technical .site-map-list li { background: rgba(8, 17, 31, .52); }
.db-map-wrap { overflow-x: auto; padding: .6rem .75rem .9rem; }
.database-schema-svg { min-width: 980px; width: 100%; height: auto; display: block; }
.db-table-node rect { fill: rgba(15, 23, 42, .92); stroke: rgba(96,165,250,.36); stroke-width: 1.2; filter: drop-shadow(0 12px 18px rgba(0,0,0,.22)); }
.db-table-node text { fill: var(--muted); font-size: 11px; }
.db-table-node .db-table-title { fill: var(--text); font-size: 14px; font-weight: 900; }
.db-table-node .db-table-meta { fill: #bfdbfe; font-size: 10px; }
.db-relation-line path { fill: none; stroke: rgba(52, 211, 153, .58); stroke-width: 2; stroke-dasharray: 6 5; marker-end: url(#db-arrow); }
.db-relation-line path:hover { stroke: rgba(52, 211, 153, .95); stroke-width: 3; }
.database-schema-svg marker path { fill: rgba(52, 211, 153, .78); }
.db-relationship-list { list-style: none; margin: 0; padding: .75rem; display: grid; gap: .45rem; }
.db-relationship-list li { padding: .55rem .65rem; border: 1px solid var(--line); border-radius: .7rem; background: rgba(15,23,42,.58); color: var(--muted); }
.db-relationship-list strong { color: var(--text); }
.db-table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: .75rem; align-items: start; }
.db-column-list { list-style: none; margin: 0; padding: .75rem; display: grid; gap: .32rem; }
.db-column-list li { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(5.5rem, .7fr) minmax(7rem, 1fr); gap: .45rem; align-items: center; padding: .42rem .5rem; border: 1px solid rgba(148,163,184,.13); border-radius: .58rem; background: rgba(8,17,31,.42); }
.db-column-list code { color: #bfdbfe; font-weight: 800; overflow-wrap: anywhere; }
.db-column-list span { color: var(--muted); font-size: .76rem; }
.db-column-list em { color: var(--green); font-style: normal; font-size: .72rem; }
.decision-item { display: grid; grid-template-columns: 1.3fr .58fr .72fr .58fr .7fr .7fr; gap: .35rem; padding: .4rem .5rem; border-radius: .55rem; background: rgba(15, 23, 42, .55); border: 1px solid var(--line); font-size: .72rem; }
.decision-item div { display: flex; flex-direction: column; min-width: 0; }
.decision-item strong { color: var(--text); }
.decision-item span, .decision-item p { color: var(--muted); margin: 0; }
.decision-item p { grid-column: 1 / -1; line-height: 1.35; }
.trade-list { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .28rem; }
.trade-item { display: grid; grid-template-columns: 1fr .75fr .75fr .55fr .55fr .7fr .75fr .75fr; gap: .35rem; padding: .35rem .45rem; border-radius: .55rem; background: rgba(15, 23, 42, .55); border: 1px solid var(--line); font-size: .72rem; }
.trade-item strong { color: var(--text); }
.trade-item span { color: var(--muted); min-width: 0; }
.trade-item .score-btn { justify-self: start; }
.table-filter-summary { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .72rem .15rem; border-bottom: 1px solid rgba(148,163,184,.10); }
.table-filter-summary .pill { background: rgba(96,165,250,.10); }
.article:last-child { border-bottom: 0; }
.article-meta { color: var(--green); font-size: .78rem; margin-bottom: .35rem; }
.article a { display: block; font-weight: 800; text-decoration: none; line-height: 1.25; }
.article a:hover { color: var(--blue); }
.article p { color: var(--muted); margin: .45rem 0 0; font-size: .92rem; line-height: 1.45; }
.filters-panel { margin-bottom: .75rem; }
.filters-actions { display: flex; gap: .45rem; align-items: center; }
.filters-actions button, .filters-reset, .trade-toolbar button, .trade-toolbar a { border: 1px solid var(--line); background: rgba(15, 23, 42, .82); color: var(--text); border-radius: .7rem; min-height: 2.45rem; padding: .56rem .8rem; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.filters-actions button:hover, .filters-reset:hover, .trade-toolbar button:hover, .trade-toolbar a:hover { border-color: var(--blue); }
.period-row { display: flex; gap: .5rem; align-items: center; justify-content: space-between; padding: .3rem .72rem .15rem; flex-wrap: wrap; }
.period-label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.period-links { display: flex; gap: .35rem; flex-wrap: wrap; }
.period-pill { border: 1px solid var(--line); background: rgba(15, 23, 42, .78); color: var(--text); border-radius: 999px; padding: .28rem .6rem; font-size: .74rem; text-decoration: none; }
.period-pill:hover, .period-pill.active { border-color: var(--blue); color: var(--blue); }
.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-bottom: .55rem; }
.chart-card { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 12px 28px rgba(0,0,0,.18); backdrop-filter: blur(14px); border-radius: .85rem; overflow: hidden; }
.chart-card.empty { display: flex; flex-direction: column; }
.chart-card.overlay-chart { margin-bottom: .55rem; }
.dual-axis-chart { grid-column: 1 / -1; }
.overlay-legend { display: flex; gap: .45rem .75rem; flex-wrap: wrap; padding: .42rem .72rem 0; color: var(--muted); font-size: .7rem; }
.overlay-legend-item { display: inline-flex; gap: .35rem; align-items: center; }
.overlay-legend-item i { width: .58rem; height: .58rem; border-radius: 999px; display: inline-block; box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; }
.chart-head { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; padding: .55rem .72rem .35rem; border-bottom: 1px solid var(--line); }
.chart-head h3 { margin: 0; font-size: .92rem; letter-spacing: -.02em; }
.chart-head p { margin: .12rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.chart-range { text-align: right; color: var(--muted); font-size: .7rem; display: grid; gap: .08rem; }
.chart-range strong { color: var(--text); font-size: .76rem; }
.chart-svg { display: block; width: 100%; height: 210px; background: linear-gradient(180deg, rgba(15, 23, 42, .2), rgba(15, 23, 42, 0)); }
.chart-axis { stroke: rgba(148, 163, 184, .35); stroke-width: 1; }
.chart-zero { stroke: rgba(250, 204, 21, .45); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-axis-label {
  fill: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
  dominant-baseline: middle;
  pointer-events: none;
}
.chart-axis-label-x {
  dominant-baseline: hanging;
}
.chart-footer { display: flex; justify-content: space-between; gap: .6rem; padding: 0 .72rem .7rem; color: var(--muted); font-size: .7rem; }
.chart-empty { margin: 0; padding: .8rem .72rem .9rem; color: var(--muted); }
.trade-chart-legend { display: flex; gap: .5rem; flex-wrap: wrap; padding: .6rem .75rem 0; color: var(--muted); font-size: .76rem; font-weight: 800; }
.trade-chart-legend span { display: inline-flex; align-items: center; gap: .32rem; }
.trade-chart-legend span::before { content: ''; display: inline-block; width: .7rem; height: .7rem; border-radius: .2rem; }
.legend-buy::before { background: var(--green); }
.legend-sell::before { background: var(--red); }
.legend-total::before { background: #60a5fa; }
.trade-chart-wrap { overflow-x: auto; padding: .35rem .55rem .75rem; }
.trade-chart { display: block; min-width: 720px; width: 100%; height: auto; }
.chart-buy { fill: rgba(52, 211, 153, .88); }
.chart-sell { fill: rgba(251, 113, 133, .88); }
.chart-buy-line, .chart-sell-line, .chart-total-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-buy-line { stroke: rgba(52, 211, 153, .92); }
.chart-sell-line { stroke: rgba(251, 113, 133, .92); }
.chart-total-line { stroke: rgba(96, 165, 250, .94); }
.chart-buy-point { fill: #34d399; stroke: rgba(6, 78, 59, .9); stroke-width: 1.5; }
.chart-sell-point { fill: #fb7185; stroke: rgba(136, 19, 55, .9); stroke-width: 1.5; }
.chart-total-point { fill: #60a5fa; stroke: rgba(30, 64, 175, .9); stroke-width: 1.5; }
.chart-buy:hover, .chart-sell:hover, .chart-buy-point:hover, .chart-sell-point:hover, .chart-total-point:hover { filter: brightness(1.16); }
.chart-detail-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .65rem .75rem 0; color: var(--muted); font-size: .78rem; }
.chart-detail-trigger { cursor: zoom-in; }
.chart-detail-trigger:hover { background: rgba(96, 165, 250, .07); }
.chart-detail-card { width: min(1180px, 98vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.chart-detail-help { color: var(--muted); margin: -.45rem 2.4rem .7rem 0; }
.chart-detail-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; align-items: end; margin: .8rem 0 .55rem; }
.chart-detail-controls label { display: grid; gap: .25rem; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.chart-detail-controls input { border: 1px solid var(--line); background: rgba(15, 23, 42, .82); color: var(--text); border-radius: .7rem; min-height: 2.4rem; padding: .35rem .55rem; }
.chart-zoom-control { grid-template-columns: 1fr auto; column-gap: .5rem; align-items: center; }
.chart-zoom-control span { grid-column: 1 / -1; }
.chart-detail-summary { color: var(--muted); font-size: .82rem; margin: .25rem 0 .55rem; }
.chart-detail-scroll { flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: rgba(15, 23, 42, .52); padding: .45rem; display: flex; }
.portfolio-total-detail-chart { width: 100%; height: 100%; max-width: 100%; min-width: 0; display: block; flex: 1; min-height: 0; }
body.modal-open { overflow: hidden; }
.trade-chart text { fill: var(--muted); font-size: 11px; }
.trade-chart .chart-mini-label { fill: #dbeafe; font-size: 10px; font-weight: 800; }
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 11.75rem minmax(0, 1fr); }
  .brand small { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prices { margin-bottom: 1rem; }
  .charts-grid { grid-template-columns: 1fr; }
  .signals-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .app-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
  .app-nav { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
  .sidebar-section { margin-top: 0; }
  .topbar { justify-content: flex-start; flex-wrap: wrap; }
  .detail-columns { grid-template-columns: 1fr; }
  .simulation-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  table { min-width: 1380px; }
  th, td { padding: .65rem .5rem; font-size: .88rem; }
  .trade-table { min-width: 1360px; }
  .simulation-form,
  .trade-toolbar,
  .filters { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .page-header { padding-inline: .85rem; }
  .simulation-kpi-grid { grid-template-columns: 1fr; }
}
