:root {
  color-scheme: light;
  --navy-950: #07111f;
  --navy-900: #0b1728;
  --navy-800: #13243a;
  --navy-700: #1d3450;
  --teal-700: #06645f;
  --teal-600: #087e78;
  --teal-500: #0d9488;
  --teal-300: #5eead4;
  --teal-100: #ccfbf1;
  --teal-50: #effcf9;
  --blue-50: #f5f8fb;
  --blue-100: #e9f1fb;
  --amber-100: #fff4da;
  --amber-700: #9a580c;
  --red-100: #fee2e2;
  --red-700: #b42318;
  --slate-950: #101828;
  --slate-800: #293547;
  --slate-700: #435063;
  --slate-600: #5d6a7c;
  --slate-500: #718096;
  --slate-400: #98a2b3;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --page-pad: clamp(18px, 3.5vw, 56px);
  --content-width: 1600px;
  --sidebar-width: 264px;
  --shadow-card: 0 10px 32px rgba(15, 34, 53, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--slate-950);
  background: var(--blue-50);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy-900);
  transform: translateY(-150%);
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  padding: 0 var(--page-pad);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.78);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--teal-300), #2dd4bf);
  box-shadow: inset 0 0 0 1px rgba(7, 17, 31, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--navy-950);
  font-size: 0.92rem;
}

.brand-copy small {
  color: var(--slate-500);
  font-size: 0.7rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 38px);
}

.topnav a {
  color: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--teal-700);
}

.topnav a[aria-current="page"] {
  color: var(--navy-900);
  text-decoration: underline;
  text-decoration-color: var(--teal-500);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.noscript-notice {
  width: min(calc(100% - var(--page-pad) - var(--page-pad)), var(--content-width));
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--red-700);
  border-radius: 10px;
  color: var(--red-700);
  background: var(--red-100);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.5;
}

.dashboard-hero {
  display: flex;
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: clamp(38px, 5vw, 70px) var(--page-pad) clamp(30px, 4vw, 52px);
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.eyebrow,
.panel-kicker,
.chart-eyebrow {
  margin: 0 0 10px;
  color: var(--teal-700);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  color: var(--navy-950);
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.45rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--slate-600);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.65;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  max-width: 390px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hero-meta > span {
  padding: 8px 11px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  color: var(--slate-600);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-meta .status-pill {
  color: var(--teal-700);
  border-color: #b8e9df;
  background: var(--teal-50);
}

.status-pill i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 0 var(--page-pad) clamp(70px, 8vw, 120px);
  align-items: start;
  gap: 24px;
}

.filter-panel {
  position: sticky;
  top: 94px;
  padding: 22px;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.filter-heading,
.section-title-row,
.chart-card-header,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.filter-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--slate-200);
}

.filter-heading h2,
.section-title-row h2,
.insights-panel h2,
.methodology h2,
.analyst-cta h2,
.dialog-header h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.field {
  display: grid;
  margin-top: 18px;
  gap: 8px;
}

.field > span {
  color: var(--slate-700);
  font-size: 0.73rem;
  font-weight: 800;
}

.field select {
  width: 100%;
  min-height: 43px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  color: var(--slate-950);
  background: var(--white);
  cursor: pointer;
}

.field select:hover {
  border-color: var(--teal-500);
}

.field select:focus-visible,
.button:focus-visible,
.chart-actions button:focus-visible,
.icon-button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--teal-700);
  outline-offset: 2px;
}

.filter-actions {
  display: grid;
  margin-top: 22px;
  gap: 8px;
}

.button,
.chart-actions button,
.icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
}

.button {
  display: inline-flex;
  padding: 10px 15px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--navy-900);
  background: var(--slate-100);
  font-size: 0.75rem;
  text-decoration: none;
}

.button:hover {
  background: var(--slate-200);
}

.button-primary {
  color: var(--white);
  background: var(--navy-900);
}

.button-primary:hover {
  background: var(--navy-700);
}

.button-quiet {
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  background: var(--white);
}

.filter-context,
.filter-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}

.filter-context span {
  display: block;
  margin-bottom: 6px;
  color: var(--slate-500);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.filter-context strong,
.filter-note strong {
  color: var(--navy-900);
  font-size: 0.78rem;
  line-height: 1.5;
}

.filter-note {
  padding: 15px;
  border: 0;
  border-radius: 10px;
  background: var(--teal-50);
}

.filter-note p {
  margin: 5px 0 0;
  color: var(--slate-600);
  font-size: 0.7rem;
  line-height: 1.5;
}

.filter-close,
.mobile-filter-button,
.filter-scrim {
  display: none;
}

.dashboard-main {
  min-width: 0;
}

.report-toolbar {
  display: flex;
  min-height: 42px;
  margin-bottom: 14px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.refresh-status {
  margin: 0 auto 0 0;
  color: var(--slate-500);
  font-size: 0.72rem;
}

.refresh-status.is-error {
  color: var(--red-700);
}

.refresh-status.is-demo {
  color: var(--amber-700);
}

.kpi-section,
.chart-section,
.methodology {
  padding: clamp(20px, 2.8vw, 32px);
  border: 1px solid var(--slate-200);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.section-title-row {
  align-items: flex-end;
}

.section-title-row > p,
.analysis-heading > p {
  max-width: 480px;
  margin-bottom: 0;
  color: var(--slate-500);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: right;
}

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

.kpi-card {
  position: relative;
  min-height: 154px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: linear-gradient(150deg, var(--white), #f9fbfd);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 4px;
  border-radius: 0 0 0 4px;
  background: var(--teal-500);
}

.kpi-card > span {
  color: var(--slate-600);
  font-size: 0.72rem;
  font-weight: 800;
}

.kpi-card strong {
  display: block;
  margin: 15px 0 12px;
  color: var(--navy-950);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.kpi-card p {
  margin-bottom: 0;
  color: var(--slate-500);
  font-size: 0.67rem;
  line-height: 1.45;
}

.kpi-card.is-loading strong,
.kpi-card.is-loading p {
  color: transparent;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--slate-100), var(--white), var(--slate-100));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.kpi-card.is-loading strong {
  width: 70%;
}

.insights-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 1fr);
  margin: 18px 0;
  padding: 24px clamp(22px, 3vw, 34px);
  align-items: center;
  gap: 28px;
  border-radius: 16px;
  color: var(--white);
  background: var(--navy-900);
  box-shadow: 0 14px 36px rgba(7, 17, 31, 0.15);
}

.insights-intro {
  display: flex;
  align-items: center;
  gap: 14px;
}

.insights-panel .panel-kicker,
.insights-panel h2 {
  color: var(--white);
}

.insight-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 12px;
  color: var(--teal-300);
  background: rgba(13, 148, 136, 0.12);
  font-size: 1.25rem;
}

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

.insight-list p {
  margin: 0;
  padding: 12px 14px;
  border-left: 2px solid var(--teal-500);
  color: #dce5ef;
  font-size: 0.76rem;
  line-height: 1.55;
}

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

.chart-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: var(--white);
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card-header {
  min-height: 70px;
}

.chart-card-header h3 {
  margin-bottom: 5px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.chart-card-header p {
  margin-bottom: 0;
  color: var(--slate-500);
  font-size: 0.69rem;
  line-height: 1.45;
}

.chart-eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: 0.58rem;
}

.chart-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.chart-actions button {
  min-width: 44px;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  background: var(--white);
  font-size: 0.62rem;
}

.chart-actions button:hover {
  color: var(--teal-700);
  border-color: #b8e9df;
  background: var(--teal-50);
}

.chart-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.chart-host,
.chart-host.vega-embed {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 320px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
}

.chart-card-wide .chart-host {
  min-height: 350px;
}

.chart-host.is-loading,
.chart-host.is-empty,
.chart-host.is-error {
  display: grid;
  place-items: center;
}

.chart-host.is-loading::before {
  content: "Loading visualization…";
  color: var(--slate-400);
  font-size: 0.73rem;
}

.chart-message {
  margin: 0;
  max-width: 280px;
  color: var(--slate-500);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.chart-host.is-error .chart-message {
  max-width: 300px;
  color: var(--red-700);
}

.chart-mount {
  width: 100%;
  min-width: 0;
}

.chart-host.vega-embed,
.chart-host.vega-embed > div,
.chart-host .vega-embed,
.chart-host .vega-embed > div {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.chart-host canvas,
.chart-host svg {
  max-width: 100%;
}

.data-details,
.source-details {
  margin-top: 12px;
  border-top: 1px solid var(--slate-200);
}

.data-details summary,
.source-details summary {
  display: flex;
  min-height: 44px;
  padding: 10px 2px 2px;
  align-items: center;
  color: var(--slate-600);
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
}

.table-wrap th,
.table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--slate-200);
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  color: var(--slate-600);
  background: var(--slate-100);
  font-size: 0.61rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calculation-note {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 8px;
  color: var(--slate-600);
  background: var(--slate-100);
  font-size: 0.65rem;
  line-height: 1.55;
}

.methodology {
  margin-top: 18px;
}

.methodology > div:first-child > p:last-child {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--slate-600);
  font-size: 0.82rem;
  line-height: 1.65;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  gap: 15px;
}

.method-grid article {
  padding: 19px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}

.method-grid span {
  color: var(--teal-600);
  font-size: 0.66rem;
  font-weight: 900;
}

.method-grid h3 {
  margin: 12px 0 7px;
  font-size: 0.9rem;
}

.method-grid p,
#sourceNotes {
  margin-bottom: 0;
  color: var(--slate-600);
  font-size: 0.7rem;
  line-height: 1.55;
}

.source-details {
  margin-top: 22px;
}

#sourceNotes {
  padding-top: 14px;
}

#sourceNotes ul {
  padding-left: 20px;
}

.analyst-cta {
  display: flex;
  margin-top: 18px;
  padding: clamp(26px, 4vw, 44px);
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--teal-50), var(--blue-100));
}

.analyst-cta p:last-child {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--slate-600);
  font-size: 0.8rem;
}

.footer {
  display: flex;
  min-height: 95px;
  padding: 24px var(--page-pad);
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  color: #d3dde8;
  background: var(--navy-950);
  font-size: 0.72rem;
}

.footer a {
  color: var(--white);
  font-weight: 850;
  text-decoration: none;
}

.footer p {
  margin: 0;
}

.chart-dialog {
  width: min(1120px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  padding: 24px;
  border: 0;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(7, 17, 31, 0.3);
}

.chart-dialog::backdrop {
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(4px);
}

.icon-button {
  display: grid;
  width: 40px;
  min-height: 40px;
  place-items: center;
  color: var(--slate-600);
  background: var(--slate-100);
  font-size: 1.3rem;
}

.dialog-chart {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: min(580px, 70vh);
  margin-top: 18px;
  place-items: center;
}

.dialog-chart.vega-embed,
.dialog-chart.vega-embed > div,
.dialog-chart .vega-embed,
.dialog-chart .vega-embed > div {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.vega-actions a {
  color: var(--teal-700) !important;
  font-size: 0.68rem !important;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

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

  .insights-panel {
    grid-template-columns: 1fr;
  }

  .insight-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-hero {
    display: grid;
  }

  .hero-meta {
    justify-content: flex-start;
  }

  .dashboard-layout {
    display: block;
  }

  .filter-panel {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(340px, calc(100% - 34px));
    overflow-y: auto;
    border-radius: 0 16px 16px 0;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .filter-panel.is-open {
    transform: translateX(0);
  }

  .filter-close,
  .mobile-filter-button {
    display: grid;
  }

  .mobile-filter-button {
    grid-auto-flow: column;
  }

  .mobile-filter-button span {
    display: grid;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    place-items: center;
    border-radius: 999px;
    color: var(--white);
    background: var(--teal-600);
    font-size: 0.62rem;
  }

  .filter-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(7, 17, 31, 0.58);
  }

  .filter-scrim[hidden] {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 66px;
  }

  .brand-copy small,
  .topnav a:first-child,
  .topnav a:last-child {
    display: none;
  }

  .dashboard-hero {
    padding-top: 36px;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3.7rem);
  }

  .section-title-row {
    display: grid;
    gap: 8px;
  }

  .section-title-row > p,
  .analysis-heading > p {
    text-align: left;
  }

  .chart-grid,
  .method-grid,
  .insight-list {
    grid-template-columns: 1fr;
  }

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

  .chart-card-wide {
    grid-column: auto;
  }

  .chart-card-header {
    display: grid;
  }

  .chart-actions {
    order: -1;
    justify-content: flex-end;
  }

  .chart-actions button {
    min-height: 44px;
  }

  .vega-embed > details > summary {
    display: grid;
    min-width: 40px;
    min-height: 40px;
    place-items: center;
  }

  .analyst-cta,
  .footer {
    display: grid;
  }

  .footer {
    justify-items: start;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 135px;
  }

  .report-toolbar {
    flex-wrap: wrap;
  }

  .refresh-status {
    order: 3;
    flex-basis: 100%;
  }

  .chart-section,
  .kpi-section,
  .methodology {
    padding: 18px;
  }

  .chart-card {
    padding: 16px;
  }
}

@media print {
  @page {
    margin: 0.55in;
  }

  html,
  body {
    min-width: 0;
    color: #111b19;
    background: #ffffff;
  }

  .skip-link,
  .topbar,
  .filter-panel,
  .report-toolbar,
  .chart-actions,
  .filter-scrim,
  .analyst-cta,
  .footer,
  .data-details,
  .noscript-notice {
    display: none !important;
  }

  .dashboard-hero,
  .dashboard-layout {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .dashboard-hero {
    display: block;
    padding-bottom: 24px;
  }

  .dashboard-hero h1 {
    max-width: none;
    font-size: 32pt;
  }

  .dashboard-layout,
  .dashboard-main,
  .chart-grid {
    display: block;
  }

  .kpi-section,
  .insights-panel,
  .chart-section,
  .methodology,
  .chart-card {
    border-color: #cbd3cc;
    box-shadow: none;
    break-inside: avoid;
  }

  .chart-card {
    margin-bottom: 18px;
  }

  .source-details > summary {
    display: none;
  }

  .source-details > #sourceNotes {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
