/* ==========================================================
   Asset Prediction System -- Shared Design Tokens & Styles
   Preserves ALL existing CSS variables from the original scoreboard.
   ========================================================== */

:root {
  /* Surfaces */
  --ink: #0a0c10;
  --ink2: #0e1116;
  --panel: #13171e;
  --panel2: #171c24;

  /* Borders */
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);

  /* Text */
  --txt: #e7e9ee;
  --txt2: #a3a9b5;
  --txt3: #6a7180;

  /* Warm spectrum (overweight / bullish) */
  --warm3: #ff2d20;
  --warm2: #ff6a3d;
  --warm1: #ffab57;

  /* Neutral */
  --neut: #7f8694;

  /* Cool spectrum (underweight / bearish) */
  --cool1: #56a7e6;
  --cool2: #3b82f6;
  --cool3: #1f5ad8;

  /* Direction colors */
  --up: #ff4d4f;
  --down: #27c08a;

  /* Typography */
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: 'Fraunces', Georgia, 'Songti SC', serif;
  --cjk: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, sans-serif;

  /* Spacing rhythm */
  --gap: 14px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

/* ---- Reset & Base ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--cjk);
  background: var(--ink);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(255, 90, 50, 0.06), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(40, 90, 220, 0.07), transparent 55%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 80px;
  position: relative;
  z-index: 2;
}

/* ---- Masthead ---- */
header.mast {
  padding: 34px 0 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
}

.brand .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--txt3);
}

.brand h1 {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 40px;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 6px 0 4px;
}

.brand h1 em {
  font-style: italic;
  color: var(--warm1);
  font-weight: 500;
}

.brand .sub {
  font-size: 13px;
  color: var(--txt2);
}

.mast-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.meta-row {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--txt2);
  align-items: center;
}

.meta-row b {
  color: var(--txt);
  font-weight: 500;
}

/* Data freshness indicator */
.fresh-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 3px 9px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

.fresh-tag.fresh {
  color: #7fd0a8;
  border: 1px solid rgba(39, 192, 138, 0.35);
  background: rgba(39, 192, 138, 0.08);
}

.fresh-tag.stale {
  color: #e0b15a;
  border: 1px solid rgba(224, 177, 90, 0.4);
  background: rgba(224, 177, 90, 0.1);
}

.fresh-tag .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.fresh-tag.fresh .dot {
  background: #27c08a;
  box-shadow: 0 0 4px rgba(39, 192, 138, 0.5);
}

.fresh-tag.stale .dot {
  background: #e0b15a;
  box-shadow: 0 0 4px rgba(224, 177, 90, 0.5);
}

/* Legend scale bar */
.legend {
  display: flex;
  align-items: center;
  gap: 9px;
}

.legend .bar {
  width: 200px;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cool3), var(--cool1) 30%, var(--neut) 50%, var(--warm1) 70%, var(--warm3));
}

.legend span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt3);
}

/* ---- Nav Tabs ---- */
nav.tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 26px;
  border-bottom: 1px solid var(--line);
}

nav.tabs button {
  font-family: var(--cjk);
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 14px;
  padding: 11px 18px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

nav.tabs button:hover {
  color: var(--txt2);
}

nav.tabs button.on {
  color: var(--txt);
}

nav.tabs button.on::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--warm2), var(--warm1));
  border-radius: 2px;
}

/* ---- Section visibility ---- */
.tab-section {
  display: none;
}

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

/* ---- Group header ---- */
.group {
  margin-bottom: 30px;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
}

.group-head h2 {
  font-family: var(--disp);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.group-head .ln {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.group-head .ct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
}

/* ---- Asset cards grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

/* ---- Asset Card ---- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--ink2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.22s, box-shadow 0.22s;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.5s forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line2);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.8);
}

.card .edge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.a-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.a-code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--txt3);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* Card meta row (code + coverage) */
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}

.coverage-chip.high {
  color: #7fd0a8;
  border: 1px solid rgba(39, 192, 138, 0.3);
  background: rgba(39, 192, 138, 0.06);
}

.coverage-chip.med {
  color: #e0b15a;
  border: 1px solid rgba(224, 177, 90, 0.3);
  background: rgba(224, 177, 90, 0.06);
}

.coverage-chip.low {
  color: #ff6a3d;
  border: 1px solid rgba(255, 106, 61, 0.3);
  background: rgba(255, 106, 61, 0.06);
}

/* Badge (score display) */
.badge {
  text-align: right;
  flex-shrink: 0;
}

.badge .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
}

.badge .lab {
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Gauge */
.gauge {
  margin: 15px 0 11px;
  position: relative;
  height: 30px;
}

.gauge .track {
  position: absolute;
  top: 13px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(60, 130, 246, 0.35), rgba(127, 134, 148, 0.3) 50%, rgba(255, 107, 61, 0.35));
}

.gauge .tick {
  position: absolute;
  top: 9px;
  width: 1px;
  height: 12px;
  background: var(--line2);
}

.gauge .zero {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.25);
}

.gauge .mk {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 2.5px solid var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 3px 8px rgba(0, 0, 0, 0.6);
  transition: left 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gauge .raw {
  position: absolute;
  top: -2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt2);
  transform: translateX(-50%);
}

/* Sparkline */
.spark {
  height: 30px;
  margin: 2px -2px 10px;
  display: block;
  width: calc(100% + 4px);
}

/* Returns row */
.rets {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.ret {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--line);
}

.ret:last-child {
  border-right: none;
}

.ret .k {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--txt3);
  letter-spacing: 0.05em;
}

.ret .vv {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 2px;
}

/* ---- Portfolio Chart Section ---- */
.portfolio-section {
  margin-bottom: 30px;
}

.portfolio-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.portfolio-section .section-header h2 {
  font-family: var(--disp);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.track-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--line2);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--panel);
}

.track-toggle button {
  font-family: var(--cjk);
  font-size: 12px;
  background: none;
  border: none;
  color: var(--txt3);
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.track-toggle button:hover {
  color: var(--txt2);
}

.track-toggle button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--txt);
  font-weight: 500;
}

.chart-container {
  background: linear-gradient(180deg, var(--panel), var(--ink2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
}

.chart-container canvas {
  max-height: 380px;
}

/* ---- Stage Table ---- */
.tablewrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
  text-align: right;
  padding: 13px 16px;
  background: var(--panel);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

thead th:first-child {
  text-align: left;
}

thead th:hover {
  color: var(--txt);
}

thead th .sort-arrow {
  margin-left: 4px;
  font-size: 9px;
  opacity: 0.4;
}

thead th .sort-arrow.active {
  opacity: 1;
  color: var(--warm1);
}

tbody td {
  padding: 12px 16px;
  text-align: right;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
}

tbody td:first-child {
  text-align: left;
  font-family: var(--cjk);
  font-weight: 500;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.chip {
  display: inline-block;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
}

/* ---- Detail View (replaces old drawer) ---- */
.detail-view {
  display: none;
}

.detail-view.active {
  display: block;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--txt2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--txt);
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--txt3);
  font-family: var(--mono);
  font-size: 10px;
}

.breadcrumb .current {
  color: var(--txt);
  font-weight: 500;
}

/* Detail header */
.detail-header {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--ink2));
  margin-bottom: 20px;
}

.detail-header .dh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.detail-header h3 {
  font-family: var(--disp);
  font-size: 27px;
  font-weight: 600;
}

.detail-header .dc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  margin-top: 4px;
}

.detail-header .dscore {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.detail-header .dscore .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 34px;
}

.detail-header .dscore .lab {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.detail-header .dscore .raw {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt3);
  margin-left: auto;
}

.detail-header .dscore .cov {
  font-family: var(--mono);
  font-size: 11px;
  margin-left: auto;
}

/* ---- Pillar Card ---- */
.pillar-card {
  background: linear-gradient(180deg, var(--panel), var(--ink2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.pillar-card:hover {
  border-color: var(--line2);
}

.pillar-card.open {
  border-color: rgba(255, 255, 255, 0.16);
}

.pillar-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.pillar-summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.pillar-summary .chevron {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt3);
  transition: transform 0.25s;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.pillar-card.open .pillar-summary .chevron {
  transform: rotate(90deg);
}

.pillar-summary .p-name {
  font-size: 14.5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.pillar-summary .p-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  min-width: 44px;
  text-align: right;
}

.pillar-summary .p-weight {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--txt3);
  min-width: 48px;
  text-align: right;
}

.pillar-summary .p-cov {
  font-family: var(--mono);
  font-size: 9.5px;
  min-width: 56px;
  text-align: right;
}

.pillar-factors {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 18px 16px;
}

.pillar-card.open .pillar-factors {
  display: block;
}

/* Factor table in pillars */
.factor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.factor-table td {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.factor-table tr:first-child td {
  border-top: none;
}

.factor-table .fn {
  font-family: var(--cjk);
  color: var(--txt);
  font-size: 13px;
}

.factor-table .fn small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt3);
  margin-top: 2px;
  font-weight: 400;
}

.wbar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  position: relative;
  margin-top: 4px;
  width: 90px;
  overflow: hidden;
}

.wbar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--warm1), var(--warm2));
}

.src {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line2);
  color: var(--txt2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.src.auto {
  color: #7fd0a8;
  border-color: rgba(39, 192, 138, 0.35);
}

.src.pending {
  color: #e0b15a;
  border-color: rgba(224, 177, 90, 0.35);
}

.src.manual {
  color: #56a7e6;
  border-color: rgba(86, 167, 230, 0.35);
}

.src .src-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
}

.src.auto .src-dot {
  background: #27c08a;
}

.src.pending .src-dot {
  background: #e0b15a;
}

.src.manual .src-dot {
  background: #56a7e6;
}

/* Factor score cell */
.fsc {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  text-align: right;
}

.fval {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  text-align: right;
}

/* Judgment note on factors */
.judgment-note {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--txt3);
  margin-top: 2px;
}

.judgment-note .j-date {
  color: var(--cool1);
}

/* ---- Stage Returns Section (detail) ---- */
.stage-section {
  margin-bottom: 20px;
}

.stage-section h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 14px;
}

.statrow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.stat .k {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--txt3);
  letter-spacing: 0.05em;
}

.stat .v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  margin-top: 4px;
}

/* Stage chart container (detail view) */
.stage-chart-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.stage-chart-wrap canvas {
  max-height: 200px;
}

/* ---- Helper / Utility ---- */
.note {
  font-size: 11.5px;
  color: var(--txt3);
  margin-top: 14px;
  line-height: 1.6;
}

.loading {
  text-align: center;
  padding: 80px;
  color: var(--txt3);
  font-family: var(--mono);
}

.hidden {
  display: none !important;
}

/* Back to overview button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt2);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-back:hover {
  color: var(--txt);
  border-color: var(--txt3);
  background: var(--panel2);
}

/* ---- Legacy drawer (kept for compatibility, may be unused) ---- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 40;
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: var(--ink2);
  border-left: 1px solid var(--line2);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 50;
  overflow-y: auto;
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.9);
}

.drawer.open {
  transform: none;
}

.dh {
  padding: 26px 26px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, var(--panel), var(--ink2));
  z-index: 2;
}

.dh .x {
  position: absolute;
  top: 22px;
  right: 24px;
  background: none;
  border: 1px solid var(--line2);
  color: var(--txt2);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.dh .x:hover {
  color: var(--txt);
  border-color: var(--txt3);
}

.dh h3 {
  font-family: var(--disp);
  font-size: 27px;
  font-weight: 600;
}

.dh .dc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt3);
  margin-top: 3px;
}

.dh .dscore {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
}

.dh .dscore .v {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 34px;
}

.dh .dscore .lab {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.dh .dscore .raw {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--txt3);
  margin-left: auto;
}

.dsec {
  padding: 20px 26px;
}

.dsec h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 14px;
}

.ftbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ftbl td {
  padding: 9px 6px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.ftbl tr:first-child td {
  border-top: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .brand h1 {
    font-size: 28px;
  }

  nav.tabs button {
    font-size: 12px;
    padding: 10px 12px;
  }

  .detail-header .dh-top {
    flex-direction: column;
  }

  .chart-container canvas {
    max-height: 300px;
  }

  .pillar-summary {
    padding: 12px 14px;
    gap: 8px;
  }

  .pillar-summary .p-name {
    font-size: 13px;
  }
}
