:root {
  --bg: #000000;
  --panel: #040808;
  --panel2: #07100e;
  --line: rgba(120, 255, 140, 0.20);
  --line2: rgba(64, 210, 255, 0.22);
  --green: #67f05c;
  --green2: #39cf56;
  --cyan: #37c8ff;
  --yellow: #ffc247;
  --red: #ff4d4f;
  --text: #eef7f2;
  --muted: #93a2a7;
  --card-shadow: 0 18px 40px rgba(0, 0, 0, .50), 0 0 14px rgba(90, 255, 105, .06);
}
* { box-sizing: border-box; }
html {
  min-height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #000000;
}
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
/* Mockup browser frame removed in v2. The real site starts directly at .app. */
.browser-topbar, .address-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: rgba(15, 26, 34, 0.88);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.window-dots { display: flex; gap: 8px; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; display: block; }
.window-dots span:nth-child(1){background:#ff5f57}.window-dots span:nth-child(2){background:#febc2e}.window-dots span:nth-child(3){background:#28c840}
.browser-tab { background: rgba(8,13,17,.82); padding: 9px 18px; border-radius: 12px 12px 4px 4px; min-width: 250px; font-weight: 700; letter-spacing: .3px; }
.browser-tab span { float: right; color: var(--muted); }
.new-tab { font-size: 24px; color: var(--muted); }
.address-bar { padding: 7px 20px 9px; color: #b6c4c8; }
.url { flex: 1; background: rgba(1, 8, 12, .8); padding: 10px 16px; border-radius: 18px; color: #dfe8e9; }
.app {
  width: min(100%, 1448px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 96px 34px 44px;
  border-left: 1px solid rgba(127, 225, 255, 0.12);
  border-right: 1px solid rgba(127, 225, 255, 0.12);
  background: #000000;
  box-shadow: none;
}
.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
h1 { margin: 0; font-size: 31px; letter-spacing: .8px; }
.subtitle { display: none; color: var(--muted); margin: 0; font-size: 13px; }
.tabs { display: flex; gap: 28px; }
.tab {
  border: 0; background: transparent; color: #dce5e2; font-size: 16px; padding: 8px 4px 12px; cursor: pointer; position: relative;
}
.tab.active { color: var(--green); font-weight: 800; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--green); box-shadow: 0 0 14px var(--green); }
.status-box { justify-self: end; text-align: right; min-width: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(99, 255, 90, .45); color: var(--green); border-radius: 999px; padding: 7px 18px; font-weight: 800; background: rgba(15, 90, 28, .26); white-space: nowrap; }
.app-header .status-pill { display: none; }
.header-range-filter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  padding: 5px;
  border: 1px solid rgba(120, 255, 140, .24);
  border-radius: 999px;
  background: rgba(2, 12, 14, .78);
  box-shadow: inset 0 0 18px rgba(103, 240, 92, .035), 0 0 12px rgba(55, 200, 255, .055);
}
.range-filter-button {
  min-width: 42px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 5px 10px;
  color: #dce8e5;
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.range-filter-button.active {
  color: var(--green);
  border-color: rgba(103, 240, 92, .68);
  background: rgba(103, 240, 92, .13);
  box-shadow: 0 0 12px rgba(103, 240, 92, .16);
}
.range-filter-button:hover,
.range-filter-button:focus-visible {
  color: #fff;
  border-color: rgba(55, 200, 255, .42);
  outline: 0;
}
.pulse { width: 12px; height: 12px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 0 rgba(103,240,92,.28); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(103,240,92,0); } 100% { box-shadow: 0 0 0 0 rgba(103,240,92,0); }}
.updated { margin-top: 10px; color: #a5b2b7; font-size: 13px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 18px; }
.kpi-card, .panel, .latest-card, .filter-bar, .risk-banner {
  border: 1px solid rgba(150, 232, 255, .15);
  background: linear-gradient(180deg, var(--panel) 0%, rgba(5, 18, 24, .78) 100%);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.kpi-card { min-height: 118px; padding: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.kpi-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(96,255,88,.5); background: radial-gradient(circle, rgba(88,255,100,.25), rgba(21,70,35,.52)); border-radius: 50%; font-size: 25px; }
.kpi-content { min-width: 0; }
.kpi-label { color: #c8d2d1; font-size: 15px; }
.kpi-value { font-size: 34px; font-weight: 900; margin: 3px 0 5px; }
.kpi-sub { color: #a4b0b0; font-size: 13px; }
.spark { display: none; }
.latest-card { padding: 22px; margin-bottom: 14px; position: relative; overflow: hidden; }
.latest-card::before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(103,240,92,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(103,240,92,.05) 1px, transparent 1px); background-size: 28px 28px; opacity:.46; pointer-events:none; }
.glow-card { border-color: rgba(103,240,92,.78); box-shadow: 0 14px 32px rgba(0,0,0,.34), 0 0 16px rgba(103,240,92,.10); }
.latest-inner { position: relative; z-index: 1; }
.panel-title, .page-title { color: var(--green); font-size: 24px; font-weight: 900; margin-bottom: 14px; }
.latest-grid { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr) 120px; gap: 18px; align-items: center; }
.signal-symbol { display: flex; align-items: center; gap: 14px; }
.coin-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid rgba(150,232,255,.25); font-size: 22px; flex: 0 0 auto; }
.big-symbol { font-size: 28px; font-weight: 950; }
.field-label { color: #b2bec2; font-size: 13px; margin-bottom: 7px; }
.field-value { font-size: 21px; font-weight: 850; }
.badge { display: inline-flex; align-items:center; justify-content:center; padding: 5px 12px; border-radius: 9px; font-size: 13px; font-weight: 900; border: 1px solid currentColor; background: rgba(255,255,255,.04); white-space: nowrap; }
.badge.long, .pos { color: var(--green); }
.badge.short, .neg { color: var(--red); }
.badge.wait { color: var(--yellow); }
.badge.info { color: var(--cyan); }
.badge.green { color: var(--green); }
.latest-extra { margin-top: 16px; padding-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px dashed rgba(255,255,255,.18); }
.target-mark { justify-self: end; width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--green); display:grid; place-items:center; color:var(--green); font-size:46px; box-shadow: 0 0 14px rgba(103,240,92,.18); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.lower { align-items: stretch; }
.panel { padding: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: #aebabe; font-weight: 700; text-align: left; padding: 10px 12px; background: rgba(255,255,255,.025); }
td { padding: 12px; border-top: 1px solid rgba(180,230,255,.08); color: #e5eeec; }
tr.selected { outline: 1px solid rgba(103,240,92,.74); outline-offset: -1px; background: rgba(67,240,92,.06); }
.num-green { color: var(--green); font-weight: 850; }
.num-red { color: var(--red); font-weight: 850; }
.num-cyan { color: var(--cyan); font-weight: 850; }
.live-list { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; overflow: hidden; }
.live-row { display: grid; grid-template-columns: 110px 1fr 150px; gap: 10px; padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.live-row:first-child { border-top: 0; }
.state-dot { width: 10px; height: 10px; display:inline-block; border-radius:50%; margin-right: 9px; background: var(--cyan); box-shadow: 0 0 7px currentColor; }
.state-dot.green { background: var(--green); color: var(--green); }
.system-mini { margin-top: 10px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; display: grid; gap: 8px; }
.result-row { display:grid; grid-template-columns: 1fr 80px 120px 80px; gap: 10px; padding: 10px 12px; border-bottom: 1px dashed rgba(255,255,255,.10); align-items:center; }
.result-row:last-child { border-bottom: 0; }
.timeline { display: grid; gap: 0; }
.timeline-row { display: grid; grid-template-columns: minmax(128px, auto) 24px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-time { color: var(--cyan); }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px currentColor; }
.timeline-dot.green { background: var(--green); color: var(--green); }
.timeline-dot.red { background: var(--red); color: var(--red); }
.timeline-dot.yellow { background: var(--yellow); color: var(--yellow); }
.risk-banner { display: flex; gap: 22px; align-items: center; padding: 18px 24px; border-color: rgba(255,194,71,.7); background: linear-gradient(90deg, rgba(92,67,0,.55), rgba(29,24,7,.72)); box-shadow: 0 12px 28px rgba(0,0,0,.28), 0 0 12px rgba(255,194,71,.10); }
.risk-icon { font-size: 48px; }
.risk-banner h3 { color: var(--yellow); margin: 0 0 7px; font-size: 24px; }
.risk-banner p { margin: 0; color: #f0ece0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.mini-kpi-row { display: grid; grid-template-columns: repeat(4, 130px); gap: 12px; }
.mini-kpi { border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 12px; background: rgba(255,255,255,.03); }
.mini-kpi strong { display:block; font-size: 26px; margin-top: 4px; }
.filter-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 14px; flex-wrap: wrap; }
.filter, .log-pill, .refresh-btn, .pagination button { background: rgba(255,255,255,.04); color: #dce8e5; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-weight: 750; }
.filter.active, .log-pill.active, .pagination button.active { color: var(--green); border-color: rgba(103,240,92,.65); background: rgba(103,240,92,.11); box-shadow: 0 0 10px rgba(103,240,92,.10); }
select, input { background: rgba(2,12,16,.95); border: 1px solid rgba(176,230,255,.20); color: var(--text); border-radius: 8px; padding: 10px 12px; min-width: 130px; }
label { color: #b5c1c4; display: flex; align-items: center; gap: 8px; }
.refresh-btn { color: var(--green); margin-left: auto; }
.signals-layout { display: grid; grid-template-columns: 1fr 370px; gap: 16px; }
.signal-table-wrap { max-height: 514px; }
.signal-table td, .signal-table th { padding: 11px 10px; font-size: 13px; }
.table-panel { min-width: 0; }
.pagination { display:flex; justify-content: space-between; align-items:center; color: var(--muted); padding-top: 13px; }
.detail-panel { border-color: rgba(103,240,92,.52); box-shadow: 0 0 12px rgba(103,240,92,.10); }
.detail-row { display:grid; grid-template-columns: 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.note-box { margin-top: 14px; padding: 13px; border: 1px solid rgba(103,240,92,.20); border-radius: 10px; color: #cddbd8; }
.chart-layout { display:grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-bottom: 16px; }
.three-col { display:grid; grid-template-columns: .95fr 1.15fr 1fr; gap: 16px; }
.legend { color: #a8b6b8; display:flex; align-items:center; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.dot { width:10px;height:10px;border-radius:50%;display:inline-block }.dot.green{background:var(--green)}
.dash { width: 32px; border-top: 2px dashed #9aa7a7; display:inline-block; }
.line-chart { height: 330px; position: relative; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.axis-label { fill: #9fb0b4; font-size: 12px; }
.chart-grid { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.performance-line { fill: none; stroke: var(--green); stroke-width: 3; filter: none; }
.performance-area { fill: rgba(103,240,92,.14); }
.performance-point { fill: #07100e; stroke: var(--green); stroke-width: 3; }
.bar-chart { height: 330px; display:flex; align-items:flex-end; justify-content: space-around; gap: 18px; padding: 34px 12px 34px; position: relative; }
.bar-item { width: 86px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align:center; position: relative; z-index:1; }
.bar { width: 40px; margin: 0 auto 10px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #87ff76, #32c64e); box-shadow: 0 0 10px rgba(103,240,92,.12); }
.bar-negative { background: linear-gradient(180deg, #ff7779, #d82f36); box-shadow: 0 0 10px rgba(255,77,79,.14); }
.bar-value { color:#e7f6ea; font-weight:800; margin-bottom:7px; }
.bar-label { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color:#cbd5d4; font-size:13px; line-height: 1.18; text-align: center; white-space: normal; }
.bar-label span { display: block; width: 100%; text-align: center; }
.bar-separator { color: var(--muted); font-weight: 800; line-height: 1; }
.distribution { display:grid; grid-template-columns: 160px 1fr; gap: 20px; align-items:center; }
.donut { width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--green) 0 37%, var(--cyan) 37% 68%, var(--red) 68% 89%, var(--yellow) 89% 100%); display:grid; place-items:center; position:relative; }
.donut::after { content:""; position:absolute; width: 88px; height:88px; border-radius:50%; background:#061115; }
.donut-inner { position:relative; z-index:1; text-align:center; }
.donut-inner strong { font-size: 30px; }
.legend-list { display:grid; gap: 10px; color:#cbd7d6; }
.insight-row { display:grid; grid-template-columns: 52px 1fr auto; align-items:center; gap: 12px; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; margin-bottom: 10px; }
.logs-layout { display:grid; grid-template-columns: 1fr 320px; gap: 16px; }
.log-filter input { margin-left: auto; min-width: 290px; }
.log-table-head { display:grid; grid-template-columns: 150px 150px 1fr; gap: 20px; padding: 0 12px 13px; color:#c8d2d5; border-bottom: 1px solid rgba(255,255,255,.12); }
.log-table .timeline-row { grid-template-columns: 150px 150px 1fr; padding: 10px 12px; }
.log-type { font-weight: 850; }
.trade-journal-panel { min-width: 0; margin-bottom: 0; }
.journal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  min-width: 0;
}
.journal-card-head .panel-title {
  flex: 0 0 auto;
  margin-bottom: 0;
}
.journal-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 520px;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.journal-filter .log-pill {
  flex: 0 0 auto;
  padding: 8px 14px;
}
.journal-stats-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}
.journal-stat-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}
.journal-stat-card span {
  display: block;
  color: #aebbbe;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}
.journal-stat-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.journal-stat-card,
.system-status-card {
  position: relative;
  z-index: 1;
  transform-origin: center;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.trade-journal-wrap { max-width: 100%; overflow-x: auto; }
.trade-journal-table { min-width: 1180px; }
.trade-journal-table th,
.trade-journal-table td {
  white-space: nowrap;
}
.trade-journal-table td:last-child {
  white-space: normal;
}
.journal-time {
  color: var(--cyan);
  font-weight: 800;
}
.muted-text {
  color: var(--muted);
}
.side-stack { display:grid; gap: 14px; align-content:start; }
.system-row { display:grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.event-card { display:grid; grid-template-columns: 44px 1fr auto; align-items:center; gap: 10px; padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; margin-bottom: 9px; }
.info-note { color:#b7c4c6; line-height:1.55; }
@media (max-width: 1100px) {
  .browser-shell { aspect-ratio: auto; }
  .app-header, .two-col, .chart-layout, .three-col, .signals-layout, .logs-layout { grid-template-columns: 1fr; }
  .journal-card-head { align-items: flex-start; flex-direction: column; }
  .journal-filter { justify-content: flex-start; }
  .journal-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .latest-grid { grid-template-columns: 1fr 1fr; }
  .target-mark { display:none; }
  .mini-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .status-box { justify-self:start; text-align:left; }
  .header-range-filter { justify-content: flex-start; }
  .tabs { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .app { padding: 18px; }
  .kpi-grid, .mini-kpi-row { grid-template-columns: 1fr; }
  .journal-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browser-topbar, .address-bar { display:none; }
  .latest-extra, .latest-grid { grid-template-columns: 1fr; }
  .live-row, .result-row, .log-table .timeline-row, .log-table-head { grid-template-columns: 1fr; }
}

/* ===== v3 overflow fix =====
   Fix: KPI sparkline/card overflow, performance chart label escaping panel,
   and wide grid columns forcing horizontal clipping on real browser windows. */
.app,
.app-header,
.kpi-grid,
.two-col,
.chart-layout,
.three-col,
.signals-layout,
.logs-layout,
.panel,
.kpi-card,
.latest-card,
.risk-banner {
  min-width: 0;
}

.app {
  width: 100%;
  max-width: 1448px;
  overflow-x: clip;
}

.app-header {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

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

.kpi-card {
  grid-template-columns: 54px minmax(0, 1fr);
  overflow: hidden;
}

.kpi-label,
.kpi-sub,
.kpi-value {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.kpi-card .spark {
  display: none;
}

.chart-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
}

.three-col {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr) minmax(0, 1fr);
}

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

.signals-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
}

.logs-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
}

.panel {
  overflow: hidden;
}

.chart-big,
.line-chart,
.bar-chart {
  overflow: hidden;
}

.line-chart svg,
.spark {
  display: block;
  overflow: hidden !important;
}

.kpi-card .spark {
  display: none;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.signal-table {
  min-width: 980px;
}

@media (max-width: 1250px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-layout, .three-col, .two-col, .signals-layout, .logs-layout { grid-template-columns: 1fr; }
  .app-header { grid-template-columns: 1fr; }
  .status-box { justify-self: start; text-align: left; }
  .header-range-filter { justify-content: flex-start; }
  .app { padding-top: 158px; }
}

@media (max-width: 720px) {
  .kpi-card { grid-template-columns: 48px minmax(0, 1fr); }
}

/* ===== v4 live control-room polish ===== */
:root {
  --panel-hover: #07100e;
  --deep-shadow: 0 22px 55px rgba(0, 0, 0, .65), 0 0 22px rgba(90, 255, 105, .12);
  --card-shadow: 0 18px 40px rgba(0, 0, 0, .50), 0 0 14px rgba(90, 255, 105, .06);
}

h1,
.browser-tab {
  letter-spacing: 0;
}

body {
  position: relative;
  background: #000000;
}

body::before,
body::after {
  content: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background: none;
  background-size: auto;
  mask-image: none;
  opacity: 0;
}

body::after {
  z-index: 0;
  background: none;
  mix-blend-mode: normal;
  opacity: 0;
}

.app {
  position: relative;
  z-index: 1;
  background: #000000;
  box-shadow: none;
  isolation: isolate;
}

.app::before {
  content: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: none;
  opacity: 0;
}

.app::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 2px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(103, 240, 92, 0.95), rgba(55, 200, 255, 0.9), transparent);
  box-shadow: 0 0 14px rgba(103, 240, 92, 0.24);
  opacity: 0;
}

.app > * {
  position: relative;
  z-index: 1;
}

.app-header {
  position: fixed;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1416px;
  z-index: 1000;
  align-items: center;
  margin: 0;
  padding: 8px 14px;
  background: rgba(5, 10, 10, 0.78);
  border: 1px solid rgba(120, 255, 140, 0.20);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .46), 0 0 12px rgba(64, 210, 255, .06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(141, 255, 154, .18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 0%, rgba(141, 255, 154, .22), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(52, 240, 106, .055));
  box-shadow: inset 0 0 18px rgba(141, 255, 154, .045), 0 0 20px rgba(52, 240, 106, .055);
}

.brand-lockup h1 {
  font-size: clamp(24px, 2.2vw, 33px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: .2px;
  background: linear-gradient(135deg, #ffffff, #8dff9a, #34f06a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(103, 240, 92, .28));
}

.kpi-card,
.panel,
.latest-card,
.filter-bar,
.risk-banner,
.mini-kpi,
.live-list,
.system-mini,
.note-box,
.insight-row,
.event-card {
  background: linear-gradient(145deg, #040808, #07100E);
  border-color: rgba(120, 255, 140, 0.20);
  box-shadow: var(--card-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.kpi-card,
.mini-kpi,
.insight-row,
.event-card {
  background: linear-gradient(145deg, #050A0A, #080F0E);
}

.latest-card {
  background: linear-gradient(145deg, #020606, #07150F);
  border-color: rgba(93, 255, 108, 0.45);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .65), 0 0 22px rgba(90, 255, 105, .12);
}

.latest-card::before {
  opacity: .18;
}

.kpi-card,
.panel,
.latest-card,
.risk-banner,
.filter-bar,
.mini-kpi,
.insight-row,
.event-card {
  position: relative;
  z-index: 1;
  transform-origin: center;
}

.glow-card,
.detail-panel {
  border-color: rgba(93, 255, 108, 0.45);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .65), 0 0 22px rgba(90, 255, 105, .12);
}

@media (hover: hover) {
  .kpi-card:hover,
  .panel:hover,
  .latest-card:hover,
  .risk-banner:hover,
  .filter-bar:hover,
  .mini-kpi:hover,
  .insight-row:hover,
  .event-card:hover {
    z-index: 12;
    transform: translateY(-3px);
    border-color: rgba(98, 255, 111, 0.42);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .56), 0 0 14px rgba(90, 255, 110, 0.08);
  }

  .latest-card:hover,
  .glow-card:hover,
  .detail-panel:hover {
    border-color: rgba(93, 255, 108, 0.55);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .65), 0 0 20px rgba(90, 255, 105, .11);
  }

  .risk-banner:hover {
    border-color: rgba(255, 216, 118, 0.82);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 16px rgba(255, 194, 71, 0.12);
  }

  .filter:hover,
  .log-pill:hover,
  .range-filter-button:hover,
  .refresh-btn:hover,
  .pagination button:hover,
  select:hover,
  input:hover {
    border-color: rgba(55, 200, 255, 0.42);
    box-shadow: 0 0 10px rgba(55, 200, 255, 0.10);
  }
}

@media (hover: hover) and (pointer: fine) {
  .system-status-card:hover,
  .journal-stat-card:hover {
    z-index: 12;
    transform: translateY(-4px);
    background: linear-gradient(145deg, #07100E, #0B1714);
    border-color: rgba(98, 255, 111, 0.42);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .56), 0 0 14px rgba(90, 255, 110, 0.08);
  }
}

.status-pill {
  position: relative;
  overflow: visible;
  gap: 8px;
  padding: 6px 12px;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(103, 240, 92, 0.11);
}

.status-separator {
  color: rgba(216, 240, 232, .68);
}

#updatedAt {
  color: #c8d2d1;
  font-weight: 760;
}

.status-pill::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(103, 240, 92, 0.28);
  opacity: 0.42;
  animation: softHalo 3.2s ease-in-out infinite;
}

.pulse {
  animation: livePulse 2.4s ease-out infinite;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(103, 240, 92, 0.28);
  animation: liveRipple 2.4s ease-out infinite;
}

.pulse,
.state-dot {
  position: relative;
}

.updated {
  min-height: 22px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 7px;
  padding: 2px 7px;
  border: 1px solid rgba(103, 240, 92, 0.44);
  border-radius: 999px;
  color: var(--green);
  background: rgba(103, 240, 92, 0.08);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(103, 240, 92, 0.12);
}

.tabs {
  align-items: center;
}

.tab {
  border-radius: 10px;
  transition: color 160ms ease;
}

.tab:hover,
.tab:focus-visible {
  color: #fff;
  background: rgba(55, 200, 255, 0.065);
  outline: 0;
}

.tab.active {
  text-shadow: 0 0 18px rgba(103, 240, 92, 0.3);
}

.tab.active::after {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(103, 240, 92, 0.25), var(--green), rgba(55, 200, 255, 0.65));
  box-shadow: 0 0 12px rgba(103, 240, 92, 0.34);
}

.tab-panel.active {
  animation: panelIn 260ms ease both;
}

.tab-panel.tab-transitioning {
  animation: panelIn 260ms ease both;
}

tbody tr,
.live-row,
.result-row,
.timeline-row,
.system-row {
  transition: background 160ms ease;
}

tbody tr {
  background: #040909;
}

tbody tr:hover,
.live-row:hover,
.result-row:hover,
.timeline-row:hover,
.system-row:hover {
  background: rgba(55, 200, 255, 0.055);
}

tr.selected {
  background: linear-gradient(90deg, rgba(103, 240, 92, 0.095), rgba(55, 200, 255, 0.035));
  box-shadow: none;
}

.badge.green,
.badge.info,
.badge.long {
  box-shadow: inset 0 0 16px rgba(103, 240, 92, 0.04);
}

.empty-state {
  color: #9eb0b4;
  text-align: center;
  padding: 18px;
}

.skeleton,
.shimmer,
.loading-glow {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.skeleton {
  min-height: 18px;
  color: transparent !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(55, 200, 255, 0.075), rgba(255, 255, 255, 0.045)) !important;
}

.shimmer::after,
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: shimmerSweep 1.4s ease-in-out infinite;
}

.loading-glow {
  box-shadow: 0 0 22px rgba(55, 200, 255, 0.16), inset 0 0 18px rgba(103, 240, 92, 0.045);
  animation: loadingGlow 1.8s ease-in-out infinite;
}

.value-flash {
  animation: valueFlash 950ms ease-out;
}

.value-updated {
  animation: updatedGlow 1.05s ease-out;
}

.row-enter {
  animation: rowEnter 780ms ease-out;
}

.soft-pulse {
  animation: softPulse 1.15s ease-out;
}

body.data-refreshing .app::after,
body.refreshed .app::after {
  animation: refreshSweep 1.05s ease-out both;
}

body.live-updated .status-pill {
  animation: statusLiveGlow 1.05s ease-out;
}

body.data-refreshing .live-badge {
  animation: softPulse 1s ease-out infinite;
}

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

@keyframes softHalo {
  0%, 100% {
    opacity: 0.36;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.012);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(103, 240, 92, 0.28), 0 0 6px rgba(103, 240, 92, 0.14);
  }
  72% {
    box-shadow: 0 0 0 6px rgba(103, 240, 92, 0), 0 0 10px rgba(103, 240, 92, 0.14);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(103, 240, 92, 0), 0 0 6px rgba(103, 240, 92, 0.10);
  }
}

@keyframes liveRipple {
  0% {
    opacity: 0.28;
    transform: scale(0.82);
  }
  78%, 100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes shimmerSweep {
  100% {
    transform: translateX(100%);
  }
}

@keyframes loadingGlow {
  0%, 100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes valueFlash {
  0% {
    color: #fff;
    text-shadow: 0 0 0 rgba(103, 240, 92, 0);
    transform: translateY(0);
  }
  35% {
    color: #fff;
    text-shadow: 0 0 12px rgba(103, 240, 92, 0.46);
    transform: translateY(-1px);
  }
  100% {
    text-shadow: none;
    transform: translateY(0);
  }
}

@keyframes updatedGlow {
  0% {
    box-shadow: 0 0 0 rgba(103, 240, 92, 0);
    border-color: rgba(150, 232, 255, 0.18);
  }
  36% {
    box-shadow: 0 0 16px rgba(103, 240, 92, 0.16);
    border-color: rgba(103, 240, 92, 0.58);
  }
  100% {
    box-shadow: var(--card-shadow);
  }
}

@keyframes rowEnter {
  from {
    opacity: 0.35;
    transform: translateY(6px);
    background: rgba(103, 240, 92, 0.08);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    background: transparent;
  }
}

@keyframes softPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.015);
    opacity: 0.92;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes refreshSweep {
  0% {
    opacity: 0;
    transform: translateX(-18px);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(18px);
  }
}

@keyframes statusLiveGlow {
  0% {
    box-shadow: 0 0 10px rgba(103, 240, 92, 0.10);
  }
  40% {
    box-shadow: 0 0 16px rgba(103, 240, 92, 0.18);
  }
  100% {
    box-shadow: 0 0 10px rgba(103, 240, 92, 0.10);
  }
}

@media (hover: hover) {
  .app .kpi-card:hover,
  .app .panel:hover,
  .app .latest-card:hover,
  .app .risk-banner:hover,
  .app .filter-bar:hover,
  .app .mini-kpi:hover,
  .app .insight-row:hover,
  .app .event-card:hover {
    transform: translateY(-4px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .kpi-card:hover,
  .panel:hover,
  .latest-card:hover,
  .risk-banner:hover,
  .filter-bar:hover,
  .mini-kpi:hover,
  .insight-row:hover,
  .event-card:hover,
  .system-status-card:hover,
  .journal-stat-card:hover {
    transform: none !important;
  }
}

/* ===== Home tab layout ===== */
.home-active-grid {
  grid-template-columns: minmax(0, 1fr);
}

.home-live-panel,
.home-risk-hidden,
.logs-system-summary-hidden {
  display: none;
}

.system-tab {
  display: none;
}

.system-tab.active {
  display: block;
}

.system-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.system-status-card {
  min-width: 0;
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(120, 255, 140, 0.20);
  border-radius: 12px;
  background: linear-gradient(145deg, #050A0A, #080F0E);
  box-shadow: var(--card-shadow);
}

.system-card-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96, 255, 88, .5);
  background: radial-gradient(circle, rgba(88, 255, 100, .25), rgba(21, 70, 35, .52));
  border-radius: 50%;
  font-size: 22px;
}

.system-card-content {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.system-card-label {
  color: #c8d2d1;
  font-size: 14px;
}

.system-card-value {
  min-width: 0;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.system-card-note {
  color: #a4b0b0;
  font-size: 12px;
}

.system-scan-panel,
.system-log-panel,
.system-two-col {
  margin-bottom: 14px;
}

.system-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.system-scan-table {
  min-width: 760px;
}

.system-list {
  display: grid;
  gap: 0;
}

.system-info-list {
  display: grid;
  gap: 0;
  min-width: 0;
}

.watchlist-block {
  min-width: 0;
  padding: 2px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.watchlist-label {
  color: #c8d2d1;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 9px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.watchlist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.watchlist-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(55, 200, 255, .28);
  border-radius: 999px;
  background: rgba(55, 200, 255, .07);
  color: #dff7ff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.watchlist-empty {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.system-info-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.system-info-row:last-child {
  border-bottom: 0;
}

.system-info-row span {
  color: #c8d2d1;
  min-width: 0;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.system-info-row strong {
  min-width: 0;
  text-align: right;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.system-list-row,
.system-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.system-list-row:last-child,
.system-log-row:last-child {
  border-bottom: 0;
}

.system-list-row span,
.system-log-row span:last-child {
  color: #c8d2d1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-list-row strong {
  text-align: right;
  white-space: nowrap;
}

.system-error-box {
  min-height: 154px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #c8d2d1;
}

.system-error-box strong,
.system-error-box span {
  display: block;
}

.system-log-list {
  display: grid;
  gap: 0;
}

.system-log-row {
  grid-template-columns: 120px minmax(0, 1fr);
}

.home-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .95fr) minmax(260px, .85fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
  min-width: 0;
}

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

.home-analytics-grid .panel {
  min-width: 0;
}

.home-analytics-grid .panel-title {
  font-size: 20px;
  line-height: 1.2;
}

.home-chart-legend {
  flex-wrap: wrap;
}

.home-line-chart {
  height: 220px;
}

.performance-overview-chart {
  height: 220px;
}

.home-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.home-mini-stat {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.home-mini-stat {
  padding: 10px;
  min-width: 0;
}

.home-mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.home-mini-stat strong {
  display: block;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.home-distribution {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.home-donut {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 16px rgba(255, 255, 255, .035), 0 0 14px rgba(55, 200, 255, .06);
}

.home-donut::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #050a0a;
  border: 1px solid rgba(255, 255, 255, .08);
}

.home-donut-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.home-donut-inner strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.home-donut-inner span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-distribution-legend {
  width: 100%;
  display: grid;
  gap: 0;
  min-width: 0;
}

.home-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #cbd7d6;
  font-size: 13px;
  line-height: 1.25;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.home-legend-item:last-child {
  border-bottom: 0;
}

.home-legend-item strong {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.distribution-total-line {
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #c8d2d1;
  font-size: 13px;
  text-align: center;
}

.distribution-total-line strong {
  color: var(--green);
  font-weight: 900;
}

.home-signal-stats {
  display: grid;
  gap: 0;
}

.home-stat-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.home-stat-row:last-child {
  border-bottom: 0;
}

.home-stat-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(255, 255, 255, .03);
  font-size: 12px;
  font-weight: 900;
}

.home-stat-label {
  color: #c8d2d1;
  min-width: 0;
}

.home-stat-row strong {
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1250px) {
  .system-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-analytics-grid,
  .home-bottom-grid,
  .system-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app {
    padding-top: 184px;
  }

  .app-header {
    width: calc(100% - 18px);
    gap: 10px;
    padding: 8px 12px;
  }

  .tabs {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 18px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .tab {
    font-size: 15px;
    padding: 6px 3px 9px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .brand-lockup {
    padding: 6px 10px;
  }

  .status-pill {
    max-width: 100%;
    justify-content: flex-start;
    padding: 5px 10px;
    white-space: nowrap;
  }

  .status-box {
    width: 100%;
  }

  .header-range-filter {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
    border-radius: 12px;
  }

  .range-filter-button {
    min-width: 0;
    width: 100%;
    padding: 6px 4px;
    font-size: 11px;
  }

  .system-overview-grid {
    grid-template-columns: 1fr;
  }

  .home-metric-strip {
    grid-template-columns: 1fr;
  }

  .home-legend-item strong {
    white-space: nowrap;
  }
}
