/* Mobile reading and touch targets. Desktop and printed reports retain their layout. */
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 16px; line-height: 1.5; }
  body .view, body .view > *, body fieldset { min-width: 0; }
  body .view button, body .access-card button, body dialog button,
  body .topbar button {
    min-height: 44px !important; min-width: 44px; height: auto;
    font-size: 14px !important; line-height: 1.35;
    white-space: normal; overflow-wrap: break-word;
    touch-action: manipulation;
  }
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body select, body textarea {
    min-width: 0; max-width: 100%; min-height: 44px !important;
    font-size: 16px !important; line-height: 1.4;
  }
  body input[type="file"] { width: 100%; }
  body label, body .muted-copy, body .help-copy,
  body .view small, body .access-card small,
  body .profile-card.is-compact .profile-identity span,
  body .profile-compact-stats small, body .mobile-nav-hint,
  body .standings-scroll-hint { font-size: 14px; line-height: 1.5; }
  body .view small, body .score-side b, #action-flow-kicker { font-size: 14px !important; line-height: 1.4; }
  body .view h2 { font-size: 22px; line-height: 1.25; }
  body .view h3, body .profile-card.is-compact h3 { font-size: 18px; line-height: 1.35; }
  body .view p, body .view h2, body .view h3,
  body .access-card p, body dialog p { overflow-wrap: anywhere; }
  body .view details > summary { padding-block: 10px; font-size: 15px; line-height: 1.4; }
  body .topbar .tabs { scroll-padding-inline: 10px; overscroll-behavior-x: contain; }
  body .topbar .tab { flex-shrink: 0; white-space: nowrap; padding: 10px 14px; }
  body[data-role="sin-acceso"] .mobile-nav-hint { display: none; }
  body .topbar .mobile-nav-hint { margin: 0; font-weight: 600; }
  body .topbar .project-credit { font-size: 14px; }
  #analysis-view .analysis-status-filters {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; gap: 8px; padding: 0; background: transparent;
  }
  #analysis-view .analysis-status-filters button { font-size: 14px; padding: 10px; min-height: 48px; }
  #analysis-view .analysis-status-filters button[hidden] { display: none; }
  #analysis-view .saved-match-bar { grid-template-columns: minmax(0, 1fr); }
  body .profile-card.is-compact .toggle-profile-detail { min-height: 44px; font-size: 14px; }
  body .profile-card.is-compact .profile-heading { grid-template-columns: 42px minmax(0, 1fr); }
  body .profile-card.is-compact .toggle-profile-detail { grid-column: 1 / -1; width: 100%; }
  body .profile-compact-stats > span { min-width: 0; overflow-wrap: anywhere; }
  body .directory-pagination, body .profile-pagination { gap: 8px; }
  body .table-wrap, body .standings-wrap, body .report-action-table-wrap {
    max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
  }
  body .view th, body .view td { font-size: 14px; line-height: 1.45; }
  body .report-actions, body .report-list-actions { gap: 8px; }
  #report-shell .report-actions button, #report-shell .report-actions a.ghost-button {
    height: auto; min-height: 44px; white-space: normal; padding: 10px;
    flex: 1 1 145px; font-size: 14px;
  }
  #report-shell .report-actions .report-picker { display: grid; width: 100%; gap: 6px; font-size: 14px; }
  #report-shell .report-actions .report-picker select { width: 100%; max-width: 100%; height: auto; }

  body .match-library-actions, body .match-media-controls { gap: 10px; }
  body .match-library-actions button { flex: 1 1 140px; }
  body dialog, body .match-library-player {
    box-sizing: border-box; width: calc(100% - 24px); max-width: 600px;
    max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px;
    border: 1px solid var(--line); border-radius: 12px;
  }
  #plan-access-dialog button { margin: 6px 6px 0 0; }
  body dialog::backdrop { background: #0009; }
  body .access-card { min-width: 0; padding: 20px 16px; }
  body .access-card section { margin-block: 20px; }
  body .access-card section button { margin: 4px; }
  body :is(button, input, select, textarea, summary, a):focus-visible {
    outline: 3px solid #2563eb; outline-offset: 3px;
  }
}
@media screen and (max-width: 380px) {
  #analysis-view .analysis-status-filters,
  body .report-actions, body .championship-filters,
  body .setup-grid, body .fighter-grid { grid-template-columns: minmax(0, 1fr); }
  body:not([data-match-active="true"]) .topbar h1 { font-size: 20px; }
  body:not([data-match-active="true"]) .topbar .tactigram-brand-logo {
    width: 64px; height: 48px; flex-basis: 64px;
  }
}
