/* Dashboard layout and component refinements. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: center;
  padding: 13px clamp(18px, 3vw, 42px);
  background: rgba(8, 17, 28, 0.92);
  border-bottom: 1px solid rgba(138, 164, 184, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px);
}

.brand { min-width: 245px; gap: 12px; }
.brand .logo {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(192, 255, 239, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, #61d5b9, #368db5);
  box-shadow: 0 8px 22px rgba(55, 180, 154, 0.20);
  color: #071713;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: -0.04em;
}
.brand h1 {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.brand .sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.015em;
}

.pulse {
  display: flex;
  flex: 1 1 620px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  align-items: center;
}

.chip {
  min-width: 76px;
  padding: 6px 10px;
  background: rgba(18, 31, 47, 0.82);
  border: 1px solid rgba(137, 164, 184, 0.17);
  border-radius: 11px;
  transition: border-color 160ms ease, background 160ms ease;
}
.chip:hover { border-color: rgba(120, 221, 195, 0.32); background: rgba(23, 38, 56, 0.95); }
.chip .k { color: #8498a9; font-size: 9px; letter-spacing: 0.13em; }
.chip .v { color: #e8f2f6; font-size: 11.5px; font-weight: 500; }
.sub-chip .v { color: var(--accent); font-size: 11px; }

.refresh {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(120deg, var(--accent), #9de7d3);
  box-shadow: 0 7px 18px rgba(57, 189, 158, 0.14);
  color: #071713;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}
.refresh:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(57, 189, 158, 0.22); }
.refresh:active { transform: translateY(0); }
.refresh:disabled { opacity: 0.55; cursor: wait; transform: none; }
.refresh.ghosty {
  color: var(--text);
  background: rgba(20, 34, 50, 0.88);
  border-color: rgba(137, 164, 184, 0.23);
  box-shadow: none;
}
.refresh.ghosty:hover { border-color: rgba(120, 221, 195, 0.35); }

.tabs {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  max-width: 1540px;
  margin: 0 auto;
  padding: 15px clamp(18px, 3vw, 42px) 0;
  border-bottom: 1px solid rgba(138, 164, 184, 0.14);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  flex: 0 0 auto;
  padding: 10px 15px 12px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 11px 11px 0 0;
  color: #93a6b5;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.tab:hover { color: var(--text); background: rgba(23, 38, 56, 0.55); }
.tab.active {
  color: var(--accent);
  background: rgba(120, 221, 195, 0.075);
  border-color: rgba(120, 221, 195, 0.11);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

main {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 42px) 48px;
}
.card {
  position: relative;
  padding: 20px 22px;
  margin-bottom: 18px;
  border: 1px solid rgba(137, 164, 184, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 31, 47, 0.98), rgba(15, 27, 42, 0.98));
  box-shadow: var(--shadow-card);
}
.card h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 15px;
  color: #eff6f8;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.35;
}
.hint {
  color: #879bab;
  font-size: 10.5px;
  font-weight: 450;
  letter-spacing: 0;
}
#instruction-time { margin-left: auto; }
#instruction-card {
  border-color: rgba(120, 221, 195, 0.19);
  background:
    radial-gradient(680px 220px at 85% 0, rgba(69, 161, 159, 0.105), transparent 70%),
    linear-gradient(145deg, rgba(18, 31, 47, 0.99), rgba(15, 27, 42, 0.99));
}

.grid-top { grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr); gap: 18px; }
.grid-detail { grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.78fr); gap: 18px; }

.instructions { gap: 10px; }
.ins {
  padding: 13px 15px;
  border-color: rgba(137, 164, 184, 0.14);
  border-radius: 13px;
  background: rgba(23, 38, 56, 0.76);
}
.ins-buy { border-left-color: var(--green); }
.ins-sell { border-left-color: var(--red); }
.ins-wait { border-left-color: #77899b; }
.ins-head { gap: 9px; margin-bottom: 7px; }
.ins-head strong { font-family: var(--font-display); font-size: 13.5px; }
.ins-conf { color: #93a7b6; font-size: 10.5px; }
.ins-link {
  padding: 5px 9px;
  border: 1px solid rgba(120, 221, 195, 0.22);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(120, 221, 195, 0.05);
  font: 600 10.5px var(--font-body);
}
.ins-link:hover { background: rgba(120, 221, 195, 0.12); }
.ins-line { font-family: var(--font-data); font-size: 11.5px; line-height: 1.65; }
.ins-pred { color: #acbdc9; font-size: 11px; }
.exit-chip, .fchip {
  border-color: rgba(137, 164, 184, 0.16);
  border-radius: 8px;
  color: #b8c8d1;
  background: rgba(8, 17, 28, 0.55);
}

.str-row { grid-template-columns: 46px minmax(80px, 1fr) 55px; gap: 9px; }
.str-row .cur { color: #dbe7ec; font-family: var(--font-display); font-size: 11.5px; }
.str-bar { height: 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.055); }
.str-bar i { border-radius: 999px; }
.str-row .sc { font-family: var(--font-data); font-size: 10.5px; }

.insights { gap: 8px; }
.insights li {
  padding: 10px 12px;
  border: 1px solid rgba(137, 164, 184, 0.10);
  border-left: 3px solid var(--accent2);
  border-radius: 11px;
  color: #c3d0d9;
  background: rgba(23, 38, 56, 0.62);
  font-size: 11.5px;
  line-height: 1.55;
}
.insights li.good { border-left-color: var(--green); }
.insights li.warn { border-left-color: var(--amber); }

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(137, 164, 184, 0.13);
  border-radius: 13px;
  background: rgba(7, 14, 23, 0.28);
  scrollbar-color: #3a5064 transparent;
  scrollbar-width: thin;
}
.table-wrap table { min-width: 1160px; }
table { font-size: 11px; }
th {
  position: sticky;
  top: 0;
  padding: 10px 10px;
  color: #8da2b2;
  background: #132236;
  border-bottom: 1px solid rgba(137, 164, 184, 0.18);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
th:hover { color: var(--accent); }
td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(137, 164, 184, 0.095);
  color: #d3dee5;
  font-size: 10.5px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
tbody tr { transition: background 130ms ease; }
tbody tr:hover { background: rgba(120, 221, 195, 0.055); }
tbody tr.selected { background: rgba(120, 221, 195, 0.09); }

.badge {
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.045em;
}
.badge.buy { color: #77e0b4; background: rgba(85, 212, 160, 0.11); border-color: rgba(85, 212, 160, 0.18); }
.badge.sell { color: #ff9aa0; background: rgba(250, 129, 136, 0.10); border-color: rgba(250, 129, 136, 0.18); }
.badge.wait { color: #aebdca; background: rgba(146, 166, 183, 0.09); border-color: rgba(146, 166, 183, 0.16); }
.num-pos { color: var(--green); }
.num-neg { color: var(--red); }

.pair-meta { gap: 7px; margin: 0 0 12px; }
.pair-meta .chip { min-width: 92px; }
canvas {
  border: 1px solid rgba(137, 164, 184, 0.12);
  border-radius: 13px;
  background: rgba(8, 16, 26, 0.46);
}
.plan-box {
  padding: 17px;
  border: 1px solid rgba(137, 164, 184, 0.16);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(23, 38, 56, 0.88), rgba(16, 29, 44, 0.9));
  font-size: 11.5px;
}
.plan-box h3 { font-size: 13px; }
.plan-box .levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan-box .level {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(137, 164, 184, 0.12);
  border-radius: 11px;
  background: rgba(8, 16, 26, 0.46);
}
.plan-box .level .lbl { font-size: 8px; letter-spacing: 0.09em; }
.plan-box .level .val { font-size: 12px; overflow-wrap: anywhere; }
.plan-box ol.actions li { color: #cbd8df; line-height: 1.55; }
.plan-box .factors { gap: 6px; }
.stage { border-radius: 11px; background: rgba(8, 16, 26, 0.44); }
.stage-main { font-size: 11.5px; }

.corr { border-radius: 12px; scrollbar-width: thin; scrollbar-color: #3a5064 transparent; }
.corr table { min-width: 420px; font-size: 9px; }
.corr th { position: static; padding: 5px 4px; font-size: 8px; }
.corr td { padding: 5px 3px; border-color: rgba(137, 164, 184, 0.10); }

.bt-controls { align-items: end; gap: 10px; margin: 18px 0 20px; }
.bt-controls label { min-width: 130px; color: #9cb0bd; font-size: 10px; font-weight: 600; }
.bt-controls select, .bt-controls input {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid rgba(137, 164, 184, 0.22);
  border-radius: 10px;
  background: #0c1725;
  color: var(--text);
  font-family: var(--font-data);
  font-size: 11px;
}
.bt-controls select:focus, .bt-controls input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(120, 221, 195, 0.10); }
.bt-metrics { gap: 9px; }
.metric {
  min-width: 120px;
  padding: 12px 14px;
  border-color: rgba(137, 164, 184, 0.15);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(23, 38, 56, 0.92), rgba(15, 27, 42, 0.92));
}
.metric .k { color: #8ea4b3; font-size: 8.5px; letter-spacing: 0.12em; }
.metric .v { margin-top: 4px; color: #edf5f7; font-size: 14px; }

.about h3 { color: var(--accent); font-size: 13px; letter-spacing: -0.01em; }
.about p { color: #bdcbd4; line-height: 1.75; }
.disclaimer {
  color: var(--amber) !important;
  background: rgba(239, 194, 119, 0.065);
  border-color: rgba(239, 194, 119, 0.22);
}
footer { padding: 22px 18px; color: #8499a9; font-size: 10.5px; border-color: rgba(137, 164, 184, 0.12); }

.paywall { background: rgba(4, 10, 17, 0.84); backdrop-filter: blur(14px); }
.paywall-card {
  max-width: 510px;
  padding: clamp(26px, 5vw, 44px);
  border-color: rgba(120, 221, 195, 0.22);
  border-radius: 22px;
  background: radial-gradient(520px 220px at 50% 0, rgba(69, 161, 159, 0.12), transparent 72%), var(--card);
  box-shadow: var(--shadow-float);
}
.paywall-card .logo { border-radius: 17px; }
.paywall-card h2 { font-family: var(--font-display); font-size: 21px; }
.paywall-actions .refresh { min-width: 168px; }
.linkish { color: var(--accent); text-decoration: none; }
.linkish:hover { text-decoration: underline; }
.empty { color: #92a6b7; font-size: 12px; }

@media (max-width: 1120px) {
  .topbar { align-items: flex-start; }
  .pulse { justify-content: flex-start; }
  .grid-detail { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr); }
}

@media (max-width: 900px) {
  .topbar { position: relative; flex-direction: column; align-items: stretch; }
  .pulse { flex: 1 1 auto; }
  .grid-top, .grid-detail { grid-template-columns: 1fr; }
  main { padding-top: 18px; }
}

@media (max-width: 620px) {
  .topbar { gap: 12px; padding: 13px 15px; }
  .brand { min-width: 0; }
  .brand .sub { max-width: 290px; }
  .pulse { gap: 6px; }
  .chip { min-width: 70px; flex: 1 1 28%; padding: 6px 8px; }
  .pulse .refresh { flex: 1 1 calc(50% - 6px); }
  .tabs { padding: 8px 14px 0; gap: 2px; }
  .tab { padding: 9px 11px 11px; font-size: 11px; }
  main { padding: 15px 13px 30px; }
  .card { padding: 16px 14px; margin-bottom: 13px; border-radius: 15px; }
  .card h2 { font-size: 14px; }
  .hint { font-size: 9.5px; }
  #instruction-time { margin-left: 0; }
  .ins { padding: 11px; }
  .ins-link { margin-left: 0; }
  .plan-box .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-controls label { flex: 1 1 calc(50% - 10px); min-width: 125px; }
  .bt-controls .refresh { flex: 1 1 100%; }
  .metric { min-width: calc(50% - 8px); flex: 1 1 calc(50% - 8px); }
  .pair-meta .chip { flex: 1 1 calc(50% - 8px); }
}
