.mobile-nav {
  display: none;
}

@media (max-width: 767px) {
  .has-mobile-nav {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 0.3rem 0.35rem env(safe-area-inset-bottom);
    border-top: 1px solid #31465e;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: rgba(7, 31, 61, 0.98);
    box-shadow: 0 -7px 22px rgba(7, 31, 61, 0.2);
  }

  .mobile-nav--public {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-right: 0.2rem;
    padding-left: 0.2rem;
  }

  .mobile-nav--public .mobile-nav__item {
    padding-inline: 0.1rem;
    font-size: 0.62rem;
  }

  .mobile-nav__item {
    display: grid;
    min-width: 0;
    min-height: 58px;
    border-radius: 6px;
    align-content: center;
    justify-items: center;
    gap: 0.1rem;
    color: #d9e4ed;
    font-size: 0.68rem;
    font-weight: 750;
    text-decoration: none;
  }

  .mobile-nav__item[aria-current="page"] {
    background: #ffffff;
    color: #071f3d;
  }

  .mobile-nav__icon {
    height: 1.4rem;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
  }

  .site-header__inner,
  .app-main {
    width: min(100% - 1.25rem, var(--content-width));
  }

  .form-actions .button {
    width: 100%;
  }

  .site-footer {
    padding-bottom: 1.6rem;
  }

  .auth-shell {
    width: min(100% - 1.25rem, 560px);
    min-height: calc(100vh - 76px);
    padding: 1rem 0 1.5rem;
  }

  .auth-panel {
    padding: 1.15rem;
  }

  .auth-actions .button {
    width: 100%;
  }

  .admin-topbar {
    min-height: 68px;
    padding: 0.35rem 0.75rem;
  }

  .admin-brand img {
    width: 34px;
    height: 45px;
  }

  .admin-brand small,
  .admin-identity span {
    display: none;
  }

  .admin-identity {
    max-width: 62%;
    gap: 0.15rem 0.45rem;
  }

  .admin-identity a {
    min-width: 44px;
    min-height: 44px;
    font-size: 0.68rem;
  }

  .admin-frame {
    display: block;
    min-height: calc(100vh - 68px);
  }

  .admin-sidebar {
    display: none;
  }

  .admin-main {
    width: 100%;
    padding: 1rem 0.65rem 1.5rem;
  }

  .admin-heading {
    display: grid;
    align-items: start;
  }

  .admin-heading h1 {
    font-size: 1.55rem;
  }

  .admin-heading .button {
    width: 100%;
  }

  .heading-actions {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }

  .admin-main a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-item {
    padding: 0.8rem;
  }

  .stat-item strong {
    font-size: 1.45rem;
  }

  .filter-bar,
  .filter-bar--short,
  .admin-form-grid,
  .detail-grid,
  .detail-list dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-form-grid__full {
    grid-column: auto;
  }

  .data-table-wrap {
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 0.65rem 0;
    border-bottom: 2px solid var(--line);
  }

  .data-table td {
    display: grid;
    min-width: 0;
    padding: 0.38rem 0;
    border: 0;
    grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
    gap: 0.65rem;
    overflow-wrap: anywhere;
  }

  .data-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.69rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .data-table td > * {
    min-width: 0;
    max-width: 100%;
  }

  .data-table td form,
  .data-table td select {
    width: 100%;
    min-width: 0;
  }

  .data-table td select {
    min-height: 44px;
  }

  .row-actions {
    min-width: 0;
    flex-wrap: wrap;
  }

  .coach-team-grid,
  .coach-roster-grid,
  .coach-request-list,
  .coach-action-grid,
  .coach-dashboard-grid,
  .coach-player-layout,
  .coach-quick-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-player-grid,
  .family-detail-grid,
  .family-photo-layout,
  .family-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-player-card,
  .family-membership-card,
  .family-card-item,
  .notification-item {
    padding: 0.85rem;
  }

  .family-membership-card,
  .family-card-item,
  .notification-item {
    display: grid;
    align-items: stretch;
  }

  .family-membership-card form,
  .family-card-state {
    min-width: 0;
  }

  .family-membership-card .button,
  .family-card-item .button,
  .notification-item .button,
  .family-upload-form .button,
  .family-optout .button {
    width: 100%;
  }

  .preference-grid {
    grid-template-columns: minmax(120px, 1fr) 64px 64px;
    gap: 0.35rem;
  }

  .coach-team-card,
  .coach-player-card,
  .coach-request-card,
  .coach-empty,
  .coach-add-panel {
    padding: 0.85rem;
  }

  .coach-action-grid {
    gap: 0.55rem;
  }

  .coach-player-card > header {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .coach-jersey {
    width: 50px;
    height: 50px;
  }

  .coach-quick-form .button,
  .coach-player-card > .button,
  .coach-request-card .button {
    width: 100%;
  }

  .coach-request-card {
    display: grid;
    align-items: stretch;
  }

  .coach-request-card > div:last-child {
    min-width: 0;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .pwa-install-banner,
  .public-intro__inner {
    width: min(100% - 1.25rem, var(--content-width));
  }

  .pwa-install-banner .button,
  .pwa-install-banner .text-action,
  .analytics-consent .button,
  .analytics-consent .text-action {
    min-height: var(--touch-size);
  }

  .analytics-consent {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (display-mode: standalone) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .public-header {
    padding-top: env(safe-area-inset-top);
  }
}
