:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #09090b;
  --panel-soft: #101013;
  --line: rgba(255, 255, 255, 0.1);
  --line-yellow: rgba(255, 255, 0, 0.26);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.64);
  --prism: #ffff00;
  --danger: #ff5f6d;
  --display-font: Anton, Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body-font);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 255, 0, 0.14), transparent 30%),
    radial-gradient(circle at 16% 14%, rgba(255, 255, 0, 0.08), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 0, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    #000;
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
  color: var(--text);
}

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

button {
  font: inherit;
}

.dashboard-header {
  width: min(1240px, calc(100% - 28px));
  min-height: 74px;
  position: sticky;
  top: 14px;
  z-index: 20;
  margin: 14px auto 0;
  padding: 10px 12px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-yellow);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 0, 0.04)),
    rgba(5, 5, 5, 0.84);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 164px;
  height: auto;
}

.dashboard-header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vw, 34px);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 800;
}

.dashboard-header nav a:hover {
  color: #ffffff;
}

.header-cta,
.panel-cta {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--prism);
  color: #050505;
  font-weight: 950;
  box-shadow: 0 0 32px rgba(255, 255, 0, 0.18);
}

.dashboard-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(18px, 4vw, 44px);
  align-items: end;
}

.eyebrow {
  color: var(--prism);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2 {
  font-family: var(--display-font);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(54px, 8vw, 112px);
  line-height: 0.9;
}

.dashboard-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1.6;
}

.account-card,
.panel,
.kpi-grid article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.018)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 74px rgba(0, 0, 0, 0.3);
}

.account-card {
  min-height: 170px;
  padding: 22px;
  display: grid;
  align-content: end;
}

.account-card span,
.kpi-grid span,
.panel-head span,
.position-table span,
.rule-list span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-card strong {
  margin: 8px 0;
  color: var(--prism);
  font-size: 28px;
  line-height: 1;
}

.account-card small,
.kpi-grid small,
.chart-foot,
.rule-list small {
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.45;
}

.kpi-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-grid article {
  min-height: 142px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.kpi-grid strong {
  color: #ffffff;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 0.95;
}

.dashboard-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.72fr);
  gap: 18px;
}

.lower-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.15fr 0.82fr 0.82fr;
  gap: 18px;
}

.panel {
  padding: clamp(18px, 2.6vw, 26px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 0.98;
}

.range-tabs {
  padding: 5px;
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.range-tabs button {
  min-height: 34px;
  min-width: 50px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-weight: 900;
}

.range-tabs button.is-active {
  background: var(--prism);
  color: #050505;
}

.chart-wrap {
  height: clamp(260px, 34vw, 380px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 0, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #050507;
  background-size: 48px 48px;
}

#pnl-chart {
  width: 100%;
  height: 100%;
}

.chart-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.rule-list {
  display: grid;
  gap: 12px;
}

.rule-list article {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.rule-list article div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rule-list strong {
  color: #ffffff;
}

progress {
  width: 100%;
  height: 8px;
  appearance: none;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--prism);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--prism);
}

.position-table {
  display: grid;
  gap: 8px;
}

.position-table div {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) 0.7fr 0.6fr 0.6fr;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.position-table div:first-child {
  padding-top: 0;
}

.position-table strong {
  color: #ffffff;
}

.position-table b {
  color: var(--prism);
}

.position-table .negative {
  color: var(--danger);
}

.checklist {
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.checklist li {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.68);
}

.checklist li::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.checklist li.is-done {
  color: #ffffff;
}

.checklist li.is-done::before {
  border-color: var(--prism);
  background: var(--prism);
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.28);
}

.panel-cta {
  width: 100%;
}

.notes-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.62;
}

.note-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-tags span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line-yellow);
  border-radius: 999px;
  color: var(--prism);
  background: rgba(255, 255, 0, 0.07);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .dashboard-header nav {
    display: none;
  }

  .dashboard-hero,
  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .dashboard-header {
    width: min(100% - 20px, 1240px);
    min-height: 64px;
    top: 10px;
    padding: 8px 8px 8px 12px;
  }

  .brand img {
    width: 132px;
  }

  .header-cta {
    min-height: 42px;
    padding: 0 14px;
  }

  .dashboard-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(48px, 16vw, 74px);
  }

  .dashboard-hero p {
    font-size: 16px;
  }

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

  .panel-head {
    flex-direction: column;
  }

  .range-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .range-tabs button {
    flex: 1;
  }

  .chart-foot {
    flex-direction: column;
  }

  .position-table div {
    grid-template-columns: 1fr 1fr;
  }

  .position-table div:first-child {
    display: none;
  }
}

/* Shared Prism motion test. */
body {
  overflow-x: hidden;
  animation: dashboardBackgroundDrift 24s ease-in-out infinite alternate;
  background-size: 124% 124%, 116% 116%, 72px 72px, 72px 72px, auto;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 24%, rgba(255, 255, 0, 0.08), transparent 30%),
    radial-gradient(ellipse at 78% 16%, rgba(255, 246, 90, 0.1), transparent 30%);
  filter: blur(24px);
  opacity: 0.58;
  animation: dashboardAmbientWave 18s ease-in-out infinite alternate;
}

.dashboard-header,
.dashboard-shell {
  position: relative;
  z-index: 1;
}

.panel,
.account-card,
.kpi-grid article {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.panel::after,
.account-card::after,
.kpi-grid article::after {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 26% 40%, rgba(255, 255, 0, 0.12), transparent 25%),
    radial-gradient(ellipse at 76% 58%, rgba(255, 246, 90, 0.075), transparent 28%);
  filter: blur(18px);
  opacity: 0.28;
  animation: dashboardPanelWave 13s ease-in-out infinite alternate;
}

.panel > *,
.account-card > *,
.kpi-grid article > * {
  position: relative;
  z-index: 1;
}

@keyframes dashboardBackgroundDrift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  }

  to {
    background-position: 7% -5%, -6% 6%, 24px 20px, -18px 28px, 0 0;
  }
}

@keyframes dashboardAmbientWave {
  from {
    transform: translate3d(-4%, -2%, 0) rotate(-2deg) scale(1);
  }

  to {
    transform: translate3d(5%, 3%, 0) rotate(8deg) scale(1.08);
  }
}

@keyframes dashboardPanelWave {
  from {
    transform: translate3d(-6%, -4%, 0) rotate(-6deg) scale(1);
  }

  to {
    transform: translate3d(7%, 4%, 0) rotate(8deg) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  body::after,
  .panel::after,
  .account-card::after,
  .kpi-grid article::after {
    animation: none;
  }
}

/* Organic impulse refinement. */
body {
  animation: none;
}

body::after {
  opacity: 0.48;
  transform-origin: 9% 12%;
  animation: dashboardOrganicImpulse 10.5s cubic-bezier(0.42, 0, 0.18, 1) infinite;
}

.panel::after,
.account-card::after,
.kpi-grid article::after {
  opacity: 0.22;
  animation: dashboardOrganicPanelImpulse 8.8s cubic-bezier(0.42, 0, 0.18, 1) infinite;
}

@keyframes dashboardOrganicImpulse {
  0%,
  100% {
    opacity: 0.24;
    transform: translate3d(-5%, -3%, 0) scale(0.9);
  }

  18% {
    opacity: 0.56;
    transform: translate3d(0, 0, 0) scale(1.06);
  }

  42% {
    opacity: 0.4;
    transform: translate3d(5%, 3%, 0) scale(1.18);
  }

  70% {
    opacity: 0.22;
    transform: translate3d(1%, 1%, 0) scale(1.02);
  }
}

@keyframes dashboardOrganicPanelImpulse {
  0%,
  100% {
    opacity: 0.09;
    transform: translate3d(-10%, -7%, 0) rotate(-8deg) scale(0.88);
  }

  20% {
    opacity: 0.26;
    transform: translate3d(-1%, -1%, 0) rotate(-1deg) scale(1.04);
  }

  52% {
    opacity: 0.17;
    transform: translate3d(8%, 5%, 0) rotate(8deg) scale(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .panel::after,
  .account-card::after,
  .kpi-grid article::after {
    animation: none;
  }
}
