.profile-heading { padding-block: 14px 20px; }
.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 16px 24px;
  margin-top: 11px;
}
.profile-heading .project-heading { padding: 0; align-items: end; gap: 12px 30px; }
.profile-hero:has(.profile-poster[hidden]) > .film-heading-main,
.profile-hero:has(.profile-poster[hidden]) > .profile-summary { grid-column: 1 / -1; }
.profile-heading h1 { overflow-wrap: anywhere; }
.profile-back { color: #183647; font-size: 12px; font-weight: 750; text-underline-offset: 3px; }
.film-heading-main, .profile-summary { grid-column: 2; min-width: 0; }
.film-heading-title { min-width: 0; }
.profile-poster { grid-column: 1; grid-row: 1 / 3; width: clamp(100px, 15vw, 166px); margin: 0; }
.profile-poster img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; background: #e0eaf0; outline: 1px solid #425c70; }
.profile-poster figcaption { margin-top: 5px; font-size: 10px; color: #244558; line-height: 1.25; overflow-wrap: anywhere; }
.profile-poster a, .film-wiki { color: #173d53; text-underline-offset: 2px; }
.film-wiki { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 650; }
.film-subtitle { margin: 5px 0 0; color: #213c4e; font-size: 14px; font-weight: 650; }
.profile-identity { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 25px; }
.profile-identity dt { color: #375367; font-size: 11px; font-weight: 700; }
.profile-identity dd { margin: 1px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.profile-content { padding-block: 20px 35px; }
.profile-metrics { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); }
.profile-summary { align-self: start; }
.profile-metrics div { min-width: 0; padding: 12px 17px 13px; border-right: 1px solid var(--line); }
.profile-metrics div:last-child { border-right: 0; }
.profile-metrics dt { font-size: 12px; font-weight: 700; color: var(--muted-text); }
.profile-metrics dd { margin: 1px 0 0; font: 400 clamp(26px, 4vw, 49px)/1 var(--display); }
.profile-metrics div:last-child dd { color: var(--blue-deep); }
.profile-tools { padding: 13px 17px 12px; background: #f1f4ef; border-bottom: 1px solid var(--line); }
.profile-stages { display: flex; flex-wrap: wrap; column-gap: 5px; row-gap: 5px; }
.profile-stages button { display: flex; align-items: baseline; gap: 9px; min-height: 33px; padding: 6px 9px; border: 1px solid #a5b2b5; background: var(--paper); color: var(--ink); font: 700 12px/1.25 var(--text); cursor: pointer; }
.profile-stages button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.profile-stages span { font-size: 10px; font-weight: 550; }
.profile-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 15px; margin-top: 11px; }
.profile-filters .field { flex: 1 1 260px; max-width: 410px; }
.profile-filters .confirm-line { min-height: 36px; }
#stage-context { color: var(--muted-text); font-size: 12px; margin: 7px 0 0; }
.profile-field-groups { padding: 7px 17px 14px; }
.profile-group { border-bottom: 1px solid var(--line); }
.profile-group:last-child { border-bottom: 0; }
.profile-group > summary { display: list-item; padding: 8px 0; font-weight: 730; cursor: pointer; }
.profile-group > summary small { margin-left: 8px; color: var(--muted-text); font-size: 11px; font-weight: 600; }
.profile-group-scope { margin: 11px 0 0; font: 400 27px/1.05 var(--display); }
.profile-list { margin: 0 0 10px; padding: 0 9px; background: #f4f6f1; }
.profile-pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.profile-pair:last-child { border-bottom: 0; }
.profile-pair dt, .profile-pair dd { overflow-wrap: anywhere; font-size: 13px; }
.profile-pair dd { margin: 0; justify-self: start; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.profile-pair dd.missing { color: var(--muted-text); font-weight: 450; }
.profile-definition summary { cursor: pointer; }
.profile-definition p { color: var(--muted-text); font-size: 12px; margin: 4px 0 2px 12px; }
.profile-source { color: var(--muted-text); font-size: 11px; margin: 10px 0 0; }
.profile-empty { margin: 6px 0 12px; color: var(--muted-text); }
#profile-error { padding: 16px; background: var(--paper); border: 1px solid var(--line); }
@media (min-width: 950px) {
  .profile-field-groups { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; column-gap: 22px; }
  .profile-group-scope, .profile-empty { grid-column: 1 / -1; }
}
@media (max-width: 770px) {
  .profile-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .profile-metrics div:nth-child(2) { border-right: 0; }
  .profile-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .profile-identity { gap: 7px 16px; }
  .profile-pair { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); }
  .profile-hero { gap: 12px; }
  .profile-poster { grid-row: 1; }
  .profile-summary { grid-column: 1 / -1; }
  .profile-heading .film-heading-main { align-content: center; }
}
