:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #132a44;
  --ink-soft: #55708e;
  --ink-faint: #7890aa;
  --blue: #1668dc;
  --blue-dark: #0d4fa8;
  --blue-soft: #e9f2ff;
  --line: #dce7f3;
  --green: #138a67;
  --green-soft: #e7f7f1;
  --red: #c84b5d;
  --red-soft: #fff0f2;
  --amber: #a96800;
  --amber-soft: #fff6df;
  --shadow: 0 14px 38px rgba(38, 78, 121, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, rgba(70, 145, 235, 0.12), transparent 27rem),
    var(--bg);
}

button,
input,
table {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1420px, calc(100% - 64px));
  margin-inline: auto;
}

.masthead {
  padding: 42px 0 30px;
  border-bottom: 1px solid rgba(220, 231, 243, 0.9);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.subtitle {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.header-clock {
  display: grid;
  min-width: 172px;
  justify-items: end;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.header-clock strong {
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.status-ribbon {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(520px, 2fr);
  gap: 28px;
  margin-top: 30px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.status-ribbon__lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-ribbon__lead div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.status-ribbon__lead strong {
  font-size: 0.92rem;
}

.status-ribbon__lead span:last-child {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(120, 144, 170, 0.12);
}

.status-dot--ok {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(19, 138, 103, 0.12);
}

.status-dot--warn {
  background: #e2a116;
  box-shadow: 0 0 0 5px rgba(226, 161, 22, 0.14);
}

.status-dot--error {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(200, 75, 93, 0.12);
}

.status-dot--idle {
  background: var(--ink-faint);
}

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

.status-facts div {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.status-facts dt {
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.status-facts dd {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard {
  display: grid;
  gap: 34px;
  padding-block: 38px 64px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2,
.panel-heading h2,
.ratio-section h2,
.insight-panel h2,
.methodology h2 {
  margin-bottom: 0;
  font-size: 1.16rem;
  letter-spacing: -0.015em;
}

.section-heading > p,
.panel-heading > p,
.ratio-section__intro > p:last-child {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

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

.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--card-accent, var(--blue));
  content: "";
}

.summary-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.summary-card__value {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.summary-card__caption {
  margin-bottom: 20px;
  color: var(--ink-faint);
  font-size: 0.69rem;
}

.summary-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.summary-card__meta div {
  display: grid;
  gap: 3px;
}

.summary-card__meta span {
  color: var(--ink-faint);
  font-size: 0.63rem;
}

.summary-card__meta strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-status {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.6rem;
}

.mini-status--stale {
  background: var(--amber-soft);
  color: var(--amber);
}

.ratio-section {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(0, 2.4fr);
  gap: 32px;
  align-items: center;
  padding: 25px 27px;
  border: 1px solid #cfe1f5;
  border-left: 5px solid var(--blue);
  border-radius: 14px;
  background: linear-gradient(110deg, #f5f9ff, #edf5ff);
}

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

.ratio-item {
  padding: 12px 15px;
  border-left: 1px solid #cbdff5;
}

.ratio-item span {
  display: block;
  overflow: hidden;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratio-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-dark);
  font-size: 1.15rem;
}

.ratio-item small {
  color: var(--ink-faint);
  font-size: 0.61rem;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-card {
  min-width: 0;
  padding: 22px 23px 24px;
}

.panel-heading {
  align-items: flex-start;
}

.panel-heading h3 {
  margin-bottom: 5px;
  font-size: 0.91rem;
}

.panel-heading div p {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.unit-chip {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.bar-chart {
  display: grid;
  gap: 13px;
  min-height: 220px;
  align-content: center;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) 74px;
  gap: 10px;
  align-items: center;
}

.bar-row__label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 15px;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(to right, rgba(19, 42, 68, 0.055) 1px, transparent 1px) 25% 0 / 25% 100%,
    #f0f5fa;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 0;
  border-radius: 4px;
  background: var(--bar-color, var(--blue));
  transition: width 300ms ease;
}

.bar-row__value {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 750;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track--diverging {
  overflow: visible;
  background: #f0f5fa;
}

.bar-track--diverging::after {
  position: absolute;
  inset: -4px auto -4px 50%;
  width: 1px;
  background: #a9bdd2;
  content: "";
}

.bar-fill--left {
  inset: 0 50% 0 auto;
  border-radius: 4px 0 0 4px;
  background: #da7080;
}

.bar-fill--right {
  inset: 0 auto 0 50%;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}

.table-panel {
  overflow: hidden;
}

.table-panel__heading {
  margin: 0;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  overflow-x: auto;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #e8eff7;
  text-align: right;
  white-space: nowrap;
}

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

th {
  background: #f8fbff;
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

td {
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 650;
}

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

tbody tr:hover td {
  background: #fbfdff;
}

.symbol-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.symbol-swatch {
  width: 7px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--symbol-color, var(--blue));
}

.symbol-cell div {
  display: grid;
  gap: 2px;
}

.symbol-cell small {
  color: var(--ink-faint);
  font-size: 0.56rem;
  font-weight: 500;
}

.positive {
  color: var(--green);
}

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

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.61rem;
}

.quality-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.quality-badge--stale {
  background: var(--amber-soft);
  color: var(--amber);
}

.quality-badge--missing {
  background: var(--red-soft);
  color: var(--red);
}

.insight-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 2.2fr);
  gap: 32px;
  padding: 25px 27px;
  border: 1px solid #cfe1f5;
  border-radius: var(--radius);
  background: #eef6ff;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.4rem;
}

.insight-list li {
  padding-left: 7px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.55;
}

.insight-list li::marker {
  color: var(--blue);
  font-weight: 800;
}

.methodology {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 2.2fr);
  gap: 32px;
  padding: 26px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 30px;
}

.methodology-grid h3 {
  margin-bottom: 6px;
  font-size: 0.76rem;
}

.methodology-grid p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.65;
}

.market-session-study {
  display: grid;
  gap: 20px;
  padding: 30px;
  border: 1px solid #cfe1f5;
  border-radius: 22px;
  background: linear-gradient(145deg, #f8fbff, #eef6ff);
  box-shadow: var(--shadow);
}

.study-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.study-heading h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.study-heading p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.study-heading__meta {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 7px;
  color: var(--ink-faint);
  font-size: 0.66rem;
}

.source-chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.study-notice {
  display: flex;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid #d8e7f7;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.55;
}

.study-notice strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
}

.activity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--ink-soft);
  font-size: 0.64rem;
}

.activity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.activity-legend i {
  width: 18px;
  height: 9px;
  border: 1px solid #d7e1ec;
  border-radius: 2px;
  background: var(--phase-color);
}

.activity-trends {
  display: grid;
  gap: 12px;
}

.activity-chart-card {
  min-width: 0;
  padding: 17px 18px 11px;
  box-shadow: none;
}

.activity-chart-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 7px;
}

.activity-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 126px;
}

.activity-svg__grid line {
  stroke: rgba(85, 112, 142, 0.16);
  stroke-width: 1;
}

.activity-svg__bars {
  opacity: 0.88;
}

.activity-svg text {
  fill: var(--ink-faint);
  font-family: inherit;
  font-size: 10px;
}

.activity-svg__labels text {
  fill: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.activity-chart-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
}

.activity-ratio-panel,
.activity-table-panel {
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  box-shadow: none;
}

.activity-ratio-symbol {
  display: grid;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.activity-ratio-symbol:first-child {
  padding-top: 0;
  border-top: 0;
}

.activity-ratio-symbol__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.71rem;
}

.activity-ratio-symbol__name .symbol-swatch {
  height: 16px;
}

.activity-ratio-row {
  display: grid;
  grid-template-columns: 56px minmax(90px, 1fr) 46px;
  gap: 8px;
  align-items: center;
  font-size: 0.63rem;
}

.activity-ratio-row > span:first-child {
  color: var(--ink-soft);
}

.activity-ratio-row > strong {
  text-align: right;
}

.activity-ratio-track {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: #edf3f9;
}

.activity-ratio-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--ratio-color, var(--blue));
}

.activity-ratio-baseline {
  position: absolute;
  inset-block: -3px;
  width: 1px;
  border-left: 1px dashed #5e7185;
}

.activity-table-panel {
  padding-inline: 0;
}

.activity-table-panel .panel-heading {
  padding-inline: 20px;
}

.activity-table {
  min-width: 700px;
}

.activity-table td:first-child,
.activity-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.activity-table th:first-child {
  background: #f8fbff;
}

.study-footnote {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-size: 0.64rem;
  line-height: 1.6;
}

.footer {
  padding: 22px 0 32px;
  color: var(--ink-faint);
  font-size: 0.64rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.empty-copy {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

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

  .status-ribbon {
    grid-template-columns: 1fr;
  }

  .status-facts div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .activity-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 30px, 1420px);
  }

  .masthead {
    padding: 26px 0 22px;
  }

  .brand-row {
    display: grid;
    gap: 20px;
  }

  .header-clock {
    justify-items: start;
  }

  .status-ribbon {
    gap: 20px;
    margin-top: 23px;
    padding: 17px;
  }

  .status-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 8px;
  }

  .status-facts div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .dashboard {
    gap: 28px;
    padding-block: 28px 44px;
  }

  .section-heading {
    display: grid;
    gap: 7px;
  }

  .summary-grid,
  .chart-grid,
  .methodology-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 175px;
  }

  .ratio-section,
  .insight-panel,
  .methodology {
    grid-template-columns: 1fr;
    gap: 21px;
  }

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

  .ratio-item {
    border-top: 1px solid #cbdff5;
    border-left: 0;
  }

  .chart-card {
    padding-inline: 17px;
  }

  .bar-row {
    grid-template-columns: 72px minmax(90px, 1fr) 64px;
    gap: 7px;
  }

  .bar-row__label,
  .bar-row__value {
    font-size: 0.62rem;
  }

  .table-panel__heading {
    display: grid;
  }

  .footer__inner {
    display: grid;
    gap: 7px;
  }

  .market-session-study {
    padding: 20px 15px;
    border-radius: 17px;
  }

  .study-heading {
    display: grid;
    align-items: start;
  }

  .study-heading__meta {
    justify-items: start;
  }

  .study-notice {
    display: grid;
    gap: 5px;
  }

  .activity-chart-card {
    padding-inline: 11px;
  }

  .activity-svg {
    min-height: 98px;
  }

  .activity-ratio-panel {
    padding-inline: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
