/* Shared phone layout for every Who Runs NY section. */
@media (max-width: 700px) {
  html, body { max-width: 100%; overflow-x: clip; }
  body { font-size: 1rem; line-height: 1.55; }
  main, .money-page, .candidate-carousel, .carousel-track, .candidate-card,
  .finance-panel, .vote-panel, .transaction-wrap, .donor-table-wrap { min-width: 0; max-width: 100%; }

  .site-header, .site-head { min-height: 64px; height: auto; padding: .55rem .65rem; gap: .55rem; }
  .brand { min-width: 0; gap: .45rem; }
  .brand-logo, .brand > img { width: 38px; height: 38px; }
  .brand div strong { font-size: .9rem; line-height: 1.15; }
  .brand div span, .brand small { display: none !important; }
  .share-site-button, .site-head .share-site-button { min-height: 44px; margin: 0; padding: .55rem .7rem; font-size: .875rem; }

  .county-navigation, .primary-nav { grid-template-columns: 1fr 1fr; width: calc(100% - 1rem); gap: .4rem; }
  .county-navigation a, .primary-nav a { min-width: 0; min-height: 48px; padding: .6rem .45rem; font-size: .875rem; line-height: 1.2; }
  .county-navigation .congress-tab, .primary-nav .congress-tab { font-size: .875rem; }
  .county-navigation .congress-tab img, .primary-nav .congress-tab img { width: 28px; height: 28px; }

  .candidate-carousel { contain: inline-size; }
  .carousel-track { width: 100%; }

  .bio, .lede, .hero > div > p:last-child, .methodology p,
  .committee-combination-note, .finance-method { font-size: 1rem; line-height: 1.6; }
  .eyebrow, .source-strip b, .current-map-links span,
  .map-keyboard-picker > span, .map-candidate-heading span,
  .vote-metrics span, .priorities strong, .district-map-title span,
  .district-map-title > strong, .race-lineup-header > div:first-child > span,
  .race-lineup-meta strong, .race-lineup-meta span { font-size: .75rem; line-height: 1.4; }
  .source-strip span, .district-map-title p, .coverage, .finance-empty,
  .finance-head strong, .finance-head a, .filing-links a,
  .votes summary, .votes p, .votes a { font-size: .875rem; line-height: 1.5; }
  .priorities, .contact-row a, .source-links a, .filing-links a,
  .map-candidate-copy > p, .boundary-audit { font-size: .875rem; line-height: 1.5; }
  .contact-row a, .filing-links a, .source-links a, .finance-head a,
  .votes a { display: inline-flex; align-items: center; min-height: 44px; }
  .office-line, .coverage span:first-child, .coverage-state, .chip,
  .portrait-badge, .candidate-head p, .badges span, .badges strong,
  .race > header p, .race > header > div:last-child span { font-size: .75rem; line-height: 1.35; }

  .finance-metrics { grid-template-columns: 1fr 1fr; }
  .finance-metrics span, .money-panel > span, .finance-head small,
  .finance-rankings header span, .finance-rankings header small { font-size: .75rem; line-height: 1.35; }
  .finance-metrics strong { font-size: 1.25rem; }
  .top-donors li, .money-panel li, .finance-rankings li strong,
  .finance-rankings li span, .finance-rankings li em { font-size: .8125rem; line-height: 1.4; }
  .top-donors small, .finance-rankings li>b { font-size: .75rem; line-height: 1.4; }
  .finance-rankings li>b { width: 24px; height: 24px; }
  .top-donors li { align-items: start; padding: .65rem 0; }

  .donor-table-wrap, .transaction-wrap, .vote-table-wrap {
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
    border: 0;
    background: transparent;
  }
  .donor-table, .transaction-wrap table, .vote-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    font-size: .875rem;
    border-collapse: separate;
  }
  .donor-table thead, .transaction-wrap thead, .vote-table thead { display: none; }
  .donor-table tbody, .transaction-wrap tbody, .vote-table tbody { display: grid; gap: .7rem; }
  .donor-table tr, .transaction-wrap tr, .vote-table tr {
    display: block;
    width: 100%;
    padding: .25rem .75rem;
    border: 1px solid var(--line, #cbd1d4);
    border-left: 4px solid var(--blue, #2867a4);
    background: var(--white, #fffdf8);
  }
  .finance-overview .donor-table tr { background: #1b344e; border-color: rgba(255,255,255,.3); border-left-color: #f2c14e; }
  .vote-table tr.party-break { border-left-color: var(--red, #a34141); background: #f9e9e7; }
  .donor-table td, .transaction-wrap td, .vote-table td,
  .donor-table td:nth-child(3), .donor-table td:nth-child(4) {
    display: grid !important;
    grid-template-columns: minmax(7.4rem, 38%) minmax(0, 1fr);
    gap: .75rem;
    width: 100%;
    min-width: 0 !important;
    padding: .55rem 0;
    border: 0;
    border-bottom: 1px solid var(--line, #cbd1d4);
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .finance-overview .donor-table td { border-color: rgba(255,255,255,.18); }
  .donor-table td:last-child, .transaction-wrap td:last-child, .vote-table td:last-child { border-bottom: 0; }
  .donor-table td::before, .transaction-wrap td::before, .vote-table td::before {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: var(--muted, #62717d);
  }
  .finance-overview .donor-table td::before { color: #c8d5df; }
  .donor-table small, .transaction-wrap small { font-size: .75rem; line-height: 1.45; }
  .transaction-wrap small { color: var(--muted, #62717d); }
  .entity-label, .vote-kind, .break-label { font-size: .75rem !important; line-height: 1.35; }

  .early-voting-details table { font-size: .875rem; }
  .early-voting-details td { padding: .6rem 0; }
  .map-legend, .map-keyboard-picker > span, .map-source-note,
  .map-candidate-heading span, .map-candidate-heading > strong { font-size: .75rem; line-height: 1.4; }
  .map-toolbar p, .map-toolbar button, .district-jump span, .district-jump a { font-size: .875rem; line-height: 1.4; }

  .candidate-head { grid-template-columns: 96px minmax(0, 1fr); }
  .candidate-head > div:last-child, .candidate-body, .card-title, .card-body,
  .finance-panel, .vote-panel { padding: .875rem; }
  .candidate-head h3, .card-title h3 { overflow-wrap: anywhere; }
  .money-grid, .finance-rankings { grid-template-columns: 1fr; }
  .race { padding: .6rem; }
  summary { min-height: 48px; font-size: .9375rem; }
}

@media (max-width: 380px) {
  .finance-metrics { grid-template-columns: 1fr; }
  .donor-table td, .transaction-wrap td, .vote-table td,
  .donor-table td:nth-child(3), .donor-table td:nth-child(4) { grid-template-columns: 1fr; gap: .2rem; }
  .site-header, .site-head { align-items: center; }
  .brand-logo, .brand > img { width: 34px; height: 34px; }
  .brand div strong { font-size: .82rem; }
  .share-site-button, .site-head .share-site-button { padding-inline: .55rem; font-size: .8rem; }
}
