/* Country & institution profile pages (no avatar / certificate) */
.entity-profile-wrap {
  --paper: #f5f1ea;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --ink-mute: #6b6358;
  --ink-faint: #9a9285;
  --rule: #cfc5b3;
  --accent: #6b2a1f;
  --gold: #a07a2c;
  --teal: #2b6868;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  font-family: "Inter", "Source Sans 3", system-ui, sans-serif;
}

.entity-profile-wrap .breadcrumb {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}
.entity-profile-wrap .breadcrumb a {
  color: var(--ink-faint);
  text-decoration: none;
}
.entity-profile-wrap .breadcrumb a:hover {
  color: var(--accent);
}
.entity-profile-wrap .breadcrumb .sep {
  margin: 0 10px;
  color: var(--rule);
}

.entity-masthead {
  background: #fdfaf3;
  border: 1px solid var(--rule);
  padding: 36px 40px 48px;
  position: relative;
  margin-bottom: 28px;
  box-shadow: 0 20px 40px -24px rgba(60, 40, 20, 0.1);
}
.entity-masthead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--teal));
}

.entity-masthead-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.entity-masthead-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}
.entity-masthead-actions .share-btn,
.entity-share-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 18px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.entity-masthead-actions .share-btn:hover,
.entity-share-btn:hover {
  background: var(--ink);
  color: #fdfaf3;
}

.entity-masthead .engagement-footer {
  position: absolute;
  right: 40px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: flex-end;
  align-items: flex-end;
  z-index: 2;
}
.entity-masthead .engagement-foot-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 72px;
}
.entity-masthead .engagement-foot-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.entity-masthead .engagement-foot-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal);
  line-height: 1.1;
}

.entity-identity {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.entity-icon {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.entity-icon.institution-icon {
  font-size: 32px;
  color: var(--teal);
  background: linear-gradient(135deg, #eef5f5, #d8e8e8);
}
.entity-icon .country-flag {
  width: 100%;
  height: auto;
  display: block;
}

.entity-title {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
}
.entity-subtitle {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}

.entity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.entity-badges .pill {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ebe5da;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
}
.entity-badges .pill.accent {
  background: var(--accent);
  color: #f5f1ea;
  border-color: var(--accent);
}
.entity-badges .pill-btn {
  cursor: pointer;
  font-family: inherit;
}

.entity-year-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.entity-year-row .year-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 8px;
}
.entity-year-row .year-btn {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-soft);
}
.entity-year-row .year-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fdfaf3;
  border: 1px solid var(--rule);
  padding: 16px 18px;
}
.stat-card .stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.stat-card .stat-hint {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.stat-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fdfaf3, #f8f0e6);
}

.entity-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .entity-grid-2 {
    grid-template-columns: 1fr;
  }
}

.entity-section {
  margin-bottom: 32px;
}
.entity-section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.entity-section .section-num {
  font-size: 11px;
  color: var(--ink-faint);
  font-family: "JetBrains Mono", monospace;
}
.entity-section .section-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 16px;
}

.rank-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rank-compare-table th,
.rank-compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.rank-compare-table th {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.rank-compare-table tr.is-self {
  background: rgba(107, 42, 31, 0.06);
  font-weight: 600;
}
.rank-compare-table .rank-pos {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
}

.best-author-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--rule);
  background: #fdfaf3;
}
.best-author-card .best-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  width: 100%;
  margin-bottom: -8px;
}
.best-author-card a.author-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
}
.best-author-card a.author-name:hover {
  text-decoration: underline;
}
.best-author-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.best-author-metrics strong {
  color: var(--ink);
}

.entity-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.entity-data-table th,
.entity-data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.entity-data-table th {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.entity-data-table a {
  color: var(--accent);
  text-decoration: none;
}
.entity-data-table a:hover {
  text-decoration: underline;
}

.entity-charts {
  display: grid;
  gap: 16px;
}
.entity-chart-card {
  border: 1px solid var(--rule);
  padding: 16px 18px;
  background: #fdfaf3;
}
.entity-chart-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
}
.entity-chart-card .chart-wrap {
  height: 220px;
  position: relative;
}

body.entity-profile-route {
  background: #f5f1ea;
}
body.entity-profile-route #app {
  max-width: none;
  padding: 0;
}
