.profile {
  --profile-ink: var(--brand-ink);
  --profile-muted: var(--brand-muted);
  --profile-line: var(--brand-rule);
  --profile-accent: var(--brand-teal);
  --profile-current: var(--brand-teal);
  --profile-prior: #839fb0;
  --profile-paper: #fff;
  --profile-radius: 12px;
  color: var(--profile-ink);
  display: grid;
  gap: 1rem;
}

.profile a {
  color: var(--profile-accent);
  text-underline-offset: .2em;
}

.profile a:focus-visible,
.profile summary:focus-visible,
.profile-scroll:focus-visible {
  outline: 2px solid var(--profile-accent);
  outline-offset: 3px;
}

.profile-breadcrumb {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
  color: var(--profile-muted);
  font-size: .85rem;
}

.profile-hero,
.profile-panel {
  border: 1px solid var(--profile-line);
  border-radius: var(--profile-radius);
  background: var(--profile-paper);
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.85rem);
}

.profile-hero {
  background: #142e3d;
  border-color: #142e3d;
  color: #f4fafc;
}

.profile-hero a {
  color: #a1e7dd;
}

.profile-type {
  color: #a1e7dd;
  font-size: .82rem;
  font-weight: 700;
}

.profile h1 {
  color: inherit;
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
  margin: .4rem 0 .7rem;
}

.profile h2 {
  color: inherit;
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
  line-height: 1.45;
  margin: 0 0 .45rem;
}

.profile h3 {
  color: inherit;
  font-size: .95rem;
  margin: 1.25rem 0 .4rem;
}

.profile p {
  line-height: 1.7;
  margin: .55rem 0;
}

.profile-registration,
.profile-entity-note {
  color: #dcf0f3;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #3a5666;
  padding: 0;
  margin: 1.4rem 0 0;
  border: 1px solid #3a5666;
  border-radius: 9px;
  overflow: hidden;
}

.profile-metric {
  background: #1a3747;
  padding: .8rem clamp(.65rem, 2vw, 1.15rem);
}

.profile-metric dt {
  font-size: .82rem;
  color: #c2d7e1;
}

.profile-metric dd {
  margin: .2rem 0 0;
}

.profile-metric-value {
  font-size: clamp(1.05rem, 2.3vw, 1.75rem);
  line-height: 1.4;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.profile-metric-detail {
  color: #c2d7e1;
  font-size: .76rem;
}

.profile-observation {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
}

.profile-section-header {
  display: flex;
  gap: .6rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.profile-section-header p,
.profile-period,
.profile-muted {
  color: var(--profile-muted);
  font-size: .86rem;
}

.profile-period {
  white-space: nowrap;
}

.profile-chart-figure {
  --plot-height: clamp(7rem, 18vw, 11rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .5rem;
  margin-top: 1.15rem;
}

.profile-chart-axis {
  height: var(--plot-height);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-.5em);
  margin-bottom: -.5em;
  text-align: right;
}

.profile-chart-axis span,
.profile-chart-day {
  color: var(--profile-muted);
  font-size: clamp(.56rem, 1.3vw, .73rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.profile-chart-columns {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  background: repeating-linear-gradient(
    to bottom, var(--profile-line) 0 1px, transparent 1px 25%
  ) left top / 100% var(--plot-height) no-repeat;
}

.profile-chart-column {
  text-align: center;
}

.profile-chart-track {
  border-bottom: 1px solid var(--profile-line);
  display: flex;
  align-items: end;
  justify-content: center;
  height: var(--plot-height);
}

.profile-chart-column:nth-child(8) .profile-chart-track {
  border-left: 1px dashed #7d9aaa;
}

.profile-chart-bar {
  display: block;
  height: var(--height);
  background: var(--profile-current);
  border-radius: 3px 3px 0 0;
  width: 70%;
  max-width: 2rem;
}

.profile-chart-column.prior .profile-chart-bar {
  background: var(--profile-prior);
}

.profile-chart-column.missing .profile-chart-bar,
.profile-key-missing::before {
  height: .2rem;
  margin-bottom: .13rem;
  border-radius: 0;
  background: repeating-linear-gradient(
    135deg, #748b99 0 1px, transparent 1px 3px
  );
  opacity: .85;
}

.profile-chart-column.zero .profile-chart-bar,
.profile-key-zero::before {
  height: 2px;
  background: #425b6a;
}

.profile-chart-column.prior.zero .profile-chart-bar {
  background: #425b6a;
}

.profile-key-zero::before {
  width: .65rem;
}

.profile-chart-mark,
.profile-key-event::before {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: #ae5425;
}

.profile-chart-mark {
  display: block;
  margin: 0 auto;
}

.profile-chart-key,
.profile-entity-links,
.profile-events {
  list-style: none;
  padding: 0;
}

.profile-chart-key {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  color: var(--profile-muted);
  font-size: .75rem;
  margin: .65rem 0 0;
}

.profile-chart-key li {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.profile-chart-key li::before {
  content: "";
  display: inline-block;
}

.profile-key-prior::before,
.profile-key-current::before {
  width: .65rem;
  height: .55rem;
  border-radius: 2px;
  background: var(--profile-prior);
}

.profile-key-current::before {
  background: var(--profile-current);
}

.profile-key-missing::before {
  width: .65rem;
  margin-bottom: 0;
}

.profile-details {
  margin-top: 1rem;
  border-top: 1px solid var(--profile-line);
  padding-top: .7rem;
}

.profile-details summary {
  color: var(--profile-accent);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-events {
  margin: .7rem 0 0;
}

.profile-events li {
  display: grid;
  grid-template-columns: minmax(2.65rem, auto) minmax(0, 1fr);
  gap: .65rem;
  border-top: 1px solid var(--profile-line);
  padding: .48rem 0;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.profile-events time {
  color: var(--profile-muted);
  font-variant-numeric: tabular-nums;
}

.profile-scroll {
  overflow-x: auto;
}

.profile-table {
  background: var(--profile-paper);
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  margin-top: .8rem;
}

.profile-table th,
.profile-table td {
  padding: .55rem .45rem;
  border-bottom: 1px solid var(--profile-line);
}

.profile-table th {
  text-align: left;
}

.profile-table thead th {
  color: var(--profile-muted);
}

.profile-table td,
.profile-table thead th:nth-child(n + 3) {
  text-align: right;
}

.profile-jingu-table thead th:nth-child(n + 3) {
  min-width: 5.6rem;
}
.profile-daily a { text-decoration: underline; text-underline-offset: .18em; }
.profile-official [id^="record-"]:target { background: #eaf5f3; }
.school-alumni-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .4rem 1rem;
  list-style: none;
  padding: 0;
}
.school-alumni-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .45rem; }
.school-alumni-list .alumni-evidence a { font-size: .8rem; text-decoration: underline; text-underline-offset: .18em; }
.school-alumni h3 span { font-size: .88rem; color: #526873; font-weight: 500; }

.profile-jingu-table th:nth-child(2) {
  min-width: 8rem;
}

.profile-daily th:last-child,
.profile-daily td:last-child {
  text-align: left;
}

.profile-insight:not(:empty) {
  background: #eaf5f3;
  border-radius: 7px;
  color: #15544f;
  font-weight: 650;
  padding: .7rem .9rem;
}

.profile-entity-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .6rem 0 0;
}

.profile-entity-links a {
  display: block;
  border: 1px solid var(--profile-line);
  border-radius: 6px;
  padding: .3rem .55rem;
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.profile-entity-links a:hover {
  background: #eaf5f3;
}

.profile-sources ul {
  padding-left: 1.3rem;
  margin: .65rem 0 0;
}

.profile-sources li {
  margin-top: .35rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .profile-observation {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 550px) {
  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-record-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: .6rem;
  list-style: none;
  padding: 0;
  margin: .7rem 0 0;
}

.profile-record-cards > li {
  border: 1px solid var(--profile-line);
  border-radius: 6px;
  padding: .75rem;
}
.profile .profile-x { margin-block:1.25rem; }
.profile .profile-x p { display:flex; gap:.5rem; flex-wrap:wrap; align-items:baseline; }
.profile .profile-x a { text-decoration:underline; text-underline-offset:.18em; }
.profile .profile-x p a:last-child { font-size:.875rem; }
.profile .profile-x-timeline { max-width:520px; margin-top:.7rem; }
.profile .profile-x-timeline iframe { max-width:100%; }
.profile-recent { margin: 1rem 0; padding: .75rem 1rem; border-inline-start: 3px solid #087c7b; background: #edf6f4; }
.profile-recent h2 { margin: 0 0 .35rem; font-size: .95rem; }
.profile-recent p { margin: .25rem 0; line-height: 1.55; overflow-wrap: anywhere; }
.favorite-next[hidden] { display: none; }
