:root {
  --ink: #171717;
  --muted: #5f6f82;
  --soft: #f7fbff;
  --line: #d9e7f4;
  --panel: #ffffff;
  --rail: #0d1726;
  --accent: #0084d5;
  --blue: #005cb9;
  --blue-2: #0084d5;
  --blue-3: #64b5f6;
  --blue-4: #b7dbf2;
  --navy: #1d4e89;
  --shadow: 0 18px 48px rgba(23, 23, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 116px;
  background: var(--rail);
  color: #d7ebff;
  z-index: 3;
}

.rail::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 5px;
  background: var(--accent);
}

.mark {
  margin: 74px 0 0 31px;
  font-size: 39px;
  font-weight: 800;
}

.rail-line {
  width: 42px;
  height: 2px;
  margin: 10px 0 0 31px;
  background: var(--accent);
}

.rail-copy {
  position: absolute;
  left: 33px;
  bottom: 84px;
  width: 280px;
  transform: rotate(-90deg);
  transform-origin: left bottom;
  color: #aab2c0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.shell {
  margin-left: 116px;
  padding: 58px 64px 46px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
  max-width: 790px;
  overflow-wrap: break-word;
}

.subhead {
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding-top: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.topbar > div:first-child {
  min-width: 0;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue-2);
}

.client-switch {
  display: flex;
  gap: 10px;
  margin: 24px 0 22px;
}

.client-tab {
  display: grid;
  gap: 3px;
  min-width: 190px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.client-tab span {
  font-size: 14px;
  font-weight: 800;
}

.client-tab small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.client-tab.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -6px 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #e7f1fb;
}

.view-tab {
  min-width: 116px;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.view-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(23, 23, 23, 0.08);
}

.toolbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pass-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-2);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 24px;
}

.primary,
.side {
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

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

.metric {
  position: relative;
  min-height: 96px;
  padding: 24px 24px 18px;
  background: rgba(255, 255, 255, 0.3);
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 24px;
  width: 35px;
  height: 4px;
  background: var(--blue);
}

.metric-blue-mid::before {
  background: var(--blue-2);
}

.metric-blue-light::before {
  background: var(--blue-3);
}

.metric-blue-soft::before {
  background: var(--blue-4);
}

.metric span {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(21px, 1.65vw, 25px);
  line-height: 1;
  white-space: nowrap;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: #5f6f82;
  font-size: 12px;
}

.summary-band,
.pdf-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.summary-band h2 {
  font-size: 26px;
  line-height: 1.05;
}

.summary-band > div,
.pdf-strip > div {
  min-width: 0;
  max-width: 100%;
}

.summary-band p:not(.label),
.pdf-strip p:not(.label) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--rail);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.download-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.charts {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
  min-width: 0;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.compare-panel {
  border-color: #9cc6e8;
}

.compare-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #d9e7f4;
  border-radius: 8px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #d9e7f4;
  gap: 1px;
}

.compare-cell {
  min-height: 50px;
  padding: 12px 14px;
  background: #fff;
}

.compare-cell:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.compare-cell strong {
  display: block;
  font-size: 14px;
}

.compare-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h3 {
  font-size: 18px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.allocation {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 240px;
}

.donut {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0deg 90deg, var(--blue-2) 90deg 210deg, var(--blue-3) 210deg 260deg, var(--blue-4) 260deg 360deg);
}

.donut::after {
  content: "100%\A total";
  white-space: pre;
  display: grid;
  place-items: center;
  position: absolute;
  inset: 39px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  line-height: 1.35;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #273244;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-row strong {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.legend-row small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.legend-name {
  min-width: 0;
}

.returns {
  display: grid;
  gap: 17px;
  min-height: 240px;
  align-content: center;
}

.return-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}

.return-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.return-meta em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  position: relative;
  height: 10px;
  background: #e7f1fb;
  border-radius: 999px;
}

.bar-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 1px;
  height: 20px;
  background: #a9c9e8;
}

.bar {
  position: absolute;
  top: 0;
  height: 10px;
  border-radius: 999px;
  background: var(--blue-2);
}

.bar.negative {
  background: var(--navy);
}

.chart-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chart-check strong {
  color: var(--ink);
  font-size: 12px;
}

.chart-check span {
  display: block;
}

.pdf-strip h3 {
  font-size: 19px;
  line-height: 1.2;
}

.pdf-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.pdf-list a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.holdings-panel {
  padding-bottom: 18px;
}

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

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #d9e7f4;
  text-align: right;
  font-size: 12px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: #273244;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.positive {
  color: var(--blue-2);
}

.negative {
  color: var(--navy);
}

.pipeline ol {
  display: grid;
  gap: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pipeline li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid #d9e7f4;
}

.pipeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pipeline li span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.pipeline li strong {
  display: block;
  grid-column: 2;
  font-size: 14px;
}

.pipeline li small {
  display: block;
  grid-column: 2;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#recommendations {
  display: grid;
  gap: 12px;
}

.rec {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d9e7f4;
}

.rec:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rec-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.rec h4 {
  margin: 0;
  font-size: 14px;
}

.badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eaf6fd;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.rec p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.note {
  padding: 18px;
  border-left: 3px solid var(--accent);
  background: #eaf6fd;
  color: #273244;
}

.test-card {
  display: grid;
  gap: 10px;
}

.test-card code {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbff;
  color: #273244;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.gate-list div {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  column-gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d9e7f4;
}

.gate-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.gate-list span {
  align-self: start;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(0, 132, 213, 0.12);
  color: var(--blue-2);
  font-size: 9px;
  font-weight: 900;
}

.gate-list strong {
  font-size: 13px;
}

.gate-list small {
  grid-column: 2;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.note strong {
  font-size: 14px;
}

.note p {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1060px) {
  .rail {
    display: none;
  }

  .shell {
    margin-left: 0;
    padding: 32px 22px;
  }

  .topbar,
  .summary-band,
  .pdf-strip,
  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

@media (max-width: 620px) {
  .shell {
    padding: 24px 14px;
  }

  h1 {
    font-size: 33px;
    line-height: 1.04;
  }

  .subhead {
    font-size: 15.5px;
    line-height: 1.35;
  }

  .status {
    align-items: flex-start;
    line-height: 1.35;
    max-width: 100%;
  }

  .client-switch,
  .pdf-list,
  .segmented {
    flex-direction: column;
  }

  .summary-band,
  .pdf-strip {
    align-items: stretch;
  }

  .client-tab,
  .view-tab,
  .download-btn,
  .pdf-list a {
    width: 100%;
    max-width: 100%;
  }

  .download-btn,
  .pdf-list a {
    justify-content: center;
    text-align: center;
  }

  .pdf-strip h3 {
    font-size: 18px;
  }

  .metrics,
  .allocation {
    grid-template-columns: 1fr;
  }

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

  .metric:last-child {
    border-bottom: 0;
  }

  .donut {
    justify-self: center;
  }

  .return-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    align-items: start;
  }

  .return-meta em {
    justify-self: start;
    text-align: left;
  }

  .bar-track {
    width: 100%;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .compare-cell:first-child {
    background: #eaf6fd;
  }
}
