:root {
  --ink: #07110f;
  --panel: rgba(11, 24, 21, 0.84);
  --panel-strong: #0e1f1c;
  --line: rgba(190, 226, 208, 0.18);
  --text: #eff8f2;
  --muted: #98aa9f;
  --green: #38d989;
  --lime: #b9f268;
  --cyan: #6ed9ff;
  --amber: #f2b84b;
  --red: #ff6b5f;
  --paper: #f5f0e7;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(56, 217, 137, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(110, 217, 255, 0.16), transparent 30rem),
    linear-gradient(135deg, #07110f 0%, #0b1714 48%, #111511 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

#market-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 4.75rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 15, 0.74);
  backdrop-filter: blur(18px);
}

.brand {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 13rem;
}

.brand-mark {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid rgba(185, 242, 104, 0.45);
  border-radius: 0.55rem;
  background: linear-gradient(140deg, rgba(56, 217, 137, 0.22), rgba(110, 217, 255, 0.1));
  color: var(--lime);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  justify-content: center;
  color: #c4d7cd;
  font-size: 0.88rem;
}

.nav-links a,
.site-footer a {
  transition: color 160ms ease;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--lime);
}

.header-action,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  gap: 0.5rem;
  border-radius: 0.6rem;
  font-weight: 750;
  white-space: nowrap;
}

.header-action {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  top: 50%;
  transform: translateY(-50%);
  justify-self: end;
  padding: 0 1rem;
  border: 1px solid rgba(110, 217, 255, 0.32);
  background: rgba(110, 217, 255, 0.08);
  color: var(--cyan);
  font-size: 0.9rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 0.82fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  min-height: calc(100vh - 4.7rem);
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem) 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow span,
.pulse-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(56, 217, 137, 0.5);
  animation: pulse 1.8s infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.15rem;
  color: #fbfff9;
  font-size: clamp(2.35rem, 5.8vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 39rem;
  margin-bottom: 1.6rem;
  color: #bfd2c8;
  font-size: clamp(0.92rem, 1vw, 1rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.7rem;
}

.primary-action {
  padding: 0 1.35rem;
  background: linear-gradient(135deg, var(--lime), var(--green));
  color: #07110f;
  box-shadow: 0 1rem 2rem rgba(56, 217, 137, 0.2);
}

.secondary-action {
  padding: 0 1.15rem;
  border: 1px solid rgba(239, 248, 242, 0.2);
  background: rgba(239, 248, 242, 0.06);
  color: #e9f4ee;
}

.secondary-action.light {
  width: fit-content;
  margin-top: 1.1rem;
  border-color: rgba(7, 17, 15, 0.16);
  background: rgba(7, 17, 15, 0.08);
  color: #07110f;
}

.watchlist-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.watchlist-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
}

.watchlist-hero h1 {
  max-width: 18ch;
  margin-bottom: 0.8rem;
  font-size: clamp(1.85rem, 4vw, 3.1rem);
}

.watchlist-status-card {
  min-width: 13rem;
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.06);
}

.watchlist-status-card span,
.watchlist-status-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.watchlist-status-card strong {
  font-size: 1.35rem;
}

.watchlist-toolbar {
  display: flex;
  align-items: end;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(7, 17, 15, 0.48);
}

.watchlist-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.watchlist-toolbar input,
.watchlist-toolbar select {
  min-height: 2.5rem;
  min-width: 12rem;
  border: 1px solid rgba(239, 248, 242, 0.16);
  border-radius: 0.55rem;
  background: rgba(3, 9, 8, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0 0.75rem;
}

.watchlist-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.watchlist-table th,
.watchlist-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.09);
  text-align: left;
  vertical-align: middle;
}

.watchlist-table th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.watchlist-table td {
  font-size: 0.9rem;
}

.watchlist-table td small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.rate-cell {
  font-size: 1rem;
  font-weight: 850;
}

.rate-cell.up {
  color: var(--green);
}

.rate-cell.down {
  color: var(--red);
}

.rate-cell.flat {
  color: var(--text);
}

.status-up {
  border-color: rgba(56, 217, 137, 0.35);
  background: rgba(56, 217, 137, 0.12);
  color: var(--green);
}

.status-down {
  border-color: rgba(255, 107, 95, 0.36);
  background: rgba(255, 107, 95, 0.12);
  color: var(--red);
}

.status-flat {
  border-color: rgba(239, 248, 242, 0.14);
  background: rgba(239, 248, 242, 0.06);
  color: var(--muted);
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(185, 242, 104, 0.38);
  border-radius: 0.55rem;
  background: rgba(185, 242, 104, 0.12);
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 850;
}

.charts-page-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.charts-page-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
}

.charts-page-hero h1 {
  max-width: 18ch;
  margin-bottom: 0.8rem;
  font-size: clamp(1.85rem, 4vw, 3.1rem);
}

.charts-page-status-card {
  min-width: 13rem;
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.06);
}

.charts-page-status-card span,
.charts-page-status-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.charts-page-status-card strong {
  font-size: 1.35rem;
}

.charts-page-controls {
  display: flex;
  align-items: end;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(7, 17, 15, 0.48);
}

.charts-page-controls label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.charts-page-controls select {
  min-height: 2.5rem;
  min-width: 10rem;
  border: 1px solid rgba(239, 248, 242, 0.16);
  border-radius: 0.55rem;
  background: rgba(3, 9, 8, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0 0.75rem;
}

.charts-page-panel {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
  overflow: hidden;
}

.charts-page-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.charts-page-meta div {
  min-width: 0;
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--line);
}

.charts-page-meta div:last-child {
  border-right: 0;
}

.charts-page-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.charts-page-meta strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.mt5-chart {
  position: relative;
  height: min(68vh, 620px);
  min-height: 420px;
}

.chart-message {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.chart-message[hidden] {
  display: none;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 38rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(7, 17, 15, 0.4);
  overflow: hidden;
}

.hero-stats div {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats dt {
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 850;
}

.hero-stats dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.terminal-panel,
.market-strip,
.feature-band,
.dashboard-band {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.terminal-panel {
  position: relative;
  padding: 1rem;
  border-radius: 1.1rem;
  overflow: hidden;
}

.terminal-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 10px;
  opacity: 0.24;
}

.panel-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.panel-toolbar span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #43524c;
}

.panel-toolbar span:nth-child(1) {
  background: var(--red);
}

.panel-toolbar span:nth-child(2) {
  background: var(--amber);
}

.panel-toolbar span:nth-child(3) {
  margin-right: 0.5rem;
  background: var(--green);
}

.signal-head {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.85rem;
  background: rgba(239, 248, 242, 0.05);
}

.signal-head p {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.signal-head strong {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.bias {
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.bias.buy {
  background: rgba(56, 217, 137, 0.16);
  color: var(--green);
}

.bias.sell {
  background: rgba(255, 107, 95, 0.16);
  color: var(--red);
}

.chart-shell {
  position: relative;
  height: clamp(13rem, 32vw, 17rem);
  margin: 1rem 0;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.85rem;
  background:
    linear-gradient(rgba(239, 248, 242, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 248, 242, 0.045) 1px, transparent 1px),
    rgba(5, 13, 11, 0.68);
  background-size: 100% 25%, 25% 100%, auto;
  overflow: hidden;
}

#sparkline {
  width: 100%;
  height: 100%;
}

.signal-grid,
.metrics-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.signal-grid div,
.metrics-board div,
.feature-grid article,
.pair-card {
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.055);
}

.signal-grid div {
  padding: 0.85rem;
}

.signal-grid span,
.metrics-board span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.signal-grid strong,
.metrics-board strong {
  display: block;
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem;
}

.decision-card {
  position: relative;
  display: flex;
  gap: 0.7rem;
  align-items: start;
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(185, 242, 104, 0.1);
  color: #dcebdd;
}

.decision-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.market-strip,
.feature-band,
.dashboard-band {
  margin: 1rem clamp(1rem, 4vw, 3rem);
  border-radius: 1.1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.section-heading p {
  margin-bottom: 0.45rem;
  color: var(--lime);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading h2,
.dashboard-copy h2 {
  max-width: 43rem;
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.pair-card {
  min-height: 9.75rem;
  padding: 0.9rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.pair-card:hover {
  transform: translateY(-3px);
  border-color: rgba(185, 242, 104, 0.38);
}

.pair-card.is-muted {
  opacity: 0.66;
}

.pair-card.is-muted:hover {
  transform: none;
  border-color: rgba(239, 248, 242, 0.12);
}

.pair-top,
.pair-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.pair-bottom {
  align-items: end;
  flex-wrap: wrap;
}

.pair-bottom div {
  display: grid;
  gap: 0.22rem;
}

.pair-name {
  font-weight: 850;
}

.pair-change {
  font-size: 0.82rem;
  font-weight: 800;
}

.pair-chart {
  width: 100%;
  height: 3.9rem;
  margin: 0.75rem 0;
}

.pair-price {
  display: block;
  font-variant-numeric: tabular-nums;
  color: #fbfff9;
}

.pair-action {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(185, 242, 104, 0.42);
  border-radius: 999px;
  padding: 0 0.7rem;
  color: var(--text);
  background: rgba(185, 242, 104, 0.1);
  font-size: 0.74rem;
  font-weight: 850;
  text-decoration: none;
}

.pair-action:hover {
  border-color: rgba(185, 242, 104, 0.78);
  background: rgba(185, 242, 104, 0.18);
}

.market-clock-panel .signal-head strong {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid rgba(239, 248, 242, 0.14);
  border-radius: 999px;
  padding: 0 0.75rem;
  font-size: 0.76rem;
  font-weight: 850;
}

.session-pill.is-open {
  border-color: rgba(56, 217, 137, 0.34);
  background: rgba(56, 217, 137, 0.12);
  color: var(--green);
}

.session-pill.is-closed {
  border-color: rgba(255, 107, 95, 0.34);
  background: rgba(255, 107, 95, 0.12);
  color: var(--red);
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.session-card {
  display: grid;
  min-height: 8rem;
  align-content: space-between;
  gap: 0.45rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  padding: 1rem;
  background: rgba(239, 248, 242, 0.055);
}

.session-card span,
.session-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.session-card strong {
  color: #fbfff9;
  font-size: 1.35rem;
}

.session-card em {
  width: fit-content;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
}

.session-card.is-open {
  border-color: rgba(56, 217, 137, 0.3);
}

.session-card.is-open em {
  background: rgba(56, 217, 137, 0.14);
  color: var(--green);
}

.session-card.is-closed em {
  background: rgba(239, 248, 242, 0.08);
  color: var(--muted);
}

.news-table-wrap {
  overflow-x: auto;
}

.news-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.news-table th,
.news-table td {
  padding: 0.78rem 0.8rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.1);
  text-align: left;
  vertical-align: top;
}

.news-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.news-sentiment {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 850;
}

.news-sentiment.bullish,
.news-sentiment.positive {
  background: rgba(56, 217, 137, 0.14);
  color: var(--green);
}

.news-sentiment.bearish,
.news-sentiment.negative {
  background: rgba(255, 107, 95, 0.14);
  color: var(--red);
}

.news-sentiment.neutral {
  background: rgba(239, 248, 242, 0.08);
  color: var(--muted);
}

.mt5-safety-table td small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.mt5-safety-table .bias {
  border-radius: 999px;
  padding: 0.24rem 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.feature-grid article {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.feature-icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  margin-bottom: 1.3rem;
  border-radius: 0.55rem;
  background: rgba(110, 217, 255, 0.12);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 900;
}

.feature-grid h3 {
  margin-bottom: 0.65rem;
  font-size: 1.08rem;
}

.feature-grid p,
.dashboard-copy p {
  color: #bdd0c6;
}

.dashboard-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(20rem, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 1rem;
  background:
    linear-gradient(135deg, rgba(245, 240, 231, 0.96), rgba(220, 239, 224, 0.94)),
    var(--paper);
  color: #07110f;
}

.dashboard-copy p {
  max-width: 36rem;
  color: #405249;
}

.dashboard-band .eyebrow {
  color: #0b6b42;
}

.metrics-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metrics-board div {
  min-height: 9rem;
  padding: 1.1rem;
  border-color: rgba(7, 17, 15, 0.12);
  background: rgba(255, 255, 255, 0.54);
}

.metrics-board span {
  color: #51645b;
  font-weight: 750;
}

.metrics-board strong {
  margin-top: 1.2rem;
  color: #07110f;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer span:first-child {
  color: var(--text);
  font-weight: 800;
}

.app-page {
  min-height: 100vh;
}

.nav-links [aria-current="page"] {
  color: var(--lime);
}

.trades-shell {
  padding: clamp(1rem, 4vw, 3rem);
}

.trades-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.82fr);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.trades-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1;
}

.trade-summary-grid,
.trade-controls,
.risk-panel,
.trade-card,
.empty-state {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.trade-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 1.1rem;
}

.trade-summary-grid div {
  min-height: 6.8rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.8rem;
  background: rgba(239, 248, 242, 0.055);
}

.trade-summary-grid span,
.trade-metrics span,
.price-ladder span,
.trade-score span,
.risk-panel-metrics span,
.last-updated {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.trade-summary-grid strong {
  display: block;
  margin-top: 1rem;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1;
}

.trade-controls {
  display: grid;
  grid-template-columns: 1.2fr minmax(9rem, 0.55fr) minmax(10rem, 0.65fr) auto;
  align-items: end;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 1rem;
}

.trade-controls label {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.trade-controls input,
.trade-controls select {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid rgba(239, 248, 242, 0.16);
  border-radius: 0.65rem;
  outline: none;
  background: rgba(5, 13, 11, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0 0.8rem;
}

.trade-controls input:focus,
.trade-controls select:focus {
  border-color: rgba(185, 242, 104, 0.7);
}

.last-updated {
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

.open-trades-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.34fr);
  gap: 1rem;
  align-items: start;
}

.trade-list {
  display: grid;
  gap: 0.85rem;
}

.trade-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.trade-table {
  width: 100%;
  min-width: 94rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.trade-table th,
.trade-table td {
  padding: 0.68rem 0.78rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.trade-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(7, 17, 15, 0.96);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trade-table tbody tr {
  transition: background 160ms ease;
}

.trade-table tbody tr:hover {
  background: rgba(239, 248, 242, 0.055);
}

.trade-table tbody tr:last-child td {
  border-bottom: 0;
}

.trade-table .numeric {
  text-align: right;
}

.current-rate-cell {
  display: grid;
  gap: 0.2rem;
  justify-items: end;
}

.current-rate-cell strong {
  color: var(--text);
  font-size: 0.92rem;
}

.current-rate-cell span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.current-rate-cell.is-fresh strong {
  color: var(--green);
}

.current-rate-cell.is-stale strong {
  color: var(--amber);
}

.current-rate-cell.is-missing strong {
  color: var(--muted);
}

.execution-cell {
  display: grid;
  gap: 0.28rem;
  min-width: 8rem;
}

.execution-cell strong {
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.execution-cell span,
.execution-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.inline-action {
  width: fit-content;
  border: 1px solid rgba(161, 255, 90, 0.45);
  border-radius: 8px;
  background: rgba(161, 255, 90, 0.10);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.38rem 0.56rem;
}

.inline-action:disabled {
  cursor: progress;
  opacity: 0.65;
}

.table-pair {
  display: grid;
  gap: 0.14rem;
}

.table-pair strong {
  color: var(--text);
  font-size: 0.9rem;
}

.table-pair span {
  color: var(--muted);
  font-size: 0.72rem;
}

.score-cell {
  color: var(--lime);
  font-weight: 850;
}

.reason-cell {
  max-width: 24rem;
  white-space: normal;
}

.reason-cell strong,
.reason-cell span {
  display: block;
}

.reason-cell strong {
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.35;
}

.reason-cell span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.trade-table .reason-cell {
  min-width: 28rem;
  max-width: 42rem;
  white-space: normal;
}

.trade-reason-text {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.trade-reason-text p,
.trade-reason-text small {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.45;
}

.trade-reason-text p {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
}

.trade-reason-text small {
  color: var(--muted);
  font-size: 0.72rem;
}

.trade-card,
.empty-state,
.loading-card,
.risk-panel {
  border-radius: 1rem;
}

.trade-card {
  padding: clamp(1rem, 2.5vw, 1.35rem);
}

.trade-card-main {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.trade-pair-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.trade-pair-row strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.trade-card-main p {
  margin-bottom: 0;
  color: var(--muted);
}

.trade-grade {
  padding: 0.34rem 0.55rem;
  border-radius: 999px;
  background: rgba(110, 217, 255, 0.12);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 850;
}

.trade-score {
  min-width: 5rem;
  text-align: right;
}

.trade-score strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--lime);
  font-size: 1.9rem;
  line-height: 1;
}

.price-ladder,
.trade-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.price-ladder {
  margin-bottom: 0.7rem;
}

.price-ladder div,
.trade-metrics div {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(239, 248, 242, 0.1);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.05);
}

.price-ladder strong,
.trade-metrics strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.trade-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.risk-panel {
  position: sticky;
  top: 5.8rem;
  padding: 1rem;
}

.risk-scale {
  height: 0.75rem;
  margin: 1.2rem 0 1rem;
  border-radius: 999px;
  background: rgba(239, 248, 242, 0.1);
  overflow: hidden;
}

#risk-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
  transition: width 260ms ease;
}

.risk-panel-metrics {
  display: grid;
  gap: 0.7rem;
}

.risk-panel-metrics div {
  padding: 0.8rem;
  border: 1px solid rgba(239, 248, 242, 0.1);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.05);
}

.risk-panel-metrics strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.18rem;
}

.risk-note {
  margin: 1rem 0 0;
  color: #bdd0c6;
  font-size: 0.9rem;
}

.empty-state,
.loading-card {
  padding: clamp(1.3rem, 4vw, 2rem);
}

.empty-state strong,
.loading-card {
  display: block;
  color: var(--text);
  font-size: 1.12rem;
}

.empty-state p {
  max-width: 42rem;
  margin: 0.45rem 0 1rem;
  color: #bdd0c6;
}

.error-state {
  border-color: rgba(255, 107, 95, 0.36);
}

.dashboard-shell {
  padding: clamp(1rem, 4vw, 3rem);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.38fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin-bottom: 1rem;
}

.dashboard-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  line-height: 1;
}

.dashboard-status-card,
.kpi-grid article,
.performance-panel,
.dashboard-side-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.dashboard-status-card {
  min-height: 10rem;
  padding: 1rem;
  border-radius: 1rem;
}

.dashboard-status-card span,
.dashboard-status-card small,
.kpi-grid span,
.profit-loss-bars span,
.side-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.dashboard-status-card strong {
  display: block;
  margin: 1.25rem 0 0.55rem;
  color: var(--lime);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kpi-grid article {
  min-height: 7rem;
  padding: 1rem;
  border-radius: 0.9rem;
}

.kpi-grid strong {
  display: block;
  margin-top: 1rem;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  line-height: 1;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.32fr);
  gap: 1rem;
  align-items: start;
}

.daily-gate-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.daily-gate-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.daily-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.gate-action-button {
  min-height: 2.25rem;
  border-radius: 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0 0.75rem;
}

.gate-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.gate-action-button.pause {
  border: 1px solid rgba(255, 107, 95, 0.36);
  background: rgba(255, 107, 95, 0.12);
  color: var(--red);
}

.gate-action-button.resume {
  border: 1px solid rgba(56, 217, 137, 0.36);
  background: rgba(56, 217, 137, 0.12);
  color: var(--green);
}

.daily-gate-main h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.daily-gate-main p:last-child {
  max-width: 56rem;
  margin-bottom: 0;
  color: #bdd0c6;
}

.daily-gate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.daily-gate-grid article {
  min-height: 6.6rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.1);
  border-radius: 0.8rem;
  background: rgba(239, 248, 242, 0.05);
}

.daily-gate-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.daily-gate-grid strong {
  display: block;
  margin-top: 1rem;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1;
}

.performance-panel,
.dashboard-side-panel {
  border-radius: 1rem;
  padding: 1rem;
}

.compact-heading {
  margin-bottom: 1rem;
}

.profit-loss-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.profit-loss-bars > div {
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.1);
  border-radius: 0.8rem;
  background: rgba(239, 248, 242, 0.05);
}

.profit-loss-bars strong {
  display: block;
  margin: 0.4rem 0 0.7rem;
  font-size: 1.35rem;
}

.bar-track {
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(239, 248, 242, 0.1);
  overflow: hidden;
}

.profit-bar,
.loss-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease;
}

.profit-bar {
  background: linear-gradient(90deg, var(--green), var(--lime));
}

.loss-bar {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.performance-table th,
.performance-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.1);
}

.performance-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
}

.performance-table td {
  text-align: right;
  font-weight: 800;
}

.performance-table tr:last-child th,
.performance-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-side-panel {
  position: sticky;
  top: 5.8rem;
}

.side-metric {
  margin-bottom: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(239, 248, 242, 0.1);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.05);
}

.side-metric strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.3rem;
}

.ops-shell {
  padding: clamp(1rem, 4vw, 3rem);
}

.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.48fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin-bottom: 1rem;
}

.ops-hero h1 {
  max-width: 17ch;
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  line-height: 1;
}

.admin-key-card,
.ops-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.admin-key-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 1rem;
}

.admin-key-card label,
.admin-key-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

.admin-key-row input,
.admin-key-row button {
  min-height: 2.65rem;
  border-radius: 0.65rem;
  font: inherit;
}

.admin-key-row input {
  width: 100%;
  border: 1px solid rgba(239, 248, 242, 0.16);
  outline: none;
  background: rgba(5, 13, 11, 0.72);
  color: var(--text);
  padding: 0 0.8rem;
}

.admin-key-row input:focus {
  border-color: rgba(185, 242, 104, 0.7);
}

.admin-key-row button {
  border: 1px solid rgba(110, 217, 255, 0.32);
  background: rgba(110, 217, 255, 0.1);
  color: var(--cyan);
  cursor: pointer;
  font-weight: 800;
  padding: 0 1rem;
}

.ops-kpis {
  margin-bottom: 1rem;
}

.ops-panel {
  padding: 1rem;
  border-radius: 1rem;
}

.admin-tools-panel {
  margin-top: 1rem;
}

.admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-tool-grid a {
  min-height: 6rem;
  display: grid;
  align-content: space-between;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.055);
  transition: border-color 160ms ease, background 160ms ease;
}

.admin-tool-grid a:hover {
  border-color: rgba(185, 242, 104, 0.42);
  background: rgba(185, 242, 104, 0.08);
}

.admin-tool-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.admin-tool-grid strong {
  color: var(--text);
  font-size: 1rem;
}

.backtest-shell {
  display: grid;
  gap: 1rem;
}

.backtest-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.backtest-actions h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.backtest-actions p {
  margin: 0;
  color: var(--muted);
}

.backtest-actions p[data-tone="error"] {
  color: var(--red);
}

.backtest-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.backtest-controls select,
.backtest-controls button {
  min-height: 2.65rem;
  border-radius: 0.65rem;
  font: inherit;
  font-weight: 800;
}

.backtest-controls select {
  border: 1px solid rgba(239, 248, 242, 0.16);
  background: rgba(5, 13, 11, 0.72);
  color: var(--text);
  padding: 0 0.8rem;
}

.backtest-controls button {
  border: 1px solid rgba(185, 242, 104, 0.36);
  background: rgba(185, 242, 104, 0.12);
  color: var(--green);
  cursor: pointer;
  padding: 0 1rem;
}

.backtest-controls button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.backtest-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.backtest-metric {
  min-height: 8rem;
  display: grid;
  align-content: space-between;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.2);
}

.backtest-metric span,
.backtest-metric small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.backtest-metric strong {
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

.backtest-metric.positive strong,
.positive-text {
  color: var(--green);
}

.backtest-metric.negative strong,
.negative-text {
  color: var(--red);
}

.backtest-table-panel {
  overflow: hidden;
}

.diagnostic-select {
  min-height: 2.4rem;
  border: 1px solid rgba(239, 248, 242, 0.16);
  border-radius: 0.65rem;
  background: rgba(5, 13, 11, 0.72);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 0 0.75rem;
}

.compact-table {
  width: 100%;
  min-width: 54rem;
  border-collapse: collapse;
}

.compact-table th,
.compact-table td {
  padding: 0.8rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 0.82rem;
}

.compact-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compact-table small {
  color: var(--muted);
  font-weight: 750;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
}

.result-pill.is-win {
  background: rgba(56, 217, 137, 0.12);
  color: var(--green);
}

.result-pill.is-loss {
  background: rgba(255, 107, 95, 0.12);
  color: var(--red);
}

.result-pill.is-time {
  background: rgba(110, 217, 255, 0.12);
  color: var(--cyan);
}

.scheduler-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(5, 13, 11, 0.42);
}

.scheduler-table {
  width: 100%;
  min-width: 76rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.scheduler-table th,
.scheduler-table td {
  padding: 0.68rem 0.78rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.scheduler-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(7, 17, 15, 0.96);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scheduler-table tbody tr:hover {
  background: rgba(239, 248, 242, 0.055);
}

.scheduler-table tbody tr:last-child td {
  border-bottom: 0;
}

.scheduler-table .numeric {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
}

.status-good {
  background: rgba(56, 217, 137, 0.16);
  color: var(--green);
}

.status-running {
  background: rgba(110, 217, 255, 0.16);
  color: var(--cyan);
}

.status-warn {
  background: rgba(242, 184, 75, 0.16);
  color: var(--amber);
}

.status-bad {
  background: rgba(255, 107, 95, 0.16);
  color: var(--red);
}

.status-muted {
  background: rgba(239, 248, 242, 0.1);
  color: var(--muted);
}

.journal-shell {
  padding: clamp(1rem, 4vw, 3rem);
}

.journal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.38fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin-bottom: 1rem;
}

.journal-hero h1 {
  max-width: 17ch;
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  line-height: 1;
}

.journal-summary-card,
.journal-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
}

.journal-summary-card {
  min-height: 10rem;
  padding: 1rem;
  border-radius: 1rem;
}

.journal-summary-card span,
.journal-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.journal-summary-card strong {
  display: block;
  margin: 1.25rem 0 0.55rem;
  color: var(--lime);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.journal-kpis,
.journal-controls {
  margin-bottom: 1rem;
}

.journal-panel {
  padding: 1rem;
  border-radius: 1rem;
}

.journal-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(5, 13, 11, 0.42);
}

.journal-table {
  width: 100%;
  min-width: 116rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.journal-table th,
.journal-table td {
  padding: 0.68rem 0.78rem;
  border-bottom: 1px solid rgba(239, 248, 242, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.journal-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(7, 17, 15, 0.96);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.journal-table tbody tr:hover {
  background: rgba(239, 248, 242, 0.055);
}

.journal-table tbody tr:last-child td {
  border-bottom: 0;
}

.journal-table .numeric {
  text-align: right;
}

.journal-table .reason-cell {
  min-width: 16rem;
  max-width: 22rem;
  white-space: normal;
  vertical-align: top;
}

.journal-reason-details {
  max-width: 22rem;
}

.journal-reason-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
  list-style-position: outside;
  overflow-wrap: anywhere;
}

.journal-reason-details summary:hover {
  color: var(--green);
}

.journal-reason-text {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
  max-height: 11rem;
  min-width: 0;
  overflow: auto;
  padding-right: 0.25rem;
}

.journal-reason-text p,
.journal-reason-text small {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.4;
}

.journal-reason-text p {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
}

.journal-reason-text small {
  color: var(--muted);
  font-size: 0.7rem;
}

.pnl-positive {
  color: var(--green);
  font-weight: 850;
}

.pnl-negative {
  color: var(--red);
  font-weight: 850;
}

.journal-edit-cell {
  min-width: 18rem;
  white-space: normal;
}

.journal-edit-cell label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.journal-edit-cell input,
.journal-edit-cell textarea {
  width: 100%;
  border: 1px solid rgba(239, 248, 242, 0.16);
  border-radius: 0.55rem;
  outline: none;
  background: rgba(5, 13, 11, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.55rem;
}

.journal-edit-cell input:focus,
.journal-edit-cell textarea:focus {
  border-color: rgba(185, 242, 104, 0.7);
}

.journal-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
  margin-bottom: 0.55rem;
}

.journal-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(110, 217, 255, 0.14);
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 850;
}

.journal-save-button {
  min-height: 2.25rem;
  border: 1px solid rgba(185, 242, 104, 0.36);
  border-radius: 0.55rem;
  background: rgba(185, 242, 104, 0.12);
  color: var(--lime);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0 0.75rem;
}

.journal-save-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 0.7rem rgba(56, 217, 137, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 217, 137, 0);
  }
}

@media (max-width: 1050px) {
  .hero,
  .dashboard-band,
  .trades-hero,
  .open-trades-layout,
  .dashboard-hero,
  .dashboard-layout,
  .ops-hero,
  .journal-hero {
    grid-template-columns: 1fr;
  }

  .pair-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .risk-panel {
    position: static;
  }

  .dashboard-side-panel {
    position: static;
  }

  .trade-controls {
    grid-template-columns: 1fr 1fr;
  }

  .last-updated {
    justify-self: start;
  }

  .trade-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-gate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: start;
    flex-wrap: wrap;
  }

  .brand {
    position: static;
    transform: none;
    min-width: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .header-action {
    position: static;
    transform: none;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.1rem);
  }

  .hero-stats,
  .feature-grid,
  .signal-grid,
  .metrics-board,
    .trade-summary-grid,
    .kpi-grid,
    .admin-tool-grid,
    .daily-gate-grid,
    .profit-loss-bars,
  .price-ladder,
  .trade-metrics,
  .trade-controls {
    grid-template-columns: 1fr;
  }

  .watchlist-hero {
    display: grid;
  }

  .watchlist-status-card {
    min-width: 0;
  }

  .watchlist-toolbar {
    display: grid;
  }

  .watchlist-toolbar input,
  .watchlist-toolbar select,
  .watchlist-toolbar .secondary-action {
    width: 100%;
    min-width: 0;
  }

  .watchlist-table {
    min-width: 0;
  }

  .watchlist-table thead {
    display: none;
  }

  .watchlist-table,
  .watchlist-table tbody,
  .watchlist-table tr,
  .watchlist-table td {
    display: block;
  }

  .watchlist-table tr {
    margin: 0.75rem;
    border: 1px solid rgba(239, 248, 242, 0.12);
    border-radius: 0.75rem;
    background: rgba(239, 248, 242, 0.04);
    overflow: hidden;
  }

  .watchlist-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.45fr) 1fr;
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
  }

  .watchlist-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .charts-page-hero {
    display: grid;
  }

  .charts-page-status-card {
    min-width: 0;
  }

  .charts-page-controls {
    display: grid;
  }

  .charts-page-controls select,
  .charts-page-controls .secondary-action {
    width: 100%;
    min-width: 0;
  }

  .charts-page-meta {
    grid-template-columns: 1fr;
  }

  .charts-page-meta div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .charts-page-meta div:last-child {
    border-bottom: 0;
  }

  .mt5-chart {
    min-height: 340px;
    height: 58vh;
  }

  .trades-shell {
    padding-top: 1rem;
  }

  .trade-card-main {
    display: grid;
  }

  .trade-score {
    text-align: left;
  }

  .trade-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .trade-table {
    min-width: 0;
  }

  .trade-table,
  .trade-table thead,
  .trade-table tbody,
  .trade-table tr,
  .trade-table th,
  .trade-table td {
    display: block;
    width: 100%;
  }

  .trade-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .trade-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
    overflow: hidden;
  }

  .trade-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.45fr) 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid rgba(239, 248, 242, 0.1);
    white-space: normal;
  }

  .trade-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .trade-table .numeric {
    text-align: left;
  }

  .scheduler-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .scheduler-table {
    min-width: 0;
  }

  .scheduler-table,
  .scheduler-table thead,
  .scheduler-table tbody,
  .scheduler-table tr,
  .scheduler-table th,
  .scheduler-table td {
    display: block;
    width: 100%;
  }

  .scheduler-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .scheduler-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
    overflow: hidden;
  }

  .scheduler-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.45fr) 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid rgba(239, 248, 242, 0.1);
    white-space: normal;
  }

  .scheduler-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .scheduler-table .numeric {
    text-align: left;
  }

  .journal-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .journal-table {
    min-width: 0;
  }

  .journal-table,
  .journal-table thead,
  .journal-table tbody,
  .journal-table tr,
  .journal-table th,
  .journal-table td {
    display: block;
    width: 100%;
  }

  .journal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .journal-table tr {
    margin-bottom: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 1.2rem 3.5rem rgba(0, 0, 0, 0.24);
    overflow: hidden;
  }

  .journal-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.45fr) 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.78rem 0.9rem;
    border-bottom: 1px solid rgba(239, 248, 242, 0.1);
    white-space: normal;
  }

  .journal-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .journal-table .numeric {
    text-align: left;
  }

  .hero-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-stats div:last-child {
    border-bottom: 0;
  }

  .pair-grid {
    grid-template-columns: 1fr;
  }

  .session-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .news-table {
    min-width: 0;
  }

  .news-table thead {
    display: none;
  }

  .news-table,
  .news-table tbody,
  .news-table tr,
  .news-table td {
    display: block;
  }

  .news-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(239, 248, 242, 0.12);
    border-radius: 0.75rem;
    background: rgba(239, 248, 242, 0.045);
    overflow: hidden;
  }

  .news-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.4fr) 1fr;
    gap: 0.8rem;
    padding: 0.72rem 0.85rem;
    white-space: normal;
  }

  .news-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .news-table .numeric {
    text-align: left;
  }
}

.analysis-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.analysis-hero,
.analysis-grid,
.analysis-explanation {
  position: relative;
  z-index: 1;
}

.analysis-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
}

.analysis-hero h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.analysis-hero p {
  max-width: 58rem;
  color: var(--muted);
}

.analysis-status {
  min-width: 12rem;
  display: grid;
  align-content: center;
  gap: 0.35rem;
  padding: 0.9rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.055);
}

.analysis-status span,
.analysis-status small,
.analysis-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.analysis-status strong {
  font-size: 1.4rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.analysis-card {
  min-height: 8rem;
  display: grid;
  align-content: space-between;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.75rem;
  background: rgba(239, 248, 242, 0.055);
}

.analysis-card.primary {
  grid-column: span 2;
  border-color: rgba(185, 242, 104, 0.34);
  background: rgba(185, 242, 104, 0.08);
}

.analysis-card strong {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1;
}

.analysis-card small {
  color: var(--muted);
}

.analysis-explanation {
  margin-top: 1rem;
  padding: 1.2rem;
  border: 1px solid rgba(239, 248, 242, 0.12);
  border-radius: 0.85rem;
  background: rgba(5, 13, 11, 0.72);
}

.analysis-explanation h2 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.analysis-explanation p {
  color: var(--muted);
  line-height: 1.7;
}

.analysis-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.analysis-actions .secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 900px) {
  .analysis-hero {
    display: grid;
  }

  .analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-card.primary {
    grid-column: span 2;
  }
}
