/* Profile page — from profile.html mock (scoped) */
.profile-wrap {
  --paper: #f5f1ea;
  --paper-soft: #ebe5da;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --ink-mute: #6b6358;
  --ink-faint: #9a9285;
  --rule: #cfc5b3;
  --rule-soft: #ddd3c0;
  --accent: #6b2a1f;
  --gold: #a07a2c;
  --teal: #2b6868;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  font-family: "Inter", "Source Sans 3", system-ui, sans-serif;
}

.profile-wrap .profile-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.profile-wrap .profile-main {
  min-width: 0;
  max-width: 100%;
}

.profile-wrap .profile-related {
  position: sticky;
  top: 20px;
  background: #fdfaf3;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 22px 18px 20px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 16px 32px -24px rgba(60, 40, 20, 0.1);
}
.profile-wrap .related-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-soft);
}
.profile-wrap .related-title {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}
.profile-wrap .related-sub {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-mute);
  font-style: italic;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
}
.profile-wrap .related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-wrap .related-loading,
.profile-wrap .related-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.profile-wrap .related-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px 11px;
  border: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, #fffdf8 0%, #f7f1e6 100%);
  border-radius: 2px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.profile-wrap .related-card:hover {
  border-color: rgba(107, 42, 31, 0.35);
  box-shadow: 0 8px 18px -14px rgba(60, 40, 20, 0.35);
  transform: translateY(-1px);
}
.profile-wrap .related-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.profile-wrap .related-card-rank {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.profile-wrap .related-card-rank .rank-all-paren {
  color: var(--ink-faint);
  font-weight: 400;
}
.profile-wrap .related-card-h {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  white-space: nowrap;
}
.profile-wrap .related-card-name {
  margin: 0 0 4px;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1.02rem;
  font-weight: 550;
  line-height: 1.25;
  color: var(--ink);
}
.profile-wrap .related-card-inst {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-wrap .related-card-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-mute);
}
.profile-wrap .related-card-meta img,
.profile-wrap .related-card-meta .fi {
  flex-shrink: 0;
}
.profile-wrap .related-card-field {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--rule-soft);
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

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

.profile-wrap .profile-listing-bar {
  margin-bottom: 16px;
}

.profile-wrap .masthead {
  background: #fdfaf3;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 40px 44px 52px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 20px 40px -20px rgba(60, 40, 20, 0.08);
}
.profile-wrap .masthead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 50%, var(--teal) 100%);
}
.profile-wrap .badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.profile-wrap .pill {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.profile-wrap .pill.accent {
  background: var(--accent);
  color: #f5f1ea;
  border-color: var(--accent);
}
.profile-wrap .pill-btn {
  cursor: pointer;
  font-family: inherit;
}
.profile-wrap .pill-btn:hover {
  opacity: 0.9;
}

.profile-wrap .masthead-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: start;
}
.profile-wrap .avatar-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}
.profile-wrap .avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5e6c8 0%, #d4b483 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 42px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--rule);
  overflow: hidden;
  cursor: pointer;
}
.profile-wrap .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-wrap .avatar-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  pointer-events: none;
}
.profile-wrap .avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 30px;
  height: 30px;
  background: var(--ink);
  border: 2px solid #fdfaf3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.profile-wrap .avatar-edit:hover {
  background: var(--accent);
}

.profile-wrap .scholar-name {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.profile-wrap .scholar-name .first {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.profile-wrap .verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0d5c63;
  background: rgba(13, 92, 99, 0.08);
  border: 1px solid rgba(13, 92, 99, 0.28);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}
.profile-wrap .verified-badge svg {
  color: #c5a059;
}
.profile-wrap .member-bio {
  margin: 0.65rem 0 0;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.profile-wrap .claim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: #fffefb;
  background: #001f3f;
  border: 1px solid #001f3f;
  border-radius: 2px;
  cursor: pointer;
}
.profile-wrap .claim-btn:hover {
  background: #0d5c63;
  border-color: #0d5c63;
  text-decoration: none;
  color: #fff;
}
.profile-wrap .claim-btn-manage {
  background: #fffefb;
  color: #001f3f;
  border-color: rgba(0, 31, 63, 0.25);
}
.profile-wrap .claim-pending {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9a7a3a;
}
.profile-wrap .affiliation {
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
}
.profile-wrap .country-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.profile-wrap .country-line code {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-faint);
}
.profile-wrap .rank-line {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.profile-wrap .rank-line .label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.profile-wrap .rank-line .num {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 6px;
}
.profile-wrap .rank-line .num .rank-all-paren {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--ink-soft);
}
.profile-wrap .rank-line .rank-all-paren {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--ink-soft);
}
.profile-wrap .rank-line .alt {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-faint);
}

.profile-wrap .action-cluster {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 188px;
}

.profile-wrap .scholar-site-cta-wrap--profile {
  order: -1;
  margin-bottom: 2px;
}

.profile-wrap .scholar-site-cta--profile {
  margin-bottom: 0;
}

.profile-wrap .scholar-site-cta--profile .scholar-site-cta__mark {
  width: 28px;
  height: 28px;
  color: #c5a059;
  background: rgba(0, 31, 63, 0.07);
  border-color: rgba(197, 160, 89, 0.4);
}

.profile-wrap .scholar-site-cta--profile .scholar-site-cta__eyebrow {
  color: rgba(26, 26, 26, 0.48);
}

.profile-wrap .scholar-site-cta--profile .scholar-site-cta__label {
  font-size: 0.8rem;
  letter-spacing: 0.015em;
}

.profile-wrap .engagement-footer {
  position: absolute;
  right: 44px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: flex-end;
  align-items: flex-end;
  z-index: 2;
  max-width: min(100%, 420px);
}
.profile-wrap .engagement-foot-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 72px;
}
.profile-wrap .engagement-foot-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.profile-wrap .engagement-foot-value {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--teal);
  line-height: 1.1;
}
@media (max-width: 720px) {
  .profile-wrap .masthead {
    padding-bottom: 72px;
  }
  .profile-wrap .engagement-footer {
    right: 20px;
    bottom: 12px;
    gap: 8px 16px;
  }
}
.profile-wrap .cert-btn {
  background: linear-gradient(180deg, #b08938 0%, #8a6a26 100%);
  color: #fdfaf3;
  border: 1px solid #6a5018;
  padding: 11px 20px;
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  min-width: 168px;
  font-family: inherit;
}
.profile-wrap .cert-btn:hover {
  transform: translateY(-1px);
}
.profile-wrap .share-btn,
.profile-wrap .profile-share-btn {
  --ps-navy: #0c1f36;
  --ps-navy-deep: #001f3f;
  --ps-navy-mid: #163a5f;
  --ps-gold: #c5a059;
  --ps-gold-soft: #e2c789;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(197, 160, 89, 0.14) 0%, transparent 42%),
    linear-gradient(165deg, var(--ps-navy-mid) 0%, var(--ps-navy) 52%, var(--ps-navy-deep) 100%);
  color: #f7f1e6;
  border: 1px solid rgba(197, 160, 89, 0.72);
  padding: 11px 18px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  min-width: 168px;
  font-family: "Inter Tight", "Inter", "Source Sans 3", system-ui, sans-serif;
  box-shadow:
    inset 0 1px 0 rgba(226, 199, 137, 0.28),
    0 10px 22px -14px rgba(0, 31, 63, 0.65);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    background 0.18s ease;
}
.profile-wrap .share-btn::before,
.profile-wrap .profile-share-btn::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ps-gold-soft), transparent);
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}
.profile-wrap .profile-share-btn__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--ps-gold-soft);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(197, 160, 89, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  z-index: 1;
}
.profile-wrap .profile-share-btn__label {
  position: relative;
  z-index: 1;
  line-height: 1;
}
.profile-wrap .share-btn .profile-share-icon,
.profile-wrap .profile-share-btn .profile-share-icon {
  display: block;
}
.profile-wrap .share-btn:hover,
.profile-wrap .profile-share-btn:hover {
  transform: translateY(-1px);
  color: #fffdf8;
  border-color: var(--ps-gold-soft);
  background:
    linear-gradient(180deg, rgba(226, 199, 137, 0.22) 0%, transparent 48%),
    linear-gradient(165deg, #1d4a78 0%, var(--ps-navy-mid) 45%, var(--ps-navy) 100%);
  box-shadow:
    inset 0 1px 0 rgba(226, 199, 137, 0.4),
    0 14px 28px -14px rgba(0, 31, 63, 0.72);
}
.profile-wrap .share-btn:hover .profile-share-btn__mark,
.profile-wrap .profile-share-btn:hover .profile-share-btn__mark {
  color: #f3e2b4;
  border-color: rgba(226, 199, 137, 0.55);
  background: rgba(0, 0, 0, 0.22);
}
.profile-wrap .share-btn:active,
.profile-wrap .profile-share-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(226, 199, 137, 0.2),
    0 6px 14px -12px rgba(0, 31, 63, 0.55);
}
.profile-wrap .share-btn:focus-visible,
.profile-wrap .profile-share-btn:focus-visible {
  outline: 2px solid var(--ps-gold);
  outline-offset: 3px;
}

.profile-wrap .year-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 28px;
  margin-bottom: 20px;
}
.profile-wrap .year-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-right: 12px;
}
.profile-wrap .year-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 14px;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  border-radius: 2px;
}
.profile-wrap .year-btn:hover {
  color: var(--ink);
  background: var(--paper-soft);
}
.profile-wrap .year-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.profile-wrap .fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fdfaf3;
  overflow: hidden;
}
.profile-wrap .field-cell {
  padding: 16px 20px;
  border-right: 1px solid var(--rule);
}
.profile-wrap .field-cell:last-child {
  border-right: none;
}
.profile-wrap .field-cell .lbl {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.profile-wrap .field-cell .val {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}
.profile-wrap .field-cell.primary {
  background: linear-gradient(180deg, rgba(107, 42, 31, 0.04) 0%, transparent 100%);
}
.profile-wrap .field-cell.primary .lbl {
  color: var(--accent);
}

.profile-wrap .subfield-rank {
  margin-top: 16px;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(107, 42, 31, 0.06) 0%, transparent 100%);
  border-left: 3px solid var(--accent);
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: left;
}
.profile-wrap .subfield-rank strong {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
}

.profile-wrap .profile-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
  align-items: start;
}
.profile-wrap .section-heading {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-align: left;
}
.profile-wrap .section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.profile-wrap .section-heading .num {
  font-size: 12px;
  color: var(--ink-faint);
  font-family: "JetBrains Mono", monospace;
}
.profile-wrap .section-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 24px;
  font-style: italic;
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  text-align: left;
}

.profile-wrap .metric-group {
  margin-bottom: 32px;
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.profile-wrap .metric-group-title {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.profile-wrap table.metrics {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.profile-wrap table.metrics thead th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--rule);
}
.profile-wrap table.metrics thead th.num {
  text-align: right;
}
.profile-wrap table.metrics tbody td {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
}
.profile-wrap table.metrics tbody td.num {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.profile-wrap table.metrics tbody td.num.muted {
  color: var(--ink-mute);
}
.profile-wrap table.metrics tr.highlight td {
  background: rgba(160, 122, 44, 0.06);
}
.profile-wrap table.metrics tr.highlight td.num {
  color: var(--accent);
  font-weight: 600;
}
.profile-wrap .self-cite-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.profile-wrap .self-cite-bar {
  width: 80px;
  height: 4px;
  background: var(--paper-soft);
  border-radius: 2px;
  overflow: hidden;
}
.profile-wrap .self-cite-bar-fill {
  height: 100%;
  background: var(--teal);
}

.profile-wrap .profile-link {
  margin-top: 24px;
  padding: 12px 14px;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-wrap .profile-link label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  white-space: nowrap;
}
.profile-wrap .profile-link input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-soft);
  outline: none;
  min-width: 0;
}
.profile-wrap .copy-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 6px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
}
.profile-wrap .copy-btn:hover {
  background: var(--accent);
}

.profile-wrap .expand-all-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 6px;
}
.profile-wrap .expand-all-bar button {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
}
.profile-wrap .expand-all-bar button:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.profile-wrap .chart-card {
  background: #fdfaf3;
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
}
.profile-wrap .chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
}
.profile-wrap .chart-head:hover {
  background: rgba(160, 122, 44, 0.04);
}
.profile-wrap .chart-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-wrap .chart-toggle {
  width: 26px;
  height: 26px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--paper);
  transition: transform 0.25s ease;
}
.profile-wrap .chart-card.collapsed .chart-toggle {
  transform: rotate(-90deg);
}
.profile-wrap .chart-title {
  font-family: "Fraunces", "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}
.profile-wrap .chart-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-faint);
}
.profile-wrap .chart-body {
  padding: 0 20px 16px;
  border-top: 1px solid var(--rule-soft);
  max-height: 280px;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}
.profile-wrap .chart-card.collapsed .chart-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-top-color: transparent;
  overflow: hidden;
}
.profile-wrap .chart-canvas-wrap {
  position: relative;
  height: 180px;
  margin-top: 12px;
}

.profile-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.profile-share-overlay.open {
  display: flex;
}
.profile-share-modal {
  background: #fdfaf3;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 32px 36px;
  width: 90%;
  max-width: 480px;
  position: relative;
}
.profile-share-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6b2a1f 0%, #a07a2c 50%, #2b6868 100%);
}
.profile-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #f5f1ea;
  padding: 10px 18px;
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.25s, transform 0.25s;
}
.profile-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  .profile-wrap .profile-shell {
    grid-template-columns: 1fr;
  }
  .profile-wrap .profile-related {
    position: static;
    order: 2;
  }
  .profile-wrap .related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .profile-wrap .profile-content {
    grid-template-columns: 1fr;
  }
  .profile-wrap .masthead-grid {
    grid-template-columns: auto 1fr;
  }
  .profile-wrap .action-cluster {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .profile-wrap .fields-grid {
    grid-template-columns: 1fr;
  }
  .profile-wrap .field-cell {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .profile-wrap .field-cell:last-child {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .profile-wrap {
    padding: 16px 14px 48px;
    overflow-x: clip;
  }

  .profile-wrap .profile-main,
  .profile-wrap .profile-content,
  .profile-wrap .profile-content > section,
  .profile-wrap .profile-content > * {
    min-width: 0;
    max-width: 100%;
  }

  .profile-wrap .masthead {
    padding: 24px 18px 64px;
  }

  .profile-wrap .masthead-grid {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
  }

  .profile-wrap .avatar-wrap,
  .profile-wrap .avatar {
    width: 84px;
    height: 84px;
  }

  .profile-wrap .avatar {
    font-size: 32px;
  }

  .profile-wrap .action-cluster {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    gap: 8px;
  }

  .profile-wrap .cert-btn,
  .profile-wrap .share-btn,
  .profile-wrap .profile-share-btn,
  .profile-wrap .print-report-btn,
  .profile-wrap .action-cluster > * {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .profile-wrap .engagement-footer {
    position: static;
    max-width: none;
    justify-content: flex-start;
    align-items: flex-start;
    margin-top: 16px;
    right: auto;
    bottom: auto;
  }

  .profile-wrap .engagement-foot-stat {
    align-items: flex-start;
  }

  .profile-wrap .masthead {
    padding-bottom: 24px;
  }

  .profile-wrap .year-btn {
    min-height: 40px;
    padding: 8px 12px;
  }

  .profile-wrap .profile-content {
    margin-top: 28px;
    gap: 28px;
  }

  .profile-wrap .section-heading {
    font-size: 1.45rem;
  }

  .profile-wrap .self-cite-bar {
    width: 56px;
  }

  .profile-wrap table.metrics {
    min-width: 0;
    font-size: 12.5px;
  }

  .profile-wrap .related-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .profile-wrap {
    padding: 12px 10px 40px;
  }

  .profile-wrap .masthead {
    padding: 18px 14px 20px;
  }

  .profile-wrap .masthead-grid {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .profile-wrap .avatar-wrap {
    margin-bottom: 4px;
  }

  .profile-wrap .breadcrumb .sep {
    margin: 0 6px;
  }
}

body.profile-route {
  background: #f5f1ea;
  background-image:
    radial-gradient(at 0% 0%, rgba(160, 122, 44, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(107, 42, 31, 0.03) 0px, transparent 50%);
}

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