:root {
  --profile-ink: #172033;
  --profile-muted: #687386;
  --profile-line: #d9e1ec;
  --profile-soft: #eef4f7;
  --profile-teal: #167c80;
  --profile-blue: #2457a6;
  --profile-cyan: #3f8eaa;
  --profile-gold: #b07815;
  --profile-red: #ad3434;
  --profile-green: #2f7d4b;
}

.journal-profile-body {
  min-height: 100vh;
  background: #f4f7fa;
  color: var(--profile-ink);
}

.profile-topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--profile-line);
  background: #fff;
  padding: 0 max(24px, calc((100vw - 1380px) / 2));
}

.profile-brand {
  display: grid;
  color: var(--profile-ink);
  text-decoration: none;
}

.profile-brand span {
  font-size: 18px;
  font-weight: 800;
}

.profile-brand small {
  color: var(--profile-muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.back-link,
.official-site-link {
  color: var(--profile-blue);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.official-site-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.journal-page {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.profile-loading,
.profile-error {
  min-height: 55vh;
  display: grid;
  place-content: center;
  color: var(--profile-muted);
  text-align: center;
}

.journal-identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 0 24px;
}

.journal-title-block {
  min-width: 0;
}

.profile-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.level-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid #a8c7ca;
  border-radius: 5px;
  background: #e9f4f4;
  color: #0f686c;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.journal-identity h1 {
  max-width: 980px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
}

.journal-identity-line {
  margin: 12px 0 0;
  color: var(--profile-muted);
  font-size: 15px;
}

.official-site-link {
  flex: 0 0 auto;
  padding-bottom: 5px;
}

.profile-kpi-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  border: 1px solid var(--profile-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.profile-kpi {
  min-height: 92px;
  padding: 15px;
  border-right: 1px solid var(--profile-line);
}

.profile-kpi:last-child {
  border-right: 0;
}

.profile-kpi span {
  display: block;
  min-height: 30px;
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-kpi strong {
  display: block;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.profile-section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--profile-line);
  background: rgba(244, 247, 250, 0.96);
  padding: 18px 0 12px;
}

.profile-section-nav a {
  color: var(--profile-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.profile-section-nav a:hover {
  color: var(--profile-teal);
}

.profile-section {
  scroll-margin-top: 58px;
  padding: 34px 0 8px;
}

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

.section-heading h2 {
  font-size: 22px;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--profile-teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.coverage-label {
  color: var(--profile-muted);
  font-size: 12px;
}

.journal-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--profile-line);
}

.journal-facts div {
  min-height: 82px;
  padding: 16px 18px 12px 0;
  border-bottom: 1px solid var(--profile-line);
}

.journal-facts dt {
  color: var(--profile-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.journal-facts dd {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 650;
}

.taxonomy-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 20px;
}

.taxonomy-group h3 {
  margin: 0 0 10px;
  color: var(--profile-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.taxonomy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.taxonomy-tag {
  border: 1px solid #cbd7e4;
  border-radius: 5px;
  background: #fff;
  padding: 6px 8px;
  color: #344054;
  font-size: 12px;
}

.profile-chart-grid {
  display: grid;
  gap: 14px;
}

.profile-chart-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-panel {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--profile-line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.chart-panel figcaption {
  display: grid;
  gap: 3px;
}

.chart-panel figcaption strong {
  font-size: 15px;
}

.chart-panel figcaption span {
  color: var(--profile-muted);
  font-size: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 34px;
  align-items: center;
  color: var(--profile-muted);
  font-size: 11px;
}

.legend-line,
.legend-box {
  display: inline-block;
  width: 16px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--profile-blue);
}

.legend-box {
  height: 10px;
}

.index-one { background: var(--profile-cyan); }
.index-two { background: var(--profile-blue); }
.index-five { background: var(--profile-gold); }
.external { background: var(--profile-teal); }
.self { background: var(--profile-red); }
.quality { background: var(--profile-green); }
.risk { background: var(--profile-red); }

.chart-panel canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.profile-table-wrap {
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--profile-line);
  border-radius: 8px;
  background: #fff;
}

.profile-year-table {
  min-width: 1460px;
}

.profile-year-table th,
.profile-year-table td {
  padding: 10px 9px;
}

.profile-year-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.profile-year-table td:nth-child(3) {
  text-align: center;
}

.current-year-row {
  background: #f0f7f7;
}

@media (max-width: 1100px) {
  .profile-kpi-strip {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .profile-kpi {
    border-bottom: 1px solid var(--profile-line);
  }

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

@media (max-width: 760px) {
  .profile-topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .profile-brand span {
    font-size: 15px;
  }

  .journal-page {
    width: min(100% - 28px, 1380px);
    padding-top: 16px;
  }

  .journal-identity {
    display: grid;
    align-items: start;
  }

  .journal-identity h1 {
    font-size: 32px;
  }

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

  .profile-kpi {
    min-height: 82px;
  }

  .profile-section-nav {
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .journal-facts,
  .taxonomy-block,
  .profile-chart-grid.two-column {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}
