:root {
  --bg: #0b1220;
  --panel: rgba(16, 24, 40, 0.82);
  --panel-border: rgba(148, 163, 184, 0.16);
  --text: #e5e7eb;
  --muted: rgba(229, 231, 235, 0.72);
  --muted2: rgba(229, 231, 235, 0.55);
  --accent: #22c55e;
  --danger: #fb7185;
  --warn: #fbbf24;
  --shadow: rgba(0, 0, 0, 0.35);
  --grid: rgba(229, 231, 235, 0.12);
  --axis: rgba(229, 231, 235, 0.35);

  /* Okabe-Ito (color-blind friendly) */
  --c-invested: #0072b2;
  --c-profit: #009e73;
  --c-loss: #d55e00;
  --c-totalTrades: #cc79a7;
  --c-winningTrades: #56b4e9;

  --radius: 18px;
  --radius-lg: 24px;
  --pad: 16px;
  --pad-lg: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

:root[data-theme='light'] {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.7);
  --muted2: rgba(15, 23, 42, 0.52);
  --accent: #16a34a;
  --danger: #e11d48;
  --warn: #d97706;
  --shadow: rgba(15, 23, 42, 0.12);
  --grid: rgba(15, 23, 42, 0.12);
  --axis: rgba(15, 23, 42, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1000px 500px at 10% 0%, rgba(34, 197, 94, 0.12), transparent 60%),
    radial-gradient(800px 450px at 90% 10%, rgba(86, 180, 233, 0.14), transparent 55%), var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100%;
}

.view--center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(10px);
}

.login-title {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.login-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

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

input {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.22);
  color: var(--text);
  outline: none;
}

select {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.22);
  color: var(--text);
  outline: none;
}

:root[data-theme='light'] input {
  background: rgba(255, 255, 255, 0.85);
}

:root[data-theme='light'] select {
  background: rgba(255, 255, 255, 0.85);
}

input:focus {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

select:focus {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.btn {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.92);
  color: rgba(2, 6, 23, 0.92);
  font-weight: 700;
}

.btn-primary:hover {
  background: rgba(34, 197, 94, 0.82);
}

.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.12);
}

.btn-model-data {
  border-color: rgba(249, 115, 22, 0.38);
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
}

.btn-model-data:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.52);
}

:root[data-theme='light'] .btn-model-data {
  border-color: rgba(234, 88, 12, 0.28);
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.btn-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

#refresh-btn {
  width: 120px;
  min-width: 120px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 2vw;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: min(96vw, 1680px);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(12px);
}

.modal__panel--wide {
  width: min(96vw, 1760px);
}

.modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(11, 18, 32, 0.92);
}

.modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
}

.view-toggle .btn {
  border-color: transparent;
  padding: 8px 12px;
}

.view-toggle .btn.is-active {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.16);
  color: var(--text);
}

:root[data-theme='light'] .modal__header {
  background: rgba(245, 247, 251, 0.96);
}

.modal__title {
  margin: 4px 0 0;
  font-size: 22px;
}

.modal__body {
  padding: 18px 20px 24px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.model-table-wrap {
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.36);
}

.model-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 13px;
}

.model-table th,
.model-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.model-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8, 13, 24, 0.96);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

:root[data-theme='light'] .model-table-wrap {
  background: rgba(255, 255, 255, 0.92);
}

:root[data-theme='light'] .model-table thead th {
  background: rgba(245, 247, 251, 0.98);
}

.model-table tbody tr:hover {
  background: rgba(34, 197, 94, 0.06);
}

.model-table__pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.model-card {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(20, 31, 53, 0.88), rgba(9, 16, 30, 0.92)),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.14), transparent 38%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

:root[data-theme='light'] .model-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 246, 252, 0.94)),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.1), transparent 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 18px 40px rgba(15, 23, 42, 0.1);
}

.model-card__glow {
  position: absolute;
  top: -36px;
  right: -36px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.18), transparent 68%);
  pointer-events: none;
}

.model-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.model-card__symbol-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-card__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.94;
}

.model-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.model-card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.model-badge--up {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.model-badge--down {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
}

.model-badge--neutral,
.model-badge--muted {
  color: var(--muted);
}

.model-card__metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.model-metric {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme='light'] .model-metric {
  background: rgba(15, 23, 42, 0.025);
}

.model-metric__label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-metric__value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.model-card__rows {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.model-card__row {
  display: grid;
  grid-template-columns: minmax(110px, 140px) 1fr;
  gap: 12px;
  align-items: start;
  font-size: 13px;
  padding: 8px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.model-card__key {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-card__value {
  color: var(--text);
  word-break: break-word;
  font-weight: 600;
}

.form-error {
  margin: 0;
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--danger);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  padding: 18px 10vw;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.66), rgba(2, 6, 23, 0));
  backdrop-filter: blur(12px);
}

:root[data-theme='light'] .topbar {
  background: linear-gradient(to bottom, rgba(245, 247, 251, 0.88), rgba(245, 247, 251, 0.22));
}

.topbar__left {
  display: grid;
  gap: 6px;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(34, 197, 94, 0.85);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
}

.title {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.01em;
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-sep {
  opacity: 0.65;
}

.topbar__right {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 920px) {
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .topbar__right {
    margin-top: 0;
  }
}

@media (max-width: 1180px) {
  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 760px) {
  .modal {
    padding: 14px 10px;
  }

  .modal__header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .model-card__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .model-card__metrics {
    grid-template-columns: 1fr;
  }
}

.container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 14px 10vw 40px;
  display: grid;
  gap: 16px;
}

.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 680px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.stat-card {
  padding: var(--pad-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 12px 42px var(--shadow);
  backdrop-filter: blur(10px);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted2);
}

.stat-sub__spacer {
  height: 8px;
}

.stat-sub__roi-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-sub__roi-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 12px 42px var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.panel__header {
  padding: 14px var(--pad-lg);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__header--stack {
  flex-direction: column;
  align-items: flex-start;
}

.panel__meta {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--muted2);
}

.panel__meta span {
  white-space: nowrap;
}

.panel__meta-inline {
  font-size: 11px;
  color: var(--muted2);
}

.panel__meta .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.panel__title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.panel__body {
  padding: var(--pad-lg);
}

.panel__collapse {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
}

.panel__collapse span {
  display: inline-block;
  transform: translateY(-1px);
}

.panel--collapsed .panel__header {
  border-bottom: 0;
}

.empty {
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted2);
  background: rgba(148, 163, 184, 0.06);
}

.pnl-strip {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pnl-strip__items {
  flex: 1;
  min-width: 0;
}

.pnl-strip__total {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 650;
}

.buyhold-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.buyhold-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
}

:root[data-theme='light'] .buyhold-card {
  background: rgba(255, 255, 255, 0.9);
}

.buyhold-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.buyhold-label__sub {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted2);
}

.buyhold-value {
  font-size: 14px;
  font-weight: 650;
}

.buyhold-sub {
  font-size: 12px;
  color: var(--muted2);
}

.kline-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.profit-factor-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.profit-factor-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
}

:root[data-theme='light'] .profit-factor-card {
  background: rgba(255, 255, 255, 0.9);
}

.profit-factor-card--lead {
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(59, 130, 246, 0.08)),
    rgba(15, 23, 42, 0.35);
}

.profit-factor-card__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.profit-factor-card__value {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.profit-factor-card__sub {
  font-size: 11px;
  color: var(--muted2);
  line-height: 1.35;
}

.globals-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.globals-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

:root[data-theme='light'] .globals-card {
  background: rgba(255, 255, 255, 0.9);
}

.globals-card__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.globals-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.globals-card__row span {
  color: var(--muted2);
  font-size: 10px;
}

@media (max-width: 1200px) {
  .profit-factor-cards {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
  .globals-cards {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .profit-factor-cards {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .globals-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .kline-cards {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 960px) {
  .kline-cards {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  .kline-cards {
    grid-template-columns: repeat(1, minmax(140px, 1fr));
  }
}

.kline-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
  align-items: center;
  position: relative;
  grid-auto-rows: min-content;
}

:root[data-theme='light'] .kline-card {
  background: rgba(255, 255, 255, 0.9);
}

.kline-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 1;
}

.kline-side-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.kline-entry-price {
  font-size: 9px;
  letter-spacing: 0.01em;
  color: var(--muted2);
}

.kline-card__change {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 650;
}

.coin-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  filter: invert(92%) sepia(8%) saturate(200%) hue-rotate(180deg) brightness(98%);
}

.kline-card__logo {
  position: absolute;
  inset: 18% 12% auto auto;
  width: 56%;
  height: 56%;
  opacity: 0.1;
  filter: invert(92%) sepia(8%) saturate(200%) hue-rotate(180deg) brightness(98%);
  pointer-events: none;
}

.globals-card__logo {
  position: absolute;
  inset: 15% 10% auto auto;
  width: 60%;
  height: 60%;
  opacity: 0.12;
  filter: invert(92%) sepia(8%) saturate(200%) hue-rotate(180deg) brightness(98%);
  pointer-events: none;
}

.kline-card__spark {
  color: var(--accent);
  margin-bottom: 2px;
}

.sparkline-entry-line {
  stroke: rgba(250, 204, 21, 0.9);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.sparkline-entry-label {
  fill: rgba(250, 204, 21, 0.95);
  font-size: 5px;
  letter-spacing: 0.02em;
}

.kline-card__value {
  font-size: 13px;
  font-weight: 650;
}

.kline-card__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  line-height: 1.2;
}

.kline-card__roi {
  font-size: 11px;
  color: var(--muted2);
}

.kline-bar {
  display: grid;
  grid-template-columns: 24px 1fr 54px;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted2);
  width: 100%;
  min-width: 0;
  margin-top: 2px;
  padding-bottom: 1px;
}

.kline-bar__label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kline-bar__svg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  display: block;
}

.kline-bar__sell {
  fill: var(--danger);
}

.kline-bar__buy {
  fill: var(--c-invested);
}

.kline-bar__buy--ratio {
  fill: #3b82f6;
}

.kline-bar__sell--ratio {
  fill: #93c5fd;
}

.kline-bar__text {
  text-align: right;
  font-size: 9px;
  white-space: nowrap;
}

.sparkline {
  width: 100%;
  height: 42px;
  display: block;
}

.sparkline-line {
  stroke: var(--accent);
  stroke-width: 1;
}

.pnl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.pnl-card {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
}

:root[data-theme='light'] .pnl-card {
  background: rgba(255, 255, 255, 0.9);
}

.pnl-card__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pnl-card__value {
  font-size: 14px;
  font-weight: 650;
}

.pnl-cards--totals {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.filters__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.filters__export {
  width: auto;
  min-width: 140px;
  padding: 10px 14px;
  cursor: pointer;
}

.filters__count {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.pagination__meta {
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 12px;
  white-space: nowrap;
}

th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
}

td {
  color: var(--text);
}

td .coin-icon {
  margin-right: 6px;
  vertical-align: middle;
}

.unrealized-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vu-meter {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 140px;
  height: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(148, 163, 184, 0.08);
  overflow: hidden;
  border-radius: 8px;
}

.vu-meter::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--axis);
  opacity: 0.6;
}

.vu-meter--disabled {
  opacity: 0.35;
}

.vu-side {
  flex: 1;
  display: flex;
}

.vu-side--neg {
  justify-content: flex-end;
}

.vu-fill {
  height: 100%;
}

.vu-fill--neg {
  width: 0;
  background: var(--danger);
  opacity: 0.75;
}

.vu-fill--pos {
  width: 0;
  background: var(--accent);
  opacity: 0.75;
}

.pct-0 { width: 0%; }
.pct-1 { width: 1%; }
.pct-2 { width: 2%; }
.pct-3 { width: 3%; }
.pct-4 { width: 4%; }
.pct-5 { width: 5%; }
.pct-6 { width: 6%; }
.pct-7 { width: 7%; }
.pct-8 { width: 8%; }
.pct-9 { width: 9%; }
.pct-10 { width: 10%; }
.pct-11 { width: 11%; }
.pct-12 { width: 12%; }
.pct-13 { width: 13%; }
.pct-14 { width: 14%; }
.pct-15 { width: 15%; }
.pct-16 { width: 16%; }
.pct-17 { width: 17%; }
.pct-18 { width: 18%; }
.pct-19 { width: 19%; }
.pct-20 { width: 20%; }
.pct-21 { width: 21%; }
.pct-22 { width: 22%; }
.pct-23 { width: 23%; }
.pct-24 { width: 24%; }
.pct-25 { width: 25%; }
.pct-26 { width: 26%; }
.pct-27 { width: 27%; }
.pct-28 { width: 28%; }
.pct-29 { width: 29%; }
.pct-30 { width: 30%; }
.pct-31 { width: 31%; }
.pct-32 { width: 32%; }
.pct-33 { width: 33%; }
.pct-34 { width: 34%; }
.pct-35 { width: 35%; }
.pct-36 { width: 36%; }
.pct-37 { width: 37%; }
.pct-38 { width: 38%; }
.pct-39 { width: 39%; }
.pct-40 { width: 40%; }
.pct-41 { width: 41%; }
.pct-42 { width: 42%; }
.pct-43 { width: 43%; }
.pct-44 { width: 44%; }
.pct-45 { width: 45%; }
.pct-46 { width: 46%; }
.pct-47 { width: 47%; }
.pct-48 { width: 48%; }
.pct-49 { width: 49%; }
.pct-50 { width: 50%; }
.pct-51 { width: 51%; }
.pct-52 { width: 52%; }
.pct-53 { width: 53%; }
.pct-54 { width: 54%; }
.pct-55 { width: 55%; }
.pct-56 { width: 56%; }
.pct-57 { width: 57%; }
.pct-58 { width: 58%; }
.pct-59 { width: 59%; }
.pct-60 { width: 60%; }
.pct-61 { width: 61%; }
.pct-62 { width: 62%; }
.pct-63 { width: 63%; }
.pct-64 { width: 64%; }
.pct-65 { width: 65%; }
.pct-66 { width: 66%; }
.pct-67 { width: 67%; }
.pct-68 { width: 68%; }
.pct-69 { width: 69%; }
.pct-70 { width: 70%; }
.pct-71 { width: 71%; }
.pct-72 { width: 72%; }
.pct-73 { width: 73%; }
.pct-74 { width: 74%; }
.pct-75 { width: 75%; }
.pct-76 { width: 76%; }
.pct-77 { width: 77%; }
.pct-78 { width: 78%; }
.pct-79 { width: 79%; }
.pct-80 { width: 80%; }
.pct-81 { width: 81%; }
.pct-82 { width: 82%; }
.pct-83 { width: 83%; }
.pct-84 { width: 84%; }
.pct-85 { width: 85%; }
.pct-86 { width: 86%; }
.pct-87 { width: 87%; }
.pct-88 { width: 88%; }
.pct-89 { width: 89%; }
.pct-90 { width: 90%; }
.pct-91 { width: 91%; }
.pct-92 { width: 92%; }
.pct-93 { width: 93%; }
.pct-94 { width: 94%; }
.pct-95 { width: 95%; }
.pct-96 { width: 96%; }
.pct-97 { width: 97%; }
.pct-98 { width: 98%; }
.pct-99 { width: 99%; }
.pct-100 { width: 100%; }

.vu-zero {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  color: var(--muted2);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(148, 163, 184, 0.09);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.badge-long {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: rgba(34, 197, 94, 0.95);
}

.badge-short {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.12);
  color: rgba(251, 113, 133, 0.95);
}

.badge-type-a {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: rgba(147, 197, 253, 0.98);
  min-width: 24px;
  justify-content: center;
}

.badge-type-m {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.14);
  color: rgba(253, 230, 138, 0.98);
  min-width: 24px;
  justify-content: center;
}

.trend-up {
  color: var(--accent);
  font-weight: 650;
}

.trend-down {
  color: var(--danger);
  font-weight: 650;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.06);
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-item--c-invested {
  color: var(--c-invested);
}

.legend-item--c-profit {
  color: var(--c-profit);
}

.legend-item--c-loss {
  color: var(--c-loss);
}

.legend-item--c-total-trades {
  color: var(--c-totalTrades);
}

.legend-item--c-winning-trades {
  color: var(--c-winningTrades);
}

.legend-swatch {
  width: 12px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.chart-tooltip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(2, 6, 23, 0.82);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  backdrop-filter: blur(10px);
  max-width: 320px;
}

:root[data-theme='light'] .chart-tooltip {
  background: rgba(255, 255, 255, 0.94);
}

.chart-tooltip--empty {
  color: var(--muted);
}

.tooltip-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tooltip-key {
  color: var(--muted);
}

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