/* Minimal reading layer (see compact.js). */
.person-section.is-empty{display:none}
.empty-summary{margin:18px 0 8px;padding:14px 18px;border:1px solid var(--line);border-radius:9px;background:var(--paper);font-size:12px;color:var(--muted)}
.empty-summary summary{cursor:pointer;font-weight:550;color:var(--ink,#1b2f3d)}
.empty-summary p{margin:8px 0}
.empty-summary div{display:flex;flex-wrap:wrap;gap:6px}
.empty-summary button{border:1px solid var(--line);border-radius:999px;padding:5px 10px;font-size:11px;background:transparent;color:inherit}

.show-all-rows{display:none}
@media(max-width:650px){
  /* Fewer words: method caveats stay on the sources page and in each record. */
  .profile-reading-guide,.person-section>.observer-note,.observer-intro p.observer-note{display:none}
  .profile-chapters{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-bottom:4px}
  .profile-chapters>div{display:contents}
  .profile-chapters span{display:none}
  .profile-chapters a{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:6px 11px;font-size:11px;white-space:nowrap}
  .person-section h2{font-size:21px}
  .person-section>p{font-size:12px;line-height:1.6}

  /* Row tables become cards: label left, value right. */
  table.stack-on-mobile thead{display:none}
  table.stack-on-mobile,table.stack-on-mobile tbody,table.stack-on-mobile tr,table.stack-on-mobile td{display:block;width:100%}
  table.stack-on-mobile tr{border:1px solid var(--line);border-radius:8px;padding:8px 12px;margin-bottom:8px;background:var(--paper)}
  table.stack-on-mobile td{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:5px 0!important;border:0!important;white-space:normal!important;min-width:0!important;text-align:right}
  table.stack-on-mobile td::before{content:attr(data-label);font-size:10px;color:var(--muted);text-align:left;flex-shrink:0;max-width:45%}
  table.stack-on-mobile td:first-child{font-weight:550;text-align:left}
  table.stack-on-mobile td:first-child::before{display:none}
  .observer-table-wrap,.table-scroll{overflow:visible}

  /* Wider tables: name on top, the other fields in a two-column grid. */
  table.stack-on-mobile:not(.stack-compact) tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px}
  table.stack-on-mobile td.col-constant{display:none}
  table.stack-on-mobile:not(.stack-compact) td{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;text-align:left}
  table.stack-on-mobile:not(.stack-compact) td::before{max-width:none}
  table.stack-on-mobile:not(.stack-compact) td:first-child{grid-column:1/-1;font-size:13px}
  table.stack-compact tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:4px 14px;align-items:center;padding:9px 12px;margin-bottom:6px}
  table.stack-compact td{display:flex;flex-direction:column;align-items:flex-end;padding:0!important}
  table.stack-compact td:first-child{align-items:flex-start}
  table.stack-compact td::before{font-size:9px;max-width:none}
  table.stack-on-mobile tr.row-extra{display:none}
  .show-all-rows{display:block;width:100%;margin:2px 0 8px;padding:9px;border:1px solid var(--line);border-radius:8px;background:transparent;font-size:12px;color:var(--teal)}
  .reading-links>a.dup-link{display:none}

  /* Vote history: one election per swipe, % only (vote counts stay on desktop). */
  .history-section{padding:20px 16px}
  .history-columns{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:14px;margin:16px -4px;padding:0 4px 6px;scrollbar-width:none}
  .history-year{flex:0 0 78%;scroll-snap-align:start}
  .history-party-row{margin-bottom:10px}
  .history-party-row small{display:none}
  .history-bar{height:5px}

  /* Cities as columns: keep the grid, scroll sideways with the label column pinned. */
  .comparison-table th:first-child,.comparison-table td:first-child{position:sticky;left:0;background:var(--paper);z-index:1}
}
