/* The profile page, /p/<id>/. Loaded after components.css and charts.css.
   Everything here is scoped under .prof so it never reaches another page. */

.prof { padding-bottom: var(--s8); }

/* ------------------------------------------------------------ identity */

.prof-id {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: var(--s4) var(--s5);
  padding-top: var(--s6);
}
@media (min-width: 768px) {
  .prof-id { gap: var(--s6); padding-top: var(--s7); }
}
.prof-id__text { min-width: 0; padding-bottom: 2px; }
.prof-id__credit {
  grid-column: 1 / -1;
  margin-top: calc(-1 * var(--s2));
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.prof-id__credit a { color: inherit; text-decoration-color: var(--axis); }
.prof-id__eyebrow a { color: inherit; text-decoration-color: var(--axis); }
.prof-id__eyebrow a:hover { color: var(--ink-2); }
.prof-id__name { margin-top: var(--s2); overflow-wrap: anywhere; }
.prof-id__office {
  margin-top: var(--s2);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
}
.prof-id__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin-top: var(--s2);
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-3);
}
.prof-id__facts > li { white-space: nowrap; }
.prof-id__facts > li + li::before { content: "·"; margin: 0 8px; color: var(--axis); }
.prof-id__earlier { margin-top: var(--s1); font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-3); }
.prof-id__elected { margin-top: var(--s1); font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-2); font-weight: 560; max-width: 60ch; }
@media (max-width: 479px) {
  /* A narrow phone: the portrait sits beside the name, smaller, top aligned. */
  .prof-id { grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: var(--s4); }
  .prof-id .portrait--l { --pw: 96px; }
  .prof-id__facts { display: block; }
  .prof-id__facts > li { white-space: normal; }
  .prof-id__facts > li + li::before { content: none; }
}

/* ------------------------------------------------------------ the ledger line */

.prof-ledger { margin-top: var(--s6); }
@media (min-width: 768px) { .prof-ledger { margin-top: var(--s7); } }
.prof-ledger__evidence { margin-top: var(--s3); font-size: var(--t-small); line-height: var(--lh-small); }

/* How the figure adds up: assets listed, debts counted, then the mortgage debt
   the figure leaves out (DESIGN 10 item 5, 11 item 3). One quiet block under
   the ledger line. */
.prof-parts {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--hairline);
}
.prof-parts__table { max-width: 560px; }
.prof-parts__table caption.prof-parts__h { caption-side: top; text-align: left; padding-bottom: var(--s1); }
.prof-parts__table th, .prof-parts__table td { padding: 7px 0 7px 12px; vertical-align: top; }
.prof-parts__table thead td, .prof-parts__table thead th { border-bottom-color: var(--axis); }
.prof-parts__table thead th { white-space: normal; text-align: right; }
/* The two column heads may take two lines, so the table never has to be wider than the page. */
.prof-parts__table thead th.num { white-space: normal; }
.prof-parts__table tbody th { font-weight: 450; color: var(--ink-2); text-align: left; padding-left: 0; }
.prof-parts__table thead td { width: 34%; }
/* On a phone the label column takes only what its words need, and on a small
   phone the amounts are set a little tighter, so two nine-digit amounts fit. */
@media (max-width: 479px) { .prof-parts__table thead td { width: auto; } }
@media (max-width: 379px) {
  .prof-parts__table th, .prof-parts__table td { padding-left: 8px; }
  .prof-parts__table td.num { font-size: 13px; }
}
.prof-parts__table td.num { color: var(--ink); }
.prof-parts__table tr.is-total th, .prof-parts__table tr.is-total td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; color: var(--ink); }
.prof-parts__more { display: block; font-size: var(--t-micro); line-height: var(--lh-micro); font-weight: 450; color: var(--ink-3); }
.prof-parts > .note { margin-top: var(--s2); }
.prof-parts > .note a { color: var(--ink-2); }
.prof-mortgage { display: grid; gap: 4px; margin-top: var(--s4); max-width: 66ch; }
.prof-parts > .prof-mortgage:first-child { margin-top: 0; }
.prof-mortgage__value {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 26px;
  color: var(--ink);
}
.prof-mortgage__value strong { font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------ sections */

.prof-sec { margin-top: var(--s7); }
.prof-sec + .prof-sec { padding-top: var(--s7); border-top: 1px solid var(--hairline); }
.prof-sec--since { margin-top: var(--s6); padding-top: 0 !important; border-top: 0 !important; }
.prof-sec--since + .prof-sec { border-top: 0; padding-top: 0; }
.prof-sec__title { margin-bottom: var(--s4); }
.prof-sec__lede {
  max-width: 66ch;
  margin-bottom: var(--s4);
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
}
.prof-sec__order { margin-bottom: var(--s4); }
.prof-empty { color: var(--ink-3); font-size: var(--t-small); line-height: var(--lh-small); }
.prof-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  font-weight: 650;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ------------------------------------------------------------ since taking office */

.prof-since { container-type: inline-size; }
.prof-since__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
}
.prof-since__title { margin: 0; }
.prof-since__verdict .verdict { min-height: 32px; padding: 4px 12px 4px 10px; font-size: var(--t-body); line-height: var(--lh-body); gap: 9px; }
.prof-since__verdict .glyph { width: 14px; height: 14px; }
.prof-since__sentence {
  margin-top: var(--s3);
  max-width: 60ch;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 27px;
  color: var(--ink);
  text-wrap: pretty;
}
@media (min-width: 768px) { .prof-since__sentence { font-size: 20px; line-height: 29px; } }
.prof-since__sentence--none { color: var(--ink-2); }
.prof-since > .prof-since__verdict { margin-top: var(--s3); }
.prof-since__basis { margin-top: var(--s2); max-width: 66ch; font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-2); }

/* Two bars on one ruler. Labels sit above each bar on a phone and in a column at
   left when the card is wide; the bars and the axis share the plot column, and the
   "owes more than owns" wash runs behind both bars. */
.prof-since__plot {
  --lab: 0px;
  --lab-gap: 0px;
  position: relative;
  margin-top: var(--s5);
}
@container (min-width: 820px) {
  .prof-since__plot { --lab: 200px; --lab-gap: 24px; }
}
.prof-since__zone {
  position: absolute;
  top: 0;
  bottom: 36px;
  left: calc(var(--lab) + var(--lab-gap));
  width: calc((100% - var(--lab) - var(--lab-gap)) * var(--zero));
  background: color-mix(in srgb, var(--range) 22%, transparent);
  pointer-events: none;
}
.prof-since__row {
  position: relative;
  display: grid;
  grid-template-columns: var(--lab) minmax(0, 1fr);
  column-gap: var(--lab-gap);
  align-items: center;
  padding-block: 6px;
}
.prof-since__row + .prof-since__row { border-top: 1px solid var(--hairline); }
.prof-since__label {
  display: flex;
  align-items: baseline;
  gap: 0 10px;
  margin-bottom: 2px;
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
}
.prof-since__what { display: flex; flex-wrap: wrap; gap: 0 8px; }
.prof-since__when {
  flex: none;
  min-width: 3.6em;
  font-size: var(--t-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  font-weight: 650;
  color: var(--ink);
}
.prof-since__date { color: var(--ink-3); }
@container (min-width: 820px) {
  .prof-since__label { grid-column: 1; margin: 0; }
  .prof-since__what { display: block; }
  .prof-since__date { display: block; font-size: var(--t-micro); line-height: var(--lh-micro); }
  .prof-since__label { position: relative; z-index: 1; }
}
@container (max-width: 819px) {
  .prof-since__row { grid-template-columns: minmax(0, 1fr); }
  /* Labels sit above the bars here, so the wash goes behind each bar on its own. */
  .prof-since__zone { display: none; }
  .prof-since__bar::before {
    content: "";
    position: absolute;
    top: -4px;
    bottom: -6px;
    left: 0;
    width: calc(100% * var(--zero));
    background: color-mix(in srgb, var(--range) 22%, transparent);
    pointer-events: none;
  }
  .prof-since__figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof-since__figs > div:last-child { grid-column: 1 / -1; }
}
.prof-since__bar { position: relative; min-width: 0; }
.prof-since__axis { margin-left: calc(var(--lab) + var(--lab-gap)); container-type: inline-size; }
.prof-since__axis .axis { margin-top: 0; }
.prof-since__axis .axis__zone { display: none; }

.prof-since__figs {
  display: grid;
  gap: var(--s3) var(--s5);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--hairline);
}
@container (min-width: 560px) {
  .prof-since__figs { grid-template-columns: repeat(3, minmax(0, max-content)); justify-content: start; column-gap: var(--s7); }
}
.prof-since__figs dt {
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  font-weight: 650;
  color: var(--ink-3);
}
.prof-since__figs dd {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 560;
  color: var(--ink);
}
.prof-since__over { font-size: var(--t-small); font-weight: 450; color: var(--ink-2); }
.prof-since__figs + .note { margin-top: var(--s3); }

/* ------------------------------------------------------------ history */

.prof-hist__sentence { max-width: 70ch; }
.prof-hist__table { margin-top: var(--s4); }
.prof-hist .table tr.is-gap td { color: var(--ink-3); }
.prof-hist .chart__twin .table-wrap, .prof-hist .chart__twin .prof-hist__table { margin-top: 0; }

/* ------------------------------------------------------------ published estimates */

.prof-pub {
  display: grid;
  gap: var(--s4);
}
@media (min-width: 768px) { .prof-pub { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.prof-pub__item {
  padding: var(--s4) var(--s4) var(--s4) var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--surface);
}
.prof-pub__by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: var(--t-small);
  line-height: var(--lh-small);
  font-weight: 600;
  color: var(--ink);
}
.prof-pub__key {
  width: 9px;
  height: 9px;
  margin: 0 2px;
  border: 1.5px solid var(--ink-2);
  background: var(--surface);
  transform: rotate(45deg);
}
.prof-pub__date { font-weight: 450; color: var(--ink-3); }
.prof-pub__value {
  margin-top: var(--s2);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 22px;
  line-height: 30px;
  color: var(--ink-2);
}
.prof-pub__value strong { color: var(--ink); font-weight: 600; }
.prof-pub__where { margin-top: var(--s1); font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-2); }
.prof-pub__scope { margin-top: var(--s2); }
.prof-pub__link { margin-top: var(--s3); font-size: var(--t-small); line-height: var(--lh-small); }

/* ------------------------------------------------------------ background */

.prof-bio__grid { display: grid; gap: var(--s5); }
@media (min-width: 900px) {
  .prof-bio__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--s7); }
}
.prof-bio__summary { color: var(--ink); }
.prof-bio__sources { margin-top: var(--s3); }
.prof-bio__h { margin-bottom: var(--s2); }
.prof-bio__h ~ .prof-bio__h { margin-top: var(--s5); }
.prof-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--axis);
  border-radius: var(--r-chip);
  background: var(--surface);
  font-size: var(--t-small);
  line-height: 1;
  font-weight: 560;
  color: var(--ink);
  text-decoration: none;
}
a.prof-chip:hover { border-color: var(--ink-3); }
.prof-edu > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
}
.prof-edu > li:first-child { border-top: 1px solid var(--hairline); }
.prof-edu__degree { font-weight: 600; color: var(--ink); }
.prof-edu__year { margin-left: auto; color: var(--ink-3); }

/* ------------------------------------------------------------ where they sit */

.prof-ranks { display: grid; gap: var(--s5); }
@media (min-width: 768px) { .prof-ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7); } }
.prof-rank__sentence {
  margin-top: var(--s1);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 26px;
  color: var(--ink);
  text-wrap: pretty;
}
.rankband { position: relative; height: 20px; margin-top: var(--s3); }
.rankband > span { position: absolute; top: 50%; }
.rankband__track { left: 0; right: 0; height: 1px; background: var(--axis); }
.rankband__band {
  height: 10px;
  margin-top: -5px;
  min-width: 4px;
  border-radius: var(--r-band);
  background: var(--range);
  box-shadow: inset 1px 0 0 var(--range-edge), inset -1px 0 0 var(--range-edge);
}
.rankband__track { margin-top: -0.5px; }
.rankband__at { width: 2px; height: 18px; margin: -9px 0 0 -1px; background: var(--ink); border-radius: 1px; }
.rankband__ends {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.prof-where { margin-top: var(--s5); container-type: inline-size; }
.prof-where__plot { position: relative; margin-top: var(--s4); }
.prof-where__row { position: relative; height: 56px; }
.prof-where__row::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 36px;
  height: 1px;
  background: var(--hairline);
}
.prof-dot {
  position: absolute;
  top: 36px;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--neutral);
  box-shadow: 0 0 0 2px var(--surface);
}
.prof-dot--hollow { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--neutral), 0 0 0 2px var(--surface); }
.prof-dot--me {
  z-index: 2;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink);
}
.prof-dot--me.prof-dot--hollow { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.prof-where__name {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.prof-where__name--left { transform: translateX(-100%); }

/* ------------------------------------------------------------ filings */

.prof-filings .prof-filings__report { font-weight: 450; vertical-align: top; }
.prof-filings td { vertical-align: top; }
.prof-filings__name { display: flex; align-items: baseline; gap: 6px; color: var(--ink); font-weight: 560; }
.prof-filings__meta { display: block; color: var(--ink-3); font-size: var(--t-micro); line-height: var(--lh-micro); margin-top: 2px; }
.prof-filings__note { display: block; color: var(--ink-2); }
.prof-filings__unread { color: var(--ink-2); }
.prof-filings tr.is-child .prof-filings__report { padding-left: 18px; }
.prof-filings__elbow {
  flex: none;
  width: 9px;
  height: 9px;
  margin-left: -15px;
  margin-right: 6px;
  border-left: 1px solid var(--ink-3);
  border-bottom: 1px solid var(--ink-3);
  transform: translateY(-2px);
}
.prof-filings tbody.has-children tr:not(:last-child) > * { border-bottom-color: transparent; }
.prof-filings tbody.has-children tr:not(:first-child) > * { padding-top: 2px; }
.prof-filings tr.is-superseded .prof-filings__name { color: var(--ink-2); font-weight: 450; }
.prof-filings del.del { text-decoration-thickness: 1px; }
/* On a phone each filing stacks: report and grade on one line, range and link on
   the next. The ARIA roles in the markup keep it a table for assistive tech. */
@media (max-width: 559px) {
  .prof-filings, .prof-filings tbody { display: block; }
  .prof-filings thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prof-filings tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "report grade" "range doc";
    column-gap: var(--s3);
    padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .prof-filings tr > * { padding: 0 !important; border: 0 !important; }
  .prof-filings .prof-filings__report { grid-area: report; }
  .prof-filings .prof-filings__grade { grid-area: grade; justify-self: end; }
  .prof-filings td.prof-filings__range { grid-area: range; margin-top: 4px; text-align: left; font-size: var(--t-body); line-height: var(--lh-body); }
  .prof-filings .prof-filings__unread { font-size: var(--t-small); line-height: var(--lh-small); }
  .prof-filings .prof-filings__doc { grid-area: doc; align-self: end; justify-self: end; }
  .prof-filings .prof-filings__doc a { display: inline-flex; align-items: center; min-height: 32px; }
  .prof-filings .prof-filings__mid { display: none; }
  .prof-filings tbody.has-children tr:not(:last-child) { border-bottom-color: transparent; padding-bottom: 4px; }
  .prof-filings tr.is-child { margin-left: 18px; }
  .prof-filings tr.is-child .prof-filings__report { padding-left: 0 !important; }
}

.prof-grades {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin-top: var(--s4);
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  color: var(--ink-3);
}
.prof-grades > li { display: flex; align-items: center; gap: 8px; max-width: 36ch; }
.prof-grades .grade { flex: none; }

/* ------------------------------------------------------------ the end matter */

.prof-end { display: grid; gap: var(--s7); }
@media (min-width: 900px) { .prof-end { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--s7); } }
.prof-leave__list > li {
  position: relative;
  padding: 8px 0 8px 18px;
  border-top: 1px solid var(--hairline);
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
  max-width: 70ch;
}
.prof-leave__list > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 5px;
  height: 1px;
  background: var(--ink-3);
}
.prof-leave__more { margin-top: var(--s3); font-size: var(--t-small); line-height: var(--lh-small); }
.prof-updates__list > li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: var(--s3);
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
}
.prof-updates__list time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 900px) { .prof-updates__list > li { grid-template-columns: 10.5em minmax(0, 1fr); } }

/* The ring the profile script draws around this person's dot in the office Spread. */
.prof-correct { margin-top: var(--s5); }

@media print {
  .prof-where, .prof-hist .chart__controls { display: none; }
}

/* The filings table reads as a ledger column, not a full-bleed grid. */
@media (min-width: 560px) {
  .prof-filings-wrap { max-width: 880px; }
  .prof-filings .prof-filings__unread { text-align: right; }
  .prof-filings th.prof-filings__report { width: 44%; }
  .prof-filings .prof-filings__grade { width: 64px; }
  .prof-filings .prof-filings__doc { width: 88px; text-align: right; }
  .prof-filings thead th:last-child { text-align: right; }
  .prof-grades { max-width: 880px; }
}

/* The history table on a phone: the grade is in the filings table below, so it
   drops here, and the columns tighten until the table fits without scrolling. */
@media (max-width: 559px) {
  .prof-hist .prof-hist__grade { display: none; }
  .prof-hist .table th, .prof-hist .table td { padding-inline: 6px; }
  .prof-hist .table thead th { white-space: normal; vertical-align: bottom; }
  .prof-hist .table .prof-tag { display: block; margin: 2px 0 0; }
}
.prof-hist__phone { display: none; }
@media (max-width: 559px) {
  .prof-hist .prof-hist__report { display: none; }
  .prof-hist .prof-hist__phone { display: block; }
  .prof-hist .prof-hist__year .prof-tag { display: block; margin: 2px 0 0; text-align: left; }
  .prof-hist .prof-hist__year { text-align: left; }
  .prof-hist .prof-hist__gap { text-align: left; }
}
@media (max-width: 559px) {
  .prof-hist .table td.prof-hist__year { text-align: left; white-space: normal; width: 1%; }
  .prof-hist .table td.prof-hist__year .prof-tag { white-space: normal; letter-spacing: 0.02em; }
  .prof-hist .table td.prof-hist__gap { text-align: left; }
}
/* Desktop shows lowest and highest in their own columns; a phone shows one Range
   column instead, so the table fits without scrolling. */
.prof-hist .prof-hist__range { display: none; }
@media (max-width: 559px) {
  .prof-hist .table .prof-hist__range { display: table-cell; }
  .prof-hist .table .prof-hist__end { display: none; }
  .prof-hist .table td.prof-hist__range { font-variant-numeric: tabular-nums; }
  .prof-hist .table td.num { white-space: normal; }
}
@media (max-width: 559px) {
  .prof-hist .table thead th:first-child { text-align: left; }
}
@media (min-width: 560px) {
  .prof-grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof-grades > li { max-width: none; }
}

/* How each filing was read (DESIGN 10, item 6). */
.prof-filings__how { display: block; }
